From e03c4b345fee10106efabed2617c1d4b26d93a8c Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 4 Aug 2020 09:43:21 +0100 Subject: [PATCH] Remove unndeeded data stuff; Fix startup script --- data/61cadence-session-inject | 19 - data/autostart/cadence-session-start.desktop | 11 - data/cadence | 38 - data/cadence-aloop-daemon | 10 - data/cadence-jacksettings | 10 - data/cadence-logs | 10 - data/cadence-pulse2jack | 127 - data/cadence-pulse2loopback | 107 - data/cadence-render | 10 - data/cadence-session-start | 27 - data/cadence.desktop | 66 - data/catarina | 10 - data/catarina.desktop | 10 - data/catia | 4 +- data/claudia | 38 - data/claudia-launcher | 38 - data/claudia-launcher.desktop | 11 - data/claudia.desktop | 10 - .../16x16/apps/arctican_plugins.png | Bin 797 -> 0 bytes .../claudia-hicolor/16x16/apps/ardour.png | Bin 627 -> 0 bytes .../icons/claudia-hicolor/16x16/apps/aria.png | Bin 649 -> 0 bytes .../claudia-hicolor/16x16/apps/arpage.png | Bin 1084 -> 0 bytes .../icons/claudia-hicolor/16x16/apps/azr3.png | Bin 649 -> 0 bytes .../16x16/apps/bristol_BME700.png | Bin 530 -> 0 bytes .../16x16/apps/bristol_aks.png | Bin 1165 -> 0 bytes .../16x16/apps/bristol_arp2600.png | Bin 1128 -> 0 bytes .../16x16/apps/bristol_axxe.png | Bin 1110 -> 0 bytes .../16x16/apps/bristol_bassmaker.png | Bin 498 -> 0 bytes .../16x16/apps/bristol_bit99.png | Bin 1070 -> 0 bytes .../16x16/apps/bristol_bitone.png | Bin 1082 -> 0 bytes .../16x16/apps/bristol_cs80.png | Bin 457 -> 0 bytes .../claudia-hicolor/16x16/apps/bristol_dx.png | Bin 1067 -> 0 bytes .../16x16/apps/bristol_explorer.png | Bin 1115 -> 0 bytes .../16x16/apps/bristol_granular.png | Bin 602 -> 0 bytes .../16x16/apps/bristol_hammondB3.png | Bin 1105 -> 0 bytes .../16x16/apps/bristol_juno.png | Bin 1043 -> 0 bytes .../16x16/apps/bristol_jupiter8.png | Bin 445 -> 0 bytes .../16x16/apps/bristol_memoryMoog.png | Bin 1065 -> 0 bytes .../16x16/apps/bristol_mini.png | Bin 1121 -> 0 bytes .../16x16/apps/bristol_mixer.png | Bin 1173 -> 0 bytes .../16x16/apps/bristol_monopoly.png | Bin 1121 -> 0 bytes .../16x16/apps/bristol_ms20.png | Bin 1103 -> 0 bytes .../16x16/apps/bristol_obx.png | Bin 1084 -> 0 bytes .../16x16/apps/bristol_obxa.png | Bin 1082 -> 0 bytes .../16x16/apps/bristol_odyssey.png | Bin 1171 -> 0 bytes .../16x16/apps/bristol_poly.png | Bin 1036 -> 0 bytes .../16x16/apps/bristol_poly800.png | Bin 444 -> 0 bytes .../16x16/apps/bristol_pro1.png | Bin 559 -> 0 bytes .../16x16/apps/bristol_prophet.png | Bin 1092 -> 0 bytes .../16x16/apps/bristol_prophet10.png | Bin 1124 -> 0 bytes .../16x16/apps/bristol_prophet52.png | Bin 1084 -> 0 bytes .../16x16/apps/bristol_realistic.png | Bin 1117 -> 0 bytes .../16x16/apps/bristol_rhodes.png | Bin 1055 -> 0 bytes .../16x16/apps/bristol_rhodesbass.png | Bin 1155 -> 0 bytes .../16x16/apps/bristol_roadrunner.png | Bin 317 -> 0 bytes .../16x16/apps/bristol_sidney.png | Bin 413 -> 0 bytes .../16x16/apps/bristol_solina.png | Bin 1056 -> 0 bytes .../16x16/apps/bristol_sonic6.png | Bin 576 -> 0 bytes .../16x16/apps/bristol_stratus.png | Bin 491 -> 0 bytes .../16x16/apps/bristol_trilogy.png | Bin 492 -> 0 bytes .../16x16/apps/bristol_vox.png | Bin 1086 -> 0 bytes .../16x16/apps/bristol_voyager.png | Bin 581 -> 0 bytes .../16x16/apps/distrho_plugins.png | Bin 2950 -> 0 bytes .../claudia-hicolor/16x16/apps/energyxt2.png | Bin 492 -> 0 bytes .../claudia-hicolor/16x16/apps/foo-yc20.png | Bin 485 -> 0 bytes .../claudia-hicolor/16x16/apps/ingen.png | Bin 514 -> 0 bytes .../claudia-hicolor/16x16/apps/jack-rack.png | Bin 494 -> 0 bytes .../claudia-hicolor/16x16/apps/jacker.png | Bin 692 -> 0 bytes .../claudia-hicolor/16x16/apps/jsampler.png | Bin 466 -> 0 bytes .../16x16/apps/juced_plugins.png | Bin 758 -> 0 bytes .../claudia-hicolor/16x16/apps/linuxdsp.png | Bin 967 -> 0 bytes .../icons/claudia-hicolor/16x16/apps/lmms.png | Bin 919 -> 0 bytes .../claudia-hicolor/16x16/apps/loomer.png | Bin 823 -> 0 bytes data/icons/claudia-hicolor/16x16/apps/lv2.png | Bin 580 -> 0 bytes .../claudia-hicolor/16x16/apps/mixxx.png | Bin 763 -> 0 bytes .../icons/claudia-hicolor/16x16/apps/muse.png | Bin 989 -> 0 bytes .../claudia-hicolor/16x16/apps/non-mixer.png | Bin 586 -> 0 bytes .../16x16/apps/non-sequencer.png | Bin 731 -> 0 bytes .../16x16/apps/non-timeline.png | Bin 656 -> 0 bytes .../claudia-hicolor/16x16/apps/phasex.png | Bin 208 -> 0 bytes .../claudia-hicolor/16x16/apps/pianoteq.png | Bin 916 -> 0 bytes .../claudia-hicolor/16x16/apps/qamix.png | Bin 860 -> 0 bytes .../claudia-hicolor/16x16/apps/radium.png | Bin 740 -> 0 bytes .../claudia-hicolor/16x16/apps/rakarrack.png | Bin 3277 -> 0 bytes .../claudia-hicolor/16x16/apps/renoise.png | Bin 692 -> 0 bytes .../16x16/apps/tal_plugins.png | Bin 3087 -> 0 bytes .../claudia-hicolor/16x16/apps/traverso.png | Bin 604 -> 0 bytes .../16x16/apps/wolpertinger.png | Bin 656 -> 0 bytes .../claudia-hicolor/16x16/apps/yoshimi.png | Bin 740 -> 0 bytes .../claudia-hicolor/16x16/apps/zonage.png | Bin 932 -> 0 bytes .../claudia-hicolor/16x16/apps/zynjacku.png | Bin 877 -> 0 bytes .../48x48/apps/arctican_plugins.png | Bin 3419 -> 0 bytes .../claudia-hicolor/48x48/apps/ardour.png | Bin 3135 -> 0 bytes .../icons/claudia-hicolor/48x48/apps/aria.png | Bin 2966 -> 0 bytes .../claudia-hicolor/48x48/apps/arpage.png | Bin 2296 -> 0 bytes .../icons/claudia-hicolor/48x48/apps/azr3.png | Bin 2875 -> 0 bytes .../48x48/apps/bristol_BME700.png | Bin 3495 -> 0 bytes .../48x48/apps/bristol_aks.png | Bin 2382 -> 0 bytes .../48x48/apps/bristol_arp2600.png | Bin 2266 -> 0 bytes .../48x48/apps/bristol_axxe.png | Bin 2045 -> 0 bytes .../48x48/apps/bristol_bassmaker.png | Bin 3205 -> 0 bytes .../48x48/apps/bristol_bit100.png | Bin 1891 -> 0 bytes .../48x48/apps/bristol_bit99.png | Bin 1790 -> 0 bytes .../48x48/apps/bristol_bitone.png | Bin 1899 -> 0 bytes .../48x48/apps/bristol_cs80.png | Bin 2811 -> 0 bytes .../claudia-hicolor/48x48/apps/bristol_dx.png | Bin 1763 -> 0 bytes .../48x48/apps/bristol_explorer.png | Bin 2140 -> 0 bytes .../48x48/apps/bristol_granular.png | Bin 3455 -> 0 bytes .../48x48/apps/bristol_hammondB3.png | Bin 1989 -> 0 bytes .../48x48/apps/bristol_juno.png | Bin 1561 -> 0 bytes .../48x48/apps/bristol_jupiter8.png | Bin 2590 -> 0 bytes .../48x48/apps/bristol_memoryMoog.png | Bin 1788 -> 0 bytes .../48x48/apps/bristol_mini.png | Bin 2142 -> 0 bytes .../48x48/apps/bristol_mixer.png | Bin 2488 -> 0 bytes .../48x48/apps/bristol_monopoly.png | Bin 2104 -> 0 bytes .../48x48/apps/bristol_ms20.png | Bin 2087 -> 0 bytes .../48x48/apps/bristol_obx.png | Bin 1930 -> 0 bytes .../48x48/apps/bristol_obxa.png | Bin 1919 -> 0 bytes .../48x48/apps/bristol_odyssey.png | Bin 4282 -> 0 bytes .../48x48/apps/bristol_poly.png | Bin 1625 -> 0 bytes .../48x48/apps/bristol_poly800.png | Bin 2436 -> 0 bytes .../48x48/apps/bristol_pro1.png | Bin 3270 -> 0 bytes .../48x48/apps/bristol_prophet.png | Bin 1870 -> 0 bytes .../48x48/apps/bristol_prophet10.png | Bin 2160 -> 0 bytes .../48x48/apps/bristol_prophet52.png | Bin 1895 -> 0 bytes .../48x48/apps/bristol_realistic.png | Bin 1959 -> 0 bytes .../48x48/apps/bristol_rhodes.png | Bin 1677 -> 0 bytes .../48x48/apps/bristol_rhodesbass.png | Bin 2418 -> 0 bytes .../48x48/apps/bristol_roadrunner.png | Bin 1514 -> 0 bytes .../48x48/apps/bristol_sidney.png | Bin 2314 -> 0 bytes .../48x48/apps/bristol_solina.png | Bin 1708 -> 0 bytes .../48x48/apps/bristol_sonic6.png | Bin 3689 -> 0 bytes .../48x48/apps/bristol_stratus.png | Bin 2936 -> 0 bytes .../48x48/apps/bristol_trilogy.png | Bin 2785 -> 0 bytes .../48x48/apps/bristol_vox.png | Bin 1858 -> 0 bytes .../48x48/apps/bristol_voxM2.png | Bin 2009 -> 0 bytes .../48x48/apps/bristol_voyager.png | Bin 3908 -> 0 bytes .../48x48/apps/distrho_plugins.png | Bin 4340 -> 0 bytes .../claudia-hicolor/48x48/apps/energyxt2.png | Bin 1164 -> 0 bytes .../claudia-hicolor/48x48/apps/foo-yc20.png | Bin 1971 -> 0 bytes .../claudia-hicolor/48x48/apps/ingen.png | Bin 3222 -> 0 bytes .../claudia-hicolor/48x48/apps/jack-rack.png | Bin 1899 -> 0 bytes .../claudia-hicolor/48x48/apps/jacker.png | Bin 2937 -> 0 bytes .../claudia-hicolor/48x48/apps/jsampler.png | Bin 1961 -> 0 bytes .../48x48/apps/juced_plugins.png | Bin 3243 -> 0 bytes .../claudia-hicolor/48x48/apps/linuxdsp.png | Bin 4090 -> 0 bytes .../icons/claudia-hicolor/48x48/apps/lmms.png | Bin 4698 -> 0 bytes .../claudia-hicolor/48x48/apps/loomer.png | Bin 2870 -> 0 bytes data/icons/claudia-hicolor/48x48/apps/lv2.png | Bin 1872 -> 0 bytes .../claudia-hicolor/48x48/apps/mixxx.png | Bin 1577 -> 0 bytes .../icons/claudia-hicolor/48x48/apps/muse.png | Bin 5163 -> 0 bytes .../claudia-hicolor/48x48/apps/non-mixer.png | Bin 2966 -> 0 bytes .../48x48/apps/non-sequencer.png | Bin 3301 -> 0 bytes .../48x48/apps/non-timeline.png | Bin 3149 -> 0 bytes .../claudia-hicolor/48x48/apps/phasex.png | Bin 262 -> 0 bytes .../claudia-hicolor/48x48/apps/pianoteq.png | Bin 4834 -> 0 bytes .../claudia-hicolor/48x48/apps/qamix.png | Bin 3703 -> 0 bytes .../claudia-hicolor/48x48/apps/radium.png | Bin 5001 -> 0 bytes .../claudia-hicolor/48x48/apps/rakarrack.png | Bin 5682 -> 0 bytes .../claudia-hicolor/48x48/apps/renoise.png | Bin 3374 -> 0 bytes .../48x48/apps/tal_plugins.png | Bin 3996 -> 0 bytes .../claudia-hicolor/48x48/apps/traverso.png | Bin 2686 -> 0 bytes .../48x48/apps/wolpertinger.png | Bin 2379 -> 0 bytes .../claudia-hicolor/48x48/apps/yoshimi.png | Bin 3241 -> 0 bytes .../claudia-hicolor/48x48/apps/zonage.png | Bin 1955 -> 0 bytes .../claudia-hicolor/48x48/apps/zynjacku.png | Bin 3885 -> 0 bytes data/icons/claudia-hicolor/index.theme | 15 - data/pulse2jack/play+rec.pa | 52 - data/pulse2jack/play.pa | 50 - data/pulse2loopback/play+rec.pa | 52 - data/pulse2loopback/play.pa | 50 - data/templates/Ardour2/Ardour2.ardour | 79 - data/templates/Ardour2/instant.xml | 3 - data/templates/Ardour3/Ardour3.ardour | 86 - data/templates/Ardour3/instant.xml | 3 - data/templates/CalfJackHost | 2 - data/templates/Carla.carxp | 4 - data/templates/Hydrogen.h2song | 930 ----- data/templates/Jack-Mixer.xml | 4 - data/templates/Jack-Rack.xml | Bin 133 -> 0 bytes data/templates/Jacker.jsong | 130 - data/templates/LMMS.mmp | 281 -- data/templates/MusE.med | 114 - data/templates/Non-Sequencer.non | Bin 251 -> 0 bytes data/templates/Non-Timeline/history | 1 - data/templates/Non-Timeline/info | 8 - data/templates/Qsampler.lscp | 4 - data/templates/Qtractor.qtr | 98 - data/templates/Rosegarden.rg | Bin 10098 -> 0 bytes data/templates/Seq24.midi | Bin 4407 -> 0 bytes data/unity/cadence-unity-support | 118 - data/unity/cadence-unity-support.desktop | 9 - data/windows/README | 10 - data/windows/build-win32.sh | 109 - data/windows/build-win64.sh | 109 - data/windows/unzipfx-catarina/.gitignore | 7 - data/windows/unzipfx-catarina/Makefile.linux | 28 - data/windows/unzipfx-catarina/Makefile.win32 | 33 - data/windows/unzipfx-catarina/README | 11 - data/windows/unzipfx-catarina/consts.h | 54 - data/windows/unzipfx-catarina/crc32.c | 732 ---- data/windows/unzipfx-catarina/crc32.h | 60 - data/windows/unzipfx-catarina/crypt.c | 653 ---- data/windows/unzipfx-catarina/crypt.h | 169 - data/windows/unzipfx-catarina/ebcdic.h | 301 -- data/windows/unzipfx-catarina/extract.c | 2820 --------------- data/windows/unzipfx-catarina/fileio.c | 2855 --------------- data/windows/unzipfx-catarina/globals.c | 222 -- data/windows/unzipfx-catarina/globals.h | 443 --- data/windows/unzipfx-catarina/inflate.c | 1775 ---------- data/windows/unzipfx-catarina/inflate.h | 39 - data/windows/unzipfx-catarina/match.c | 442 --- data/windows/unzipfx-catarina/process.c | 3092 ---------------- data/windows/unzipfx-catarina/ttyio.c | 705 ---- data/windows/unzipfx-catarina/ttyio.h | 227 -- data/windows/unzipfx-catarina/ubz2err.c | 63 - data/windows/unzipfx-catarina/unix/unix.c | 1876 ---------- data/windows/unzipfx-catarina/unix/unxcfg.h | 230 -- data/windows/unzipfx-catarina/unzip.c | 2666 -------------- data/windows/unzipfx-catarina/unzip.h | 722 ---- .../unzipfx-catarina/unzipfx/appDetails.c | 80 - .../unzipfx-catarina/unzipfx/appDetails.h | 22 - data/windows/unzipfx-catarina/unzpriv.h | 3123 ---------------- data/windows/unzipfx-catarina/unzvers.h | 89 - data/windows/unzipfx-catarina/win32/nt.c | 554 --- data/windows/unzipfx-catarina/win32/nt.h | 33 - data/windows/unzipfx-catarina/win32/w32cfg.h | 571 --- data/windows/unzipfx-catarina/win32/win32.c | 3139 ----------------- .../windows/unzipfx-catarina/win32/win32i64.c | 129 - data/windows/unzipfx-catarina/zip.h | 25 - data/windows/unzipfx-catarina/zipinfo.c | 2315 ------------ data/windows/unzipfx-catia/.gitignore | 7 - data/windows/unzipfx-catia/Makefile.linux | 28 - data/windows/unzipfx-catia/Makefile.win32 | 33 - data/windows/unzipfx-catia/README | 11 - data/windows/unzipfx-catia/consts.h | 54 - data/windows/unzipfx-catia/crc32.c | 732 ---- data/windows/unzipfx-catia/crc32.h | 60 - data/windows/unzipfx-catia/crypt.c | 653 ---- data/windows/unzipfx-catia/crypt.h | 169 - data/windows/unzipfx-catia/ebcdic.h | 301 -- data/windows/unzipfx-catia/extract.c | 2820 --------------- data/windows/unzipfx-catia/fileio.c | 2855 --------------- data/windows/unzipfx-catia/globals.c | 222 -- data/windows/unzipfx-catia/globals.h | 443 --- data/windows/unzipfx-catia/inflate.c | 1775 ---------- data/windows/unzipfx-catia/inflate.h | 39 - data/windows/unzipfx-catia/match.c | 442 --- data/windows/unzipfx-catia/process.c | 3092 ---------------- data/windows/unzipfx-catia/ttyio.c | 705 ---- data/windows/unzipfx-catia/ttyio.h | 227 -- data/windows/unzipfx-catia/ubz2err.c | 63 - data/windows/unzipfx-catia/unix/unix.c | 1876 ---------- data/windows/unzipfx-catia/unix/unxcfg.h | 230 -- data/windows/unzipfx-catia/unzip.c | 2666 -------------- data/windows/unzipfx-catia/unzip.h | 722 ---- .../unzipfx-catia/unzipfx/appDetails.c | 80 - .../unzipfx-catia/unzipfx/appDetails.h | 22 - data/windows/unzipfx-catia/unzpriv.h | 3123 ---------------- data/windows/unzipfx-catia/unzvers.h | 89 - data/windows/unzipfx-catia/win32/nt.c | 554 --- data/windows/unzipfx-catia/win32/nt.h | 33 - data/windows/unzipfx-catia/win32/w32cfg.h | 571 --- data/windows/unzipfx-catia/win32/win32.c | 3139 ----------------- data/windows/unzipfx-catia/win32/win32i64.c | 129 - data/windows/unzipfx-catia/zip.h | 25 - data/windows/unzipfx-catia/zipinfo.c | 2315 ------------ 267 files changed, 2 insertions(+), 63485 deletions(-) delete mode 100755 data/61cadence-session-inject delete mode 100644 data/autostart/cadence-session-start.desktop delete mode 100755 data/cadence delete mode 100755 data/cadence-aloop-daemon delete mode 100755 data/cadence-jacksettings delete mode 100755 data/cadence-logs delete mode 100755 data/cadence-pulse2jack delete mode 100755 data/cadence-pulse2loopback delete mode 100755 data/cadence-render delete mode 100755 data/cadence-session-start delete mode 100644 data/cadence.desktop delete mode 100755 data/catarina delete mode 100644 data/catarina.desktop delete mode 100755 data/claudia delete mode 100755 data/claudia-launcher delete mode 100644 data/claudia-launcher.desktop delete mode 100644 data/claudia.desktop delete mode 100644 data/icons/claudia-hicolor/16x16/apps/arctican_plugins.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/ardour.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/aria.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/arpage.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/azr3.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_BME700.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_aks.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_arp2600.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_axxe.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_bassmaker.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_bit99.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_bitone.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_cs80.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_dx.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_explorer.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_granular.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_hammondB3.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_juno.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_jupiter8.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_memoryMoog.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_mini.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_mixer.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_monopoly.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_ms20.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_obx.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_obxa.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_odyssey.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_poly.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_poly800.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_pro1.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_prophet.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_prophet10.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_prophet52.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_realistic.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_rhodes.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_rhodesbass.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_roadrunner.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_sidney.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_solina.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_sonic6.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_stratus.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_trilogy.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_vox.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/bristol_voyager.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/distrho_plugins.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/energyxt2.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/foo-yc20.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/ingen.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/jack-rack.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/jacker.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/jsampler.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/juced_plugins.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/linuxdsp.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/lmms.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/loomer.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/lv2.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/mixxx.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/muse.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/non-mixer.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/non-sequencer.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/non-timeline.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/phasex.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/pianoteq.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/qamix.png delete mode 100755 data/icons/claudia-hicolor/16x16/apps/radium.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/rakarrack.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/renoise.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/tal_plugins.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/traverso.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/wolpertinger.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/yoshimi.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/zonage.png delete mode 100644 data/icons/claudia-hicolor/16x16/apps/zynjacku.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/arctican_plugins.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/ardour.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/aria.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/arpage.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/azr3.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_BME700.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_aks.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_arp2600.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_axxe.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_bassmaker.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_bit100.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_bit99.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_bitone.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_cs80.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_dx.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_explorer.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_granular.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_hammondB3.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_juno.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_jupiter8.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_memoryMoog.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_mini.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_mixer.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_monopoly.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_ms20.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_obx.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_obxa.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_odyssey.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_poly.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_poly800.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_pro1.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_prophet.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_prophet10.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_prophet52.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_realistic.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_rhodes.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_rhodesbass.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_roadrunner.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_sidney.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_solina.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_sonic6.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_stratus.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_trilogy.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_vox.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_voxM2.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/bristol_voyager.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/distrho_plugins.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/energyxt2.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/foo-yc20.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/ingen.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/jack-rack.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/jacker.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/jsampler.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/juced_plugins.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/linuxdsp.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/lmms.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/loomer.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/lv2.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/mixxx.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/muse.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/non-mixer.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/non-sequencer.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/non-timeline.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/phasex.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/pianoteq.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/qamix.png delete mode 100755 data/icons/claudia-hicolor/48x48/apps/radium.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/rakarrack.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/renoise.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/tal_plugins.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/traverso.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/wolpertinger.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/yoshimi.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/zonage.png delete mode 100644 data/icons/claudia-hicolor/48x48/apps/zynjacku.png delete mode 100644 data/icons/claudia-hicolor/index.theme delete mode 100644 data/pulse2jack/play+rec.pa delete mode 100644 data/pulse2jack/play.pa delete mode 100644 data/pulse2loopback/play+rec.pa delete mode 100644 data/pulse2loopback/play.pa delete mode 100644 data/templates/Ardour2/Ardour2.ardour delete mode 100644 data/templates/Ardour2/instant.xml delete mode 100644 data/templates/Ardour3/Ardour3.ardour delete mode 100644 data/templates/Ardour3/instant.xml delete mode 100644 data/templates/CalfJackHost delete mode 100755 data/templates/Carla.carxp delete mode 100644 data/templates/Hydrogen.h2song delete mode 100644 data/templates/Jack-Mixer.xml delete mode 100644 data/templates/Jack-Rack.xml delete mode 100644 data/templates/Jacker.jsong delete mode 100755 data/templates/LMMS.mmp delete mode 100644 data/templates/MusE.med delete mode 100644 data/templates/Non-Sequencer.non delete mode 100644 data/templates/Non-Timeline/history delete mode 100644 data/templates/Non-Timeline/info delete mode 100644 data/templates/Qsampler.lscp delete mode 100644 data/templates/Qtractor.qtr delete mode 100644 data/templates/Rosegarden.rg delete mode 100644 data/templates/Seq24.midi delete mode 100755 data/unity/cadence-unity-support delete mode 100644 data/unity/cadence-unity-support.desktop delete mode 100644 data/windows/README delete mode 100755 data/windows/build-win32.sh delete mode 100755 data/windows/build-win64.sh delete mode 100644 data/windows/unzipfx-catarina/.gitignore delete mode 100644 data/windows/unzipfx-catarina/Makefile.linux delete mode 100644 data/windows/unzipfx-catarina/Makefile.win32 delete mode 100644 data/windows/unzipfx-catarina/README delete mode 100644 data/windows/unzipfx-catarina/consts.h delete mode 100644 data/windows/unzipfx-catarina/crc32.c delete mode 100644 data/windows/unzipfx-catarina/crc32.h delete mode 100644 data/windows/unzipfx-catarina/crypt.c delete mode 100644 data/windows/unzipfx-catarina/crypt.h delete mode 100644 data/windows/unzipfx-catarina/ebcdic.h delete mode 100644 data/windows/unzipfx-catarina/extract.c delete mode 100644 data/windows/unzipfx-catarina/fileio.c delete mode 100644 data/windows/unzipfx-catarina/globals.c delete mode 100644 data/windows/unzipfx-catarina/globals.h delete mode 100644 data/windows/unzipfx-catarina/inflate.c delete mode 100644 data/windows/unzipfx-catarina/inflate.h delete mode 100644 data/windows/unzipfx-catarina/match.c delete mode 100644 data/windows/unzipfx-catarina/process.c delete mode 100644 data/windows/unzipfx-catarina/ttyio.c delete mode 100644 data/windows/unzipfx-catarina/ttyio.h delete mode 100644 data/windows/unzipfx-catarina/ubz2err.c delete mode 100644 data/windows/unzipfx-catarina/unix/unix.c delete mode 100644 data/windows/unzipfx-catarina/unix/unxcfg.h delete mode 100644 data/windows/unzipfx-catarina/unzip.c delete mode 100644 data/windows/unzipfx-catarina/unzip.h delete mode 100644 data/windows/unzipfx-catarina/unzipfx/appDetails.c delete mode 100644 data/windows/unzipfx-catarina/unzipfx/appDetails.h delete mode 100644 data/windows/unzipfx-catarina/unzpriv.h delete mode 100644 data/windows/unzipfx-catarina/unzvers.h delete mode 100644 data/windows/unzipfx-catarina/win32/nt.c delete mode 100644 data/windows/unzipfx-catarina/win32/nt.h delete mode 100644 data/windows/unzipfx-catarina/win32/w32cfg.h delete mode 100644 data/windows/unzipfx-catarina/win32/win32.c delete mode 100644 data/windows/unzipfx-catarina/win32/win32i64.c delete mode 100644 data/windows/unzipfx-catarina/zip.h delete mode 100644 data/windows/unzipfx-catarina/zipinfo.c delete mode 100644 data/windows/unzipfx-catia/.gitignore delete mode 100644 data/windows/unzipfx-catia/Makefile.linux delete mode 100644 data/windows/unzipfx-catia/Makefile.win32 delete mode 100644 data/windows/unzipfx-catia/README delete mode 100644 data/windows/unzipfx-catia/consts.h delete mode 100644 data/windows/unzipfx-catia/crc32.c delete mode 100644 data/windows/unzipfx-catia/crc32.h delete mode 100644 data/windows/unzipfx-catia/crypt.c delete mode 100644 data/windows/unzipfx-catia/crypt.h delete mode 100644 data/windows/unzipfx-catia/ebcdic.h delete mode 100644 data/windows/unzipfx-catia/extract.c delete mode 100644 data/windows/unzipfx-catia/fileio.c delete mode 100644 data/windows/unzipfx-catia/globals.c delete mode 100644 data/windows/unzipfx-catia/globals.h delete mode 100644 data/windows/unzipfx-catia/inflate.c delete mode 100644 data/windows/unzipfx-catia/inflate.h delete mode 100644 data/windows/unzipfx-catia/match.c delete mode 100644 data/windows/unzipfx-catia/process.c delete mode 100644 data/windows/unzipfx-catia/ttyio.c delete mode 100644 data/windows/unzipfx-catia/ttyio.h delete mode 100644 data/windows/unzipfx-catia/ubz2err.c delete mode 100644 data/windows/unzipfx-catia/unix/unix.c delete mode 100644 data/windows/unzipfx-catia/unix/unxcfg.h delete mode 100644 data/windows/unzipfx-catia/unzip.c delete mode 100644 data/windows/unzipfx-catia/unzip.h delete mode 100644 data/windows/unzipfx-catia/unzipfx/appDetails.c delete mode 100644 data/windows/unzipfx-catia/unzipfx/appDetails.h delete mode 100644 data/windows/unzipfx-catia/unzpriv.h delete mode 100644 data/windows/unzipfx-catia/unzvers.h delete mode 100644 data/windows/unzipfx-catia/win32/nt.c delete mode 100644 data/windows/unzipfx-catia/win32/nt.h delete mode 100644 data/windows/unzipfx-catia/win32/w32cfg.h delete mode 100644 data/windows/unzipfx-catia/win32/win32.c delete mode 100644 data/windows/unzipfx-catia/win32/win32i64.c delete mode 100644 data/windows/unzipfx-catia/zip.h delete mode 100644 data/windows/unzipfx-catia/zipinfo.c diff --git a/data/61cadence-session-inject b/data/61cadence-session-inject deleted file mode 100755 index b2ac190..0000000 --- a/data/61cadence-session-inject +++ /dev/null @@ -1,19 +0,0 @@ -# Cadence Session Startup Injection -# Set plugin paths and start JACK (or not) according to user settings - -INSTALL_PREFIX="X-PREFIX-X" - -if [ -f $INSTALL_PREFIX/bin/cadence-session-start ]; then - -export CADENCE_AUTO_STARTED="true" - -export LADSPA_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printLADSPA_PATH`" -export DSSI_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printDSSI_PATH`" -export LV2_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printLV2_PATH`" -export VST_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printVST_PATH`" - -STARTUP="$INSTALL_PREFIX/bin/cadence-session-start --system-start-by-x11-startup $STARTUP" - -fi - -unset INSTALL_PREFIX diff --git a/data/autostart/cadence-session-start.desktop b/data/autostart/cadence-session-start.desktop deleted file mode 100644 index 2794b81..0000000 --- a/data/autostart/cadence-session-start.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Name=Cadence session startup -Comment=Cadence session startup -Exec=cadence-session-start --maybe-system-start -Icon=cadence -Terminal=false -GenericName= -NoDisplay=true diff --git a/data/cadence b/data/cadence deleted file mode 100755 index c16d8a3..0000000 --- a/data/cadence +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Check if already running - -PROCS=`ps -f -u $USER | grep /share/cadence/src/cadence.py | grep python` - -if [ x"$PROCS" != x"" ]; then - - # One instance only - PROC=`echo "$PROCS" | head -n 1` - - # Get PID - PID=`echo "$PROC" | awk '{printf$2}'` - - # Last check, just to make sure - if [ x"$PID" != x"" ]; then - - # Tell user about this - echo "Cadence already started, showing GUI now..." - - # Send SIGUSR2, shows the GUI - kill -USR2 "$PID" - - # Quit now - exit - - fi -fi - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -# We only got here if not running yet -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence.py "$@" diff --git a/data/cadence-aloop-daemon b/data/cadence-aloop-daemon deleted file mode 100755 index 9cc5851..0000000 --- a/data/cadence-aloop-daemon +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_aloop_daemon.py "$@" diff --git a/data/cadence-jacksettings b/data/cadence-jacksettings deleted file mode 100755 index b1ca676..0000000 --- a/data/cadence-jacksettings +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/jacksettings.py "$@" diff --git a/data/cadence-logs b/data/cadence-logs deleted file mode 100755 index 27cd3c3..0000000 --- a/data/cadence-logs +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/logs.py "$@" diff --git a/data/cadence-pulse2jack b/data/cadence-pulse2jack deleted file mode 100755 index 5266cb9..0000000 --- a/data/cadence-pulse2jack +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -# Script to bridge/start pulseaudio into JACK mode - -INSTALL_PREFIX="X-PREFIX-X" - -# ---------------------------------------------- - -if [ ! -d ~/.pulse ]; then - mkdir -p ~/.pulse -fi - -if [ ! -f ~/.pulse/client.conf ]; then - echo "autospawn = no" > ~/.pulse/client.conf -else - if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then - sed -i '/autospawn =/d' ~/.pulse/client.conf - echo "autospawn = no" >> ~/.pulse/client.conf - fi -fi - -if [ ! -f ~/.pulse/daemon.conf ]; then - echo "default-sample-format = float32le" > ~/.pulse/daemon.conf - echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf - echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf - echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf -else - if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then - sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf - echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then - sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf - echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then - sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf - echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then - sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf - echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf - fi -fi - -# ---------------------------------------------- - -PLAY_ONLY="no" - -case $1 in - -h|--h|--help) -echo "usage: $0 [command] - - -p, --play Playback mode only - - -h, --help Show this help menu - --dummy Don't do anything, just create the needed files - -NOTE: - When runned with no arguments, pulse2jack will - activate PulseAudio with both playback and record modes. -" -exit - ;; - - --dummy) -exit - ;; - - -p|--p|--play) -PLAY_ONLY="yes" -FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play.pa - ;; - - *) -FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play+rec.pa - ;; -esac - -# ---------------------------------------------- - -IsPulseAudioRunning() -{ - PROCESS=`ps -u $USER | grep pulseaudio` - if [ "$PROCESS" == "" ]; then - false - else - true - fi -} - -if (IsPulseAudioRunning); then -{ - if (`jack_lsp | grep "PulseAudio JACK Sink:" > /dev/null`); then - { - echo "PulseAudio is already running and bridged to JACK" - } - else - { - echo "PulseAudio is already running, bridge it..." - - if [ "$PLAY_ONLY" == "yes" ]; then - { - pactl load-module module-jack-sink > /dev/null - pacmd set-default-source jack_in > /dev/null - } - else - { - pactl load-module module-jack-sink > /dev/null - pactl load-module module-jack-source > /dev/null - pacmd set-default-sink jack_out > /dev/null - pacmd set-default-source jack_in > /dev/null - } - fi - - echo "Done" - } - fi -} -else -{ - if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then - echo "Initiated PulseAudio successfully!" - else - echo "Failed to initialize PulseAudio!" - fi -} -fi diff --git a/data/cadence-pulse2loopback b/data/cadence-pulse2loopback deleted file mode 100755 index 9232346..0000000 --- a/data/cadence-pulse2loopback +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash -# Script to bridge/start pulseaudio into loopback mode - -INSTALL_PREFIX="X-PREFIX-X" - -# ---------------------------------------------- - -if [ ! -d ~/.pulse ]; then - mkdir -p ~/.pulse -fi - -if [ ! -f ~/.pulse/client.conf ]; then - echo "autospawn = no" > ~/.pulse/client.conf -else - if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then - sed -i '/autospawn =/d' ~/.pulse/client.conf - echo "autospawn = no" >> ~/.pulse/client.conf - fi -fi - -if [ ! -f ~/.pulse/daemon.conf ]; then - echo "default-sample-format = float32le" > ~/.pulse/daemon.conf - echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf - echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf - echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf -else - if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then - sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf - echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then - sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf - echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then - sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf - echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf - fi - if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then - sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf - echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf - fi -fi - -# ---------------------------------------------- - -case $1 in - -h|--h|--help) -echo "usage: $0 [command] - - -p, --play Playback mode only - - -h, --help Show this help menu - --dummy Don't do anything, just create the needed files - -NOTE: - When runned with no arguments, pulse2jack will - activate PulseAudio with both playback and record modes. -" -exit - ;; - - --dummy) -exit - ;; - - -p|--p|--play) -FILE=$INSTALL_PREFIX/share/cadence/pulse2loopback/play.pa - ;; - - *) -FILE=$INSTALL_PREFIX/share/cadence/pulse2loopback/play+rec.pa - ;; -esac - -# ---------------------------------------------- - -IsPulseAudioRunning() -{ - PROCESS=`ps -u $USER | grep pulseaudio` - if [ "$PROCESS" == "" ]; then - false - else - true - fi -} - -if (IsPulseAudioRunning); then -{ - echo "PulseAudio is already running, make sure it outputs to Loopback" - - pactl load-module module-alsa-source source_name=input_loopback device=hw:Loopback > /dev/null - pactl load-module module-alsa-sink sink_name=output_loopback device=hw:Loopback > /dev/null - pacmd set-default-source input_loopback > /dev/null - pacmd set-default-sink output_loopback > /dev/null - - echo "Done" -} -else -{ - if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then - echo "Initiated PulseAudio successfully!" - else - echo "Failed to initialize PulseAudio!" - fi -} -fi diff --git a/data/cadence-render b/data/cadence-render deleted file mode 100755 index 7a70122..0000000 --- a/data/cadence-render +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/render.py "$@" diff --git a/data/cadence-session-start b/data/cadence-session-start deleted file mode 100755 index bf35e68..0000000 --- a/data/cadence-session-start +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" - -if [ "$1"x == "--system-start-by-x11-startup"x ]; then - # called via $STARTUP in 21cadence-session-inject - $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start & - shift - if [ "$1"x != ""x ]; then - exec "$@" - else - exec x-session-manager - fi -elif [ "$1"x == "--maybe-system-start"x ]; then - # called via autostart cadence-session-start.desktop - # this will check if jack is already running before trying to restart things - exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start-desktop -else - # called by user - exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py "$@" -fi diff --git a/data/cadence.desktop b/data/cadence.desktop deleted file mode 100644 index 5e79f3d..0000000 --- a/data/cadence.desktop +++ /dev/null @@ -1,66 +0,0 @@ -[Desktop Entry] -Name=Cadence -GenericName=Cadence -Comment=JACK Toolbox -Comment[fr]=Boîte à outils JACK -Exec=cadence -Icon=cadence -Terminal=false -Type=Application -Categories=AudioVideo;AudioEditing;Qt; -X-Ayatana-Desktop-Shortcuts=Catia;Claudia;ClaudiaLauncher;Carla;CarlaControl;JackMeterIn;JackMeterOut;JackSettings;Logs;Render;XYController; - -[Catia Shortcut Group] -Name=Catia -Exec=catia -TargetEnvironment=Unity - -[Claudia Shortcut Group] -Name=Claudia -Exec=claudia -TargetEnvironment=Unity - -[ClaudiaLauncher Shortcut Group] -Name=Claudia Launcher -Exec=claudia-launcher -TargetEnvironment=Unity - -[Carla Shortcut Group] -Name=Carla -Exec=carla -TargetEnvironment=Unity - -[CarlaControl Shortcut Group] -Name=Carla Control -Exec=carla-control -TargetEnvironment=Unity - -[JackMeterIn Shortcut Group] -Name=JACK Meter (Inputs) -Exec=cadence-jackmeter -in -TargetEnvironment=Unity - -[JackMeterOut Shortcut Group] -Name=JACK Meter (Outputs) -Exec=cadence-jackmeter -TargetEnvironment=Unity - -[JackSettings Shortcut Group] -Name=JACK Settings -Exec=cadence-jacksettings -TargetEnvironment=Unity - -[Logs Shortcut Group] -Name=Logs -Exec=cadence-logs -TargetEnvironment=Unity - -[Render Shortcut Group] -Name=Render -Exec=cadence-render -TargetEnvironment=Unity - -[XYController Shortcut Group] -Name=XY-Controller -Exec=cadence-xycontroller -TargetEnvironment=Unity diff --git a/data/catarina b/data/catarina deleted file mode 100755 index bbb1724..0000000 --- a/data/catarina +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/catarina.py "$@" diff --git a/data/catarina.desktop b/data/catarina.desktop deleted file mode 100644 index c2fd4eb..0000000 --- a/data/catarina.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Catarina -GenericName=Catarina -Comment=PatchCanvas Test Application -Comment[fr]=Application de test du canevas de patch -Exec=catarina -Icon=catarina -Terminal=false -Type=Application -Categories=Utility;Qt; diff --git a/data/catia b/data/catia index 012d5e2..221bd6c 100755 --- a/data/catia +++ b/data/catia @@ -2,7 +2,7 @@ # Check if already running -PROCS=`ps -f -u $USER | grep /share/cadence/src/catia.py | grep python` +PROCS=`ps -f -u $USER | grep /share/catia/catia.py | grep python` if [ x"$PROCS" != x"" ]; then @@ -35,4 +35,4 @@ fi # We only got here if not running yet INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/catia.py "$@" +exec $PYTHON $INSTALL_PREFIX/share/catia/catia.py "$@" diff --git a/data/claudia b/data/claudia deleted file mode 100755 index 4517c51..0000000 --- a/data/claudia +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Check if already running - -PROCS=`ps -f -u $USER | grep /share/cadence/src/claudia.py | grep python` - -if [ x"$PROCS" != x"" ]; then - - # One instance only - PROC=`echo "$PROCS" | head -n 1` - - # Get PID - PID=`echo "$PROC" | awk '{printf$2}'` - - # Last check, just to make sure - if [ x"$PID" != x"" ]; then - - # Tell user about this - echo "Claudia already started, showing GUI now..." - - # Send SIGUSR2, shows the GUI - kill -USR2 "$PID" - - # Quit now - exit - - fi -fi - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -# We only got here if not running yet -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/claudia.py "$@" diff --git a/data/claudia-launcher b/data/claudia-launcher deleted file mode 100755 index cec6538..0000000 --- a/data/claudia-launcher +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Check if already running - -PROCS=`ps -f -u $USER | grep /share/cadence/src/claudia-launcher.py | grep python` - -if [ x"$PROCS" != x"" ]; then - - # One instance only - PROC=`echo "$PROCS" | head -n 1` - - # Get PID - PID=`echo "$PROC" | awk '{printf$2}'` - - # Last check, just to make sure - if [ x"$PID" != x"" ]; then - - # Tell user about this - echo "Claudia-Launcher already started, showing GUI now..." - - # Send SIGUSR2, shows the GUI - kill -USR2 "$PID" - - # Quit now - exit - - fi -fi - -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else - PYTHON=python -fi - -# We only got here if not running yet -INSTALL_PREFIX="X-PREFIX-X" -exec $PYTHON $INSTALL_PREFIX/share/cadence/src/claudia_launcher.py "$@" diff --git a/data/claudia-launcher.desktop b/data/claudia-launcher.desktop deleted file mode 100644 index d9a4dde..0000000 --- a/data/claudia-launcher.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=Claudia Launcher -GenericName=Claudia Launcher -GenericName[fr]=Lanceur Claudia -Comment=Multimedia Applications Launcher -Comment[fr]=Lanceur d'applications multimédia -Exec=claudia-launcher -Icon=claudia-launcher -Terminal=false -Type=Application -Categories=AudioVideo;AudioEditing;Qt; diff --git a/data/claudia.desktop b/data/claudia.desktop deleted file mode 100644 index 6daa548..0000000 --- a/data/claudia.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=Claudia -GenericName=Claudia -Comment=LADISH Frontend -Comment[fr]=Interface graphique utilisateur pour LADISH -Exec=claudia -Icon=claudia -Terminal=false -Type=Application -Categories=AudioVideo;AudioEditing;Qt; diff --git a/data/icons/claudia-hicolor/16x16/apps/arctican_plugins.png b/data/icons/claudia-hicolor/16x16/apps/arctican_plugins.png deleted file mode 100644 index 25070e53c73ef395325ee6720a331e96571389e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 797 zcmV+&1LFLNP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipl3 z6EXuH>Qngu00Ny!L_t(I%UzSbOCwPf#eZ)cqk<5Lqo9aJvC@EO6VXOQv=AhaLJJH3 z3M<)WvDDVe%ECslu(S}wMpOclkP#6BA)wA^iX<{0$-7&)4!a(>#e2MWxaXd85s@9O zb)dBl9mfgF<#O0)G(r)HN^AY!`ELaxvZF*K1k6&Y#P#(x&(F{F_V$v^W(k6T{{DUp z!vH`;P)hL+vwdL=c6LT4lL6rT{G7J7Hd?I~xm*sV6yN<7LMZ( zi^VV+jRuxwMOp_32l0KM_V#uFs?{pRVv*U|S!~+|ptG}+csx!bk-!iUYPDKqQ#zfd zP$*y+26J zoSdA<+uNInh?t2)fGu4 z)ZfiAzgs;$J>}-+hDM`7v)PQumX?;7pP&D^P+Ez|4)9Av)VD6*_o>xtG@H%H^PjT- b1o-_2*L9jr685Wi00000NkvXXu0mjf>ojd3 diff --git a/data/icons/claudia-hicolor/16x16/apps/ardour.png b/data/icons/claudia-hicolor/16x16/apps/ardour.png deleted file mode 100644 index 20e3b07238cf52182cf27dbc66d592eb44437963..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 627 zcmV-(0*w8MP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01esz01es!OBnX+00007bV*G`2igc0 z4m%JL=mb3g00Hw!L_t(I%e9kDOO#<0hOcv;`O?=nMf{+oQft()O-Pi1B3g?UZ6jQ? zX{XF4{0l7wH!fu|&W zoH^C`Io0{&Zse#%8m>o-c?C!#3?~+0`NRTg(3mkBHzy|tT(v6CS5`Lb)($O#{ry&t zP@QS)%7?&M!i6tb?fP zLMoXw-M&w)RH9ZYajIS?+0qh^sxBNGAq}I5+_^n972hqFag_?YK0V&TzibZm{97cq1s=Nq-Pjzck`#{aUz%`gfoY%`KLE=+x>%GYD$M`@ N002ovPDHLkV1id(4C4R* diff --git a/data/icons/claudia-hicolor/16x16/apps/aria.png b/data/icons/claudia-hicolor/16x16/apps/aria.png deleted file mode 100644 index 2df86b9e305ce61d9c5c1ff13937b08faa8dbac8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 649 zcmV;40(Sk0P)Px#24YJ`L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IfioHsAl%;$5K%Oz11F&>XOKR?G>OB6*UNkUN+NGUnX z&$zh?P;Th3y`k+IR+q0are^W@5!McXBM5xbG$qSY#wRDFSxOwoNKbOq`YrPx%{ZLF)MFap70096104f3q3<(Ad4hIDY3I+@f7zhs_2oV?$5Dg0v6B7^=69I1k z1ey*QA`=%K3K}RB7#R^4D;F3R7#A877c?3i8W|iO7#<`Z93UGXAs!zc8zLzlA|oIo z9~&Y@B_k#wB_|jgc_bwx9wt30Dkv){EiEZ1Co3*5C@d{6EG;oJG%qhQFf%qTGchwT zFEULvHZ(FfIXN{nI5#jjHaR&uI6OQwI6Xf-J3l}?J3T)*7*R#;V7SWs73TU=LG#VspmR#dMyI#pg}BW{{lU{+CIZ&+G< zS6p{uU0h;cQ(jeeFs8o%MkB*InU9>)BuTGMU zi&wxakdlv(kE526kdT#^kD7m?kCNPkFI~kkm6w#7m6MmCWT={Co0^fGn3tBDotc}M zoSB{0j768TD4Ut7(v~NooSUSdo}Z$n(w1GJqoBa0L#LvlrJ=IErdX<^qtBddqQWAm zs;8}}r>Cl}uBf%kq<^=lqp+*0&agwtsf^96bg{0tw6Ct7+`25T(+4LGuel7g^HTS`_C%Q$942&1pK79Ci>g&DCuOEN0I0FTi zELk>h-jXHDmjD?>%YXtJSM*MQij4JnFE{y^-dS!2wy&RFe%kWw>$FdwZh!o=Lz+SE z)4a632bO$P*EW&=H0`!91G~}{naH!&w@nSSwZF<8ozKAe_3V?|?_a)mH8-{R`tj@& zhLDe+?tT6E_?V-Gsp+SWFTXNeGyW#E^W(g)U*CWF^htZ~SB8(@K7IZ6@#~y7kDkeV fTlVoI1L*(&)y{1^l^P$z00000NkvXXu0mjfg_zeP diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_arp2600.png b/data/icons/claudia-hicolor/16x16/apps/bristol_arp2600.png deleted file mode 100644 index ae75d8e52a6095c7c1f068fac5fa75b160fb93b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1128 zc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A~ktDnm{r-UW|SXPV` diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_axxe.png b/data/icons/claudia-hicolor/16x16/apps/bristol_axxe.png deleted file mode 100644 index 075c3faae529eb6ca9e5752babd72b9815b56e59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1110 zcmV-c1gZOpP)Px%{ZLF)MGp}U1qcKS4GInr3=tC$7ZMN?6cQZ~3ltU;9up546%!*66c-p48y6NB z85bfK6d4;BBo-AU7!VyA85$fJ8yy=i7YraA93~qW9UmMl8V@NP4lWxBC>#_XARaLp z6(b)WB_A3fAs;vz4|$TV@y6#QczYSQc+^ZjWY7ifL1# zVmgXxS*T+$&sqg@b#j$xTcT$@mup9(XgA1S37%>~#a;u915Gd>W;ek^X=lnw*)jl#}?30JfQdpP`=glmP#SD*uTz`inZG zrlbCiHMXFgzMzPwsivx|ssEKht*@-Fv9AA{OS`VG|D9C+qE@!Jwg0DJyu7*ps%ieO zY{kXH$jZmd&C1Tt%+l1+*xJ|K-`wBf-s0rp=jrC_?&|OH?)3Ka`TO|&|NM|nT)QC21tV(7^N_u8M0X@euCI%*MRv{rF zSy@>LS$-g3XJBM<{HgZ0>gtQHfB*jd_fM38i81@P>A$86FTVZ*^8c|iFfo1q4Prq7 c8v_*p0F}o)=JmbKH2?qr07*qoM6N<$g2Il2Z~y=R diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_bassmaker.png b/data/icons/claudia-hicolor/16x16/apps/bristol_bassmaker.png deleted file mode 100644 index 2ab429b8205b788fffe7f61452d46f1c6f610c41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 498 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5E>HqhX3UN00DAIL_t(I%k9%iZqz^kK+#{b%XXXe5CTd-C_4s;MRpv3`(J=n6QT$* zwP#nAi;Lvl;lV3$bMrF`SyL2XU5)dS6f}oR&+%7_uN?cmM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R<6dUd39PwvNvBj&|<0 zcG(7oj?NCYPJtF~-mZ?WHty~YuI@gLPA+cFVNRw=RxXVuf)>8P?w)QX*3w=cJ}%xt zZr;95zJ3ix=Jl4Mp57i_oHA|vN`O2ouPr$$8w zBxi)j6;AZi>I+m3Psogl%bDRTAD)yPmk>K8K)E(JC?+v^hM#&;LP}zCLSj;OMN~p^ zYEoQU?(}fwl(dw@)Z)mj{IZ1b`0VWTjI@-@?1JR{NwH>G895nQ>B}QkRzzxN=VmR6 zG0MoPPADv&7iW^5UokVqFs-OKyP#-gjA>p$Zef0LK~a8JW>!g2O>t>aa&<#)MP*T0 zWp-6VXHjZ-Wm#EOM|NXdb!}B)LtABCLs?@}ePi9MiprL@=GxA#%B~45o!uQ>?LB?n z?UScWnAG1gWA2n`llx}P?wz+}_S{)h7c5+`X#UdWi&v~#zGmI3^&8ji+`VJ({yhf| zA2@d6$f+|YFI+l*<=W-zH?Q5iedG4MTlXH`ef8$WyAN+afBp3P@2`LV|G0&&^HED`9XhN=+j0|VeoYIb6Mw<&;$VasB(+| diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_cs80.png b/data/icons/claudia-hicolor/16x16/apps/bristol_cs80.png deleted file mode 100644 index 6cfd50f1ea0472ba48d42f5be13a06dc1cef1ad9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 457 zcmV;)0XF`LP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5G@_|K0-hM00Bu!L_t(I%k9!XZqz^&z~SGU8UMxFB1$$$5#53!Mf98@6&I!80^9;c zN{Tcn1+XO8YkO?ZyvHRd^PS;?SMurOwdJZq#L#RsZAnhb78k@6Ls4~D-atT1*i

zhhJtw(d}sW2gD0z#%Y{zUeRd=3|S)UlF8+YmkQIBWQJ>NH2o%QNm=F*?*lPLLU1f` zCT9@Km?|3?r=Vn1LDf(*f-^$th1C*W(_(4iVt>Zz6zRgi*~>H2rLtBZ`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+J=rW@biaAmC(JeP+*z&9iegni7R9noK-Q7$jyl z?U`L05R%rVk=SGm6c9AlSf1a!V`W@#r!MF=2>~jgJqF zjS7nfg3ELIE;H008v#L=SY0sxklo002ovPDHLkV1hIWhK>LL diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_granular.png b/data/icons/claudia-hicolor/16x16/apps/bristol_granular.png deleted file mode 100644 index 2bcdabd717f3fdc0c97dae491a827a5c27cbb4ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 602 zcmV-g0;TPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5GxJ5)AgbN00G)bL_t(I%k9(IP7_f8fZ_j~nNFue2bvCricr#mC6)w?DBQZl7w}2t z!b|T>l(+yFAc+eBrF3IDo#o7Od=KOI4j=p{mTRt_bE;U5i*)KF^*YL}qlHaeafvMx z-S4BvBl6jpV%(?j2k0b3XA1FftE-!9oAmB&;x*fxdkuayJi;VpY8cFJuE|R-MU)_; zkmAR8^yClO&trni3rxdXgKC3zugB(ki}NpMh&hAkZb(tCQe1ySZtbG{F;!;{RjnZJ zKf%ssq)CP;JKJQ9WlqX2SFvEQ(janOba01?CKSOKBMT8rHL}VALM2$jp|a8f0kzU>soqlF^b%i0(w zVnv!|EX>bSQZd2T4@k>GXfREK(4TNIxWH`5jQv`L*DnsZ>G#>)*Px%{ZLF)MF0T+1P1~L3I-4f2NMnq77hgv5e^&=2^tauArAu{5d2qO{*8x;>0 z7Ze{94zHG8G9X8xtWN7#$xSAsrno91SNP9yA;cH6H;YBq1>$ z6gwOWDk2#uBON#&3MeEaGa?Z%BNj>-1wBq=5+B}yO$QXK**D=0xF4J;}x zE-NHDC>J*=9X%)$DJ?HAD=IQ7FD))CGB7kSGA}hSFF`IGM=lj!Bn>_=Bw8j8Ff=w} zBL`C{6ILn>Gc_|zFA+F3FHtTNG&nj^F%LI5Has;wTQ3PYH#Om{^cR8u>CLn2gAPf=1(b4V#`Oe$zhG*wbdVNgSNO&E+r z7@Iv2dQKB}P!m{JMQBqsRaaDhOCyF!9aL9ab5#^uRbGZlBwtfsnnM?8RYHSK9(h*} zeNrcxNEC5dJX&60jZqwJT1S>m9*j{bUSC{cVos1!C1YJ^Xj^A=TSt~sC}?3?d|f+i zVpL~mO|DHFbzfMPS1OxUD`jV7pIIlVRU?dIHl184s#zYnQy6e>R-|1lvR5dWV==2= z6K!v7u3`ppabAmSN33QDs$~@wwumXdsylZBL)l$xBGrkjtV zqE`Y0-0be_^zq^F^6&NZ>-6^X`TO|&|NI;N(tiK| z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}nbC>l~`70000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPmq|oHR2b7^V4wn6u;b*(lSfaUJiKGa`gQASzkA#m#7zwh%qu=jaa-m00000NkvXXu0mjflh%K# diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_juno.png b/data/icons/claudia-hicolor/16x16/apps/bristol_juno.png deleted file mode 100644 index b963d7a82a69eb8d3b5dd27550cee6fe85623b6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1043 zcmV+u1nm2XP)Px%{ZLF)MGg=Q3k?Yn5)Tp-5fl~^7Z?^88Vnd37$O)H8XOuN9vmhc5-J%K9v>Yj z9}zAb5dbDzAR!+#8x33r6h#sm6(UR{Bq9JQZBq~xPZJSB8W=br7hw(yCMYFv2?;1E zCjc&ig98RNCMY*46e=t!dpGRFeEfiqXGnCA{49u0bwE;Gc_}u3J5kgHFF*tumuDRI;j9atvEV2!2keg zC?9Dl8f7aUI7AapITAWNIsib!t_lk|L=*x-w?I8IJU%Ht9UlBcQAm0f0cZ0g@{{(hJ%QThqr+`wT%+qcpI6TBief!u96y!kBpp)fsvDt z+=myDtsRt>lgX15y^dR$nwO=Rhsm54xuPYMwjaTiV6(3PoSvJUycwXPpQNUvyrGk( z#TclnrmU{3;IR(v0_+5pDL z#mdad&d|-%*3#G6*4y3M-r(HfFnt2@9XjN@b>ui`TY3(|NK-Goa6ui z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}nYIx$QyD0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPSxH1eR2b7^V4wxKdH&GyuDL1J@(${ZAi%(zQXCdmwmwW<%v#L2`{Xf(^SgE_ zsDgl^gq)&+f&#-_#)cn1{#oDtH}_Q8$GG1=7#JCU`~yKC05cfq0su+nC_VsogR%es N002ovPDHLkV1gVPcToTU diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_jupiter8.png b/data/icons/claudia-hicolor/16x16/apps/bristol_jupiter8.png deleted file mode 100644 index f9d43fc814007e4c30fe3430bceba1ad59747724..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 445 zcmV;u0Yd(XP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5Go!ac7;6v00BKoL_t(I%k9#^PTMd5fZ^YcgA>|@XJWBf#J9S}{i!k5VvWUFM{8P~>9D=UbsiZ5 zhqgrsNtPd>vttg%qW1ee)3W4LINDb5E@3!I2pT?gf@`54ORx<-8)1S(5fQ=hktxKN zi_2I{r=+Purx^nSLpOjA_z*GHAeEpq9Ws@8A92nhq(Cc$I@X$#@XE;~V_J@wl;8RF zxI&2%h8M18f}C$Co$>Viz`1`zUz~CO+i^%HB-gh$Kew+9+m{3RPx%`cO<%MI8(e3l0hl5fc;-4jK;-6BQC05)u~}78(~ABoz}K8X6cJ9vU1PCm0wW z9~~hc9W@ykAtE3nBorkfATJ*sBPAm&A|oa!7bYkrDkdc;DJMW8AuB8@DJ(ERCKfL% zDmp1AE-x)IE-gkZ6EQO|IxsLkE-+0hDKs@RN-`KWH#I*sH8?sqJUBN(H#j&vJ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p#o>iQIO$0|UJ_Gec2!+UBD1lnI9tLaW|CTm>*Wxolu zut73}%}5li+vW1vm94_M6zuZ(gRCa#wFg-|9Dto6o3xX+jg&L2x09}oc)g8o$1o`v zq$Ksx>NYpB)d4%hkVAu_a+yQ5Ov&kcoxc{~3@osnwQ4BKq6Mqwmc z?@Q6ic-`AhFqrUd4*HW3zc10~PUG>W+E~1SO;gQ{R6O1iY}q^zu_aTD`xz$O?oD^R z)z)HRdx?D!Y@&e|O?P)RH%&*hyEjH-?d_qiUN&nw77HIrjhXAuIgyPy0w2xp*wkI zlVK$5YRw1wN3pMysqvl8bA2_1U1s0$n&I4zruXRSJ^Dl0w&YQ2Y?A(90va37-`TVJ zop&cEk3$E}D9;`t4<9KOFGy#uNKTzTdFqDv#0~Y?+x*Y(N-tf$_~ir9jhol+KbQ?4 z6~0{lid-xb2b_QY+OuprL#!8=UM2FE%$h-e^DqFsUcF2i@X2vrDXho^>Y0j1l`E?# zLe=}IvJ{DOOjFL2-M&3DkOMqJnT}khTRO5O*C$Q%Wu$DNK04p694IY54tQM&-h-}o z>1xi9_>Z}{xtjI8Zx*lKdh+b2S;yG#`M;k2n_g;Ox--7GaR0|*`;~vN?19~VqW>~a zCF8H|_WFyh_Wd;z{{jZ4dS-l&iROzh z?!EXM>$?2&S6A;G-8%P+YW(yMHvFTHZys*jJ2mpfvCj^@DxY6C7badqkbN8kK^(jG zAsqDlLf_Pr(N~j`w@1%MznQJfF0B}Q4b46;gy+NO%b%^7FBBH@Qw!1S$t+ dV(6`ttALHiTrW=-9w|ySfdCWnUUIh={s-$oZ7Ki& diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_monopoly.png b/data/icons/claudia-hicolor/16x16/apps/bristol_monopoly.png deleted file mode 100644 index 37de369d7f427c5427b4f1530070d38657bd3cd5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1121 zcmV-n1fKheP)Px%{ZLF)MF0Z;2@DAe4G;?s3Jwqq4-pO&4-O9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AV*0}Q14_V zZU6uPr%6OXR2b7^V4wovm6Mc`Q;?C8k`osZ5fK+>5YpAw($dnlw=grcvollGWf0Oc z)7PD{bjPZht2S(yIa8NGz9C1~ti5UG%=V>ST{#8X3_?m;?JAozH81s?zIkk^hb{vX z3o{E7GZ(A8OU3-%S0BD&VB>m~)l!l6ch=w6AOHUQ@t%R1^;P4d`n13E{=WJ84=lj_ n>f@)czyE^3zkmP!lHnBqvSmW*V{(!p00000NkvXXu0mjf`!1dn diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_ms20.png b/data/icons/claudia-hicolor/16x16/apps/bristol_ms20.png deleted file mode 100644 index f7b802c9a44e0766154b4c1f7b41d11f3a6c9155..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1103 zcmV-V1hD&wP)Px%{ZLF)MH>_mDmXnUH%BZsNi8@-GdDReIXWpjL^e1z zGC4prI7BQyM?yC>Fg`>zJVP=)NIE<@J32xyK29${N;y40G(Ar~JU=rlWouMsaam+>WM*SwWpY<)bZ}!|S8ID-X?9#|aa(mo zYG-R=YH?d_cw%XMZD(-cXJm7EX>oaJaDsknYh!hQcW!fX zb8vWZe1vdjYI%QbcZFwqg@AHxcXfGicz<(tg>a2DY=4S%eT8v-m2!cHbbyVIcyMuq zkBNMGdV-06gOY`Tkc@$cc!`yne{p@2ReFk$fQXNXhKh%Xg^`4TfRC2pdH{!zn2?T> zh?{JUl9Zm0h?J0?{CEVIlai{AfR31-q>+@EmYSlSoSUMmqMxv~oQ|cUr>vl%vZ0%y z!5^oornjoAudb}Gud}ShRKBjKtkEC0xV5&ry}q}@y4y&>!oR-QQ^di>%E`ve%Fo!= z+S}IE-`d&U;N9Wh|NJWAb|wG- z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}u!tXv(570000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPl}SWFR2b7^V4wnUb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q!2OTLb zCMYE-CoCu_Cp#q%D=rHyF9s?rDH}B(E-n=LHKLPu^eHD5aX>(|4Zf{d>YiV+9W~^ZZZ*W`gVq8?eq2W`uzF*|NM0Uf*1e* z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}vM()%sW<0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uP*-1n}R2b7^U?2!gSrQn7j97WJ1$cP4MA_IFOqq=WJ(+prC3plR1bEm%0to_H zHX7R65&{AO5~|AKEs(JHuQ;fSrYziHYIOgXtGePU<$7;ZZVXV`XJy*tq5N zs}qx|;?Hjs6X0nn3T9x-`1kiy!ndk_zyGO!@BS{vz&h#Q-*;)>r~mu)Py74A?`#Y# lfB*ga_xJlhC@DbLvjAc~PD1q}e6;`o002ovPDHLkV1hO^f?ogt diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_poly.png b/data/icons/claudia-hicolor/16x16/apps/bristol_poly.png deleted file mode 100644 index 48a033d0192e8ddc2c82afbac6792e408b3ab8b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1036 zcmV+n1oQieP)Px%`cO<%MGFlI2@eqs4-5|x4iOU&4-^&>6cH5@7Zeo}7#0~87!?;87a15F8XOuN z8y*`RBOV_e9v&tj9wH$kAR!_tBqJsxB_kswDDkdi`CnzQ)C^RT3 zF()fGD=aE1D>E!BE-EfMFD*JQFfA)DJ1#FbEip4OFEcDKJTNgiF*7hOGCngfJ~%Hr zFf>6lH8V6dJwY!#GdDRlG(t8vH8VCtIX5~#H8nRlKsY)#H918)JUTc#NIX16JU%-& zKSet~K|eh~K0rM?KTAA#OH4{lOHW2lRY*=yO;1cpPFqb*S7=Nt zP*P7#QC>_`TTxP4QdCh;R98$_SYl09R#aG2R#Q<`V^mdMS6EhlMo>{&VN+XISXp6K zS!Y>WSX^0MTw7CETwYsUT326NTU=yVVO?KeSEfHgUS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`8Id z4FbRSIOk~FmJkBodt!`iHXDwPj_CUytu@wKlu~%_$@82{<){G&A)vJ;#-9D&VT@s5 zz?gz8%P7kdYwhDnAjZgc+Ynrh%A{mG9s>hy=dfkTAO;Q&#t5J^hN37Q%MPszMxznq z!wK!L9_4)?$`LnTZkQAq+t~2rIA$LDW9`0)N6r>CdP=W_s3 xO5EPwGM!EVI6prp#t48?iWn1LKYips_zOG}$OF)2(FFhi002ovPDHLkV1oIb^aTI_ diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_prophet.png b/data/icons/claudia-hicolor/16x16/apps/bristol_prophet.png deleted file mode 100644 index 48b37efeee970de05e7fdeeebec3a71425adc9b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1092 zcmV-K1iSl*P)Px%{ZLF)MF|WD78ey992FZK8y_ARA0ZwhAsZtkA|WOoB`G2&C?+c>CMhcQ4F+@T{PCh_GL_$SIG)O}|Svx#WK{!!CGeb%?MMp$INkvmb zHBv)5M@C9+HaAQ}NlQjWM@dG4Ff>F=NJ&aado(siO;k`yNk~mkOHE2rOGRryKu%0h zQA$&2LO@MVOioZuQ%+4;Pd|A@AyrUHP*P7+P*0#QGOH{wO;lS{QdUw_QBqwiS5jSF zQd3n{R8&=6f=MBOODA(oN>W*1SXx(uPAXzoSY23UU{_~aTV#t)CtF=wiBc(vQZA2C zBw1i*pG^~#P$gwsY+qqsX zU?`+wE}mpLsAVdwV=HoWaeQ!Yu4OH&XDzX3FSu(Hc6oewd3UsFEsAz?d47O=etV61 zc8Yv?fP#OBfO@2OS(Aczg@=T*dQFjpfuVtEii?PikBqH}bCQ&i?|=ZTk${w$o28VA zn3|WOnUnO70G*$lq@9+xn17kN8>*a_oS~$xoRPJfi=w2VtD~H;qMfFwq_v}&v8I}) zs;#BQ8^NTIxT~M8u&t=hBdxKsv9qwbv8u1r9ksf>yTHQ0!oS+Qsl&y>;J>BG%gD>n z($Uk;(AC)4+t}dZ-{I!z=umv(Squx#noXz7_-+oGa zXoQAJMn>ZNj07!3X)Olngup}r+4+m5tYgyEEv3vECd{5Qd**^UOXf_SI&0pX4=)&m z^p?N;@>BZRzuK3fzYLE4W2jC1_wUQU@BjY&{_^DCuYdoj;c@`HX*Y?}#pR;_0000< KMNUMnLSTZ=(x_kn diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_prophet10.png b/data/icons/claudia-hicolor/16x16/apps/bristol_prophet10.png deleted file mode 100644 index 39d0fa4c0f4fda80cb51e254dd8d060ef4257566..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1124 zcmV-q1e^PbP)Px%{ZLF)MGX)Q6BQE|85bNI6&f5F9v>YXAR-_j8Xq7hAtE3nAtW*#93mwhBP1dx zBO*5(9xEauBqc2+Brzu?C?hE(CMYE&EGQ@{C@U%>Eh#7|Dl#i9Dkv;CC@(81E-x!9 zIxZ|PEiWuBE;cVT9WXL4EHp4hDJn2AIWsXdH8C(SF+MUgF)%bXE;ceyCn-8HF+VRb zGc__ZF-bEtJY6FtHZ(XiHZwRhGc`9fG&njoI5j#pH90prH#s&oH$*r&H#j&zQ7$q? zG&DUpH#s^uH#JUc%^Vlx~)K1W5*x@;Q&CY> zS5Q=8R8~`0R9IGAF;!JwR#;VAR$y6NPFq|_SzB0KT3w$%KU-Z|SzTbHK0#buWnEuf zVParrU~6q&WnyD&US(}!W@v6=V`XP#s9OtZYG`L`b8KsGZEkFEa&K^TcYbhebar!h zc6)Vte1~&!czSnxe}aC1eT#i~f`o~Kg@S*TJ&1~jh>4Voi;s(qija$n?05)|k&cm; znU<88l$Mi~mY|oJmY1BLotvMVotmAWoSUGco}st+mjI@usHCQ&pr@&)sivo>vZcc@ zr>m~3t*WfCw6LE`I==<4U^?CNaT q_xInoe;@yS{|A)+@b4cPUI73mc1nyWF!NUc0000Px%{ZLF)MGp}T1`H1i4hj?x4jl{+5fcy-6cQ2@7Zny17Z?^J6ciyA6dD^D92*rS z7a1cN6&oEICm0qRAP^rP7%C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R8?14R&+~Eo;X3IHa=ig zRySmKXH!*yNKIT@R9akFI%j&vEH+tPUte2WOk!%2L`;cEP+VSIVqa2*O;L7MS6^XX zVqsZIXm?>_U}s`sWn^4qWMX1wXk}((J9Ln0XIf`zW;J@1Y-eUtaDQoQXm4v?Z)$0C zXlZS1WNvG3Y;J3EZ(?q6ZE4zgP&u0esXkiJBO%`YGHSFZk1_bd3I?@g`9PF zb$EJretT_wd~|z#dVPOeSA%jtbu@dNRqREfqsR8b%BF`goJy9hJ#F)yo-i& zh=+fMhlPuWdXvab%+Jfx)X~=2)!N+H+~3>a;@{=x>+S09@a^&Q@b~%k`uzF*|NM1FE$sjR z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}vuHLVhxA0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPqe(!AIo2HumIyfAb9=n j@4s*VKK)bUCBrKKFw;e~<*iL700000NkvXXu0mjfU-6%? diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_rhodes.png b/data/icons/claudia-hicolor/16x16/apps/bristol_rhodes.png deleted file mode 100644 index 0a7c672c1a6e1e9d9485447e3c4b566d6c3c7bfb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1055 zcmV+)1mOFLP)Px%{ZLF)MFIr@0tgHR2m}ZV1_lfd3JeGf4GIYl5eyFt5DgLz5DX6y4G z6cG>=7Znp06crN{78Dm17#0^57Z?^585SZ9UmYbAs-?jAs-kN={5qN={Hr zPD@WsP)koyPESoxPEt=%PEJ!*QBzP-R8dn^Qc_k}SyWS1R#aD2Syoq7R#;V3SzA|G zR$NzBT3B0ITUc3LUtL>YTU}aTTUuORTUuXXU0+;cUR+*aU0h&eVP0ZiVP0QgXkcPr zUSnlrVP#=sU}0ivVq{@sWny7vXl7(*VrOY*Wocz+WN2n;XJ}?*X=`a`YiMa_Wom3{ zXl!O{ZEI<5X=`X}ZE9+6aBgsIZ*gvJb9HfZaB_5UbairecXV`le0X|ydwqI;fPQ>| zgoA~GgNTcUh=qrVhKY-aij0Yjj*E(ql8=#&k&}>*la`T|n3R^2n3kH9nVgrImYJKF zo1K}Ro1dAUpqihdo}iteqMx9psH3H#qo}K=sivu`sHm;4tgfrDvahqXv9-6fw7I;v zy0^N#xxK%L9b#>~#j%*oBq%+S)#)YsG3+1A?J+1}vY;NsunE`I_=j!a~?C$IC@a^yN?(y^R^Y!xf`Stnx`1}3({Qvv@|NKbQNK60# z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}m@4!5J|f0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPWl2OqR2b7^V4wxy4Dk2&@p1F?_jGn~aB*>EP+hTh)#8P#*REQ#dg-JE3pyEC zHRR-!w3Ox4RWwxP6y=l|%4@dv@BZ`Wz{z9BPX77xxSB!j_wRrI{`~p(2Son)qs2fM Z003x)Dp>80`1}9>002ovPDHLkV1k9ZijDvP diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_rhodesbass.png b/data/icons/claudia-hicolor/16x16/apps/bristol_rhodesbass.png deleted file mode 100644 index 1caf0621fdc43f48bdfcc42ca7b6f94c11b7ad26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1155 zcmV-}1bq96P)Px%{ZLF)MF$E70R#X71pxpC2?PfN0tpNY2MrDf1qBQb3JeGf4GInm5DgCu3lI_! z4iXO$4G6cG>=7Znp07ZVW_6%!H`7!?*27#0~87!?;778My97#SBC7#kKE z92pxJ8yX!Q8W|cK85Dw3Zfb04Xl!q5ZE9?8Yin+KZg6dLadmQZadCBcbar!gcy)An ze0h3zc6)t#e0h9+dwzg@f`oyCh>C}ahKY-aiH(qrkBpCzj*pX;l#-T^m6(&2l9rU1 zl$Mi~mz0;8mX(^Enw*)KouHkcoS>qgo}#6srlX^%tEs1}rK+r`s;8^1s;#fAtg*DQ zv#_zYxV5*mw!6N%ytuu;yu880zrnu2!@$4A$HK?T#>mCV%gDye&d<`$)Yj70*wxwF z*xcUR-{IcjFen0?dtCE?Cv#YF z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}u`*7LvUw0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uP$w@>(R2b7^U?2z>+1NNa*;rWF*w|QEm>5|ZM4j#JZ5(Xu>|H%=?M)mV7)<&n zb+vc5^-k&UZEtJuXksv#GJVF3{@zKGr%#*I)7n$Vz-wadX>D#{h&dkor#LCFd#>j9wbN$(qKyc>dX&`y_48yE{AHOKP|CgQg?_cbTd;jzqs{VcY zV*2i1lf}Qkc`t7Nb6_y~_xH=Mzd+*Ozke_O{!?e*{rB(7FCYgf@b|^Pf07KO0|3>j VSPB#oQY!!e002ovPDHLkV1kJDvKjyY diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_roadrunner.png b/data/icons/claudia-hicolor/16x16/apps/bristol_roadrunner.png deleted file mode 100644 index 04b7d7e43b31980df7c3ef1ad58db1801772527b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg49%cbm=A$pZY6FG#db&7z%sS)0PH`MJXO(~ZG#@|v9LH5Wx(9WR@Ngu2FFFNtlhiddUs?>k}N%6ah- zI_Ga5l|5&>tHgAP@nx9HoFTW#}4zK+p~(KXcKwrwrYBMhFdelF{r G5}E*;!+7=p diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_sidney.png b/data/icons/claudia-hicolor/16x16/apps/bristol_sidney.png deleted file mode 100644 index f583a772c6a7732326b950efdc338ed73fa7f975..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg49%cav?uEBamjg|a^>lFzu{izq zlDFTX00xJP(f1bTdaXX8uW}{h2#e%T?p-|JR|T`{9kOuf6ch+_$k3efZR=52i^2zy zha2nnFS~pHUhZ=LehQ>j$QKQV(s?Oy!MgJ_VNi=&9uemYQFR(&pNSi`i0dyYL@VG z{5)E?(RFj_se})wqW?{H(Ybg`J;yA2-T7*l+bs5Pk}WK2);3-F+7qO=aBuzL750x- z+)9zv={(ePI7#}r!N<)4TPJ_~wCD6wS9bpX)?dfAWu17L;`|~$lg|$9wqm;Xp z`K08gr6%4s+kBJfu)&AFs_R}0u`p)Ny70E_zxZEHdye|XwZaeLK|##m>FVdQ&MBb@ E02Mr{P5=M^ diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_solina.png b/data/icons/claudia-hicolor/16x16/apps/bristol_solina.png deleted file mode 100644 index bd8a5992c0c97985cd67cba691d316f3416afb70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1056 zcmV+*1mF9KP)Px%{ZLF)MFNE;t_2nH!CC^9H1EG{cBEGu^n z6o>{4kOcr}78!CA8Za>~W*Hw`9wIm{FFh3K0CAz4@N*WJwil4LO*Ub9z;b$XFM2b zIwDm=Ft!&PWIrc+HXLm~6mLBqYCSGVN=S7)97jt|fjJgA3 zE_p>IT2N4OOEObcQg=%zheaRk6cvRT_~qtF0WfKqF+9rVmG*39jsn3y;~TxUM0I( zExuYHxLhu*V=Jj*Il5gZzgsA|VI8($Ewf`MvSTf*W;3a1I;m(sc6fEeUoFL8B)euT z#AGJIWHrBOC$wrotZzcLY&XSbFurLvet&$la5~0qG`(^%!E`Rla5u|wFUfE{yLUo{ zh=sm-KFW4E$a*WxcQnd(LA`!Wi;arTe>u#7K+J$fkdlwchC#`POUsHrm6w#tkWBW9 z0H2|rr>Ul}vai9zz{twS%+Jfy)zaSJ-QnZl=IQ0>?CA0H@AUTb`TO_%|NH_Dk{AxPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z4?6~Sx!N`W00F>BL_t(I%k9w1P7_f8fZ_jK=5jhy8ahL3EL9?u*t$U!6B9!hK7eZz zeOMD$Y*~1L7;B=z8Wd^ETu#p%H@<|4-y?kR&lAt5&-`HTF*n5xpWmI(yM2$me~0&{ zZ;(>cI7=rVvNL*uz|(jEz9a||mX~Mf;dn~E^OP{kxw}6l>h7Xt$o7L5cqEZ_cmZjv z&8qf<$u=rJr3nkZoK)x_Oh`Ke)gRf!H0oLwN0e60%BuEG-#rx{uZmY1IphmQ_@V?A*w`L$TEc55OP;1GB~ z{N46K;C(|tgK4D%VMtZgXo<&Bv$?g+%h#_cih?Z5n9XLSX@a#4&N;Gd6KiXPPzSfA9x4W35CJKGA*v O0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5E2_kgUv|*00C=BL_t(I%k9!TZWBQOfZ>04$DV!I-gN{;Vj2XBD^k!vixeeS-~yb2 z8&Gow4uU9XsAv%e#RwG3*|$AAI}Zx3K$)-qyC3ca@87=hYWbY~en;CibWKlH*Hq;l zRn^dTHP%>+vqVA=5&kO$ym$oS_x`}mR#R3zQsx*tMca%Ar{}Cz0qwD6Vy2{Ngh*y6 z&dOm%4N2qkeZubK@k%T_rBroXOo+M7_niiZ#D@`mD=Gg-8JR%en h`GSMi_aFZce*w~3x8UeLE${#U002ovPDHLkV1o2_%5nez diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_trilogy.png b/data/icons/claudia-hicolor/16x16/apps/bristol_trilogy.png deleted file mode 100644 index b9ddb234a8afdb2d1a56aeb6d58ee049bb6eb142..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 492 zcmVPx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0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}m}KSos420000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uPgh@m}R2b8>#X$@~07*qoM6N<$ Ef)htddjJ3c diff --git a/data/icons/claudia-hicolor/16x16/apps/bristol_voyager.png b/data/icons/claudia-hicolor/16x16/apps/bristol_voyager.png deleted file mode 100644 index 7f0f1e474003d7e6d1ee751979a471c897a595d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z4>v2H)5%W&00G5GL_t(I%k9D2P7^@@fZ=~;XLokH?Y3+=lmwwfEgm9*UV7sr_zEUI zq;KJkCME)r78F|wv^(8%cYF>LzYqR-;^@tLyEA;o%A{ytqP!Na4k*`WwBsdBs;H5kk3t~J0;jG~ zR2l7V1a_C8*T+j1gi#k&89c{g5lH1>n+7Wc(pvmZkJ37n$sJ0&5$SABI-e5d1!{JO z|6oYth@c%|g`g;E0xt$r;JF)2&&P!E7PWN{`$wmCZ51tFQ{@E>4Xz)u&QpYtc-kk= zQg8&evV8jZfs2cuL}AF}W`PQVHr+=DygSMV=RwWeLI|>h@5|!BLvuvs+BI;y?HcMR32Y T)M^`u00000NkvXXu0mjf3yu1O diff --git a/data/icons/claudia-hicolor/16x16/apps/distrho_plugins.png b/data/icons/claudia-hicolor/16x16/apps/distrho_plugins.png deleted file mode 100644 index 2bcaff12cff8ac6e8f4f011f091540086c8e686b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2950 zcmV;13wiX3P)StO&>uS)ve<0AYj> z5AR{$W90N^4L=L-RlQUJ&DC0@ZjPh;=*jPLSYvv5M~MFBAl0-BNIsH15C~g000{K(ZT*WKal6< z?_01!^k@7iDG<<3=fuAC~28EsPoqkpK{9G%|Vj z005J}`Hw&=0RY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LxiE1rN|oLm#H9Ze3GJ(Gk{WA|bLqH@XUH`7=pFl+1`=$%KsVvRIKe*~+= w8!J4S7@djnpNVzXSpAURddhX5spdO>0lv`SX>`HdPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igc2 z0RtO)CQ(2D00C@CL_t(I%Z<~$Y86owhT&%oG1#OF1gyLU!7in6FHy7%t=o4kYrc0nOX1p);oKbVU0%?l}+)j z%1&+g?G&qlwC0uD6*uq{J87LeH2_zOk?J>LE%7F;i>C!#N=T@ZBFZv8j9b^!I&%`> zuJWo1Q9%(biI;em*3v9M9Y|~~h#cX(s-Jx*OC{+i$Zu0Hizr|_IV|AUW-TTN&0zXaov^Vr79p|-w3@e41o*>rwR!{>(B7sB&m zc}m*kVXw-1;$71j|2y&|!B)lcFi_Ni@%Q3Eb-o^d64U>ZX)jgQajiL~_z+M&hx>x~ ij?0Pd+VJC~%k&p!o`R+vE*P2s0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iye$ z4lx?~VB*aH00Cu5L_t(I%hi*=YE)qm#ee7f?(V&AK(I)$B#OminJ#Y-!OjP;_Yo|8 z4TEh6*ji=%1NsD_MVdg06iEaLX>|YG+;5J>Ze)vXEHlFloZ=i9&KbD#rPF3$0Aqyy zTOb`*nZ3u4s0;yk?JPQM;uhJMAkpjbU@!nL=-(nB3XG4qdAmE}-b;_T}eevXd_OujL>ECt57B7p7lb4E%OiA{+PXs)jr<%$x8C$l-D z$%GErkSKtT`?ZO{RfTNI))wjF0yhnsPC+7uL(=6XNKgt+3Azq!^kcAL>Kgt21AvoI z80QS-)|bVWv_wG8(C<@437AY#O8>ld5=1}}Ude`60}uhTnN!%$$~x~QVuiFeANK3J b|4aM@85X#628$<+00000NkvXXu0mjf?MKe{ diff --git a/data/icons/claudia-hicolor/16x16/apps/ingen.png b/data/icons/claudia-hicolor/16x16/apps/ingen.png deleted file mode 100644 index 5f982517e9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Me diff --git a/data/icons/claudia-hicolor/16x16/apps/linuxdsp.png b/data/icons/claudia-hicolor/16x16/apps/linuxdsp.png deleted file mode 100644 index 2d11fb7b913673d44ad6e8c9b7ea35481cf98a64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 967 zcmV;&133JNP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01m_e01m_fl`9S#00007bV*G`2igc0 z5dZ~O{p+Iu000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0009bNklHHP|$ykHkD06O!hpjk)KXz4vl(Gx%7e_4Bh9pHfPT zQW~WU+5~7FptNaDr9eOsyt9Z{oU?fEKpb8?0ZOB_LF*JcNE7U!O^DV80Ph{nMK~Lw zY=pBh-hl?Rc+1eU?^7t(7<_t^R60i{S0P{MAYbSrU)W2oZ4a4jg>-9?RG7sCX|zd! z(gXm2s26*7W96k3B&{f;R`1#)`wihXt^4z%gH>Gl!FqLEM`;$ES#Pggx z{b4g82%uQ*@DR&$s~qe5B7I)?z=LFA3nrapP%59Q@=BD;WSCS zjfQ|AgfMKSB@>Wu%dxU}hmE!W=xonZE?2p?n&;3!Kbc&B_nKn4l_{TA!1)2u8_vbsD;{q`K28w*5@I)NZ)V{kShjv}I{ zf$aR*CJELFNo+xcMq`^eim*w9RvLwZ*6c1R?dp+ZBcICIOCrC{iX1;RFE77-QKlC~ zR<=ZD>mo;Axggi?h`>0g=@ZO=lw>TFOM+s3Backic>sxShdVnPEAwm-N)MM zRW{b)wdeK|hABiG-Z_*up%{~*P`Zc8?jEdzwbkpSTXK}z@1s!6vNS(SV|#^4bw4*| zCU7ps*$D3}N+~1C7>rJ#bqW)N7!zVl3Z)H5Qzq}@oy8dE61=yFI2346N;MT$25n4J pZEXMz3dH+nW#2@+LvV-}{s)g{f9$c4!Uq5V002ovPDHLkV1jt=xF!Gq diff --git a/data/icons/claudia-hicolor/16x16/apps/lmms.png b/data/icons/claudia-hicolor/16x16/apps/lmms.png deleted file mode 100644 index a6df013361c350c74a7908cc0ef5393f9320ff75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 919 zcmV;I18Dq-P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igc0 z4+%40Jxd7y00S3EL_t(I%ax8_Y!h_=$G>;?``vY1xAyeP+^s8Yv$m23GS}~wQl-OMS!uNG7_IHD z>uu}5Nu3b5zeE3wqR)Bixi(?~Wmy+J(`gCLZZuxe35&s7| zME9y$)lhS)aXN9jwts5>w0KnPc;eYL112g49|dvX%7HTz>4})N-rDZj?)mPCCr=x? zTrNfs1WBWsRbw?IL&+~@hh~2V0OkKl1mj+(!<(A z*emuk?w8!3tEzh4IBwkf&j*U4d|W6LxJ)MVULuju0f4+h8jwdO=8Hufs>7)$iYt{$ zo&0;{+(FUSz3%X5M|yldU++JId@s)kL&9@)7wT?c98m!9cszTLe|6Fi`?hs(zA6xO z?Caz+*%T{?p8o#++p;XTP1aA&Z{EFmWMJ#SaEsK^r1Lrgl>ic-BwibA988%+$t$}0 z(?yG2AuukFR8cO5i_v^O zk9a)JtX2#T93>q5@3t@8PnNek*$823U6a2}Mx(x{^+DYO*2dUSHL5tVcp|5d>x1lh z*4+Ja_ZExXeE9M&?0m(d6bULz`YOjnez;p4-N>$-tKO^Ta1}Oq@Oq#jP#?$yBACHN zj3Qs;i$7|bb~HRM%&k;q7b=BTMtr`58}QG6{q6VZ4*=lHL-=&&SDbrc1NO|NG2LiI zn^D73K}X3Zp^0N5Kgz?iu>7oXbB2Dz0KhjRn7#ieF3!$j>5V?@rUaISzYyjrHV71Q twT2kSfoA~6^v}5CbfDKJfs9_m&d1lhJq=kYKwSU;002ovPDHLkV1g(zueJaH diff --git a/data/icons/claudia-hicolor/16x16/apps/loomer.png b/data/icons/claudia-hicolor/16x16/apps/loomer.png deleted file mode 100644 index d29bf1069d5c548265911ab023922013a10273f3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 823 zcmV-71IYY|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01m_e01m_fl`9S#00007bV*G`2igc0 z5eN|S`Gr6L00Os3L_t(I%XO1kNR&|+hM#l(S=4eXNGBU3D5BBIkP0#^Drh0oBog!@ zqzLN52(_Zciij?XsIJ6=f@Ob^f5W$=5X%Jr z!~4`9+>3S%u+fS{Ez&MG|AQkY76cv~JA%^DK5C`mYcN2nFB7HU-R)cdB#Q_w^>sMh zfI#xN@z@qs0FP+EBp@|*f)7Bq2_mFmzGj={0xz<@BMSo@w^FtV*`^4m(#i5 z&!zGTPA;BLZGQe>D9q~Wo{0ps%A!{JfPs#uQ002ovPDHLkV1k?3 BbXNcX diff --git a/data/icons/claudia-hicolor/16x16/apps/lv2.png b/data/icons/claudia-hicolor/16x16/apps/lv2.png deleted file mode 100644 index 4e8faee0a8a5d301c726147d51f6efcc3033aa97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 580 zcmV-K0=xZ*P)~J!1G<$` z7oBr$|Fr0NAA=ycsf{ryrBv7dqz6F|Ro2>=wU$Dmz}-{|Yc1(?n#FgEL?RKawM3&) zaw{v`dvKrWnTJeHO=7LZ7!y}oYea@MZlgud`VOhllW*nkW{F zXsyu=pi-;iJ0B6DUa#|Vc9tXkN7_k9}td& zDQ%Sa{%suq=iKia%jNPbU9DDcXsstcz5lSiAvch}91sA$@2}QswW+QDOZ)=W4V^}H S$xsUb0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iph- z3L+?m8eTX600MhSL_t(I%cYaOZX9J8g`fAEZ)bL9y)m%%talT@b}R!;fChn}0>VXb z8QcQU(jd49q$oWJAj$w02uP7A670qncGgDB&(3^5FNH~Jq@3<_=jfaVo>KC~m!D4$ z4-Y@fvg|q4=s+m)oGi;QCIJytBVE^1*EOJs$RLEcIzNB(k-c)|`8TibAAC5OY@w17nKs)`t4b+#fO4(Ylz&O1z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Xu0mjf@zd3y diff --git a/data/icons/claudia-hicolor/16x16/apps/non-mixer.png b/data/icons/claudia-hicolor/16x16/apps/non-mixer.png deleted file mode 100644 index c5f308bdf9b6522fd65ee05d274f116f08b5159e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 586 zcmV-Q0=4~#P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L02FKh02FKi)TK^e00007bV*G`2igc0 z4+#nYIKu$|00GKLL_t(I%k7cNP7?tbM$g~5QijWPpp9}%gs|YIAzWODAzmVJq3^&e z_#AG154SEPCMG7v-~wW5A;thDavSK_X*->Eeiy<+n0WT*EWQu^dF0v3%9>#quic)W z%+2Q|ugb9N;xUEuZV@NPoQKEEtUl*5s^XcqsqXH>bwDA_37qK7B_c#g$WfzAqt&K* z5i&LQh;F9zI75_5qo{BrBXE)fcG15H%eJ{QIZJVN6vMT-H@(j1(|35D&q2CJ<<}05 zl6E?%>Kp#U YA96UnEiY&4@&Et;07*qoM6N<$g4#L$vH$=8 diff --git a/data/icons/claudia-hicolor/16x16/apps/non-sequencer.png b/data/icons/claudia-hicolor/16x16/apps/non-sequencer.png deleted file mode 100644 index 7b8a872834edc0ad69797b4f5f01539644cf5abe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 731 zcmV<10wn#3P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igc0 z5F{AH(G2SV00LV{L_t(I%dL}JNK*kA$A9N+(`=Sn>DqR@C21=fwId={rh!31*oB0o z*H-o*>3cEsrI#KA1Bs%iz?Uu$A(;<}mrQVirXgJ>nmQHdbPng-&N)4(Fg9O;{!bs@ z<{%d(>=J}1T$Pwd8;#ueaQ+;9sp8Bd_w4J;P(U5my1IWtSj zC^Roz7e!5~kU6*oBv^~;*xCv)II>8dbw8V71$#k|zM(%u4_X#V6L!$!rsJXmdrC6494Vb?Zy3+i zBDbrJtOxvTZmbYhG?F!sbj(6iRSCJ3GW|Vn!a^+D;r@*vZ5{B_o5ipv|NQrFLj$pA9Pb;qXqDxVYVhLot#IqoI>F#7MuQ);AgT&K z<}(Uz#lf{}KiXaqzN1cBGDx^2@hy3T4NQ+X?*NOVU}!=6rzk@QIe z$Zsky$F_{BE7f{E)K$acNvg|O$d}@u$$u<5L{sKWn;D)>xji&$r N002ovPDHLkV1oUyKoI}{ diff --git a/data/icons/claudia-hicolor/16x16/apps/non-timeline.png b/data/icons/claudia-hicolor/16x16/apps/non-timeline.png deleted file mode 100644 index 190087a6533327063ddb0547d280c8a46a29a77e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 656 zcmV;B0&o3^P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00!y+00!y-o_2h$00007bV*G`2igc0 z4+IG;pX~Mk00Iz6L_t(I%hl6APZMDPfbr*j@4Y+h^&fufBX1ZODJP)hcq~^64I%#6~J~|8$t560;wt+PPed8I-W1sp#lL;UNd;tCc zY2bE15!wl7E%xJfG zN;Rf?6z?p9U$qvAic5C1myce+;5n21R)>jBNU=D`gG*U<*1n@!dyV?m%TLL@AflCW z=({n8Q>{|@Ql%GYmg^h>61bgBu-+eIaJxonW0!6O;x(*GA?C$En(AzhAAw}j&M+EJ z&@@dFhC##ga9x*l{g{ovM@%0#FkP1@2vEQi4SB;4^!U~hi^Eykrp7c3vW|lmf&r}w q+HFov#Z9GXgdsr~0{CbDCH?`+H_EheMcbahwm?2y97>H=ybvF@Jq9$`Ho4q%Yz?1jM?J6 zLpjlX>X8D64LcYQ%qh<+*|2l>rHi$fdwM@y?qphjkwI;-Ag_x2>&HM-89ZJ6T-G@y GGywod22JSz diff --git a/data/icons/claudia-hicolor/16x16/apps/pianoteq.png b/data/icons/claudia-hicolor/16x16/apps/pianoteq.png deleted file mode 100644 index 462c28fe8693e1f4d73eb7dd06efaa9d8624de6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 916 zcmV;F18e+=P)Px#24Y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vjFvi`%SE?*KAH`MXkmJqh=>H>PCG%f6b<8}L1gHr zc}ce0DLgTOXYn|*ytz3lu&mxBYA>>0LAcn<^Pesc45$FEv>WwbhGor3p+fR-00000 LNkvXXu0mjfnq(pZ diff --git a/data/icons/claudia-hicolor/16x16/apps/renoise.png b/data/icons/claudia-hicolor/16x16/apps/renoise.png deleted file mode 100644 index 8722ebd51fc3ff2b8c6df499496aed0b77e8a5a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 692 zcmV;l0!#ggP)uEXD}v46Nw?1sNfbH7hDhpK@r5t##SqF-0 zf(RBCib@cp;z)$J#4RRf7L%FzxA!bGkw}aOZg;+O@8cbZQFLtSl*7xC-quB9^^*tL zFh7z<{t2&W*>1ZstvE5P2*z^93VV*eE@u84aAIY89bK90Mif>+44B{MP}F^lJ#eI> z_+-R@)2q`<=z8-IV-Qgoz{;O(_O~yxJdLc`I4t1Is&te7)X`}|A8{OvF^C8#2SE*8 z0U%=WP#w-7e0k@F8vp6N_Z3>Js>WvUO4QDrht?X20*HLHBZva6AQH!fq813i?JJjc zW6Rv{$wGH!^YYb{0SCCdc^$R$m-6n;HNL-YM;r$cC|ec!Mw<4&EPT`eu3yZ|Os6X^ zH48yMtbhK6WZgu%ORnulu`t}JGctoWlh+rc_ zEDQ07{!T#vuYbpE~o3*%U z{l%N%zu;j305{gmD%DpeE8b=c@3Q&)lr4|Gn$ckR)t4bHt94)Xmc!{io=NX|_+iw| agZc?u;tY(*d+t*J0000Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V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dv~$EDVCCF{Zj+ zE}w>B_^P#@=UMiFPp#Gt5hZLmE_A_)R2s!`?ATUKk{mOGWwc%;qA1OZsg$@W5CH{h zW0*-19ZMjyb!8iEVj_&w~A!Psn002ovPDHLkV1iNJ!7Km( diff --git a/data/icons/claudia-hicolor/16x16/apps/traverso.png b/data/icons/claudia-hicolor/16x16/apps/traverso.png deleted file mode 100644 index 93eedc0eafe9abc9474d7392a601d4b43a83e64f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 604 zcmV-i0;BzjP)Dk>5*`aTLZs-*@k3b5631 zT4*d-VF(ong;#-HNElho8=;#Z`UAS~R=Vu6?u+iC2$HaF0&$Q+iAfZOEOnT38?Cut zZ*%Y7_j|foVl{uzbN6tb^PF>@0}UWBC=eIuY*gP70@nl<1y1}=bFV;BAX4Y21*Z07 zCU96_NuaOJm4rg?#4twoI{lfzoh^JwqR|Zj-%fpIU3{F@)^ik#!&_=Wnwpvzimpm( z?IWp7oI=5-S{2IWHsHR3IkPT4Lr;&;-`^tP@KGR)>sIjlUpfo1E6cMB7d6TZf|Y?#L(Ku*w_q-#6!~QDd3Z&Qn!>h&zw81l>IZHlo5!|H_v0auax81 zn+6KjB^HYSH|XfNN_+cFa=Bx2@2>aT`TYb`fr2)PxOP$*&0SQpmw(@>whdKeptd?W zKK67Jo&SvKQw%<~W=(y>Qi;TcKSFE-t@S|p`&YcIQ&9%Ksw$hF&a*7VuW!{E+y19k zyfiUA2^)DlriZ@wg)anyIpFoK1|rg}ODka|DePJW!*$$1`eYZ$Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01sgR01sgSs6VG^00007bV*G`2igi2 z3osWDbJ^Yi00Iz6L_t(I%Z-vfXj4%X$A9PE_wwB|rnN{c@uOHBst6T~U?>U>eheKP zL_{2_lasT9Ah@}>I0-JIQxUERcnuV3BwGQSied&giTOuz`@64!NrCjxfa2s{M^AY0X3B;{R5-9rlZZen;_~R7&r~U(6Vi~VR6OKmlX0@ z*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06=v( z^e@K7^pDP;*Y$E)Z}@j<&tQfN-%d>EJ3)VvdN!*I4Q4Zje4cG9EBtfg2JX7LihtlW zn<+0W;Fjh8GJX3tg4gM!$zs8_w#H&AMXcri8g#CVAig-x`+n?;;iHJvsYOydG zZLTNY3;y80aB+eAl{yzLE-)56?~gZGiE6PhxwFAPfSAgR9A6#t?J-?cYy*IbZ4hl( z;aGmcx7*2#{420{RNM7V^)oX*a*DQ>UPl*jzf?gN(B5;9?pKcR=Ef)Hr9mzH7_e{n zjIpToeBG6N4R@d!=eKWot9zBpa~Y2A$szAvp)nNVsohaB4bPt2H+;tU8%PdKdkqmt zN3?8zbNnE3`4XBpK<~)Pp4=u_$4gf6)+ubaH6g3m`1FF&Z&LeK=LE zt{MDzOXu?4AV?b=8wT7}95kiqjJcDgZR&uTM8amREEdaU@qPSkJcEz7=<<~#*l^>P&4+KX8ytvv4XZ$Tc8c2KIptKh zP@YEg_^Vp$%g3pEnmPaT(ss5`x>lFvLkp)iLwg@4LN~$TF z%1NEZ2~B8kODV&`CDt5Ae(JB)PtBY?w*A;M{g?a&WqmS8l=1jn00000NkvXXu0mjf DTl$#& diff --git a/data/icons/claudia-hicolor/48x48/apps/arctican_plugins.png b/data/icons/claudia-hicolor/48x48/apps/arctican_plugins.png deleted file mode 100644 index 012fe519a82fb0145e444a8148665cab994a8f9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3419 zcmW+(2RzjO|3~36&&(cm6xnpjPCCwvI{T2aIeTVAC!FlU87bq)US-d+XWdUo^tD~t zn~eY4|8bA^y&v!QJ?>ub_viIo7xPeGlb(i)hK!7i9;u~a1ZJs=0igo#CKN|eU?TT6 z(o`oaALb!}1(mIirUu#h#p``bVG7u};-O{cO-4q`axuusGO{?pCbbVz?*aAHm8&e$ zH?DkL_)A7cH-*%=_tn zjTj6o?@Yf<@!P{N_dQd<_2}+s)rf!?ucLy9?pLu_1TN*p_Z zs4UyV!sC)*cMDXpsuI}Bb9|y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`}7P(aF(idOA=_d2W*l@r*^v~O+)16#gZsmj?i=feHgr$;J0lipkS7)hN zO}f1M%uBjRN&#eJIW01|ldlG$u&d%Zce(9kn>J0-8ZI?zGYU_Kk19~;rb~qb#l+!o zTKf8-qcQs}myFTlO)w-bV3fD-1fT$9DE)UzNHjWI+LOCftKBF;X&aJq!+=m!6b{_!zeX{`rt0ALwh8tJ_5U EAJ>nZq5uE@ diff --git a/data/icons/claudia-hicolor/48x48/apps/ardour.png b/data/icons/claudia-hicolor/48x48/apps/ardour.png deleted file mode 100644 index 298a56556ae2b3ff78f4679de91aef2f4567536a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3135 zcmV-F48Ze=P)H{yo;}b0p}pct2tSZK%^&Q{nccg)_nzP9{C?-Nt6c%_E&sm@yN16_ zKA*`ve>i5BX`_^KuTDppoM^z5{GZO1x%@r^-#JQKw`c6 zUQYnFAmu+C+`k{paiAjrs}y|B@yk1QAeBtA`%-)OuWp)&<~m*=*Nj82-_*(NPGkVWfoBdMN`& zDfmHvjhPI7e&a?QcHJ)mC;*7BH4Ezjz zF&6||e?OJ_H2~?gYIUsu{>hIASuj2-XLD!tYKtcQ>j zeSLj&VB0qEXyPu*Kxf%>1ib_kP3YN10|$G0Fwgncds3;pBCWD(2|ymn=Xa0${%uF^ zyc2$BP%B5ieKqbFecO3HfK~**w^&5KF`s)kTD@8Ts*E``JUED4E(gK+V!& z)>?#GqvHEG)YAjP`EU19y5(xLdc^=efHN=Ump?Qz0zxTdq)oH3##dTr#c^xQQt<8d zY@>l2(rIK}mwnaNd9K;zNMTYV~peJ5c<3A7z^Nbo2zl4V>oYT$saA1*VF9!CI${8N5((VU)rB3|EF8vQtz8DO_~EU6 z4bCBjz-?V!=+pXvE79uZ0GKf5S9#T|0K+0$>a-luCf( zgr4h)$w~#?o(Eq_Jb3OLUaHs8n@%qae6TBjb!WIla4tm$3k#Kc8Pd`W@L&#$cjS!I9oxlzspGhdgiSowT|tzysNA z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a_o51$oc;yKReem#}yyGe+@%f#cAPdA&7{t2b`{ZclI*L~l%lp=pTFn|Q5Ae6!( z1kaSq`0rXR_$=px1JF^xIs!1! zJaeL8O>~@gyjGRbxn6W7)zNp-Q8Q7?FS-QDzsP3qj!AjT6I%cHfaBc4j7hYVLQ`vO zOC->rNZ{FW89_Y$1@bA+`__UGvyU3{qz1a9ADfQ=ssQTID5|Jq)A7Q(y(S$uS|-}2 zE6!mnv>l5wWux;`5s({A&|Uz&H@fbQ!?D=GSBz=?M2PUH=MD4&g;2`avqC&bqSSUp z%>@v21l}$i9R+qZZ`;WwAlnKj9mkxge->pb69J_F6tOtC?I+n9KpDUr@BOpId&?S^ Z{{ti!D&rPz#_Rw9002ovPDHLkV1if|&=3Fs diff --git a/data/icons/claudia-hicolor/48x48/apps/aria.png b/data/icons/claudia-hicolor/48x48/apps/aria.png deleted file mode 100644 index 4f60d1a6dcd80e29525e62214a09495105e4a1fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2966 zcmV;H3u*L;P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L03N~s03N~tZqRi;00007bV*G`2iFW3 z03RZYh+8}W01FmLL_t(&-tC!tlvU+<#(&?woqcX|=5l7v+%pW95gd?$MiC`5D-BaZo>>SFt;=3 z%$)n#dw*a5@YH2Zw1SLI*XsM%UTd$tzvp?^dwJgXga5bB*7W}?Kx-_Y)>Knd{*|dU zH%_k%biXx_DgbEX8T5)3E6Q)Z_3L#2Rl3%&xVG%nH>O3NtgQ(DB@h5G#xnt*&tAR$ z-=C>AVQIo~S7kd+2fL`^KL&H31EN6pxCGwN5UrZf+OQC~&1dLGZ~H=ff30n+W}oe~ z8D=(Y+fM*>E!|_CX z*`;lFcl&}3*Gvkrqw{pJZO&rT_FEH&1_pj4rR)LJxJ=^e>T<2VF?RQXylAcSo2=V) zG81mSSd~{)=tmB|opxMzI$(`U*Vi@FRMyp3Z;jPdsOF}a@>|9bu=c8JuG>>vU*iDV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ERTQYc7}#p zeDc1-oIgLu{eLmd^*3xqy>kCweuKw9b35nGT}DxMY@gs$pMGXwck|6VfCZc@dGwLJ z0DSJ?KNH6xS(fm@58cPhFaIasI`RbX+wTPV=fZ`{{N#mySkpr-`w)g9Nt`Svu3+i{!O&_&JoNAphB_NST21Sl z=REuMPw>|V4s-V0C1y|0^7NPQ0crvxK#MeuQLp^XlluYXwb#xvdwQ0y9@-DYoH%io z+1X2^X}qRyYKk@CvBwVa)i2%0nNzd8_~PsQ$IrgZZ@%XS_I>>C@Kt~aly!-#-9XP= z>5%C^n$~yU^lrZX?AMssx|ujgD64{nxu!w;jhlCH_?b_$ZQGrUk6(o`0b^qwc1>+& z-#vSH-=0VD9)?GTKs^f!OMoyuoU*u>#nC5AHRyg2#S)W z32$9o;PyM8qTNoLA))`*X}3TOs!Eo{D^d4Kmd2prDwa}ONoPeDlHtMUcZ?4Gihvd6 zl~roiS9oJgQv>30&S7i>epQ%U#qr~_SlfR?rLVANrAHTO=uw*1ZMnB!p;ZH-eJwYA zp7;HyqF$O2R#}r?B7*nLJndCM1@G%-Zy1z@zPwjN z>i$UB3^LGYgmVR96r)-<1BolKVT>V1i3g2d7}@?bCe)Q9jH3SUG!E32!z+YQMCIIo zg$54z#@73aD2h3I>KyYY=CNLDUVZiFOm3ZG}layYlD&o|5UAw*$>$5U1%0HF;r0*l>6%E~abs>ar_j&-bK9qU-fI{rW6 ZzX1EYcogQpYn%W8002ovPDHLkV1iv|cs>9C diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_BME700.png b/data/icons/claudia-hicolor/48x48/apps/bristol_BME700.png deleted file mode 100644 index ea0b4c3533cfef2aafbaca720dbbf4eda8d3ca27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3495 zcmV;Y4OsGtP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5E%_oqoLCP01YQeL_t(&-tCy%Z(PTDz<)Dyu6y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T zL?!=Y*_u60L)otJ4HlDrZIw!bK&&M$%`j(j!7F=<8l#`ofR)8RF3a~G@o5tFT+-Tq zGrNx%^nZ3fga}niVMCLG1v=?AUss^D{2jQZr9!vvy+~|(X`?9;?r3c@c6C}@rVd?~ zM_S$1(X_J~kg>oEI!n)IFYeegKQ+*K#ds>W@*?rqaxS00m&@hcH^%i@0{tEj;X573 z7K#N5oKDJ3`Fye=rhRkJ*Aoejgb#%;F@ucTO}R)*H;!u%^wTD|0g}V=SAdOj4WAC7 zs`K5NtLILgWo`z1hr9#h7s3=CO8SR&t{*%-j@8wdFJHni1hIhKZnL>;km|f`A5F_? z#_SDv>HNWSVRyiPTyMra-y(>0_3`7?$FiEHSAdx$?L3|>Odh88Q8t%zci5G6W}TPR zmI1G&=kS-U@@AE>p}M{XsDVI$1@zsfq=noX+RhFlK|6WVPLh@((>LGw4}VpTp1@Rc zglDa*Z-r$t0Fbe_)NQnz?UwNHWz*+oGbuOpm~8zAPxSknZx}p+eqEJPx?X0i16m*e z0)Pq@APB->)(;2FU+X)GPP4&47y>w)27qZ~8!>gso6r4FJi+0LY#maC2?#I%&1ER$5jq*$jeGR-mLz2!ddl oLV!Z diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_axxe.png b/data/icons/claudia-hicolor/48x48/apps/bristol_axxe.png deleted file mode 100644 index a27a980b2199d30d9529a1a4198ca0419e546df2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2045 zcmVPx%{ZLF)MG+Ga1qcKS4GInr3=a_w7ZMN?6cQZ~3ltU;9up546%!*66c-p48y6NB z85bfK6d4;BBo-AU7!VyA85$fJ8yy=i7YraA93~qW9UmMl8V@NP4lWxBC>#_XARaLp z6(b)WB_A3fAs;vz4|$TV@y6#QczYSQc+^ZjWY7ifL1# zVmgXxS*T+$&sqg@b#j$xTcT$@mup9(XgA1S37%>~#a;u915Gd>W;ek^X=lnw*)jl#}?30JfQdpP`=glmP#SD*uTz`inZG zrlbCiHMX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w100000NkvXXu0mjfVXjQ2 diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_bassmaker.png b/data/icons/claudia-hicolor/48x48/apps/bristol_bassmaker.png deleted file mode 100644 index bc35a0ed65b1e02197653d65b6a1f5d79d38a0e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3205 zcmV;040`j4P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5E=)XTN@4l01O35L_t(&-tE}Oj-|(WfZ?~&A5QFaI!#aDFbp}IF(@V*k}Zo6H?|?b zz9REx40~aK3)>6Bk}N@x0aFr#hMXZeq0@Bklfxe>dC|TL^|LBe6{;3h-&X;yUAuPe z+O=!f{&b0r&3m!aY2%zm$|fPyARSVAV#pCe;eCx(mWUz}2|=P&iWhyNHxP52aDYNa zh_OaVNeBi{4OA$p@lGJ6#Jd_n8!rZk*o3H&dXBXMAtDg)!J(8Q1Rx5u(+F7+guSZs zjwFrf?Ts6(tnAS0Y7P%hX*cguxiOtK6bnO=H0Z7f27OrH%t&%5=AMg_fDeI{l@`rT z&DxDNLX@X?Py;^4&#%3_FCreJe@lb?M27XSIn|6P@0>sr9A!$-gvl#N@ff$D+Eo9?s5BWo8Ha^H+F7QSB|Q*v>F?H`meu5 z`AwXd@&2Fh(A$Jtw>KFLM=Xj3+gmreyqMrZ2_fgR&mQqtKm7}yR=;QG?;c>X3Lz{p zUai2g3CNIgxL0uR_CtR0?-eh;t%Hd*u$p{)|sQ{S^m$Q-1iD zKVoNRljFS^TU)niwJVl87CUidW}V(ji%u(Hef1T}(lHuMSzo)!^3qF0T*t>gD{EUU zbpyS%9kR5`WIUp`egjE|;rNVBYlAfFu+h7Pd+GV-fBF}U$#KpRLXD4>DprK(DHo2v z{>L|2X+C9N6o~ge{QLNW2R|dr4gJvxf;JnyO=gR8yiJHPa53CvZTT&V@{-aGu$5$e z^*+WZrqcnAb7s?1(yU3|Xfo)JSnu71&;b!xlxKu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mr4GmZ z@$t`TH=B$mk9qv<=PWOGIXeGe_V#yacXH0ozvlSpC28t8??2}Bc!){I?CtMT%t5G% zCr`dX%bd~<5cltY5Cv_FaY$v*vWZX&Txg-S2IeTSf;1K(1gTj?N{LhzM)we+z?c*z zJ6BmM$&o^!w4s$RVS~6jW&JuTo#DNQ*hW$l!qu1|)K_um96n45K0ykF^#w5qq!3s? zM@o(N7UxTxD|zKP)d3A@~-6Qf`u(Gnm z(a{0zb_!z7pg*L$Y*;LYOr|s1-Gss5n95G*E+vd77kIZoCo=|@Ln?blj0NM-m>9=6 zKVvjHMVp%Wd`SQDnB`T)<;5xU#hA5T&dbAHkd`z}I6i(!yPae0g3-87SGAg z))td#A7stW&N{>MJ(`JUxha_r4(T>PGiTC2Wx16w?w?Z4hqN-u?$am8P$I$!`%fPe z$|?PeM|}7A4-C$pbAI+aMi(zAr>C5q{GMWbOkFqx60HQr7|OCB z&l_m1D9VyXV;La?RaMYzwGn`|mQJ%nZ7ou3^1MM^*R+})v{sBKBU+6mloZV7QyPs9 zNWpYArPXX>eL?VnENf5{b7G9-d4tJhNSZb8PV1CI+t}wY8Ys;HAepNYa!jp~jNuIZk?lQmD+}LL@PQL^mm`F`ZTuXB~nXS!m68 zUhv_EKVoJ57H8u*fBO$VBf1I^D*oo9#W7f9CLqI_g=rnY|UuzD;y9#{Cn1`ja0r9bS@|$isJE<79Bj`ppftwpW-JGfM4HOKWSN$oZ7a z*Nlf3NMDfHDTBd`-~zt3Ove*M-DW8Nt=qvY@UiytNeb1J#zk0hlLBMwUxAcP=E6F?xP!0D^UjWPP_>m)|3^+a0}Lxdm@ zAz`-SB|><#GDs!SE~D-iK!Z#O rDigRIiR+KCYuBz_yLRo`pS1r2`CGVOz?+r-00000NkvXXu0mjfh2`ki diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_bit100.png b/data/icons/claudia-hicolor/48x48/apps/bristol_bit100.png deleted file mode 100644 index 078eb0766efc3d031cd272438757f1b61d88c898..0000000000000000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$Pw8j+ITv^8 zZEog;k6vey3~U);sZu%P{3Fp2w>eK=otA% z^`ytUfK@SqGk#{QePqCsR#0t0<#m9kBPxIqq9!v7O(hI)tZf6xkv2TiYydg~JOkb` zT5wB&_8(e~0t$d56KHA(ppm};pcrjvQWC~0WaFlrpp%wxwnsyk1dMx*H**PXwzk2{7|IM1K_ d1yA(<(VrjZ_u!o8(wYDO002ovPDHLkV1gyH4Wa-5 diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_bit99.png b/data/icons/claudia-hicolor/48x48/apps/bristol_bit99.png deleted file mode 100644 index f0063162327f60f97c5e933ad3904fa403441451..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1790 zcmVPx%{ZLF)MJNah5d;Js4iF^`4Hp#{MF|Z#5)U399V#d*SrrySARj0!E-Wr9IVvnw zA0R9;G%ztQQY0ubH8(RgGBz|fJ~T8oI5jytI5#{#WGpE>Jv%)-K}a|{UoSE{KSDx0 zMn6D4K|e!FK0iZ5LZ2QWLPkhhJUwYRIYvlDMoUdfOi4;hQ&vb%PEbuuQBzS*Q&3P@ zZ$(8?Q&DA1OI24?SXNn7SX*vQQC3%9SXx(BU08o zi;aqjjGM)CevXWgjEt6-ikFO#pO285qKJ}^l8=y-qpygNl$Mj0mY|xLoS2%Im6@oV znW~$drJSCdnVqbkpQ)jl#Gs;|ouRP1m7}Sht)!r_q@}Kqtt*yhWufDUZ(5AG+ zx2N2(v#_qR!LzWzv9i3js^q$+@3XYNwXNT@wzILd#i_W=ys^Zzw9B`&#k{ZFy{P}R zxX8J*(zv+7xU}ECuJF0LxVyK>xw+83vh2RL+{CT^yuQ1>y3Dz~&Ah$Gyt~rDvH!ui z-n_ftv%=QFz0a=3+Q7oUv%=%Uy6efb{=UM}!@$wQzTLsW*vGo{#<~B-!qmpd#mL0g z%)9=>$JfZi;>N|@yUX9R&gRR<*|^Z+!^_~y&C0sbY@0cL|v#$sn>zx1}r(XV~Z3=k@Pm~VnwX8D_Ofp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{LzOaQNT8 zXfzt3s+48PU@)NU_sH^`?a4NSa>&)4U5p4tk+ZWs!5CpU9MCkDt5>gr2>n5y>o>0B zoMSW^vA4I!WHJGS-Q8WBbBHl)Pj+Y;&u}z?7@17AxVE>;{=orq`}S?UdGjXyexLPv z&1^QK-|u6LA%sBJb@cmv-g@gT-hA^-dcEHNNvsbJ4!C*q=H~JLFJ`kDX__(^3;;Mg zJ7YW^lcwqaJCXm<55LdhUkx^?cs>*ym=hm%ToS&aRQzpR}gNV>H4dd~crfE=BVvO|reX6S36bqisCC{=o z5qT!n|D*CCf@(y>V2t5sKm8}>^Ep>`b}q{@mt1nmC6`=s$tAzd{3p^K`I+ua_|^ab N002ovPDHLkV1hCNM|c1L diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_dx.png b/data/icons/claudia-hicolor/48x48/apps/bristol_dx.png deleted file mode 100644 index f9d00695be3611055de42bbda5dae1887faab9c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1763 zcmV<91|0c`P)Px%{ZLF)MH3+s3l0hr4Ga(x5EK>^4IB#?85bKE7aJTJ9~~ei9337Y9TzGUAtN9o zAuS^%A}S&xCMYE-Cn_i@Cov}|C@M26EGiy19wjs-EiWuAFfubPEjlVOFEK7!9v?3- zI4v+fF)}GCG&MLcF)uSUF*7hVF)%?aD=s%FG%_|GLLW0UGCMIcBtai7J18hVC^R-R zG&MagIXg2qIW;#lIW;smHaRvpH99smQ7tStIW{~uHa$8lIXXB(H#j;xIX^l%O*Aw) zJ~cZ#LNh=@H$Fu=K0s|KD?C0sOE*6^LpEVE8%aAdp%WQCKs`i2FD^_jVlp*3L`6GB zIzd7}I7m4%NK8vXGH5p&WjY!-M^8gVLT)!5LPkhDO*LXVIz>lBMMh3*J0pBBG;%r` zM@U9hLqSPOKzKPER7xgEN=Q0TQ$A8aNJ>#hQ88dbMLt$HOH4{bPf>a}H&ss}R7^O1 zJsN>K8cb9#nk+F*PfR&pIdwxThCdiMT4F(0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qQoG-p`QwRA}+^c zFYe!uw-3!6)kroAkR_`1hGFZt!F@Wn+H9`r7N`%=t@+&UL^hGIC%{PKW!T10O#lKW z&gTs*13XaweDt*SRKr;N1AR3d86Ix0m3p1I_0H->v)%3m%fWgB`mWx`w6x)7HkQmA zJ#V?!=xp`AL7zt=(a2`&r09OR9;|M*+FdbN>30^X;Av5yEZ`(q!oJ|kqR}0QZ?}cj zp>FG{*z~uBwa!K;4BCrK_$LLc^1x@o67$9EGvN-pH8gY}5{NDFU-}{p`hf_7t)LeK zgP{NK!SCn?IOs&WA`oKme?l)*{t<#_&BL89XNTvQzX9^(h??Vl+g$(v002ovPDHLk FV1fW8*2Vw; diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_explorer.png b/data/icons/claudia-hicolor/48x48/apps/bristol_explorer.png deleted file mode 100644 index 9caf9dda16e1792b0f933d1100ef1a24634dcac7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2140 zcmV-i2&4CjP)Px%{ZLF)MH&8@6crd0784*66c-p478fHg z4-Oa_7%mYMA{Q7L8yy-P8aEFS8yh1W8z~kaCMp>d9UdGW9~~(g8WSTbA0Zwt91$TS zARr?pEFc&nA}J#zB1aV%6Dl|^AtF-}6(=PqF(M=;C?zN*Gc_X{D<>r{CMGB-FcL6A zUJ@88EGaK5DlIN7EG;!{6B!pcPB1brFflndF)K1OF+wjTKQSmoG8{EFG=LQwMKc^W zH9JE!DmOVcj1(R^J2?1>K|?`kHyUg;8%{(YZ8jXO79Vam9Sc{4MMgweLn3NAA|Fz2 za5x@DMN4rx8EiWqb~qbzI~s32AXi2+NJ>XnN*`TEA9Xw&c{&}r86ZzdLrO|eN=!+` z6(W2*7;iu)fI1lsV2pV`7=At)O-@W)P$FPXB7i>}Pf<=%Pf-qKl`CC&ghCk68z6~6 z8d6hG0BxyMRa0PCBaK8B+#4TVTPJBzKUP>)d{7)@RZDGIBU)Tp0C~D&Whh-=Tp4tx zf>b_qaddWba)>E{fG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hammondB3.png b/data/icons/claudia-hicolor/48x48/apps/bristol_hammondB3.png deleted file mode 100644 index 0cd16295966a133e6be9651fcd9d2b92f15e3896..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1989 zcmV;$2RitPP)Px%{ZLF)MJ5mk009652LcER1`r7c6Ala(4h0Yq4jc~&8WIB`4+9<%1S1j%8x;>0 z7Ze{94zHG8G9X8xtWN7#$xSAsrno91SNP9yA;cH6H;YBq1>$ z6gwOWDk2#uBON#&3MeEaGa?Z%BNj>-1wBq=5+B}yO$QXK**D=0xF4J;}x zE-NHDC>J*=9X%)$DJ?HAD=IQ7FD))CGB7kSGA}hSFF`IGM=lj!Bn>_=Bw8j8Ff=w} zBL`C{6ILn>Gc_|zFA+F3FHtTNG&nj^F%LI5Has;wTQ3PYH#Om{^cR8u>CLn2gAPf=1(b4V#`Oe$zhG*wbdVNgSNO&E+r z7@Iv2dQKB}P!m{JMQBqsRaaDhOCyF!9aL9ab5#^uRbGZlBwtfsnnM?8RYHSK9(h*} zeNrcxNEC5dJX&60jZqwJT1S>m9*j{bUSC{cVos1!C1YJ^Xj^A=TSt~sC}?3?d|f+i zVpL~mO|DHFbzfMPS1OxUD`jV7pIIlVRU?dIHl184s#zYnQy6e>R-|1lvR5dWV==2= z6K!v7u3`ppabAmSN33QDs$~@wwumXdsylZBL)l$xBGrkjtV zqE`Y0-0be_^zq^F^6&NZ>-6^X`TO|&|NJ&^b87$q z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}na|Z=&mW0000TbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAXI2&AV*0}Q14_V zZU6uT3rR#lR7l6|lwU|&R~W#rn|5i%qy8zcf7Dg}|QQ^6zNMtEwwK^hx#DnGt(L;Ru})!2B``(3=TjOX}|e)VuRgU551)FiqOulw^bDny1TwqzXAP9Ps z!RNBOef|BeJ1(EgXE)p3Zg=lZcfZZ$Q`L68W~|k!YDk6C0X97VqP_ZjLX?vEC{Aba zhA1TvMy{BU6r~l2Nh}gq&_>jW z0gwdq131+Yqhj?*Luyi39N_Ztk_3d~q=J}08;dsV1QG!EVMs?_=@@B2Z`Pg#d0c{o zi6MtElJXEEBq4}kpfgMjb$(}HIB-h1l#`0!e`XSjA(kKs#SrEpVesM*b@f;a%`gm2 zYiX8kX6eFcrpZD+9^cFo1O41eR9angm3rC{Y)hxO?5b@8M8#;<4Kph+oq}-@K1eT$ z$w@H^XpymtT$~Z-Zak%yFD|sEQfy|;m$JoC6!v3r6=&1ZDrq{CKlhmOCGoB)CfxQj2KCCm{3lgoVLnYFTG&ThvgC4#H}nD|<#MEB1oH?= z5Cutv$EUk=Ep=+Ore!TFX0xIw=EZ->h?#<9$wSs`=!eIYPAQXD9j=yF9z7(hmLIOH zl2^&AWtG*ks!ADA3i=_LjEG!L0xRF3UfM%@n?hF6e!b>IYx#%WO-E~b+7DDH+7!y7 zv#dCmQ!kVv=X+EKWoJH7HMJfXjH-Uk)u!00000NkvXXu0mjfZoWLX diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_juno.png b/data/icons/claudia-hicolor/48x48/apps/bristol_juno.png deleted file mode 100644 index 8091bd56f00431419710e018b6b93c8e9741ac24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1561 zcmV+!2Il#RP)Px%{ZLF)MHChj3k?Yl5DX9!4-ym+7Z?^88Vnd37$O)H8XOuN9vmhc5-J%K9v>Yj z9}zAb5dbDzAR!+#8x33r6h#sm6(UR{Bq9JQZBq~xPZJSB8W=br7hw(yCMYFv2?;1E zCjc&ig98RNCMY*46e=t!dpGRFeEfiqXGnCA{49u0bwE;Gc_}u3J5kgHFF*tumuDRI;j9atvEV2!2keg zC?9Dl8f7aUI7AapITAWNIsib!t_lk|L=*x-w?I8IJU%Ht9UlBcQAm0f0cZ0g@{{(hJ%QThqr+`wT%+qcpI6TBief!u96y!kBpp)fsvDt z+=myDtsRt>lgX15y^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leted file mode 100644 index 78260a4ca6a04bab14c205a0e09ec89ec537678b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2590 zcmV+(3gPvMP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5GoEl!IfD6012K+L_t(&-tE@Qk6l%E$MNreoYy_~QTJAr%VlG`?W#BtZ8xzAMj|M! zSWVPY6d_qK$pA4*iy;z743U`dSMYxzh0v{Tf&!77h5$AVHsvbU!&Po91I85*y9v*>p1n;SX zLko=#P&*5;#7l5hO`J73+g;4^eU{6YFH_ewySuye`+X*p2|hTa zkj&5*KT}@e(gdlJZs?uYf!3Ke~o_SRwm7=x<^}Ix)Kq!j3z>7dC zV+vCvg&>a;jQ7+*AQOdko~p9wB&LyOI3zkx7)^$Z4-R-VJ_09ruC;=mPN(ec?frDq zo>r@cQVQWJs=7k?2%`ngJ5-{nbc8b%!3DB7!Wf4!H4OUgTVkF0+IJz+W8h8JjNJ&@K|FJN>W&WK%yj7S>mOpEGycP zrz%Rcj;MoYURMMlCoqmv?)RtI5a?>pnFum3Z~|u28F`!_rQ~=rW*RgxigvR>>s}NqZD{GSbzy-ZV<25U>AB;j~8q1kG|a7LMV`lZ2mhfEWc7uagf+}2oYkdp$fHC746 z){{w1e_BzvimE7C%7Ea&!;>f=s){A4*wY^UXnUK%V8BwhOYokR)m7%RDV=r~?;MT> zQ#&O}Bb;*_Po|_gr+=_VZ@Gt34Tci570fDw_knh{#J;J>>Xd0UB{CLo6%NV1g}j|p zlosP9wNcFaLpnI8d&Cp1y$Y3fhWmj0o~;u2m1rO_aH11g*TFBGiN+I zMrpxhJSQN)O0pzoUX4+S#-S<4Gqe&|ZTZW_Di21-Se-DP&dAdY6~G5iX$<4pi1RBQ z=EfnsBuL5epwC}jzKnS0`Y*z0Fd)ww)W#Aw8f47|Nd%OZR;$CoY(l%!#?EIP^@nu3 z9ZXe|ra9g@ysb%Pgt0ZoSA-DIx&CgB;e69IHU(^ON_@% zj!CkZAC3-*Ger_5#4e({bcUr?&YyO6SY2A@+r4{qdI`0uD1t@I4QI}@8IO-CN)RY) za0F3fsu3z(;{4h=KkjT%yD7DdQC6_g>2Uwy51c!u9QJ-e4nVLBv5v-hFWjG#?WeE@O9g(;WdwGY|^`|)g<5$EhF}f}c zqwz75!$ZcAL+fBZB5{Nmq|#cPaa6F$HHJKFJC zRcwIB;xUxD25S%2L=lSC%jGq?j|99`VtC{ws+e zab0@S#1Xe5E?>}$OomZl`%V7z9}nr?{zpvOrm*0xLHzvM&%=|0Cny90hmI7HmT0LN zPv@vu5$Qk>lByCUNrLyFv|?UPQCgv*lt^lnlvJfbN{NzS%*iVxMF1g*qYUR9LO=*0 zg1{39B4E8C(h6Byv{rcU@OZoc=RJ{7SOZ4KSm#jI@zllh=o^2111TkY`}+(B1Gcxf zaZWKAj>#Jhnyn?ST)D!NCkH(9%rgv!L%#d&JG$L2D=RC65EzX{2q9QsUuSpsF@wR7 z_4Rc&H#hm{qkrS##S3g~Z1DN#pVR4d*xA|P_U+p|eE5+4{e7N$?m4!8+`?Fklme|I zI-NG#+uLMWgN=n$P`SjCI+1=em9v&Xzoa28Yb)(VX z&Ye4SyIs8ZL{Ws4k`Mw#QDCh_YmL??;mmta2m$Xs*4oor-k)sIBuTK=QdQOI_asRu ziUQ}{X`K)PN-3RIQ>^jiT?ik?|JCWL^smLy52>l*L<>A6~Kj4>w( zS?kl0an50_rQh$Lg@uKMg@uKMh5xJn1~Ru^Ku@7qtpET307*qoM6N<$g8nz* AssI20 diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_memoryMoog.png b/data/icons/claudia-hicolor/48x48/apps/bristol_memoryMoog.png deleted file mode 100644 index 05797816a6f13cc3e01661ec839796a70cd35477..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1788 zcmVPx%{ZLF)MGp}U3l0hl5fc;-4jl{+8V?W?6%rc~5*HX28W$KO6%!pA8WbEFD)`IEk-O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Dxo=&m8;VlR2d%>&_k^|N}oR2Fp| z=~KF%8o!5hotvF5>v?ZwbViRLO&4YiArTckIddv~Pt_~QnbLk;m-M0`+@1~TdY~$d zhpWQQ544JGOxTN1z@M;AWDG%1mP$sAR)uuoZ=sTx<_tj|C|CAR-^BJ>y*2=7Y z6Wd`1PN(xd38F#rGn diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_mixer.png b/data/icons/claudia-hicolor/48x48/apps/bristol_mixer.png deleted file mode 100644 index 8ecff97b4893f0c990ef99812c890b45628cd99d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2488 zcmV;p2}kycP)Px%{ZLF)MF}GW0096N7Zn>B92y%L9vc%T78xHK8W|iVBN`hV9vdbd4kI8B8zLPa zARZteBO@Ok79lzWH31kW7%3wMDIpj!933JgAr>S^KN=h%DIO&!BrPQzDJLB&CMG8- zCOsk*P8k{0BQP%v8#oswG9E80DlaT1A}vWCELtrtEHN+} zOd}aKEGEi@}GGBhwUFBe4*GcqeRF)tZJ7au_xP$?BKG&V9cF+4CXGc!0r zFe5rS2QW7;FFGqUHZwLhFD5}FI5#UbH#9mmG$1!}FFHCmI59&qGCnmhHaIpjH$*}- zEG|DOG&wsmJuX%+8fPRYOEEDuJTo{tH$OZYJ3B5RIfFYnJvuu%Jw72mJSj>xDL6kg zQ8gwPJfBNBA~!xiJ3Tr*LmDJcA0j-FVKN&;JT^r;J3T)oN& zN=Q~tNJdmuLS8geSSV6cQAb`oSyekzQ(8(|U2aZ1R##PkMMX?tL|$PMUs^avXE%OM zGJ{bVP+nwVSy+fpEO}2*Qea?9V`oQiHI7I~TwYsYW+owv6h>%pWno28Y(-h4j1_fe_zIX(lH^;)HpRYv7eg{$4+TIE2kqU%4b z>64ZHPwMLJlYe~kTN4K+CMGE5!E$NwO|w=he!OW8^yGkE!TMf&tyZbk%aw9XQ#O`j_-0#-&>1chDPue&hcM+%|)i z(jrCQ42S;aPd6XjefOUa{{G@S@8OxR1|I#n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PzP{&Y&9 z!|^#AxlDV!iA1t@#p7}%Rs?h`Ha;bTsbDghT(M(z!dbJQBpMuUHIvG%|3x^rmJ?59 zRSD*UZnw1kQdP6-trEGSF3WO0Z^NvFvx7X-Xm`^u|J=;3tNmUH-APur!^(7+mhykA zYA)L^c~fdqGoS>LG?o%pyN6abH*?6~ky5D?G6a?BVDPmeo9mbRQ%XvDr5S9V@&4Yi zi*89$5sE5lLQzz8Tgl5?|4wd6l7a>#>oFU7^yD6UW2-EyuaRZxjZhTj)qh%+-mEHU z566yL4p__wtc!xMq?KL7v# diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_obxa.png b/data/icons/claudia-hicolor/48x48/apps/bristol_obxa.png deleted file mode 100644 index 3942e30ad80d302014b1d53655b523d635da7e9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1919 zcmV-_2Y~pAP)Px%{ZLF)MHCei3l0ho5e^Iz6b};>5)%*%6&eT^AQl%D4jUjB85R>7APXHP6&f5G z8yN{AFB~2l8y+AOAtnqYF&Q8x5hE-gAs!DWG!Q5?6(=wvBq9 zEfgy`CMP8=BqbUwH5V;AC@Ci&EixG|Jt`|HC@DKICpIQ6GafKGB`iHLDK053FEc4B zSQ{8PC@Uc_KP@gS95X>9GC?9VJsvefCp0=BHbgEmG%+$TIx9UzDJm>8I!-1mBRNMk zF+nXgMKd%!F*QO&EjuVWL?t^(HaImuF+wdnKsz=yGC4p{EiW}WJ10F%EImg#J2)yq zPhc?`FF{KtMN%_CM?F3~VJtjRGej*zQanFGH9%20Ku2RV7ehTqDM(g8K|e4?Rd_2a zI7UoDL_ugc8*MfmK}AP1Nmyn&AvZ}=KSxbDNLWQiL~$@eFHKuDOInX7C}%w=Jxfq; zJQ;I38dE|^MM+CXNk)DzKQd5Wcsd-0Ej~Fn^j zVO2^?dO#q1K^sm`O*vO(TuV(rR%S_6TY5(&MOR@^R8~?{Q9WB}Xh~Z{T4{qwA&5vE zR#;W0HZ+AqM@L<3L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|UXnaLkDQ(}S8j_j`2J>Ez}Iv?%s z8N8al5KE3uj?Rux%6FB&R~F}~4*>)KLIwg@QVd~<AoyZwaI*<|Jp$GD@O z-~kWEEe7u`FE8YTL$DwLV=MU`vB-{iUVN{AX!xtd_>Gylxw+pKmskH>TU%eCzNKlS zO=z3hW~;A%wLXW9bG~w*n&VzJzf@s1SJ=wTWiOWHIQdy{ zJF?>OWa81ddjEcKN$TpAm*gd*F9k(NsyLHT)ic!hgFV&GZlAyFB-!5H+#-UYWipCJ z^rU_+d~zqdL&)})M-vpH>}py4G<7?L>9RiT#}fH(XMKwV!rF?e?h+mA7~}27hVbuZ zSPQ87ie?BGsoP?wLU*S9IBW=;>m(4+R8`eT7VAkI-^mLPKQ#ohqU}D`FHsZc2Tc{> zc!#DDLUckjO*5{9WV8B)rfrivg`hFA7pVzz1?N0sD+qB3D$R+7qeG9ynH;<@>bET7){ZSL{R_#Yoc>nWjIrCI<0002ovPDHLk FV1gb96n+2z diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_odyssey.png b/data/icons/claudia-hicolor/48x48/apps/bristol_odyssey.png deleted file mode 100644 index b0f8aec6d67bda0c2a2597216b561040522e5f7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4282 zcmV;r5Jm5aP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iph^ z3_Ao?N2vP%01!G!L_t(&-tC!NkX*-E$A72$+~%A)bJ^Y5m9)}owd<8F+p=U!iHt2{ zd_xJ2ZDImWLL589MO7Y>P?Uj6Di4M#-r$i33J4BW;SDNP2@r59Ar6jY*|IFljxH;$ zv@2k-Ory_Vq;@({OFkL$|^h>wE?Qz8$?0K z+4DbPc4ivkMTAyPk_C*64q{s_%W=%q^m%+sk_iw(;#l4d3srj}Ru-G|_SachSfH=I ziEG#9L4k0B?sGl0GKeCPxP`gdDICuQsp*MoD5W@a_6(8)rHYeEl}%5z1XA8kG;v+iObAi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yaVa`O+un{rcb c%KroTcPdRAzUOR+w*UYD07*qoM6N<$f>4E1;{X5v diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_poly.png b/data/icons/claudia-hicolor/48x48/apps/bristol_poly.png deleted file mode 100644 index adafa35cebcef5a616b8bf83d294130a286eba57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1625 zcmV-f2B!ImP)Px%{ZLF)MG+Dj3k?bh4-pLy3=a_w5fcy(6c!Q`5fu{`6crN~78w>86&D#785kTI z92y)O9vd7Z9v>YZ9ws0jA|WCmAtEUxBPJsyBO@d$A|o{+B`_or zI4?RdG(j{qGc+|lK`%TrH#s&mLN+%wGd4pxH#$ExH8(gwI65~qIYm1>IygH>JUm4_ zK07x*MLR!1KRrP{Ks`G@OHn&8Ktez{Lr*+JNZM@dF^Gd@X5NJmOoNlH^oOiE2lPex8vNKQ~qPfSWqTTM<^ zXiO_mQcq1$UQAS5QBqn`R8de=S4>w}Vog?7R9IA2Q&Cl8R8?MASXO>UP*GZ8Q(IS9 zSz%ULXIWcVTv=UQTT@tEURzySS6^FOTx3{bU0+{UrawYnU|n8cXklMtpG_NRU0qyY zZeC(#S!8NiWo2PwU|(Z#V`XAvW?f@sZDwR>V`*PrYHDL>YK~zaaAaj-Yi4I>aA#>| zUu<$~X>Dq3X=`hAc57^BbZKsIZESLAZ*pU9Z+LBSb82#VYIJXMaCB*QcXD!ja&&R6 zT3l#%eSUCjZhLTbcXV)ge|C9lb#{MqczSetaCmxmdwG3&e0g$#hj)Q`eSU|2fPH#} zba#Y=fP-{>f`oU2l7NDLg@=TLiGO~HkdcFaeu|fghl_)Zhlz`biI0Vck&NSf1CEf5 zh?Ag`kd%m)mWGw6l9Z8-mY(*11D=wSm6w!`nWveTo0yuHoSvJIp}LczwXB_(qNJgv zr=+u_pQ)>;pRU2Ht*W}Krs$WNv9qwSwYRmmw7R^x$hfn;zr4J`#KXwT#>vIb)7I0~ z(%9P9-QU~b;@;xq;pXV%=jrC@>*(w4>h16B@$>NW_44-k_4)hw`~CX;|NQ4t0XzTz z00DGTPE!Ct=GbNc0004EOGiWihy@);00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-jp0}u=AwtndpEwmsOu0dL~cALsw zb5T=fIh;ZvVntAd5y6^Z5mNLboI)=Q-|Ut6N*KLRq!&V{WsQ^GJNM9;{Rj1SAI|xH z&*9{vFO(Y~Y&fcZqqrz|br}#Mzqad0V{KA;! z4SI*;)@k(0GHtn9eqeA6qbFf8K0e+(Vp`EK8iD6^LMgA~bvj-s(;+0{>%v8hD#|M= z%@yX#>dIs2c%$uH%V}$!$)jQRnS8ttU(&Xs^FlB0FGF}9r_3qbZ|cIm_-M6c3D)7j zwR4ehq%B}e7BX6NR~N$mP7m(3wVreeHe1NrVGcPvS~~omK&Q=rC)8%CX|(!1PLtK@ z)G~)uDz%DLv1*R0iq#bC*{?mQHyG^pGfi%2TWT%tEtoocu&1*0P`VzJ4onYp>t!s1dDQ(GmvMM$`aM94aEGy}*6 zBT20TxK2EVmH8yNy%QVowU)RtnKTiZ2CbvP1yd3kBIz}9wml154hLCWqX9<@mgi@o zr*HBHEV+m%Z{-4R_Q;2NNDPx_>0j$a?8(Art%H2Yb!dvi^1^I3GL)bJAGsyVKZ(SM z++MpL7W>HLZ}Oc;ku1o4QL?%LFnT`;Ys*Uzji)wXwTleNG9m4Z#IkG&03jL3DFN8t zQGk_A*kMzKol@>fpX8+h&9;(G%ZfrZtz>{|Mo}`~h$3%OCxi+uQB#OF|6TLs`49d8 XMshue2(XX@00000NkvXXu0mjfa)qL_ diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_poly800.png b/data/icons/claudia-hicolor/48x48/apps/bristol_poly800.png deleted file mode 100644 index 6c6c4ecbf468a4fd071adb2f27bdbc6fb3e34ee8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2436 zcmV-~348X5P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ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YFLU+kRhA!pjH5Hh`12qC z#QwcKv__*4&V6u>jdq*08|%0bICt>^SJ$tzvwy(F^A`cQeBlb!uH)YNE}*!0?izP* zA9DVKE98}@UsQa)(dM(YbxP;C-M+)SAAZEn!6Bbs`!AKi7wt{5vgZ89mjL+W(ki7> z{O8gtYd3D;0{nOVCfC<)u>QptU=06$=RMYLe!;sRe#Bw7M^!sS8NAoSzSE+~dKsbi z9PD?{Xtvth?Co|ai;~@)EdV}UU!_}i+3pP2pRKL3y?2+(tCz6WkPR|!++63<<^NzK zjTeWjD>gUpaN*+%XrtNQ-a>+B_39M>u3i6(sw%ko`3-h2auWP7>Gt-v{N|0{ z%5%>?CpIr~Ha6P)?Qef)YHEVIa;OjpfH4NGHAPVnCkb^`(P%Wt^Zcu46h+i^O`4{N z2pbz47 diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_pro1.png b/data/icons/claudia-hicolor/48x48/apps/bristol_pro1.png deleted file mode 100644 index a0fae46c4442a4fe814d1030e04b582f0aa1e607..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3270 zcmV;%3_0_OP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5Ft1akJ$?V01QS+L_t(&-tCx4j~rKag}?XW#f!+y$jr#0W)_PQi`3MDrzX`lVFPMF z-8O7^SQ`E_{Rg~id*NMM5(ELg613t%D?<%gq5wf8B|~lwWs=33a*WKF<2^5m8J3LR zdEreRAd!)g5jWm&?z!g%T;Kv1xWEN2aDo3nh`)d9n*C;yGOaw65C~II32=nO7=x6O zJkN0)2Wu@t2&$^WaU6sY^)<#Agb-M30qS!=eck^)HpbL(SFwc?vaBBbDz;MU2a{bbMwVqv<`K$KY&Jrs(-`R}hoUH0E|*Ma zGe)Bk)>!8AIb~U5ttAXYeBUR}bBdy%-EJds@V5kQh8 zj7DQBQ{nqQi^T!}r4+}<$MtS377I>JPT1PoVzF4%G)vQzIF8xd+oREFFq_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;+q&A`ett9zAai43kt@QGbj^liI{;FrC=xm8p42tm} zQnHBkL1p?bMgkm{JRnTZx3Ifnn(mUtOvcLem{BPtlS8_mGSsRJ%^+2Vaxp^-`u9B7 zbscZz<`?hV%$jB8$#S7Gb9x3hTzVNpOXxUEMo6C_51vPrmm2(<(v+DoZe_*KB^(Y&5Q2Id5GwE%SJ}RLtiqhOVbmNj!|F z`eO=G5Q@WZt|&Q<_l;L~JjcG`F54I9>s5;$E0)NF-bmBxbb;olj7jpx(ZY-QBS-Rc zRQjmyyl|^-H*C|q=2jP2y-G1vvb18X8;r4OIy;rilOjxzCwT!_)23BlyKGvPHGhaL z&=#qVOtNuW$rRE?GDYyn)F2wvV|j%sPxQ|biKZ`|```!5Wp6Xbp{HEt&fE4;l9@2{ z(W?2>^`E}{?3I&4GyN=QQ-jWxC4$9vtgin0i&#(9YVTY+{nnY2wKKniKKWeuy=cR} z7XEEfB9A4KBdM`$E|WDz$8;T!Br#47W1$32r~?B7@ffVJSS&5Q1-j`k+)s5`_yKy^v2d>4$2`q@0*DI$PAxa-$9~5IU>g!P19uPL*w?_-`$lN+ZfHPhRx*&R z$=qUB{fR9`L76FMpfD_&W0ILGPNaGeHL@jNJmNo>ChyXE(*3r2EEkS~sftF;9 zco}BcPq6uB+kG^2Gzo$k{?(FNgJl`VaI!`U~_?T_5JdnKb|a002ovPDHLkV1l@>K+XUF diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_rhodes.png b/data/icons/claudia-hicolor/48x48/apps/bristol_rhodes.png deleted file mode 100644 index 8451c366accf1f8ec8d42b3ad31fb4718c9a9f0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1677 zcmV;826Fj{P)Px%{ZLF)MFj{10tEpA2n+}d1_lfd3JeGf4GIYl5eyFt5DgLz5DX6y4G z6cG>=7Znp06crN{78Dm17#0^57Z?^585SZ9UmYbAs-?jAs-kN={5qN={Hr zPD@WsP)koyPESoxPEt=%PEJ!*QBzP-R8dn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~m#8-5(7wL70yP{&?rW#*Q6enT@@y%^G~g0>5IS zC=e{feE&H7E5N{Cc7?_R^hpva$*Dv#K@wyJB|D7EC^98OmXb~+q$H&iQi@0=34%CG kWM*ZhWM;nqqy9h2-*OTmmnk_XS^xk507*qoM6N<$f+PnNr2qf` diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_roadrunner.png b/data/icons/claudia-hicolor/48x48/apps/bristol_roadrunner.png deleted file mode 100644 index 0ba64f69b625be839fcac558df48300b5ae2498a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1514 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5F{}aB$es_00nAEL_t(&-tE@UPaNkR$MN?(&ojT)%d&te3%d&#D8#jFemHI$0qX?EVAx%L?C#9- zqX)W3z2-cx(;S|edA{H0c|J3c$z(E_OeT}bWHOn|_u>r?jkuYsSI|adv>^0jjBX*r z2%S1S&k}^tYITT%UW`k5=baTcHa6Jb->0Xi2jwfiJFGD}bps=NIISO2DSA}wnEsvI^CDVK+lQjoM$78h@Eu)ojBk5|~++vCoiJCsT#thK~( zOrfWMXZpEPxyE>^Td3l+Gg9GO0=V`TCIOlNA;Z>`n?)r_ZG#gFM z+L|zqXr3N0GB8N9nUaeyA(f-vIHbRSkc0gLip3(Qr>7)I!r9pwQb<&!K*e}cg6mL- zH9{YQ%wvoqjtd+fHHe~^Z(n`O#MmS!CnvPqZF0FBjYflVxy;_)9$^@AbaceX$Or(Z zr>8_wM7>_8QmL@JyGx-^pjN9Pi+z26h=Kr%$IwU>tsIv}`smFGMoJ@CCs9gp@BMq! z8%=)y@y95oD3{C3%*?R5y2{+b93$n+tlU~=d2yM+z7nRR`0Z~VaObD1?C$RI?z`{v zi}m+-bJ*Zlzr2SrDGwezU}$IvAq0;eJpw>V$=cc)4sA*PEPT`uRr9<)FdB#^dTSp?mhnW=RdNxwu;t<@$oD4 z7K1nS0=o;1GtNd{MDmQP;GBH{vUx>Lre}lK*UZJmVkg2I@ z<`(8C6ndyuN6F=K%+AhIE|&?zkefGeQYw`Q!;osV%HrZ8K@d=>R9ISCBA?GQJUmPo zhAb^DF+M(yQVJDDA+KNW^UXJ}2rl*V^57+(e*PEA!7FF8JXO;4d82Uu&7LeOfp@qL9KoaeL>k|b$!a(qHAiZSlITiur%V=gA! z&30=ozVBajSqOoY^8bqLeiyo1?b)+u=LIg`T5&tI8oj-}%)Ip$&;RwDG}WB74Eabh zH+!9bZ~X^tET_julzGT+yK0k%ek(D{>w QC;$Ke07*qoM6N<$f~Jwc_y7O^ diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_sidney.png b/data/icons/claudia-hicolor/48x48/apps/bristol_sidney.png deleted file mode 100644 index f3b15b0bd83a125655a2d9b3b35e1f5c034fd701..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2314 zcmV+l3HA1gP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5EnZDni<3Z00@dnL_t(&-tE^*Z=C0O#_|7ic#reWft(p~IOGf|O4h-SBUwR=G<9qQ zZG*b2F1+jB-y*0BwBMq;euM%=05?FIG-!k-j@`NeX{nYaSu`nY1=R1$AJ+Cx|r zEaL>y7{8noc(6hu>KYSD&=M+(G7bbFEw%>J$jFtalN(A`5xbCDc&zkz?+FnI=U7rA zg(k8Jyk`{(S}RMX1B|GVRY|R2nOBHr6P*%Zt`>ay%YVaE1yK;-s~V|6X-yi%R7HWP zEEtOlL!zBsx_d+Z=g}i#0TzX?N_-Nc;}B6OJ%kG_9eEKi{O599v zUSgG?G!>1k0cC}95Ed0)DN5^!dmZZSCZGM+5lN$k_lDRyuF4$QXma;Y{{*?JO1yJK zO3@57i8G|m5(|$ga?Jc1Woj1FOBS;ULKtSV3j!=nEy=v2X)O&YNKB1dE(!7#Za!!7 z^>flJ#EF{9msl#ISRth)^p?mP5@!jDf}koWrxR2wB&X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3^WecJY;1govdl@- zHr`vDb3{>swKc}XX9pnf(ORDg^&TYxqG^IBlE9}AKIKP$@u&P?!(bemgX1sR%YT8d zrdR{JyNb!_9zXy2zmp_}IF6{QiX=&>>l&pLN+}Kw4*24WFV4=$N->>INz=2&Z8n=B zBBW{h%Fp-q_SoFqd=;x{8oc+f;zm*QD%MxxMb2zBHip7`QWe_;X8s>X%`PKEqgj6d0000@ diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_trilogy.png b/data/icons/claudia-hicolor/48x48/apps/bristol_trilogy.png deleted file mode 100644 index f25906256809352d4b5ebe4d1ecc113dbeeda93c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2785 zcmV<73Lf=|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z5EKNR(PugU019DAL_t(&-tE}CZ)90s!13>S+-Fs}Tz<93?cVO)>4u(Vrw63jS%hXK zURsF|MoU1j@D~t~L4Y79BO)UJArL|Y>;|luU}hx(=0P|8nC_YB8Moaow_PrmtLol+ zUOxg`B>Vvg$)Ds(M<+PHqw{;{!j&smu3Wit<;s=+x71(${

6`w_+FHBzH!;{xdd zOXumjj<#*_zQcP@+jTe}NIu}5!*z~j+pz2!eACi2fi527niA*FaLy8ZLlZh;3aAJQ zAsU5BAR?du5i|-=B#9_2C{Q{83Q~?Dl8EHu@hWFvJb(D>x3PIoAvrYOp`ym8NQy#I ziKqfm1-j@7$&*wf=|nO@BqA1UnNjFSlz;`2FA%YaEznluT_A--2nu{8#z2yU!J?E# zYjbgQC4k15a1nq8B?gp6L}86aR7oxot1NZak_{T{+Qu#Z`Gd#AYKu|5#@sc81}3vp z27^8+36ctmVg-ew=^7*@v_R7|U^F%}j7F9+F93&##dQtd3xt+71$uRlm9hqbh4-Y8 z$c(1$_sFvxw5Dx45(!Aubq{L_%BsMJC3&V1RU_`4CcrSCa(nYWRu?5cmc+K=bm{1f zW~JUCPFsu}p+(5^0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{sdPoZGq2OLBC~b`U!-vpATIwE3j(rN` zZ^*@Onc03Dl@b zMoYm|k_XmeY6m(dh-x44fg)oL`k}OV;5$u3HKcrE6eczv zT5Xk3x!RXVwn^R}lC;4@TVqMicWO+CzBVzZe2l$JX`!eHeHNb1g5N|P};P$p#ilDy%DClOtOK+bZenc`G1=e!*=a#%>D;~ppL=+9`AF_KqW zNlZ8=-!*5Pqok3p&?HJT8yl(+5$>}--L95&S%U~woG{k!X^a$S62pP-G;*7$G|Q3Y zX+DsodM`_9aEoz{xn(xR1H?SFsnnPbt4^iUU0+-4F0OZOt-ZIjbnAL|vD>}2y0qHq z-28B*yLxTyYG-l%=1ON}ef9d)PStsLYBYNN!o|-%UY@)(IyZU#X!kt)`uzm_GIg$S z=_`12`J2M_?~?^Mf>#g!_~Ny)vr#xYn(?OI-@XBF`~?8d4gpU82KOHipmYR37f)dK zzi}SmaH~W7r}B{0lI8`XedKKiS$C`4iKm;B8W;hg;y@ z{T$re1tQ#m4@x^QbC>d818nZxfy>UES6&F_r>D0+a$RcV77MhBu3H%6@wxyo^#Xft z-6`*mipA5d&8-dhIioZI?wciWC&rkHN<{WvV9%X%{JEg)`(?jb4Hl|(za9jBy-uL% wSN&?>H=98{Sn%iT)u3D*mz+JDXYtbFe^S@q=ax`x3jhEB07*qoM6N<$g8yE~_W%F@ diff --git a/data/icons/claudia-hicolor/48x48/apps/bristol_voxM2.png b/data/icons/claudia-hicolor/48x48/apps/bristol_voxM2.png deleted file mode 100644 index 3502764486a468f664820550ebdf33cb3a006aa8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2009 zcmV;~2PXK5P)Px%{ZLF)MF9i=009610ssd900IR83j+cK2Lc5M1P2KP2nz=f2nGra2onkb3k?bm z4FU`g3lj|t4iF3$4h0$v1`iPp5E2g&6A%~@3KA3%7ZMQ@6cQZ~2^19*8Wav06cZH| z6dn@~6&DmB6bKd=6&Dy58y6EE7Yi5}7bzA685SZ9V!|aE*l6e8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/48x48/apps/bristol_voyager.png deleted file mode 100644 index 7b2d924fbf11623f966ea3156e5f1d0de76085d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3908 zcmV-K54-S*P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign+ z4>ueqZfrmR01m`SL_t(&-tE{~likI6$MJ7>|JSq5rkT;Kni(M>jTR7E5Hp7HMz@Gs!}Q2P_e>vkv#+^c5E82*I73tliPDsw3~75MRNg|_ltg$4-6N7AK@?*g zfCHUlT~4OJr8$8MP@;$`1Y|BH(29&4g+peV%;Y2?C@&)R%aC{|+d?SNA|cPaq{IX^ zBZ!NnUJ=i<2{MgQirhHBk#$=5SiGiEObv}PGXmM|u#8aoQr z6BvBD-Gp|M5(Xh*5FjxGCSz&k3*ur2;aVtsa3NYajy4-~>kgtm#!sDQc(k8f2PCG2 zA4f=KXfzbghWMT%7KZZBBzyb&NShE~Occ{oj{R1dq_xh2&;N)pj<6CkJ^wv28Pho2Vsh#v z#s2d|poT>6?y%gAMnZV|9}c3ZoU0BpZ@6&eDLq5sLZTmeIJ3s z4;loNc>Z4}*t~y|QQ|7wMmmMm)>}n?;hM?dVGq>;WA&|f5`CoY4+Dw zFwWw|6@+P#8$6gCDuT|qjj7`pP{n{JUTU~tV@#gEVlhj&NlNs**XOm}t$a(g0%A@~r$o0## zHa%Lc9+`2pIvrlQex63{2wSew@C)R<8k5sg+`9TI4;P-`#|7Sg_f4KHK0^eG_kZ#( ziwn=GmWsS`VV0M- zEwQ)ooT=(C_1zuHC#Kjj0j+wEVi>a91{D_Ztl=8*saG#d3B%7^$tO8o1KTBvc2$tt7pb&Z*NhVoS}2(2BJJjtx@Oo(?c|O zmPw7~CpTWEdH9?(%lO4R*J*685thiC%mHCq1gR%jvN} zcAkF4^4c~({n?NC`pFWN(HYK+R=IumHeP9zYiB3;{L8z@!D-$+JI%+p?{VSuB&1E8 zkl;X)V}(KK0H-vWS0;C5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ObKMtGMjvhtcwM)SE+ckcRoB+Q%4FhXgUc_AMkH1P$JgKmiGAwP7$B z5Lzv?YZpWj?#h+TIfHr4CYqhau3s-1XRuaZA+_7+zWd6#RnJM_9DaTt%y93&kNTd* z49oM8bvCt+i6!A5*oR+u5DE`@4v|AMGc-=0hCauuD9Dc-C4KyH;*cZ>>)Jr&o!Q@COdk`})(cwg!1#R-?9Ytm3!^nN&L6J zV*h9~MHFpX9LJERWv002ovPDHLk FV1hh#uP6Wj diff --git a/data/icons/claudia-hicolor/48x48/apps/ingen.png b/data/icons/claudia-hicolor/48x48/apps/ingen.png deleted file mode 100644 index ab6737ec35c8a1e55c95ec63ef779e888f65203e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3222 zcmV;H3~BR;P)I2K~!jg%~@-VRn-;#);@P0%*-8ND1#t6BB-@03cf?s7;t>m zn%ekCOpHdwG*#M~*jU@fR;#vZG|{#(wN;Z=Qy;M{iVp~yLMs&pMYJm5zyKqo=rF?E zxsP-9UaLR$KKtx*hXM6R?Mcp@bNAWj+;4sB`_|g$4v7c=;MlV->Wp;d4q=(E8XCF? zQ20OC1Yk~*twi*SX&86QTQ5JmGrUeBf)l#G)m>~G_sn%yU)gfp@pGb%&Q2)x#qk>! zXaNiZ+U-X2N6qefI?iIp!~25s*cc4-^bpL0ImRl0vkR5m^pKz#ZNzj&qgX9m^Q`*vloT~Mh)jbv&q=!x`3Di zh69$F4aAKLyWOxmXNb`dW~}<-?Kt84zf{)}+R2ncW`|KmZK)_2S>RUW1)I zD*?8X1~>E|o^&`AMF%ud?LeYmY$^b(cE<`sdxnt&axlg~GdqykIFBI>4uGe!Fvc+( zFg$zFud$~$#`YIiKv)0~djuSM8$tWw({SR=4`a!94hM(;BCydIN(umk1ZLKpb6?+8 z5EksJ0>kA>P6|4dLdtdk)*n+T_#hZ;wAXRUytsMI(+y002aUL<7PCiZBH=YAJ{?c2xwWa>cSfN)8O8wFO+qum|kMQxm4x4sX1`KDw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4vkm)uu;ONyC`1h;C%a<>0S(fN_yEr&FU?&I= z>7J?+^$Hq?Nv{N+zMs@HH9i_UC=$f1+vq6T^qtNc3lc(#xPANfu}jaNKeyZ4 z+xYY64+AE~36NVVDZ$+QpxMc7h6I)vrv5-{N#|~ExqXAAL(lE*?&90GZ@6>k&T%+a lwz8G2Y-KB3*~_8(*|p->x5b2b0~002ovPDHLkV1hc#cY*)_ diff --git a/data/icons/claudia-hicolor/48x48/apps/jacker.png b/data/icons/claudia-hicolor/48x48/apps/jacker.png deleted file mode 100644 index d47311608f750ddfeaaa346522ce853fc06a8f84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2937 zcmV-<3x@QGP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L0B*Vf0B*Vg*50uf00007bV*G`2ipS* z7Y;hz)}1i`01Ej@L_t(&-ql)LY#r4VUF*!l*Pd&~D6vBdSdN1cNT{TdN-DVzKn)TN z5mh998c;>@lb@DUs;cl%X-kR}B|s(qLY;t=Dhd4{5cSKAN{UcYDMXec<-;M@RD9%G zd6*==zK@wXyB{-WICt(`$M99IG@3m}^H}@rb=KKupNk*}002P{u)n{b_&@*k_xCdh z0;ZTj04SHsSXfvvj{Ha|wVvcErIaQKl2A&)*Z?}NZQK0JwTQH}i%8aHY^`<2wPh<2 zxvI6EuGMNE+n5;y0c*9I0Pun!IHZ(%nxvlxZQJJB25vjD)GrU*T-$&P958lEYyJ0H zt@a#%FbD#=21p8in*~-3==4mhjU*)nPLh&>Cjd#EAOO?#OfV<68AC)U$qytcB9ek7 zNn;y_skQc%Qrm(cK&@7LMkxhawD~7VUnwO@DcU`~R3vOl<*AdWkWHng#1IG|0#~zZ z&*!d1Yt1wgKdsejAG_(t*Qel-f|tB~y9k(GH_@;oU?P(OAxY^=KvMvT7`HuZB4Zj; z;8032rJJvmS`Q#`faIzajF6<=>)p=Xj-qj3N1!D!d`+CMJOUpsLPU6A^d#zx;K^6- zw#SBvuGTuk2w)WemI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PyC_o8>61+bxJX3)H z;`zS3ec)~E*|SH+$Hzq}g?sP4S6+SfRXK3r06gCp0fc8N;QP}8sN_9QJSaM)%gK`` zrPXRln*2!~PYz?@7-$O*NqC-zPe1(>)oK-Y-gzfv<62<$Bb?huRICdF+@O!&prn>y-A*_(9(0J;4|9rOoiC=W^zA-xMPTT zLh#P{BN50y%VK@c$Idk2M#ZSWS2fsT+ljw8Ljy)rpDiMhEs0U#J(4IbW+(m;Wq zeIfGb8-ic_75HFUWbUR&GXmyrihMAgv_JZW;Il81`=Nw~cL>H;1AxrU&B?)o2hrQx zD~{uIqfHxyI%L#DqAgWTQ{le8K3uwV3A=ai#-T%p5}p0ogWx}Y3wdS|GJgeVEC5IT z4LNc;d95N6sf+-G5U7MUcMJiCcO=iJ-+A%H7co0Ki#2Q3bf`|zVN=NgfWE%IM*uvM zTh!CakJ!`GgVU!^v!|zr6B834Kp7t|2ka^;}lp|!yF$H=`;3x53=xU$T&EQ)>m_Hp07 zeKIgG0MGNX@0#4nfY(}!1>Wq^d{nR3Pj#h`DF@nh8B?5n`Q?{!;lc&%-Mbg7SFZ*E zL>t#aZCnfdVM~&pX@MvLOtOa9%3J2<=J3J`FW|_LBN!SQLQhXm#|~xDre9YISrM>T zUG{E8wiTO1VkmUgo~AR6O^UMF*y|c6mE8R+aJzR#|+}DnT%?!rZUa+y}ai}wDnv z7={SL@Py}iVKpa j=kZ(rXAgYa|8Da?sjA1wEJv^v00000NkvXXu0mjfv3+j0 diff --git a/data/icons/claudia-hicolor/48x48/apps/jsampler.png b/data/icons/claudia-hicolor/48x48/apps/jsampler.png deleted file mode 100644 index 00855d891b586a65a0878d91bda1df2d884d7708..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1961 zcmV;a2UhrrP)Px#0%A)?L;(MXkIcUS000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igc05Gxfu z_-vT~00%8eL_t(o!{wN5h+JnC$A9N}?wz?aJDYuL-ru%ql1-b`HZ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{dX+cqyT%VoJsUE8F^1BjR|6FdGn$+oNaa)B~kwXH3EjzJWY@LoGIAYv`I zV{t`%Jb`1lw#Wq)aliGCYCfkPB!jhMgM$^#B;!VQuoB@cuXB+Zn&g0?!VoJNBE^vx zZ#d5LxDKfcn(fY?ys|Gc3%)Y&P%jD7D9gB+O$?x9MGPP!0&;R34oAR}GRhyAz_f#` zxC6}(F*RS~wQ9-F`!`jIxkN+{y{upjODH3S9<`#OC^=2e@G8fcA}_L72#ET$zKh?? z)7e=(_O2D*>#g*tk#P)VA{0Z78afxx^%wa43o|LaV5XDD{WJ*QBdW?pi$$ zFaBaL6}57a99vX`R){^m9c+&lzh^t`pdw28!~CuRCOVtBZh-uSFks$c1g(nDq}g$7 ztFsFQVCyQF*>WRF_M`kh^6qiR&ef3gfY!`5Bw#5cG{}mewum`PP7fGtQI14a(x>vz zP`_f3xk9B}x-YBQTQ&BmTB#6q9O`lHe6TGsQ4vM+#$$dD`8<=-d`g(_ub+~&x>&^( z^FWyxOH?#paUtg(R3zYEZhlT5zJ?)C5m?c?JANQpXc0wdt7a>_fuJf7@MGbT>`BhW z^F996hd_%5N&5UJ%U>!Dw~B@;5(uaUQNZIy-8b!X`OLqnJpaxhzA^e(yhGNRNQ|Ny vR2zQO{YszauW#*N34`<#kuuIS|3~W|IQd;L|20|o00000NkvXXu0mjf)Ypg) diff --git a/data/icons/claudia-hicolor/48x48/apps/juced_plugins.png b/data/icons/claudia-hicolor/48x48/apps/juced_plugins.png deleted file mode 100644 index 5caddfde7f3958b3a18498359d8fbe35be114c62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3243 zcmV;c3{>-pP)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipb* z4+b3Xy*Hr%01PWhL_t(&-tC!rn3ZK2#((d(on_8!48s6}EW;Kcn1)aaQK4Lc2~sIx zA}U&uEh@HqDMl!6MOkVgg=rENxloxXi!f}lj1e(N#Wpj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Z}g0z`u(3h6Rb zgp8u=i#{(lw*r(DY(!&kUsQxRaO_|bGZR8#XFu7cmYIc4MWpP07IG~1yy z1el`SD4c)U!!HM*7|qy_C}KK$1LTvoSi1(ijDjdsT>gGKq#GP`3xxssv_n2E|k*nYux<+C}w*Csm7fbE$e}D6kE5^fRh%@ zTg(DfZoU+K<}wH~`#_(-hmxpRevqn?7CS+tI{Pi-P7cj%0^yT1bU#t{fy)YxX6;VR s>^RN5dIVAKC6taZ4yYiD;)|;OAJU|NdPbNuPyhe`07*qoM6N<$f-ok)@c;k- diff --git a/data/icons/claudia-hicolor/48x48/apps/lmms.png b/data/icons/claudia-hicolor/48x48/apps/lmms.png deleted file mode 100644 index f251dbe825efa3ad733c6d7cf36587d12ea357fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4698 zcmV-g5~b~lP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igc0 z4*)v%BS_=`01?_rL_t(&-qo3Td{x!8$A9|_cMf+9H*-QDF(42kDPb@mMiGKfL~uZ{ zfJ6}Vi500 zt<`$&XMfJH&slqY@7{Z@wburIq=Vc~ZpD1e`l01AKNf&dXY7p>yy|+~HRk6D5My*N zzJ9Thck>_hUD9{-&kjJPYVZ8GeC(dF+iFZP?nrw!tte|%7Wvr#XuRg;Ssro5I9hUR zi9T;+-rAN>%eM3v(g*%503<3oS%yVKjesExo*(`^DV|jb`?D5a<|9p@`?*Ih_B@`4CDpc(8?ZL*zjVP}vj}kvAwJ4U&db@se!|aC8 ze-6Mh_RE8F4<>UAM|%JW1*Mmr5z<1WB3eQBd-tQPqO8s0wLH?cpzWQX9KigvnbBgj z&e9pBHcBWxA2|;lt0VEoc-n(PDe1W)lu}SMs14+?s>f8}3t@g>QDE&)ItMgO(;IjL z7goavt6{Rfc0IXg(>>C*j%_5M1`yW5q^ERW(=f5Kb}a0_kPT;sUy4~1ll-kc`(ps; zuhkp%G5SU0v&QohmF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k)kb$ z70@B$>V7!9o&+8M>VpAJ?k_cc)*&+!XP2%Pt+h}+yH8a-k2P|h%^6BTCDBY7(xtmM^^H){#^;`4M zf*}i0l>%LZHobcB^sWP>ckR|RDq6d-0Ofmrh|*nG^to*uDP7Z14G~p<%Lz*-jx~DN zvsA)-MhZ4AoK4w3w>BX#3NmjP%Cz<0AOWT8%~zuWIJ{#!p*p|ikoHU@ZwC0X1|Qn-KabYL;9tcbN9;Cc+=Ap_Q8-bO(aoc|a(JHQpz;G{?Ed>INipOIa=Ok+CMZ9-p!5Wyh<2y3@^fi@GN+E2Ll7iK&9G`C%)LoAe|0$UkJMf(qW7rW67#whG1O>UC;D&g=U-D*zzq;B_bO-Jy7u2G<02A zCJRc_xoY$n^50x+nKqksiZBGUyCKyJsVH2*5UDA~o^}^aBaLn--T%SqO!?c!gu*91 zS`?A`qoQO7JHPnMl5rcxCfD3MnGv%V5~#5%K_g`l5rIY1N=zwZI1skmnD|)%V`nYE zX1BLW_-2Q@S};V>I|~Wa)HI0#O4AuKDvp`#&ArxixM0oWGsqm2OOGqBYN7;6G5o3D zqw6{wo_!vtw-LN`$i69$yB04;uMgpHyK%Tvu{j+P!F9_7uccZ1nZt+BLV@I8F$n=S z2_KFhLtS-s+=G;+llRPX^m}9)x@IkRr47o~|AVbd{*1R{CsMp^jM-_DlROnOV^zA& zjulJrS5{l@Y56UsfKXL6<)#1O>T%;S(`Mun5$s%^H;SOHapc<~!}Kxhznj)0TrPTE zpKIJNlDmX7uFCRqHqQAYTi=?GP`b5iOXgdNhD4RpJ=1726Ri4BkoqHs5RE!>r9j$j zxO?MG*D=oZO-?9r-E1;jZ%pX8n`P9@^T_H#M^|1gXB$$zc#KPw)r UQ#deRDgXcg07*qoM6N<$f^U&zIRF3v diff --git a/data/icons/claudia-hicolor/48x48/apps/lv2.png b/data/icons/claudia-hicolor/48x48/apps/lv2.png deleted file mode 100644 index 0b25f8589283b81b6974c0afcde2ae394351dfe2..0000000000000000000000000000000000000000 GI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`>52XzlF6il zdfRqx$G!J`8LRH8bV%*BYgaKgGKvikZp69`>p`p>>SUK%VuFyuqNA?svlPnN0b{WA zY%zoscyMz~);&`|0AS2aPh++=UR=k&Fn?>L~jrPP_c43 zP7VwL?2OFzRspzj>56Nfjy1r{R*TGqXhtaZ7USpbFIe<|ECL~h|b&ELj5{cofC zfoeygD=Swzq!R$%2@XI?iC~}~!9agrcYs_wu{3F+X_|8<&QKLHNI*`1d~^HB3*2epP#81Q zGykgsl<@g{LlqSj>)n8JRqlq#2Y57M(3Dc2 z5YfL>~E(P(0PeEdWx6nYAPvZklFxOlDC>-~k->%Gt8 z@hto_G`NlZS1*f+NF|fW$w(w}G!ls%G+y==tY8HzSiuT5zwJN6J%Em;+Vo=p0000< KMNUMnLSTYn*M(RB diff --git a/data/icons/claudia-hicolor/48x48/apps/mixxx.png b/data/icons/claudia-hicolor/48x48/apps/mixxx.png deleted file mode 100644 index ab6b55a9d42a58152f8584faaf511e2172a7287b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1577 zcmV+^2G;qBP)1-3~< zK~!ko?OAJY6jd00&SiHCEh>~6p_Ge-gf5^0NhO3!5P>LB3D=^aQS=7@@e+fH8o~!O zPzaZ(L5(qTtwli+zZm_Z&}swN8%1iNlu{K!TxfT9&czSAvzhMB%+Bt%W{teb$?Tak z=bh(yFXy~x2e>PD<^L_j{IPY%*3v>6*k%Y(rIhmLBUnml)W`XuJ1X+#mQ7o_0Dzl= zg*343u?36PRa68iV=OnT5HeVE{h?53{eh1^0Du?z5io?Ps;CIka5xODwX5>vtJ~N> zJ!4`jDk>s|5LGDzlu~|5DU?#4Ko11qbXTo)qM7|T#zctoWGic}J-^^eXD6!n>_uJu z&nd*cgvzYSO1!ptBPNU=?+V&_O%`sa*eiiud-q|&xUpEjb~U=YyK&;{lW6bgfKm!t z11b(Ac8%#DQ#KlvGp1wc&_Xn}wBo%T)!4VY+7Wc}z2yAlZs6Sr5JGUKt{&^ER-yKI z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Q%NVK1c!@_5hjj_Oe{=nD%&?}an?9z z9nLvttZ}w#Wm{pmTbWnoqy*0VbYS2w))uR4Si>6Du!c3P;s1#L209K~fA-%ZPyhe` M07*qoM6N<$f>Dv7CjbBd diff --git a/data/icons/claudia-hicolor/48x48/apps/non-sequencer.png b/data/icons/claudia-hicolor/48x48/apps/non-sequencer.png deleted file mode 100644 index 4ea65243b3965501c52308732eb1b7f25da5ede3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3301 zcmVx!^P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igc0 z5F-udO@7A!01RbGL_t(&-tC!taFz9$$3M?|uDRcV1V|${K`xSWgn|MMT8oGv_Tp@J zfvsJMbsg01)>7Rr9(3BZ-OkRIV%rJ2ovqb%>eS1+%c4+-Qk9DdiUf!xL~=VJH*z~C z=k~tO{&7x7fFzO%?aa=;Gw=M~bKc+kd!O%f{l3o+{{H}9Df4`#eB;mYZsQ8A^G%e^ zzKvvjmPNc?Pmb5?$@-H6P-Pv$OoRtNgYavCouIS+qyQehM<$Apg97k`uavAY3U2p! zik}5uQKe8-0#^)x*Xv3Bv;`b??gT&*5Mb{ZgufA}5Rq>Jh-fcp-<7n$4zIWP+g`7y zV5A8Ge>HfCqRjV|viVa4pXl{^egV1%m^WlKxza(L4)QO+QLopt*X#AH7<%*Zjiifc zq3U_<4+!vpuaxUX5Pk*dJF0vOBni$xJMg?*NdVgtV>ak=Rd#v3o*u8)vw7B>MdKqe z`*Kw>M25UHZimUhcOTz~V^Hv7o7d~v2J8a)+z`Pfkq7|VK{~D&098JSFRB89h^nfl z0Z+M|k(Se~<9-ID4Chy>{55b>Lijs?W5A{XQ7-^J=sZyojb1STBJ`>1p+T#PNa9U~ zC~ik|vdFM&r~o#D7v^5S;01*jL1xCaKB}Kz*%+v(s0;vmhRr@Ulk}wi5lk0%B!&Fz zCN=(rY1&c}n!g+Y#{|OuX%j3p4j5<$kT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tG&HVWOW^%H@ie36?80d$d zKA4a@`X{_97!Ejb3Vypstn#Xv2f6~uFWU^O3aGBAI8t|6WX|I$wu!JyM6Mq!AtO^K zwAEa7>h*d= zL^i3iMnrl*`hebH&L|L8mHsq$NV1c=>{Ye#T9BF?55mhmL?9f6V>R%*JrIpsQ4B#! zJiJ<7$z}IPhq#a@1JpUfGz+)}G$|N%MV8JwxvC(m>mMyEuF30Xz})F@O#wLEgMNKM z?=5i#`k=NEKB$J1pMcYTfu&4frLTLc{lphW6^>*U=cXcSBnj z96328YbR>YfR+bF!x%=H@q6olM}W}P+~Bydk0e7}Ceg66+2Uhg*v*-aT-tilE(qX} zVjCqBWz|)6p~S|X4)=NmQH0j+bZzR)mX5wu0wEU;dyImtbIh9PC)E|f)DaimTEk~s_HW%v~k+E?qIGeKUSqPq1sjG z==;uB9YAH}k&l4K69HdUS$X8>X!E!3U^B25P+=I5#T8X{*er00000NkvXXu0mjfp&Bd9 diff --git a/data/icons/claudia-hicolor/48x48/apps/non-timeline.png b/data/icons/claudia-hicolor/48x48/apps/non-timeline.png deleted file mode 100644 index 8ab84d0ed6794975f9e6c58d2509e153817e544d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3149 zcmV-T46^fyP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00!y+00!y-o_2h$00007bV*G`2igc0 z4+AJKw`y+y01M4YL_t(&-tCxcj8)fl$AA00@4a&$^JE^(3^RiVFkryJm|%=ez!>4E zj_SxsWjT_oMr|6asT9@u67@r+DpmU-YE`FdrKWk&)NYm5as5z3W1AY|7z4v&7zkjP zVP=>+%;V0T`#ASJ_U?zf2QxTnrS|LmrK7#iIeV|O|7)#%_F4;8u!0q=U9P5CB4e5V!lnG}!pHhZ+8>V+g~jKQoNweIdXw>KD}Sh4}bON`X=+04eKz zDN#~_lqjX@tpF9vWn)lEi}+ZEmONw$*sLGa8^ge`EDXoNa2$kb)A49Os}J0Z5E+VN zRT6C}W``GX8xjcD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@IR0}P8eC=-wd-ptc z*8GJFNmAn&aUq|a;S6t5)r{htD4loULWZQyAw1rGKA2%*w*DkLjWj7__G zH;rw|jyQPWFy-`p>o;!BRrcO<&g^+N7W=wMh&t!$i7H4D=PMm0J!m-40~GO{kD@7F z-r2owV)Lj4Us=~RFw)=;O8@}IjGubj<6oYC-K2?=Mv0$EUK7=q4J4!?3)k2TEf*ni z>WHM+gO_PQ3B-%rcdegx#z!vx^G7!1j|X_*2&dC)-h8KcdQ-!g54DZ@bh?7FmVrnE zNsB|P?0JVl-yT53AVROH8GbfrJslhQ>lJsbnK}ES1y|qy)Nun3yvyP4(lf`kjBn1o zI&(tX1g$&AOi%dC%xF<)$);ZEvW=Dm;cq;ZNUk`4&W#r0D#G3 z8t;E@XYXrHD2a5$NE4FgL?mA@Zk2rhkv`h=LydV%#5CM z)<2Y&CwBBddusbhUp(F*->tnT0szpO&D`{6cV8iw@tH3cxO#WtxoPb!3%~iy*23`w zc(nGu-jUrnee_j9Y>SJKwI7{4{s-S!^ZF6r-=3)UzlHUV1ouY#CIA2c07*qoM6N<$ Eg6rOCH2?qr diff --git a/data/icons/claudia-hicolor/48x48/apps/tal_plugins.png b/data/icons/claudia-hicolor/48x48/apps/tal_plugins.png deleted file mode 100644 index 7ad6e83c2e25442466e78e6dd02ce66e01388a6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3996 zcmV;N4`c9&P)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%Z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DF+mpnQ-hF zzyal}*alaCh$y90Rxf$+IQYkxCs>o+fo2V1_wi1iTj?aY#>K8P5oFG*$6JoabeUvYUZxT9 z1EWz2va%pI7vK|r?lt%VMC3W?6TJ2vvyzc)$J^m$XFfbKuO5dLin`O87FB~epDRiu zmKigA^>9Oj8`yF?bKkK55t#)f_g&EHv0UvBXa&$yCpQbMWkP1H+o^ zgzd)zz~hg@(WBt2^csgmfUfIn5${i{zjg0%vL5QdQyh5RgP}Q={do;AXV%C&8IvT(h zHk;&OHH3b{CBVd(G4S4d(A3loY`YT?08!(Y&q1- z^2}P?SA-*V$)t_1!Tc>(@DdF)0KWoeD>!r~M!37W zI%zRZAStwtyi!=28O7+%Ho^{};rq{Fit=Tgw;Z(YCBimsdSHVH!RZN+k(=IG_}7kH s?q4!Jd}Ge8=|8k>WVysK{$5P{KQ^Q6P_5RZp8x;=07*qoM6N<$f^gv6p#T5? diff --git a/data/icons/claudia-hicolor/48x48/apps/wolpertinger.png b/data/icons/claudia-hicolor/48x48/apps/wolpertinger.png deleted file mode 100644 index a986fcc939591b2858f21fdb5d65a80f600d9216..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2379 zcmV-R3AFZ!P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01sgR01sgSs6VG^00007bV*G`2igi2 z3okB$EMG_f00_%TL_t(&-p!hOj2%@S$3MR_bMM~W?ZWo81zKB5w@s_1Ew4bK5|jmu z5Y$98v?w6akZ6n*sv$JN#7D3O8vl?eVk5>P21t;^_-Gr0geXddS_`Pqg0w*%($enT z`<(gu$IRS2d-uL}yHrnd_RQY-&2N71$2kMd#~NS@up7t&YM5b@-`dTv#o7sHKBi$y zOjE~^0k*e59yVMzo6VkS2Ga=N4L-%RWm*w`I`C=>qK{Vt$1@x0cr~VVg5(q8gI370 z-U%bR)eKThjMK#S6hKqyu3q4D=f`^f7aC~PMvyWmT@3jE^P&M@iLFz*wQ|@+{5!C0?uFTamvXPDPJ_pSU4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uaLR2#z` z$XQ1R?ZyWtH3o7qVn?k{PHH42wv%34d6@^Vz8$tBPVb5aR-Wd?hgQbAEqT8DU=jL_ zP-+_1tciThGZ+;wzS+6Xbih~#Eom}ZTD8DI#`x=jfG1xH*t)aKpZ8VedaPb#o2kAl zoLnV}5jZ$9D)ObadBA`%2fQ#{W_0a&8O~qqfx$2L)_2~%_+YWNS7a?taMGSi6$WP* zJ2&?6$#ea7LVdvpb^&L%V8S|SWMqZMEh9Y)4>^X1oJBenSFQ53=U~W7Z-y+GX}ojdHl&E2L@MW$_{3Gi|z`W}8v~%sa{0 zwXu))p5|dE85CtI#nC=vsvU%eKq-aO5I#`Fp4uOX%RrKaD zvFVYbJ^E~wg|ke(8LPFRr9c!b*wLaWl$%xo4tN0AV5x)d{lJ2liB8d}W&gT#$dUD< zjov~9N>x#;FkPEm32g^~Gk|fMPp8xTQ-fw7Xf!?Owl)XU269H|Ipi6kv#vj1=;~7g xQkvM_1(J9Bq<%^td!)y7e{M6?+3|Cm{{osYEMKCZwA=sy002ovPDHLkV1nLIiv0ip diff --git a/data/icons/claudia-hicolor/48x48/apps/yoshimi.png b/data/icons/claudia-hicolor/48x48/apps/yoshimi.png deleted file mode 100644 index c8bf92bcf8eb95f838ac6d0ce1aa4aeb531d27d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3241 zcmV;a3|8}rP)V#Rsm)UpwX+qYt;}8dO$_kbn)7{ zNZtOb&_Dn5n&Ykd3$c0tK6+XHwg3wDZWy|K)X1!B#=7%tLx534gzq->G*#DCbS>1?l5N+ z^D=aJ{Fyi!Y=y|o%!1G7BjY9}g92bMK>uHiYiZOmX_UX&jIcUa0UXCc=-dRs`5d(7 zAT;S__yelYx-G#EfAfsfW(jJG#%*i$tW4yT+dV2sc;PHD^ z>z;ZQ!0c%A{MIF)ig zblsYMNkN#L55SmG4^65T)iq+xo%h)vxzH-@B7dD%3XnQ<0G5C7x^Z!SfesO*;-ft} zY}`2-4o4eHB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e*jIUv(gE?6ej=x002ovPDHLkV1l!CqFn$0 diff --git a/data/icons/claudia-hicolor/48x48/apps/zynjacku.png b/data/icons/claudia-hicolor/48x48/apps/zynjacku.png deleted file mode 100644 index 2347730fa2bdc477e7135a32a37726e0903beb0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3885 zcmV+|57O|7P)BN7rSr71*-L=+w(EpbV39z0x=KpwVZ zJ8SQ*?cKX~@8i7Y%uN3{cg@DJ^Du#^5~KaDyW{PF`!UUBH|Ea?|7NU*8Sc@@+ zRB4nlXk#(PVvWUG3;7?~SZZ@IzVC>@mqUf#ZR4-@bMNZ z(`AP9|cFXh0WH;TFVzJRq{{pz`H!k4ntM7JfuRJGk9Y*%u%7t^^WMJ)^ z7`kX1#UyHiftAKiM-q&NszXgIhjvNB1LN{!rsLD&TDU>}A(9{-wO;{LPGBdM(l< zh@_723gDNpu8+2YdMm*gL#8b{7cSU(nH=5vUPO2tp;}-ym<((NfHqKX#?)I0bFG-UFu?#w z2kA&$$KptX2#+IMM>uceCSEtB-0Nok`nG$n6oapX(<^eo7;YQ8;zL38oC~3G7~wb| zil8N6z;VH57zFiJj5QW*430|B7H}L80))Vo7No_*4Rq9C^_n#}!gNg>c=pS{H7}Rb z%XZ+wYs59BWoy^=j;u%Zs5U|h3X2vKG!GFb3Y8f~)YEhgugF~z zAcO#6afHS}q64M-KXv4+4$CaG@KiiRh zz?w_1rf=jN?9^^78f!HIgS7@}Glb2MHiO0#eZ8ZiSSk&#d^r3l@RgV1_L6I%?_Vhf zy}&#Aa#t5YWe6(4Z?!3 z2%*9HU_Fo$>o^FTVrS>_*-0y`N)TCuH7UYmSfk(sGK5JHCPkVQ8?`9)FG3c2%5ic1 z`++-NjNgmK*`^!sc&`=ir~0}J!iKYuhM?M@LWGJS3qj?uSsQee=Z1;FDj>s}6ik9O z3FtiO=RpS|OCU?JS^;3wkVPdaTW50c+M9$uNf{ns)g$X=&+U(PTG*RuxSg@R_;ieBN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@dG(~qp<$0qd z^4xHpJk0z;fZx?am`T3(i;(fO%A+g)66N(Egg^k5lFzE8y*zzrCZ26153Zbk16Ekh1L}4umqZpgIn^ni|Wy7)pBST&I(x9Ud ztzxX!Sd$@yz;PU;;; zOgEk}v^M|bpKl0H#q*Q`gb)Id>)(I#Sh0KHR^M~hts3nwEg$R_VUm%i8l^3n)|BF- z4DY`U=ip9yy9=D#58Wk?a>1b#I9Ou|6HPnGm}w~ z&%yT`4ouGK{o}R78uL(n_Rt?cbN8nwt+nQb^iMCq0X(1tR7SUMd-I}|oBrG{6xR&* zcRPiG@A{r2Jl7#glsz;tlO$oxz|?mStem}H_n6r(Ptqr#Y{6!Rc5JBE#8CKb|GWLh z;d5( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/templates/Ardour2/instant.xml b/data/templates/Ardour2/instant.xml deleted file mode 100644 index da4a74a..0000000 --- a/data/templates/Ardour2/instant.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/data/templates/Ardour3/Ardour3.ardour b/data/templates/Ardour3/Ardour3.ardour deleted file mode 100644 index c752bb8..0000000 --- a/data/templates/Ardour3/Ardour3.ardour +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/templates/Ardour3/instant.xml b/data/templates/Ardour3/instant.xml deleted file mode 100644 index da4a74a..0000000 --- a/data/templates/Ardour3/instant.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/data/templates/CalfJackHost b/data/templates/CalfJackHost deleted file mode 100644 index cff4fe8..0000000 --- a/data/templates/CalfJackHost +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/data/templates/Carla.carxp b/data/templates/Carla.carxp deleted file mode 100755 index 3310927..0000000 --- a/data/templates/Carla.carxp +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/data/templates/Hydrogen.h2song b/data/templates/Hydrogen.h2song deleted file mode 100644 index 5bd53a3..0000000 --- a/data/templates/Hydrogen.h2song +++ /dev/null @@ -1,930 +0,0 @@ - - - 0.9.5-svn - X_BPM_X-CLAUDIA-X_BPM_X - 0.73 - 0.5 - Untitled Song - Unknown - Empty song. - Unknown license - true - pattern - 0 - 0 - 0 - - - 0 - GMkit - Kick - 1 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - kick_Dry_b.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 1 - GMkit - Stick - 0.69 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - stick_Woody.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 2 - GMkit - Snare Jazz - 1 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - sn_Jazz_c.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 3 - GMkit - Hand Clap - 0.88 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - clap_Dry_c.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 4 - GMkit - Snare Rock - 1 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - sn_Wet_b.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 5 - GMkit - Tom Low - 0.96 - false - 0.44 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - tom_Rock_lo.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 6 - GMkit - Closed HH - 0.89 - false - 1 - 0.78 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - hhc_Dry_a.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 7 - GMkit - Tom Mid - 1 - false - 0.8 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - tom_Rock_mid.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 8 - GMkit - Pedal HH - 0.89 - false - 1 - 0.78 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - hhp_Dry_a.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 9 - GMkit - Tom Hi - 1 - false - 1 - 0.42 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - tom_Rock_hi.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 10 - GMkit - Open HH - 0.8 - false - 1 - 0.84 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - hhc_Rock_b.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 11 - GMkit - Cowbell - 0.8 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - misc_Cowbell.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 12 - GMkit - Ride Jazz - 0.8 - false - 1 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - cym_Jazz.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 13 - GMkit - Crash - 0.69 - false - 1 - 0.88 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - cra_Rock_a.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 14 - GMkit - Ride Rock - 0.8 - false - 0.58 - 1 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - cym_Rock_b.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - 15 - GMkit - Crash Jazz - 0.77 - false - 1 - 0.78 - 1 - false - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 1000 - 0 - -1 - false - -1 - 60 - - cra_Jazz.flac - false - forward - 0 - 0 - 0 - 0 - 0 - 1 - 4 - 0 - 0 - 1 - 1 - 0 - - -1 - -1 - - - -1 - -1 - - - - - - - Pattern 1 - not_categorized - 192 - - - - Pattern 2 - not_categorized - 192 - - - - Pattern 3 - not_categorized - 192 - - - - Pattern 4 - not_categorized - 192 - - - - Pattern 5 - not_categorized - 192 - - - - Pattern 6 - not_categorized - 192 - - - - Pattern 7 - not_categorized - 192 - - - - Pattern 8 - not_categorized - 192 - - - - Pattern 9 - not_categorized - 192 - - - - Pattern 10 - not_categorized - 192 - - - - - - - Pattern 1 - - - - - no plugin - - - false - 0.0 - - - no plugin - - - false - 0.0 - - - no plugin - - - false - 0.0 - - - no plugin - - - false - 0.0 - - - - - diff --git a/data/templates/Jack-Mixer.xml b/data/templates/Jack-Mixer.xml deleted file mode 100644 index 03d490e..0000000 --- a/data/templates/Jack-Mixer.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/data/templates/Jack-Rack.xml b/data/templates/Jack-Rack.xml deleted file mode 100644 index 14c57955c1db5cfff5ac6b585ffc9bc6a618ba8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 133 zcmV;00DAu)iwFpy)N)V&0|2wJugJ|&C`&CW&dkrVRWj5wP_nnVuj$y;1E||1*MFVk^(DzeUP{=NJ6hTO)oFCMBgRE1uPg35{x(0GuBHfNl^kC n1v9~pOF_XVIU_MIFEyvw&d5d|&gQbwM<@aSjXK$)kpKVyu);O$ diff --git a/data/templates/Jacker.jsong b/data/templates/Jacker.jsong deleted file mode 100644 index 6afd7af..0000000 --- a/data/templates/Jacker.jsong +++ /dev/null @@ -1,130 +0,0 @@ - -{ - "beats_per_bar" : 4, - "beats_per_minute" : X_BPM_X-CLAUDIA-X_BPM_X, - "enable_loop" : true, - "end_cue" : 0, - "format" : "jacker-song", - "frames_per_beat" : 4, - "loop" : - { - "begin" : 64, - "end" : 128 - }, - "tracks" : - [ - - { - "midi_channel" : 0, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 1, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 2, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 3, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 4, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 5, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 6, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 7, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 8, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 9, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 10, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 11, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 12, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 13, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 14, - "midi_port" : 0, - "mute" : false, - "name" : "" - }, - - { - "midi_channel" : 15, - "midi_port" : 0, - "mute" : false, - "name" : "" - } - ], - "version" : 2 -} diff --git a/data/templates/LMMS.mmp b/data/templates/LMMS.mmp deleted file mode 100755 index 9925bb3..0000000 --- a/data/templates/LMMS.mmp +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Put down your project notes here.

]]> - - - - diff --git a/data/templates/MusE.med b/data/templates/MusE.med deleted file mode 100644 index d3b1fe4..0000000 --- a/data/templates/MusE.med +++ /dev/null @@ -1,114 +0,0 @@ - - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 00:00:00:00:00 - 1 - 1 - 1 - 2 - 1 - 0 - 0 - 0 - - - 1 - 0 - 0 - 0 - - - 2 - 63 - 127 - 63 - 70 - 9 - 0 - 0 - 0 - 4 - 4 - 0 - 0 - 1 - 0 - 0.5 - - 0 - 28 - 31 - 33 - 29 - 36 - - - - - 1 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - X_SR_X-CLAUDIA-X_SR_X - - Out 1 - 0 - 0 - 0 - 0 - 2 - 20 - 0 - 1 - 0 - 0 - 0 - - - - - - - - - - 0 - 500000 - - - - - 0 - 4 - 4 - - - - - - - - diff --git a/data/templates/Non-Sequencer.non b/data/templates/Non-Sequencer.non deleted file mode 100644 index 3cff1d285a89d5298897f8c1859bb6f0713a2cdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 251 zcmZXOOA5j;5QZmKe4uW;faAth#adlRAS<_41bczl4iq1$#)x*+n|L;F5~BzTE(T_X z|M5j}mI6QxD&Vn46ziS47GTTHGFN@K1ACA4SOqNWagK9M(ol+<0!>Efbi*~B=%NzR zVC$_h$5p1~nQ#nt1fR?SSg-N@mtE)Mcq^`%2zbCJA^%k;U>y;2p5{s#Lt4GU`i{j` s+v`N`iDM+UxhpKgzobd%V(R0L3K96IazkR~;~`H;1os!%6V78sfdBvi diff --git a/data/templates/Non-Timeline/history b/data/templates/Non-Timeline/history deleted file mode 100644 index e1c150b..0000000 --- a/data/templates/Non-Timeline/history +++ /dev/null @@ -1 +0,0 @@ -Tempo_Point 0x1 create :start 0 :tempo X_BPM_X-CLAUDIA-X_BPM_X00000 diff --git a/data/templates/Non-Timeline/info b/data/templates/Non-Timeline/info deleted file mode 100644 index bd23c6a..0000000 --- a/data/templates/Non-Timeline/info +++ /dev/null @@ -1,8 +0,0 @@ -created by - The Non-Timeline 1.0.0 -created on - Thu Sep 2 02:03:44 2010 -version - 1 -sample rate - X_SR_X-CLAUDIA-X_SR_X diff --git a/data/templates/Qsampler.lscp b/data/templates/Qsampler.lscp deleted file mode 100644 index 55ae8a2..0000000 --- a/data/templates/Qsampler.lscp +++ /dev/null @@ -1,4 +0,0 @@ -# Qsampler - A LinuxSampler Qt GUI Interface -# - -RESET diff --git a/data/templates/Qtractor.qtr b/data/templates/Qtractor.qtr deleted file mode 100644 index cc2cb9a..0000000 --- a/data/templates/Qtractor.qtr +++ /dev/null @@ -1,98 +0,0 @@ - - - - X_FOLDER_X-CLAUDIA-X_FOLDER_X - - X_SR_X-CLAUDIA-X_SR_X - X_BPM_X-CLAUDIA-X_BPM_X - 960 - 4 - 2 - - - 0 - 0 - 0 - 0 - - - - - - - - - duplex - - - 0 - 2 - 1 - 1 - 0 - - - - - system - capture_1 - - - system - capture_2 - - - 1 - 0 - - - - - system - playback_1 - - - system - playback_2 - - - - - - - duplex - 127 - duplex - none - - - 0 - 1 - 0 - - - 0 - - - 1 - 0 - - - 0 - - - - - - - - 32 - 100 - 100 - 4 - 0 - 0 - - - - diff --git a/data/templates/Rosegarden.rg b/data/templates/Rosegarden.rg deleted file mode 100644 index 49f46fd0f035b40623aa5967d9e546a723e41277..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10098 zcmai)V{j$Fx9wwVVq;?4IfIe`_)>j zYxnL?ySkes77k9O-bEP<670&r!1JIz+5g69;7M%e@bb(im<0W&7uANx?5ZW-)#A0E z;E^&q18bQyvdr2+!0(-2DB3~<^Jtp&@w^qC8L@?QZLM8sWg0M?@JZp1P6Z%r7LIdz zfGb&Vo<0wofn_z1L7?m1i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AaCWRQ*+gV@nbF`3)x(97}tFpvzQuC>~^*e`yO5q9EP~){%K}>%}o^lq^ts-8m+M5s-T?eFW##j+H z1v+k)>oU+#?qQInV_JX1`-;oeI{nBWQMM|H9hVDgQY1AY`W$6PVD8ugOiRfiY z98W3GLtGquU}(dWiTA)_n1CUrzB7a~u&g6pUa@GR8^Bth%ZFf);e``?do@t$$k``Tj(hSJYnvk??x3DH5K|9Vb zQ*Lb#OpYm3^jUDJ*G?1K>UubktU7s1bOgL$<2Yn{syX@0wz#_svLBT}blH4jk diff --git a/data/templates/Seq24.midi b/data/templates/Seq24.midi deleted file mode 100644 index cf80ebd7b34921dffcc9c063269d71b863770c8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4407 zcmd7UJ8qL<5QX8-iEYgNe!qkwJqutB>B0_z1Oic@6m;oW7dta^P#(#}M4u1^o@n$s z?>S@rQsO8lr=QNo80)d9uU{vp-@nv%@5go=6t{<)58uu|pMU*$HntbbNGsOEo5EGuuGhoe zEU$Uo%{%uuxvuv?9(jz<4=T*)b)4mH^pHm$p08Z=pm0h#&2rFj9$lC z?nV!J@egamj9$lC?nV!Jb)4mH^pHm$IXc$YcET+AyQnahAK$LmqjIe^DD|^g7ORH+sk;kMS>S!;D_XS?)#;dE_zvRc)Bj z>p08Z=pm0h#=ou&GkP6oxf?y?k;nKqwP8lD<1BZhhdlBae^eW0^g7ORH+sk;kBi?Q C2N{?E diff --git a/data/unity/cadence-unity-support b/data/unity/cadence-unity-support deleted file mode 100755 index d85094d..0000000 --- a/data/unity/cadence-unity-support +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# Imports (Global) -import dbus, signal, sys -from PyQt5.QtCore import QCoreApplication, QObject - -# DBus -class DBus(object): - __slots__ = [ - 'bus', - 'jack' - ] -DBus = DBus() -DBus.bus = None -DBus.jack = None - -def appQuit(sig, frame): - app.exit(0) - -# Main Application -class CadenceUnityApp(QObject): - def __init__(self, parent=None): - QObject.__init__(self, parent) - - self.m_lastLoad = None - self.m_lastXruns = None - - self.m_timerDBus = self.startTimer(5000) - self.m_timerLauncher = self.startTimer(1000) - - self.timerCheckDBus() - self.timerCheckLauncher() - - def refreshDBus(self): - DBus.bus = dbus.SessionBus() - - try: - DBus.jack = DBus.bus.get_object("org.jackaudio.service", "/org/jackaudio/Controller") - except: - DBus.jack = None - - def jackGetLoad(self): - if DBus.jack: - try: - return DBus.jack.GetLoad() - except: - DBus.jack = None - return None - else: - return None - - def jackGetXruns(self): - if DBus.jack: - try: - return DBus.jack.GetXruns() - except: - DBus.jack = None - return None - else: - return None - - def timerCheckDBus(self): - if not DBus.jack: - self.refreshDBus() - - def timerCheckLauncher(self): - load = self.jackGetLoad() - xruns = self.jackGetXruns() - - if load != self.m_lastLoad: - if load != None: - launcher.set_property("progress", load/100) - launcher.set_property("progress_visible", True) - else: - launcher.set_property("progress", 0.0) - launcher.set_property("progress_visible", False) - - if xruns != self.m_lastXruns: - if xruns != None: - launcher.set_property("count", xruns) - launcher.set_property("count_visible", True) - else: - launcher.set_property("count", 0) - launcher.set_property("count_visible", False) - - self.m_lastLoad = load - self.m_lastXruns = xruns - - def timerEvent(self, event): - if event.timerId() == self.m_timerDBus: - self.timerCheckDBus() - elif event.timerId() == self.m_timerLauncher: - self.timerCheckLauncher() - QObject.timerEvent(self, event) - -#--------------- main ------------------ -if __name__ == '__main__': - - # Imports (Unity) - from gi import require_version as gi_require_version - gi_require_version('Unity', '7.0') - from gi.repository import Unity - - # App initialization - app = QCoreApplication(sys.argv) - app.setApplicationName("Cadence-Unity-Support") - app.setApplicationVersion("0.5.0") - app.setOrganizationName("Cadence") - - launcher = Unity.LauncherEntry.get_for_desktop_id("cadence.desktop") - qtLoop = CadenceUnityApp() - - signal.signal(signal.SIGTERM, appQuit) - signal.signal(signal.SIGINT, appQuit) - - # App-Loop - sys.exit(app.exec_()) diff --git a/data/unity/cadence-unity-support.desktop b/data/unity/cadence-unity-support.desktop deleted file mode 100644 index 3cd8329..0000000 --- a/data/unity/cadence-unity-support.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Cadence Unity Support -Comment=JACK Xruns and DSP Load for Unity -Exec=cadence-unity-support -Icon=cadence -Terminal=false -Type=Application -Categories=Utility;Qt; -OnlyShowIn=Unity;KDE; diff --git a/data/windows/README b/data/windows/README deleted file mode 100644 index 42c0cbc..0000000 --- a/data/windows/README +++ /dev/null @@ -1,10 +0,0 @@ -# --- README for Cadence - Windows build --- - -Cadence is a set of tools useful for audio production. -It's being developed by falkTX, using Python3 and Qt4 (and some C++ where needed). - -This is the Windows build of Cadence. -Not all tools can be compiled or are useful under Windows, so not all of them can be used. - -For a complete and updated description of these tools, please check: -http://kxstudio.sourceforge.net/KXStudio:Applications diff --git a/data/windows/build-win32.sh b/data/windows/build-win32.sh deleted file mode 100755 index c7b2902..0000000 --- a/data/windows/build-win32.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -set -e - -MINGW=i686-w64-mingw32 -MINGW_PATH=/opt/mingw32 - -JOBS="-j 4" - -if [ ! -f Makefile ]; then - cd ../.. -fi - -export PATH=`pwd`/data/windows:$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH -export AR=$MINGW-ar -export CC=$MINGW-gcc -export CXX=$MINGW-g++ -export MOC=$MINGW-moc -export RCC=$MINGW-rcc -export UIC=$MINGW-uic -export STRIP=$MINGW-strip -export WINDRES=$MINGW-windres - -export WINEPREFIX=~/.winepy3 - -export PYTHON_EXE="C:\\\\Python33\\\\python.exe" - -export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze" -export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py" -export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3" - -export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include" -export CXXFLAGS="-DPTW32_STATIC_LIB -DWIN32 -I$MINGW_PATH/include" - -# Clean build -make clean - -# Build PyQt4 resources -make $JOBS UI RES - -# Build C++ tools -make $JOBS -C c++/jackmeter cadence-jackmeter.exe -make $JOBS -C c++/xycontroller cadence-xycontroller.exe -mv c++/*/*.exe data/windows - -rm -rf ./data/windows/Catarina -rm -rf ./data/windows/Catia -cp ./src/catarina.py ./src/catarina.pyw -cp ./src/catia.py ./src/catia.pyw -$CXFREEZE --include-modules=re --target-dir=".\\data\\windows\\Catarina" ".\\src\\catarina.pyw" -$CXFREEZE --include-modules=re --target-dir=".\\data\\windows\\Catia" ".\\src\\catia.pyw" -rm -f ./src/catarina.pyw -rm -f ./src/catia.pyw - -cd data/windows -mv cadence-jackmeter.exe Cadence-JackMeter.exe -mv cadence-xycontroller.exe Cadence-XYController.exe - -cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Catarina/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Catarina/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Catarina/ - -cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Catia/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Catia/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Catia/ - -rm -rf ./includes/ -rm -rf ./lib/ - -# Build unzipfx -make -C unzipfx-catarina -f Makefile.win32 -make -C unzipfx-catia -f Makefile.win32 - -# Create static build -rm -f Catarina.zip Catia.zip -zip -r -9 Catarina.zip Catarina -zip -r -9 Catia.zip Catia - -rm -f Catarina.exe Catia.exe -cat unzipfx-catarina/unzipfx2cat.exe Catarina.zip > Catarina.exe -cat unzipfx-catia/unzipfx2cat.exe Catia.zip > Catia.exe -chmod +x Catarina.exe -chmod +x Catia.exe - -# Cleanup -make -C unzipfx-catarina -f Makefile.win32 clean -make -C unzipfx-catia -f Makefile.win32 clean -rm -f Catarina.zip Catia.zip -rm -f unzipfx-*/*.exe - -# Final Zip -rm -rf Cadence-0.8-beta2 -mkdir -p Cadence-0.8-beta2 -cp *.exe Cadence-0.8-beta2 -cp README Cadence-0.8-beta2 -zip -r -9 Cadence-0.8-beta2-win32.zip Cadence-0.8-beta2 - -# Testing: -echo "export WINEPREFIX=~/.winepy3" -echo "wine $PYTHON_EXE ../../src/catia.py" diff --git a/data/windows/build-win64.sh b/data/windows/build-win64.sh deleted file mode 100755 index 2f32bcf..0000000 --- a/data/windows/build-win64.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -set -e - -MINGW=x86_64-w64-mingw32 -MINGW_PATH=/opt/mingw64 - -JOBS="-j 4" - -if [ ! -f Makefile ]; then - cd ../.. -fi - -export PATH=`pwd`/data/windows:$MINGW_PATH/bin:$MINGW_PATH/$MINGW/bin:$PATH -export AR=$MINGW-ar -export CC=$MINGW-gcc -export CXX=$MINGW-g++ -export MOC=$MINGW-moc -export RCC=$MINGW-rcc -export UIC=$MINGW-uic -export STRIP=$MINGW-strip -export WINDRES=$MINGW-windres - -export WINEPREFIX=~/.winepy3_x64 - -export PYTHON_EXE="C:\\\\Python33\\\\python.exe" - -export CXFREEZE="wine $PYTHON_EXE C:\\\\Python33\\\\Scripts\\\\cxfreeze" -export PYUIC="wine $PYTHON_EXE C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\uic\\\\pyuic.py" -export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe -py3" - -export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include" -export CXXFLAGS="-DPTW32_STATIC_LIB -DWIN32 -I$MINGW_PATH/include" - -# Clean build -make clean - -# Build PyQt4 resources -make $JOBS UI RES - -# Build C++ tools -make $JOBS -C c++/jackmeter cadence-jackmeter.exe -make $JOBS -C c++/xycontroller cadence-xycontroller.exe -mv c++/*/*.exe data/windows - -rm -rf ./data/windows/Catarina -rm -rf ./data/windows/Catia -cp ./src/catarina.py ./src/catarina.pyw -cp ./src/catia.py ./src/catia.pyw -$CXFREEZE --include-modules=re --target-dir=".\\data\\windows\\Catarina" ".\\src\\catarina.pyw" -$CXFREEZE --include-modules=re --target-dir=".\\data\\windows\\Catia" ".\\src\\catia.pyw" -rm -f ./src/catarina.pyw -rm -f ./src/catia.pyw - -cd data/windows -mv cadence-jackmeter.exe Cadence-JackMeter.exe -mv cadence-xycontroller.exe Cadence-XYController.exe - -cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Catarina/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Catarina/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Catarina/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Catarina/ - -cp $WINEPREFIX/drive_c/windows/syswow64/python33.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Catia/ -cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Catia/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Catia/ -cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Catia/ - -rm -rf ./includes/ -rm -rf ./lib/ - -# Build unzipfx -make -C unzipfx-catarina -f Makefile.win32 -make -C unzipfx-catia -f Makefile.win32 - -# Create static build -rm -f Catarina.zip Catia.zip -zip -r -9 Catarina.zip Catarina -zip -r -9 Catia.zip Catia - -rm -f Catarina.exe Catia.exe -cat unzipfx-catarina/unzipfx2cat.exe Catarina.zip > Catarina.exe -cat unzipfx-catia/unzipfx2cat.exe Catia.zip > Catia.exe -chmod +x Catarina.exe -chmod +x Catia.exe - -# Cleanup -make -C unzipfx-catarina -f Makefile.win32 clean -make -C unzipfx-catia -f Makefile.win32 clean -rm -f Catarina.zip Catia.zip -rm -f unzipfx-*/*.exe - -# Final Zip -rm -rf Cadence-0.8-beta2 -mkdir -p Cadence-0.8-beta2 -cp *.exe Cadence-0.8-beta2 -cp README Cadence-0.8-beta2 -zip -r -9 Cadence-0.8-beta2-win64.zip Cadence-0.8-beta2 - -# Testing: -echo "export WINEPREFIX=~/.winepy3_x64" -echo "wine $PYTHON_EXE ../../src/catia.py" diff --git a/data/windows/unzipfx-catarina/.gitignore b/data/windows/unzipfx-catarina/.gitignore deleted file mode 100644 index 27745fc..0000000 --- a/data/windows/unzipfx-catarina/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ - -*~ -*.o -*.exe -*.zip - -unzipfx2cat diff --git a/data/windows/unzipfx-catarina/Makefile.linux b/data/windows/unzipfx-catarina/Makefile.linux deleted file mode 100644 index ed4a0d9..0000000 --- a/data/windows/unzipfx-catarina/Makefile.linux +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/Makefile -f - -CC ?= gcc - -BUILD_FLAGS = -DSFX -DLINUX -I. -I.. $(CFLAGS) -O2 -BUILD_FLAGS += -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -BUILD_FLAGS += -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -D_MBCS - -LINK_FLAGS = -static $(LDFLAGS) - -OBJ = crc32.o crypt.o extract.o fileio.o globals.o inflate.o match.o process.o ttyio.o ubz2err.o unzip.o zipinfo.o -OBJ += unix/unix.o -OBJ += unzipfx/appDetails.o - -# ----------------------------- - -all: unzipfx2cat - -unzipfx2cat: $(OBJ) - $(CC) $^ $(LINK_FLAGS) -o $@ - -clean: - rm -f *~ $(OBJ) - -# ----------------------------- - -.c.o: - $(CC) $< $(BUILD_FLAGS) -c -o $@ diff --git a/data/windows/unzipfx-catarina/Makefile.win32 b/data/windows/unzipfx-catarina/Makefile.win32 deleted file mode 100644 index 1c81fff..0000000 --- a/data/windows/unzipfx-catarina/Makefile.win32 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/Makefile -f - -CC ?= gcc -WINDRES ?= windres - -BUILD_FLAGS = -DSFX -DWIN32 -DWINDOWS -DFORCE_UNIX_OVER_WIN32 -I. -I.. $(CFLAGS) -O2 -BUILD_FLAGS += -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -BUILD_FLAGS += -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -D_MBCS - -LINK_FLAGS = -static -mwindows -lkernel32 $(LDFLAGS) - -OBJ = crc32.o crypt.o extract.o fileio.o globals.o inflate.o match.o process.o ttyio.o ubz2err.o unzip.o zipinfo.o -OBJ += win32/nt.o win32/win32.o win32/win32i64.o -OBJ += unzipfx/appDetails.o -OBJ += icon.o - -# ----------------------------- - -all: unzipfx2cat.exe - -unzipfx2cat.exe: $(OBJ) - $(CC) $^ $(LINK_FLAGS) -o $@ - -icon.o: ../../../resources/ico/catarina.rc - $(WINDRES) -i $< -o $@ -O coff - -clean: - rm -f *~ $(OBJ) - -# ----------------------------- - -.c.o: - $(CC) $< $(BUILD_FLAGS) -c -o $@ diff --git a/data/windows/unzipfx-catarina/README b/data/windows/unzipfx-catarina/README deleted file mode 100644 index b061075..0000000 --- a/data/windows/unzipfx-catarina/README +++ /dev/null @@ -1,11 +0,0 @@ -This is a special build of unzip's unzipfx tool, modified to allow full application bundles. -You get a static linked binary that extracts your files into a temporary location, then executes the main program (defined by you). - -Currently working under Linux only, but should be fairly easy to get it into other OSes (unzip itself is already available in many, including Windows, MacOS, Linux and BeOS). - - -To get a static unzipfx application, you do: - 1 - create a zip file of your application bundle, with a single parent/root directory (this directory and the main app-name must match) - 2 - edit unzipfx/appDetails.h and set SFX_APP_MININAME as the directory name set in step 1 - 3 - compile this tool using the appropriate makefile (eg: make -f Makefile.linux). That will give you 'unzipfx2cat' binary - 4 - concatenate your zip file over the 'unzipfx2cat' binary (eg: cat unzipfx2cat myapp.zip > myapp) diff --git a/data/windows/unzipfx-catarina/consts.h b/data/windows/unzipfx-catarina/consts.h deleted file mode 100644 index 5dfc0a0..0000000 --- a/data/windows/unzipfx-catarina/consts.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 1990-2001 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - consts.h - - This file contains global, initialized variables that never change. It is - included by unzip.c and windll/windll.c. - - ---------------------------------------------------------------------------*/ - - -/* And'ing with mask_bits[n] masks the lower n bits */ -ZCONST unsigned near mask_bits[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - -ZCONST char Far VersionDate[] = UZ_VERSION_DATE; /* now defined in unzvers.h */ - -#ifndef SFX - ZCONST char Far EndSigMsg[] = - "\nnote: didn't find end-of-central-dir signature at end of central dir.\n"; -#endif - -ZCONST char Far CentSigMsg[] = - "error: expected central file header signature not found (file #%lu).\n"; -ZCONST char Far SeekMsg[] = - "error [%s]: attempt to seek before beginning of zipfile\n%s"; -ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n"; -ZCONST char Far ExclFilenameNotMatched[] = - "caution: excluded filename not matched: %s\n"; - -#ifdef VMS - ZCONST char Far ReportMsg[] = "\ - (please check that you have transferred or created the zipfile in the\n\ - appropriate BINARY mode--this includes ftp, Kermit, AND unzip'd zipfiles)\n"; -#else - ZCONST char Far ReportMsg[] = "\ - (please check that you have transferred or created the zipfile in the\n\ - appropriate BINARY mode and that you have compiled UnZip properly)\n"; -#endif - -#ifndef SFX - ZCONST char Far Zipnfo[] = "zipinfo"; - ZCONST char Far CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; -#endif diff --git a/data/windows/unzipfx-catarina/crc32.c b/data/windows/unzipfx-catarina/crc32.c deleted file mode 100644 index 02f504d..0000000 --- a/data/windows/unzipfx-catarina/crc32.c +++ /dev/null @@ -1,732 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results about a factor - * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. - */ - -/* $Id: crc32.c,v 2.0 2007/01/07 05:20:36 spc Exp $ */ - -#define __CRC32_C /* identifies this source module */ - -#include "zip.h" - -#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) - -#ifndef ZCONST -# define ZCONST const -#endif - -#include "crc32.h" - -/* When only the table of precomputed CRC values is needed, only the basic - system-independent table containing 256 entries is created; any support - for "unfolding" optimization is disabled. - */ -#if (defined(USE_ZLIB) || defined(CRC_TABLE_ONLY)) -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# undef IZ_CRCOPTIM_UNFOLDTBL -# endif -#endif /* (USE_ZLIB || CRC_TABLE_ONLY) */ - -#if defined(IZ_CRCOPTIM_UNFOLDTBL) -# define CRC_TBLS 4 -#else -# define CRC_TBLS 1 -#endif - - -/* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: - x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - - Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials - is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the - polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - where a mod b means the remainder after dividing a by b. - - This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each - incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first (or only) table is simply the CRC of all possible eight bit values. - This is all the information needed to generate CRC's on data a byte-at-a-time - for all combinations of CRC register values and incoming bytes. - The remaining 3 tables (if IZ_CRCOPTIM_UNFOLDTBL is enabled) allow for - word-at-a-time CRC calculation, where a word is four bytes. -*/ - -#ifdef DYNAMIC_CRC_TABLE - -/* ========================================================================= - * Make the crc table. This function is needed only if you want to compute - * the table dynamically. - */ - -local void make_crc_table OF((void)); - -#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) - error: Dynamic allocation of CRC table not safe with reentrant code. -#endif /* DYNALLOC_CRCTAB && REENTRANT */ - -#ifdef DYNALLOC_CRCTAB - local ulg near *crc_table = NULL; -# if 0 /* not used, since sizeof("near *") <= sizeof(int) */ - /* Use this section when access to a "local int" is faster than access to - a "local pointer" (e.g.: i86 16bit code with far pointers). */ - local int crc_table_empty = 1; -# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) -# define MARK_CRCTAB_FILLED crc_table_empty = 0 -# define MARK_CRCTAB_EMPTY crc_table_empty = 1 -# else - /* Use this section on systems where the size of pointers and ints is - equal (e.g.: all 32bit systems). */ -# define CRC_TABLE_IS_EMPTY (crc_table == NULL) -# define MARK_CRCTAB_FILLED crc_table = crctab_p -# define MARK_CRCTAB_EMPTY crc_table = NULL -# endif -#else /* !DYNALLOC_CRCTAB */ - local ulg near crc_table[CRC_TBLS*256]; - local int crc_table_empty = 1; -# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) -# define MARK_CRCTAB_FILLED crc_table_empty = 0 -#endif /* ?DYNALLOC_CRCTAB */ - - -local void make_crc_table() -{ - ulg c; /* crc shift register */ - int n; /* counter for all possible eight bit values */ - int k; /* byte being shifted into crc apparatus */ -#ifdef DYNALLOC_CRCTAB - ulg near *crctab_p; /* temporary pointer to allocated crc_table area */ -#else /* !DYNALLOC_CRCTAB */ -# define crctab_p crc_table -#endif /* DYNALLOC_CRCTAB */ - -#ifdef COMPUTE_XOR_PATTERN - /* This piece of code has been left here to explain how the XOR pattern - * used in the creation of the crc_table values can be recomputed. - * For production versions of this function, it is more efficient to - * supply the resultant pattern at compile time. - */ - ulg xor; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static ZCONST uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* make exclusive-or pattern from polynomial (0xedb88320L) */ - xor = 0L; - for (n = 0; n < sizeof(p)/sizeof(uch); n++) - xor |= 1L << (31 - p[n]); -#else -# define xor 0xedb88320L -#endif - -#ifdef DYNALLOC_CRCTAB - crctab_p = (ulg near *) nearmalloc (CRC_TBLS*256*sizeof(ulg)); - if (crctab_p == NULL) { - ziperr(ZE_MEM, "crc_table allocation"); - } -#endif /* DYNALLOC_CRCTAB */ - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (ulg)n; - for (k = 8; k; k--) - c = c & 1 ? xor ^ (c >> 1) : c >> 1; - crctab_p[n] = REV_BE(c); - } - -#ifdef IZ_CRCOPTIM_UNFOLDTBL - /* generate crc for each value followed by one, two, and three zeros */ - for (n = 0; n < 256; n++) { - c = crctab_p[n]; - for (k = 1; k < 4; k++) { - c = CRC32(c, 0, crctab_p); - crctab_p[k*256+n] = c; - } - } -#endif /* IZ_CRCOPTIM_UNFOLDTBL */ - - MARK_CRCTAB_FILLED; -} - -#else /* !DYNAMIC_CRC_TABLE */ - -#ifdef DYNALLOC_CRCTAB - error: Inconsistent flags, DYNALLOC_CRCTAB without DYNAMIC_CRC_TABLE. -#endif - -/* ======================================================================== - * Table of CRC-32's of all single-byte values (made by make_crc_table) - */ -local ZCONST ulg near crc_table[CRC_TBLS*256] = { -# ifdef IZ_CRC_BE_OPTIMIZ - 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, - 0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L, - 0x1ee9d5e0L, 0x88d9d297L, 0x2b4cb609L, 0xbd7cb17eL, 0x072db8e7L, - 0x911dbf90L, 0x6410b71dL, 0xf220b06aL, 0x4871b9f3L, 0xde41be84L, - 0x7dd4da1aL, 0xebe4dd6dL, 0x51b5d4f4L, 0xc785d383L, 0x56986c13L, - 0xc0a86b64L, 0x7af962fdL, 0xecc9658aL, 0x4f5c0114L, 0xd96c0663L, - 0x633d0ffaL, 0xf50d088dL, 0xc8206e3bL, 0x5e10694cL, 0xe44160d5L, - 0x727167a2L, 0xd1e4033cL, 0x47d4044bL, 0xfd850dd2L, 0x6bb50aa5L, - 0xfaa8b535L, 0x6c98b242L, 0xd6c9bbdbL, 0x40f9bcacL, 0xe36cd832L, - 0x755cdf45L, 0xcf0dd6dcL, 0x593dd1abL, 0xac30d926L, 0x3a00de51L, - 0x8051d7c8L, 0x1661d0bfL, 0xb5f4b421L, 0x23c4b356L, 0x9995bacfL, - 0x0fa5bdb8L, 0x9eb80228L, 0x0888055fL, 0xb2d90cc6L, 0x24e90bb1L, - 0x877c6f2fL, 0x114c6858L, 0xab1d61c1L, 0x3d2d66b6L, 0x9041dc76L, - 0x0671db01L, 0xbc20d298L, 0x2a10d5efL, 0x8985b171L, 0x1fb5b606L, - 0xa5e4bf9fL, 0x33d4b8e8L, 0xa2c90778L, 0x34f9000fL, 0x8ea80996L, - 0x18980ee1L, 0xbb0d6a7fL, 0x2d3d6d08L, 0x976c6491L, 0x015c63e6L, - 0xf4516b6bL, 0x62616c1cL, 0xd8306585L, 0x4e0062f2L, 0xed95066cL, - 0x7ba5011bL, 0xc1f40882L, 0x57c40ff5L, 0xc6d9b065L, 0x50e9b712L, - 0xeab8be8bL, 0x7c88b9fcL, 0xdf1ddd62L, 0x492dda15L, 0xf37cd38cL, - 0x654cd4fbL, 0x5861b24dL, 0xce51b53aL, 0x7400bca3L, 0xe230bbd4L, - 0x41a5df4aL, 0xd795d83dL, 0x6dc4d1a4L, 0xfbf4d6d3L, 0x6ae96943L, - 0xfcd96e34L, 0x468867adL, 0xd0b860daL, 0x732d0444L, 0xe51d0333L, - 0x5f4c0aaaL, 0xc97c0dddL, 0x3c710550L, 0xaa410227L, 0x10100bbeL, - 0x86200cc9L, 0x25b56857L, 0xb3856f20L, 0x09d466b9L, 0x9fe461ceL, - 0x0ef9de5eL, 0x98c9d929L, 0x2298d0b0L, 0xb4a8d7c7L, 0x173db359L, - 0x810db42eL, 0x3b5cbdb7L, 0xad6cbac0L, 0x2083b8edL, 0xb6b3bf9aL, - 0x0ce2b603L, 0x9ad2b174L, 0x3947d5eaL, 0xaf77d29dL, 0x1526db04L, - 0x8316dc73L, 0x120b63e3L, 0x843b6494L, 0x3e6a6d0dL, 0xa85a6a7aL, - 0x0bcf0ee4L, 0x9dff0993L, 0x27ae000aL, 0xb19e077dL, 0x44930ff0L, - 0xd2a30887L, 0x68f2011eL, 0xfec20669L, 0x5d5762f7L, 0xcb676580L, - 0x71366c19L, 0xe7066b6eL, 0x761bd4feL, 0xe02bd389L, 0x5a7ada10L, - 0xcc4add67L, 0x6fdfb9f9L, 0xf9efbe8eL, 0x43beb717L, 0xd58eb060L, - 0xe8a3d6d6L, 0x7e93d1a1L, 0xc4c2d838L, 0x52f2df4fL, 0xf167bbd1L, - 0x6757bca6L, 0xdd06b53fL, 0x4b36b248L, 0xda2b0dd8L, 0x4c1b0aafL, - 0xf64a0336L, 0x607a0441L, 0xc3ef60dfL, 0x55df67a8L, 0xef8e6e31L, - 0x79be6946L, 0x8cb361cbL, 0x1a8366bcL, 0xa0d26f25L, 0x36e26852L, - 0x95770cccL, 0x03470bbbL, 0xb9160222L, 0x2f260555L, 0xbe3bbac5L, - 0x280bbdb2L, 0x925ab42bL, 0x046ab35cL, 0xa7ffd7c2L, 0x31cfd0b5L, - 0x8b9ed92cL, 0x1daede5bL, 0xb0c2649bL, 0x26f263ecL, 0x9ca36a75L, - 0x0a936d02L, 0xa906099cL, 0x3f360eebL, 0x85670772L, 0x13570005L, - 0x824abf95L, 0x147ab8e2L, 0xae2bb17bL, 0x381bb60cL, 0x9b8ed292L, - 0x0dbed5e5L, 0xb7efdc7cL, 0x21dfdb0bL, 0xd4d2d386L, 0x42e2d4f1L, - 0xf8b3dd68L, 0x6e83da1fL, 0xcd16be81L, 0x5b26b9f6L, 0xe177b06fL, - 0x7747b718L, 0xe65a0888L, 0x706a0fffL, 0xca3b0666L, 0x5c0b0111L, - 0xff9e658fL, 0x69ae62f8L, 0xd3ff6b61L, 0x45cf6c16L, 0x78e20aa0L, - 0xeed20dd7L, 0x5483044eL, 0xc2b30339L, 0x612667a7L, 0xf71660d0L, - 0x4d476949L, 0xdb776e3eL, 0x4a6ad1aeL, 0xdc5ad6d9L, 0x660bdf40L, - 0xf03bd837L, 0x53aebca9L, 0xc59ebbdeL, 0x7fcfb247L, 0xe9ffb530L, - 0x1cf2bdbdL, 0x8ac2bacaL, 0x3093b353L, 0xa6a3b424L, 0x0536d0baL, - 0x9306d7cdL, 0x2957de54L, 0xbf67d923L, 0x2e7a66b3L, 0xb84a61c4L, - 0x021b685dL, 0x942b6f2aL, 0x37be0bb4L, 0xa18e0cc3L, 0x1bdf055aL, - 0x8def022dL -# ifdef IZ_CRCOPTIM_UNFOLDTBL - , - 0x00000000L, 0x41311b19L, 0x82623632L, 0xc3532d2bL, 0x04c56c64L, - 0x45f4777dL, 0x86a75a56L, 0xc796414fL, 0x088ad9c8L, 0x49bbc2d1L, - 0x8ae8effaL, 0xcbd9f4e3L, 0x0c4fb5acL, 0x4d7eaeb5L, 0x8e2d839eL, - 0xcf1c9887L, 0x5112c24aL, 0x1023d953L, 0xd370f478L, 0x9241ef61L, - 0x55d7ae2eL, 0x14e6b537L, 0xd7b5981cL, 0x96848305L, 0x59981b82L, - 0x18a9009bL, 0xdbfa2db0L, 0x9acb36a9L, 0x5d5d77e6L, 0x1c6c6cffL, - 0xdf3f41d4L, 0x9e0e5acdL, 0xa2248495L, 0xe3159f8cL, 0x2046b2a7L, - 0x6177a9beL, 0xa6e1e8f1L, 0xe7d0f3e8L, 0x2483dec3L, 0x65b2c5daL, - 0xaaae5d5dL, 0xeb9f4644L, 0x28cc6b6fL, 0x69fd7076L, 0xae6b3139L, - 0xef5a2a20L, 0x2c09070bL, 0x6d381c12L, 0xf33646dfL, 0xb2075dc6L, - 0x715470edL, 0x30656bf4L, 0xf7f32abbL, 0xb6c231a2L, 0x75911c89L, - 0x34a00790L, 0xfbbc9f17L, 0xba8d840eL, 0x79dea925L, 0x38efb23cL, - 0xff79f373L, 0xbe48e86aL, 0x7d1bc541L, 0x3c2ade58L, 0x054f79f0L, - 0x447e62e9L, 0x872d4fc2L, 0xc61c54dbL, 0x018a1594L, 0x40bb0e8dL, - 0x83e823a6L, 0xc2d938bfL, 0x0dc5a038L, 0x4cf4bb21L, 0x8fa7960aL, - 0xce968d13L, 0x0900cc5cL, 0x4831d745L, 0x8b62fa6eL, 0xca53e177L, - 0x545dbbbaL, 0x156ca0a3L, 0xd63f8d88L, 0x970e9691L, 0x5098d7deL, - 0x11a9ccc7L, 0xd2fae1ecL, 0x93cbfaf5L, 0x5cd76272L, 0x1de6796bL, - 0xdeb55440L, 0x9f844f59L, 0x58120e16L, 0x1923150fL, 0xda703824L, - 0x9b41233dL, 0xa76bfd65L, 0xe65ae67cL, 0x2509cb57L, 0x6438d04eL, - 0xa3ae9101L, 0xe29f8a18L, 0x21cca733L, 0x60fdbc2aL, 0xafe124adL, - 0xeed03fb4L, 0x2d83129fL, 0x6cb20986L, 0xab2448c9L, 0xea1553d0L, - 0x29467efbL, 0x687765e2L, 0xf6793f2fL, 0xb7482436L, 0x741b091dL, - 0x352a1204L, 0xf2bc534bL, 0xb38d4852L, 0x70de6579L, 0x31ef7e60L, - 0xfef3e6e7L, 0xbfc2fdfeL, 0x7c91d0d5L, 0x3da0cbccL, 0xfa368a83L, - 0xbb07919aL, 0x7854bcb1L, 0x3965a7a8L, 0x4b98833bL, 0x0aa99822L, - 0xc9fab509L, 0x88cbae10L, 0x4f5def5fL, 0x0e6cf446L, 0xcd3fd96dL, - 0x8c0ec274L, 0x43125af3L, 0x022341eaL, 0xc1706cc1L, 0x804177d8L, - 0x47d73697L, 0x06e62d8eL, 0xc5b500a5L, 0x84841bbcL, 0x1a8a4171L, - 0x5bbb5a68L, 0x98e87743L, 0xd9d96c5aL, 0x1e4f2d15L, 0x5f7e360cL, - 0x9c2d1b27L, 0xdd1c003eL, 0x120098b9L, 0x533183a0L, 0x9062ae8bL, - 0xd153b592L, 0x16c5f4ddL, 0x57f4efc4L, 0x94a7c2efL, 0xd596d9f6L, - 0xe9bc07aeL, 0xa88d1cb7L, 0x6bde319cL, 0x2aef2a85L, 0xed796bcaL, - 0xac4870d3L, 0x6f1b5df8L, 0x2e2a46e1L, 0xe136de66L, 0xa007c57fL, - 0x6354e854L, 0x2265f34dL, 0xe5f3b202L, 0xa4c2a91bL, 0x67918430L, - 0x26a09f29L, 0xb8aec5e4L, 0xf99fdefdL, 0x3accf3d6L, 0x7bfde8cfL, - 0xbc6ba980L, 0xfd5ab299L, 0x3e099fb2L, 0x7f3884abL, 0xb0241c2cL, - 0xf1150735L, 0x32462a1eL, 0x73773107L, 0xb4e17048L, 0xf5d06b51L, - 0x3683467aL, 0x77b25d63L, 0x4ed7facbL, 0x0fe6e1d2L, 0xccb5ccf9L, - 0x8d84d7e0L, 0x4a1296afL, 0x0b238db6L, 0xc870a09dL, 0x8941bb84L, - 0x465d2303L, 0x076c381aL, 0xc43f1531L, 0x850e0e28L, 0x42984f67L, - 0x03a9547eL, 0xc0fa7955L, 0x81cb624cL, 0x1fc53881L, 0x5ef42398L, - 0x9da70eb3L, 0xdc9615aaL, 0x1b0054e5L, 0x5a314ffcL, 0x996262d7L, - 0xd85379ceL, 0x174fe149L, 0x567efa50L, 0x952dd77bL, 0xd41ccc62L, - 0x138a8d2dL, 0x52bb9634L, 0x91e8bb1fL, 0xd0d9a006L, 0xecf37e5eL, - 0xadc26547L, 0x6e91486cL, 0x2fa05375L, 0xe836123aL, 0xa9070923L, - 0x6a542408L, 0x2b653f11L, 0xe479a796L, 0xa548bc8fL, 0x661b91a4L, - 0x272a8abdL, 0xe0bccbf2L, 0xa18dd0ebL, 0x62defdc0L, 0x23efe6d9L, - 0xbde1bc14L, 0xfcd0a70dL, 0x3f838a26L, 0x7eb2913fL, 0xb924d070L, - 0xf815cb69L, 0x3b46e642L, 0x7a77fd5bL, 0xb56b65dcL, 0xf45a7ec5L, - 0x370953eeL, 0x763848f7L, 0xb1ae09b8L, 0xf09f12a1L, 0x33cc3f8aL, - 0x72fd2493L - , - 0x00000000L, 0x376ac201L, 0x6ed48403L, 0x59be4602L, 0xdca80907L, - 0xebc2cb06L, 0xb27c8d04L, 0x85164f05L, 0xb851130eL, 0x8f3bd10fL, - 0xd685970dL, 0xe1ef550cL, 0x64f91a09L, 0x5393d808L, 0x0a2d9e0aL, - 0x3d475c0bL, 0x70a3261cL, 0x47c9e41dL, 0x1e77a21fL, 0x291d601eL, - 0xac0b2f1bL, 0x9b61ed1aL, 0xc2dfab18L, 0xf5b56919L, 0xc8f23512L, - 0xff98f713L, 0xa626b111L, 0x914c7310L, 0x145a3c15L, 0x2330fe14L, - 0x7a8eb816L, 0x4de47a17L, 0xe0464d38L, 0xd72c8f39L, 0x8e92c93bL, - 0xb9f80b3aL, 0x3cee443fL, 0x0b84863eL, 0x523ac03cL, 0x6550023dL, - 0x58175e36L, 0x6f7d9c37L, 0x36c3da35L, 0x01a91834L, 0x84bf5731L, - 0xb3d59530L, 0xea6bd332L, 0xdd011133L, 0x90e56b24L, 0xa78fa925L, - 0xfe31ef27L, 0xc95b2d26L, 0x4c4d6223L, 0x7b27a022L, 0x2299e620L, - 0x15f32421L, 0x28b4782aL, 0x1fdeba2bL, 0x4660fc29L, 0x710a3e28L, - 0xf41c712dL, 0xc376b32cL, 0x9ac8f52eL, 0xada2372fL, 0xc08d9a70L, - 0xf7e75871L, 0xae591e73L, 0x9933dc72L, 0x1c259377L, 0x2b4f5176L, - 0x72f11774L, 0x459bd575L, 0x78dc897eL, 0x4fb64b7fL, 0x16080d7dL, - 0x2162cf7cL, 0xa4748079L, 0x931e4278L, 0xcaa0047aL, 0xfdcac67bL, - 0xb02ebc6cL, 0x87447e6dL, 0xdefa386fL, 0xe990fa6eL, 0x6c86b56bL, - 0x5bec776aL, 0x02523168L, 0x3538f369L, 0x087faf62L, 0x3f156d63L, - 0x66ab2b61L, 0x51c1e960L, 0xd4d7a665L, 0xe3bd6464L, 0xba032266L, - 0x8d69e067L, 0x20cbd748L, 0x17a11549L, 0x4e1f534bL, 0x7975914aL, - 0xfc63de4fL, 0xcb091c4eL, 0x92b75a4cL, 0xa5dd984dL, 0x989ac446L, - 0xaff00647L, 0xf64e4045L, 0xc1248244L, 0x4432cd41L, 0x73580f40L, - 0x2ae64942L, 0x1d8c8b43L, 0x5068f154L, 0x67023355L, 0x3ebc7557L, - 0x09d6b756L, 0x8cc0f853L, 0xbbaa3a52L, 0xe2147c50L, 0xd57ebe51L, - 0xe839e25aL, 0xdf53205bL, 0x86ed6659L, 0xb187a458L, 0x3491eb5dL, - 0x03fb295cL, 0x5a456f5eL, 0x6d2fad5fL, 0x801b35e1L, 0xb771f7e0L, - 0xeecfb1e2L, 0xd9a573e3L, 0x5cb33ce6L, 0x6bd9fee7L, 0x3267b8e5L, - 0x050d7ae4L, 0x384a26efL, 0x0f20e4eeL, 0x569ea2ecL, 0x61f460edL, - 0xe4e22fe8L, 0xd388ede9L, 0x8a36abebL, 0xbd5c69eaL, 0xf0b813fdL, - 0xc7d2d1fcL, 0x9e6c97feL, 0xa90655ffL, 0x2c101afaL, 0x1b7ad8fbL, - 0x42c49ef9L, 0x75ae5cf8L, 0x48e900f3L, 0x7f83c2f2L, 0x263d84f0L, - 0x115746f1L, 0x944109f4L, 0xa32bcbf5L, 0xfa958df7L, 0xcdff4ff6L, - 0x605d78d9L, 0x5737bad8L, 0x0e89fcdaL, 0x39e33edbL, 0xbcf571deL, - 0x8b9fb3dfL, 0xd221f5ddL, 0xe54b37dcL, 0xd80c6bd7L, 0xef66a9d6L, - 0xb6d8efd4L, 0x81b22dd5L, 0x04a462d0L, 0x33cea0d1L, 0x6a70e6d3L, - 0x5d1a24d2L, 0x10fe5ec5L, 0x27949cc4L, 0x7e2adac6L, 0x494018c7L, - 0xcc5657c2L, 0xfb3c95c3L, 0xa282d3c1L, 0x95e811c0L, 0xa8af4dcbL, - 0x9fc58fcaL, 0xc67bc9c8L, 0xf1110bc9L, 0x740744ccL, 0x436d86cdL, - 0x1ad3c0cfL, 0x2db902ceL, 0x4096af91L, 0x77fc6d90L, 0x2e422b92L, - 0x1928e993L, 0x9c3ea696L, 0xab546497L, 0xf2ea2295L, 0xc580e094L, - 0xf8c7bc9fL, 0xcfad7e9eL, 0x9613389cL, 0xa179fa9dL, 0x246fb598L, - 0x13057799L, 0x4abb319bL, 0x7dd1f39aL, 0x3035898dL, 0x075f4b8cL, - 0x5ee10d8eL, 0x698bcf8fL, 0xec9d808aL, 0xdbf7428bL, 0x82490489L, - 0xb523c688L, 0x88649a83L, 0xbf0e5882L, 0xe6b01e80L, 0xd1dadc81L, - 0x54cc9384L, 0x63a65185L, 0x3a181787L, 0x0d72d586L, 0xa0d0e2a9L, - 0x97ba20a8L, 0xce0466aaL, 0xf96ea4abL, 0x7c78ebaeL, 0x4b1229afL, - 0x12ac6fadL, 0x25c6adacL, 0x1881f1a7L, 0x2feb33a6L, 0x765575a4L, - 0x413fb7a5L, 0xc429f8a0L, 0xf3433aa1L, 0xaafd7ca3L, 0x9d97bea2L, - 0xd073c4b5L, 0xe71906b4L, 0xbea740b6L, 0x89cd82b7L, 0x0cdbcdb2L, - 0x3bb10fb3L, 0x620f49b1L, 0x55658bb0L, 0x6822d7bbL, 0x5f4815baL, - 0x06f653b8L, 0x319c91b9L, 0xb48adebcL, 0x83e01cbdL, 0xda5e5abfL, - 0xed3498beL - , - 0x00000000L, 0x6567bcb8L, 0x8bc809aaL, 0xeeafb512L, 0x5797628fL, - 0x32f0de37L, 0xdc5f6b25L, 0xb938d79dL, 0xef28b4c5L, 0x8a4f087dL, - 0x64e0bd6fL, 0x018701d7L, 0xb8bfd64aL, 0xddd86af2L, 0x3377dfe0L, - 0x56106358L, 0x9f571950L, 0xfa30a5e8L, 0x149f10faL, 0x71f8ac42L, - 0xc8c07bdfL, 0xada7c767L, 0x43087275L, 0x266fcecdL, 0x707fad95L, - 0x1518112dL, 0xfbb7a43fL, 0x9ed01887L, 0x27e8cf1aL, 0x428f73a2L, - 0xac20c6b0L, 0xc9477a08L, 0x3eaf32a0L, 0x5bc88e18L, 0xb5673b0aL, - 0xd00087b2L, 0x6938502fL, 0x0c5fec97L, 0xe2f05985L, 0x8797e53dL, - 0xd1878665L, 0xb4e03addL, 0x5a4f8fcfL, 0x3f283377L, 0x8610e4eaL, - 0xe3775852L, 0x0dd8ed40L, 0x68bf51f8L, 0xa1f82bf0L, 0xc49f9748L, - 0x2a30225aL, 0x4f579ee2L, 0xf66f497fL, 0x9308f5c7L, 0x7da740d5L, - 0x18c0fc6dL, 0x4ed09f35L, 0x2bb7238dL, 0xc518969fL, 0xa07f2a27L, - 0x1947fdbaL, 0x7c204102L, 0x928ff410L, 0xf7e848a8L, 0x3d58149bL, - 0x583fa823L, 0xb6901d31L, 0xd3f7a189L, 0x6acf7614L, 0x0fa8caacL, - 0xe1077fbeL, 0x8460c306L, 0xd270a05eL, 0xb7171ce6L, 0x59b8a9f4L, - 0x3cdf154cL, 0x85e7c2d1L, 0xe0807e69L, 0x0e2fcb7bL, 0x6b4877c3L, - 0xa20f0dcbL, 0xc768b173L, 0x29c70461L, 0x4ca0b8d9L, 0xf5986f44L, - 0x90ffd3fcL, 0x7e5066eeL, 0x1b37da56L, 0x4d27b90eL, 0x284005b6L, - 0xc6efb0a4L, 0xa3880c1cL, 0x1ab0db81L, 0x7fd76739L, 0x9178d22bL, - 0xf41f6e93L, 0x03f7263bL, 0x66909a83L, 0x883f2f91L, 0xed589329L, - 0x546044b4L, 0x3107f80cL, 0xdfa84d1eL, 0xbacff1a6L, 0xecdf92feL, - 0x89b82e46L, 0x67179b54L, 0x027027ecL, 0xbb48f071L, 0xde2f4cc9L, - 0x3080f9dbL, 0x55e74563L, 0x9ca03f6bL, 0xf9c783d3L, 0x176836c1L, - 0x720f8a79L, 0xcb375de4L, 0xae50e15cL, 0x40ff544eL, 0x2598e8f6L, - 0x73888baeL, 0x16ef3716L, 0xf8408204L, 0x9d273ebcL, 0x241fe921L, - 0x41785599L, 0xafd7e08bL, 0xcab05c33L, 0x3bb659edL, 0x5ed1e555L, - 0xb07e5047L, 0xd519ecffL, 0x6c213b62L, 0x094687daL, 0xe7e932c8L, - 0x828e8e70L, 0xd49eed28L, 0xb1f95190L, 0x5f56e482L, 0x3a31583aL, - 0x83098fa7L, 0xe66e331fL, 0x08c1860dL, 0x6da63ab5L, 0xa4e140bdL, - 0xc186fc05L, 0x2f294917L, 0x4a4ef5afL, 0xf3762232L, 0x96119e8aL, - 0x78be2b98L, 0x1dd99720L, 0x4bc9f478L, 0x2eae48c0L, 0xc001fdd2L, - 0xa566416aL, 0x1c5e96f7L, 0x79392a4fL, 0x97969f5dL, 0xf2f123e5L, - 0x05196b4dL, 0x607ed7f5L, 0x8ed162e7L, 0xebb6de5fL, 0x528e09c2L, - 0x37e9b57aL, 0xd9460068L, 0xbc21bcd0L, 0xea31df88L, 0x8f566330L, - 0x61f9d622L, 0x049e6a9aL, 0xbda6bd07L, 0xd8c101bfL, 0x366eb4adL, - 0x53090815L, 0x9a4e721dL, 0xff29cea5L, 0x11867bb7L, 0x74e1c70fL, - 0xcdd91092L, 0xa8beac2aL, 0x46111938L, 0x2376a580L, 0x7566c6d8L, - 0x10017a60L, 0xfeaecf72L, 0x9bc973caL, 0x22f1a457L, 0x479618efL, - 0xa939adfdL, 0xcc5e1145L, 0x06ee4d76L, 0x6389f1ceL, 0x8d2644dcL, - 0xe841f864L, 0x51792ff9L, 0x341e9341L, 0xdab12653L, 0xbfd69aebL, - 0xe9c6f9b3L, 0x8ca1450bL, 0x620ef019L, 0x07694ca1L, 0xbe519b3cL, - 0xdb362784L, 0x35999296L, 0x50fe2e2eL, 0x99b95426L, 0xfcdee89eL, - 0x12715d8cL, 0x7716e134L, 0xce2e36a9L, 0xab498a11L, 0x45e63f03L, - 0x208183bbL, 0x7691e0e3L, 0x13f65c5bL, 0xfd59e949L, 0x983e55f1L, - 0x2106826cL, 0x44613ed4L, 0xaace8bc6L, 0xcfa9377eL, 0x38417fd6L, - 0x5d26c36eL, 0xb389767cL, 0xd6eecac4L, 0x6fd61d59L, 0x0ab1a1e1L, - 0xe41e14f3L, 0x8179a84bL, 0xd769cb13L, 0xb20e77abL, 0x5ca1c2b9L, - 0x39c67e01L, 0x80fea99cL, 0xe5991524L, 0x0b36a036L, 0x6e511c8eL, - 0xa7166686L, 0xc271da3eL, 0x2cde6f2cL, 0x49b9d394L, 0xf0810409L, - 0x95e6b8b1L, 0x7b490da3L, 0x1e2eb11bL, 0x483ed243L, 0x2d596efbL, - 0xc3f6dbe9L, 0xa6916751L, 0x1fa9b0ccL, 0x7ace0c74L, 0x9461b966L, - 0xf10605deL -# endif /* IZ_CRCOPTIM_UNFOLDTBL */ -# else /* !IZ_CRC_BE_OPTIMIZ */ - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL -# ifdef IZ_CRCOPTIM_UNFOLDTBL - , - 0x00000000L, 0x191b3141L, 0x32366282L, 0x2b2d53c3L, 0x646cc504L, - 0x7d77f445L, 0x565aa786L, 0x4f4196c7L, 0xc8d98a08L, 0xd1c2bb49L, - 0xfaefe88aL, 0xe3f4d9cbL, 0xacb54f0cL, 0xb5ae7e4dL, 0x9e832d8eL, - 0x87981ccfL, 0x4ac21251L, 0x53d92310L, 0x78f470d3L, 0x61ef4192L, - 0x2eaed755L, 0x37b5e614L, 0x1c98b5d7L, 0x05838496L, 0x821b9859L, - 0x9b00a918L, 0xb02dfadbL, 0xa936cb9aL, 0xe6775d5dL, 0xff6c6c1cL, - 0xd4413fdfL, 0xcd5a0e9eL, 0x958424a2L, 0x8c9f15e3L, 0xa7b24620L, - 0xbea97761L, 0xf1e8e1a6L, 0xe8f3d0e7L, 0xc3de8324L, 0xdac5b265L, - 0x5d5daeaaL, 0x44469febL, 0x6f6bcc28L, 0x7670fd69L, 0x39316baeL, - 0x202a5aefL, 0x0b07092cL, 0x121c386dL, 0xdf4636f3L, 0xc65d07b2L, - 0xed705471L, 0xf46b6530L, 0xbb2af3f7L, 0xa231c2b6L, 0x891c9175L, - 0x9007a034L, 0x179fbcfbL, 0x0e848dbaL, 0x25a9de79L, 0x3cb2ef38L, - 0x73f379ffL, 0x6ae848beL, 0x41c51b7dL, 0x58de2a3cL, 0xf0794f05L, - 0xe9627e44L, 0xc24f2d87L, 0xdb541cc6L, 0x94158a01L, 0x8d0ebb40L, - 0xa623e883L, 0xbf38d9c2L, 0x38a0c50dL, 0x21bbf44cL, 0x0a96a78fL, - 0x138d96ceL, 0x5ccc0009L, 0x45d73148L, 0x6efa628bL, 0x77e153caL, - 0xbabb5d54L, 0xa3a06c15L, 0x888d3fd6L, 0x91960e97L, 0xded79850L, - 0xc7cca911L, 0xece1fad2L, 0xf5facb93L, 0x7262d75cL, 0x6b79e61dL, - 0x4054b5deL, 0x594f849fL, 0x160e1258L, 0x0f152319L, 0x243870daL, - 0x3d23419bL, 0x65fd6ba7L, 0x7ce65ae6L, 0x57cb0925L, 0x4ed03864L, - 0x0191aea3L, 0x188a9fe2L, 0x33a7cc21L, 0x2abcfd60L, 0xad24e1afL, - 0xb43fd0eeL, 0x9f12832dL, 0x8609b26cL, 0xc94824abL, 0xd05315eaL, - 0xfb7e4629L, 0xe2657768L, 0x2f3f79f6L, 0x362448b7L, 0x1d091b74L, - 0x04122a35L, 0x4b53bcf2L, 0x52488db3L, 0x7965de70L, 0x607eef31L, - 0xe7e6f3feL, 0xfefdc2bfL, 0xd5d0917cL, 0xcccba03dL, 0x838a36faL, - 0x9a9107bbL, 0xb1bc5478L, 0xa8a76539L, 0x3b83984bL, 0x2298a90aL, - 0x09b5fac9L, 0x10aecb88L, 0x5fef5d4fL, 0x46f46c0eL, 0x6dd93fcdL, - 0x74c20e8cL, 0xf35a1243L, 0xea412302L, 0xc16c70c1L, 0xd8774180L, - 0x9736d747L, 0x8e2de606L, 0xa500b5c5L, 0xbc1b8484L, 0x71418a1aL, - 0x685abb5bL, 0x4377e898L, 0x5a6cd9d9L, 0x152d4f1eL, 0x0c367e5fL, - 0x271b2d9cL, 0x3e001cddL, 0xb9980012L, 0xa0833153L, 0x8bae6290L, - 0x92b553d1L, 0xddf4c516L, 0xc4eff457L, 0xefc2a794L, 0xf6d996d5L, - 0xae07bce9L, 0xb71c8da8L, 0x9c31de6bL, 0x852aef2aL, 0xca6b79edL, - 0xd37048acL, 0xf85d1b6fL, 0xe1462a2eL, 0x66de36e1L, 0x7fc507a0L, - 0x54e85463L, 0x4df36522L, 0x02b2f3e5L, 0x1ba9c2a4L, 0x30849167L, - 0x299fa026L, 0xe4c5aeb8L, 0xfdde9ff9L, 0xd6f3cc3aL, 0xcfe8fd7bL, - 0x80a96bbcL, 0x99b25afdL, 0xb29f093eL, 0xab84387fL, 0x2c1c24b0L, - 0x350715f1L, 0x1e2a4632L, 0x07317773L, 0x4870e1b4L, 0x516bd0f5L, - 0x7a468336L, 0x635db277L, 0xcbfad74eL, 0xd2e1e60fL, 0xf9ccb5ccL, - 0xe0d7848dL, 0xaf96124aL, 0xb68d230bL, 0x9da070c8L, 0x84bb4189L, - 0x03235d46L, 0x1a386c07L, 0x31153fc4L, 0x280e0e85L, 0x674f9842L, - 0x7e54a903L, 0x5579fac0L, 0x4c62cb81L, 0x8138c51fL, 0x9823f45eL, - 0xb30ea79dL, 0xaa1596dcL, 0xe554001bL, 0xfc4f315aL, 0xd7626299L, - 0xce7953d8L, 0x49e14f17L, 0x50fa7e56L, 0x7bd72d95L, 0x62cc1cd4L, - 0x2d8d8a13L, 0x3496bb52L, 0x1fbbe891L, 0x06a0d9d0L, 0x5e7ef3ecL, - 0x4765c2adL, 0x6c48916eL, 0x7553a02fL, 0x3a1236e8L, 0x230907a9L, - 0x0824546aL, 0x113f652bL, 0x96a779e4L, 0x8fbc48a5L, 0xa4911b66L, - 0xbd8a2a27L, 0xf2cbbce0L, 0xebd08da1L, 0xc0fdde62L, 0xd9e6ef23L, - 0x14bce1bdL, 0x0da7d0fcL, 0x268a833fL, 0x3f91b27eL, 0x70d024b9L, - 0x69cb15f8L, 0x42e6463bL, 0x5bfd777aL, 0xdc656bb5L, 0xc57e5af4L, - 0xee530937L, 0xf7483876L, 0xb809aeb1L, 0xa1129ff0L, 0x8a3fcc33L, - 0x9324fd72L - , - 0x00000000L, 0x01c26a37L, 0x0384d46eL, 0x0246be59L, 0x0709a8dcL, - 0x06cbc2ebL, 0x048d7cb2L, 0x054f1685L, 0x0e1351b8L, 0x0fd13b8fL, - 0x0d9785d6L, 0x0c55efe1L, 0x091af964L, 0x08d89353L, 0x0a9e2d0aL, - 0x0b5c473dL, 0x1c26a370L, 0x1de4c947L, 0x1fa2771eL, 0x1e601d29L, - 0x1b2f0bacL, 0x1aed619bL, 0x18abdfc2L, 0x1969b5f5L, 0x1235f2c8L, - 0x13f798ffL, 0x11b126a6L, 0x10734c91L, 0x153c5a14L, 0x14fe3023L, - 0x16b88e7aL, 0x177ae44dL, 0x384d46e0L, 0x398f2cd7L, 0x3bc9928eL, - 0x3a0bf8b9L, 0x3f44ee3cL, 0x3e86840bL, 0x3cc03a52L, 0x3d025065L, - 0x365e1758L, 0x379c7d6fL, 0x35dac336L, 0x3418a901L, 0x3157bf84L, - 0x3095d5b3L, 0x32d36beaL, 0x331101ddL, 0x246be590L, 0x25a98fa7L, - 0x27ef31feL, 0x262d5bc9L, 0x23624d4cL, 0x22a0277bL, 0x20e69922L, - 0x2124f315L, 0x2a78b428L, 0x2bbade1fL, 0x29fc6046L, 0x283e0a71L, - 0x2d711cf4L, 0x2cb376c3L, 0x2ef5c89aL, 0x2f37a2adL, 0x709a8dc0L, - 0x7158e7f7L, 0x731e59aeL, 0x72dc3399L, 0x7793251cL, 0x76514f2bL, - 0x7417f172L, 0x75d59b45L, 0x7e89dc78L, 0x7f4bb64fL, 0x7d0d0816L, - 0x7ccf6221L, 0x798074a4L, 0x78421e93L, 0x7a04a0caL, 0x7bc6cafdL, - 0x6cbc2eb0L, 0x6d7e4487L, 0x6f38fadeL, 0x6efa90e9L, 0x6bb5866cL, - 0x6a77ec5bL, 0x68315202L, 0x69f33835L, 0x62af7f08L, 0x636d153fL, - 0x612bab66L, 0x60e9c151L, 0x65a6d7d4L, 0x6464bde3L, 0x662203baL, - 0x67e0698dL, 0x48d7cb20L, 0x4915a117L, 0x4b531f4eL, 0x4a917579L, - 0x4fde63fcL, 0x4e1c09cbL, 0x4c5ab792L, 0x4d98dda5L, 0x46c49a98L, - 0x4706f0afL, 0x45404ef6L, 0x448224c1L, 0x41cd3244L, 0x400f5873L, - 0x4249e62aL, 0x438b8c1dL, 0x54f16850L, 0x55330267L, 0x5775bc3eL, - 0x56b7d609L, 0x53f8c08cL, 0x523aaabbL, 0x507c14e2L, 0x51be7ed5L, - 0x5ae239e8L, 0x5b2053dfL, 0x5966ed86L, 0x58a487b1L, 0x5deb9134L, - 0x5c29fb03L, 0x5e6f455aL, 0x5fad2f6dL, 0xe1351b80L, 0xe0f771b7L, - 0xe2b1cfeeL, 0xe373a5d9L, 0xe63cb35cL, 0xe7fed96bL, 0xe5b86732L, - 0xe47a0d05L, 0xef264a38L, 0xeee4200fL, 0xeca29e56L, 0xed60f461L, - 0xe82fe2e4L, 0xe9ed88d3L, 0xebab368aL, 0xea695cbdL, 0xfd13b8f0L, - 0xfcd1d2c7L, 0xfe976c9eL, 0xff5506a9L, 0xfa1a102cL, 0xfbd87a1bL, - 0xf99ec442L, 0xf85cae75L, 0xf300e948L, 0xf2c2837fL, 0xf0843d26L, - 0xf1465711L, 0xf4094194L, 0xf5cb2ba3L, 0xf78d95faL, 0xf64fffcdL, - 0xd9785d60L, 0xd8ba3757L, 0xdafc890eL, 0xdb3ee339L, 0xde71f5bcL, - 0xdfb39f8bL, 0xddf521d2L, 0xdc374be5L, 0xd76b0cd8L, 0xd6a966efL, - 0xd4efd8b6L, 0xd52db281L, 0xd062a404L, 0xd1a0ce33L, 0xd3e6706aL, - 0xd2241a5dL, 0xc55efe10L, 0xc49c9427L, 0xc6da2a7eL, 0xc7184049L, - 0xc25756ccL, 0xc3953cfbL, 0xc1d382a2L, 0xc011e895L, 0xcb4dafa8L, - 0xca8fc59fL, 0xc8c97bc6L, 0xc90b11f1L, 0xcc440774L, 0xcd866d43L, - 0xcfc0d31aL, 0xce02b92dL, 0x91af9640L, 0x906dfc77L, 0x922b422eL, - 0x93e92819L, 0x96a63e9cL, 0x976454abL, 0x9522eaf2L, 0x94e080c5L, - 0x9fbcc7f8L, 0x9e7eadcfL, 0x9c381396L, 0x9dfa79a1L, 0x98b56f24L, - 0x99770513L, 0x9b31bb4aL, 0x9af3d17dL, 0x8d893530L, 0x8c4b5f07L, - 0x8e0de15eL, 0x8fcf8b69L, 0x8a809decL, 0x8b42f7dbL, 0x89044982L, - 0x88c623b5L, 0x839a6488L, 0x82580ebfL, 0x801eb0e6L, 0x81dcdad1L, - 0x8493cc54L, 0x8551a663L, 0x8717183aL, 0x86d5720dL, 0xa9e2d0a0L, - 0xa820ba97L, 0xaa6604ceL, 0xaba46ef9L, 0xaeeb787cL, 0xaf29124bL, - 0xad6fac12L, 0xacadc625L, 0xa7f18118L, 0xa633eb2fL, 0xa4755576L, - 0xa5b73f41L, 0xa0f829c4L, 0xa13a43f3L, 0xa37cfdaaL, 0xa2be979dL, - 0xb5c473d0L, 0xb40619e7L, 0xb640a7beL, 0xb782cd89L, 0xb2cddb0cL, - 0xb30fb13bL, 0xb1490f62L, 0xb08b6555L, 0xbbd72268L, 0xba15485fL, - 0xb853f606L, 0xb9919c31L, 0xbcde8ab4L, 0xbd1ce083L, 0xbf5a5edaL, - 0xbe9834edL - , - 0x00000000L, 0xb8bc6765L, 0xaa09c88bL, 0x12b5afeeL, 0x8f629757L, - 0x37def032L, 0x256b5fdcL, 0x9dd738b9L, 0xc5b428efL, 0x7d084f8aL, - 0x6fbde064L, 0xd7018701L, 0x4ad6bfb8L, 0xf26ad8ddL, 0xe0df7733L, - 0x58631056L, 0x5019579fL, 0xe8a530faL, 0xfa109f14L, 0x42acf871L, - 0xdf7bc0c8L, 0x67c7a7adL, 0x75720843L, 0xcdce6f26L, 0x95ad7f70L, - 0x2d111815L, 0x3fa4b7fbL, 0x8718d09eL, 0x1acfe827L, 0xa2738f42L, - 0xb0c620acL, 0x087a47c9L, 0xa032af3eL, 0x188ec85bL, 0x0a3b67b5L, - 0xb28700d0L, 0x2f503869L, 0x97ec5f0cL, 0x8559f0e2L, 0x3de59787L, - 0x658687d1L, 0xdd3ae0b4L, 0xcf8f4f5aL, 0x7733283fL, 0xeae41086L, - 0x525877e3L, 0x40edd80dL, 0xf851bf68L, 0xf02bf8a1L, 0x48979fc4L, - 0x5a22302aL, 0xe29e574fL, 0x7f496ff6L, 0xc7f50893L, 0xd540a77dL, - 0x6dfcc018L, 0x359fd04eL, 0x8d23b72bL, 0x9f9618c5L, 0x272a7fa0L, - 0xbafd4719L, 0x0241207cL, 0x10f48f92L, 0xa848e8f7L, 0x9b14583dL, - 0x23a83f58L, 0x311d90b6L, 0x89a1f7d3L, 0x1476cf6aL, 0xaccaa80fL, - 0xbe7f07e1L, 0x06c36084L, 0x5ea070d2L, 0xe61c17b7L, 0xf4a9b859L, - 0x4c15df3cL, 0xd1c2e785L, 0x697e80e0L, 0x7bcb2f0eL, 0xc377486bL, - 0xcb0d0fa2L, 0x73b168c7L, 0x6104c729L, 0xd9b8a04cL, 0x446f98f5L, - 0xfcd3ff90L, 0xee66507eL, 0x56da371bL, 0x0eb9274dL, 0xb6054028L, - 0xa4b0efc6L, 0x1c0c88a3L, 0x81dbb01aL, 0x3967d77fL, 0x2bd27891L, - 0x936e1ff4L, 0x3b26f703L, 0x839a9066L, 0x912f3f88L, 0x299358edL, - 0xb4446054L, 0x0cf80731L, 0x1e4da8dfL, 0xa6f1cfbaL, 0xfe92dfecL, - 0x462eb889L, 0x549b1767L, 0xec277002L, 0x71f048bbL, 0xc94c2fdeL, - 0xdbf98030L, 0x6345e755L, 0x6b3fa09cL, 0xd383c7f9L, 0xc1366817L, - 0x798a0f72L, 0xe45d37cbL, 0x5ce150aeL, 0x4e54ff40L, 0xf6e89825L, - 0xae8b8873L, 0x1637ef16L, 0x048240f8L, 0xbc3e279dL, 0x21e91f24L, - 0x99557841L, 0x8be0d7afL, 0x335cb0caL, 0xed59b63bL, 0x55e5d15eL, - 0x47507eb0L, 0xffec19d5L, 0x623b216cL, 0xda874609L, 0xc832e9e7L, - 0x708e8e82L, 0x28ed9ed4L, 0x9051f9b1L, 0x82e4565fL, 0x3a58313aL, - 0xa78f0983L, 0x1f336ee6L, 0x0d86c108L, 0xb53aa66dL, 0xbd40e1a4L, - 0x05fc86c1L, 0x1749292fL, 0xaff54e4aL, 0x322276f3L, 0x8a9e1196L, - 0x982bbe78L, 0x2097d91dL, 0x78f4c94bL, 0xc048ae2eL, 0xd2fd01c0L, - 0x6a4166a5L, 0xf7965e1cL, 0x4f2a3979L, 0x5d9f9697L, 0xe523f1f2L, - 0x4d6b1905L, 0xf5d77e60L, 0xe762d18eL, 0x5fdeb6ebL, 0xc2098e52L, - 0x7ab5e937L, 0x680046d9L, 0xd0bc21bcL, 0x88df31eaL, 0x3063568fL, - 0x22d6f961L, 0x9a6a9e04L, 0x07bda6bdL, 0xbf01c1d8L, 0xadb46e36L, - 0x15080953L, 0x1d724e9aL, 0xa5ce29ffL, 0xb77b8611L, 0x0fc7e174L, - 0x9210d9cdL, 0x2aacbea8L, 0x38191146L, 0x80a57623L, 0xd8c66675L, - 0x607a0110L, 0x72cfaefeL, 0xca73c99bL, 0x57a4f122L, 0xef189647L, - 0xfdad39a9L, 0x45115eccL, 0x764dee06L, 0xcef18963L, 0xdc44268dL, - 0x64f841e8L, 0xf92f7951L, 0x41931e34L, 0x5326b1daL, 0xeb9ad6bfL, - 0xb3f9c6e9L, 0x0b45a18cL, 0x19f00e62L, 0xa14c6907L, 0x3c9b51beL, - 0x842736dbL, 0x96929935L, 0x2e2efe50L, 0x2654b999L, 0x9ee8defcL, - 0x8c5d7112L, 0x34e11677L, 0xa9362eceL, 0x118a49abL, 0x033fe645L, - 0xbb838120L, 0xe3e09176L, 0x5b5cf613L, 0x49e959fdL, 0xf1553e98L, - 0x6c820621L, 0xd43e6144L, 0xc68bceaaL, 0x7e37a9cfL, 0xd67f4138L, - 0x6ec3265dL, 0x7c7689b3L, 0xc4caeed6L, 0x591dd66fL, 0xe1a1b10aL, - 0xf3141ee4L, 0x4ba87981L, 0x13cb69d7L, 0xab770eb2L, 0xb9c2a15cL, - 0x017ec639L, 0x9ca9fe80L, 0x241599e5L, 0x36a0360bL, 0x8e1c516eL, - 0x866616a7L, 0x3eda71c2L, 0x2c6fde2cL, 0x94d3b949L, 0x090481f0L, - 0xb1b8e695L, 0xa30d497bL, 0x1bb12e1eL, 0x43d23e48L, 0xfb6e592dL, - 0xe9dbf6c3L, 0x516791a6L, 0xccb0a91fL, 0x740cce7aL, 0x66b96194L, - 0xde0506f1L -# endif /* IZ_CRCOPTIM_UNFOLDTBL */ -# endif /* ? IZ_CRC_BE_OPTIMIZ */ -}; -#endif /* ?DYNAMIC_CRC_TABLE */ - -/* use "OF((void))" here to work around a Borland TC++ 1.0 problem */ -#ifdef USE_ZLIB -ZCONST uLongf *get_crc_table OF((void)) -#else -ZCONST ulg near *get_crc_table OF((void)) -#endif -{ -#ifdef DYNAMIC_CRC_TABLE - if (CRC_TABLE_IS_EMPTY) - make_crc_table(); -#endif -#ifdef USE_ZLIB - return (ZCONST uLongf *)crc_table; -#else - return crc_table; -#endif -} - -#ifdef DYNALLOC_CRCTAB -void free_crc_table() -{ - if (!CRC_TABLE_IS_EMPTY) - { - nearfree((ulg near *)crc_table); - MARK_CRCTAB_EMPTY; - } -} -#endif - -#ifndef USE_ZLIB -#ifndef CRC_TABLE_ONLY -#ifndef ASM_CRC - -#define DO1(crc, buf) crc = CRC32(crc, *buf++, crc_32_tab) -#define DO2(crc, buf) DO1(crc, buf); DO1(crc, buf) -#define DO4(crc, buf) DO2(crc, buf); DO2(crc, buf) -#define DO8(crc, buf) DO4(crc, buf); DO4(crc, buf) - -#if (defined(IZ_CRC_BE_OPTIMIZ) || defined(IZ_CRC_LE_OPTIMIZ)) - -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# ifdef IZ_CRC_BE_OPTIMIZ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = crc_32_tab[c & 0xff] ^ crc_32_tab[256+((c>>8) & 0xff)] ^ \ - crc_32_tab[2*256+((c>>16) & 0xff)] ^ crc_32_tab[3*256+(c>>24)] -# else /* !IZ_CRC_BE_OPTIMIZ */ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = crc_32_tab[3*256+(c & 0xff)] ^ crc_32_tab[2*256+((c>>8) & 0xff)] \ - ^ crc_32_tab[256+((c>>16) & 0xff)] ^ crc_32_tab[c>>24] -# endif /* ?IZ_CRC_BE_OPTIMIZ */ -# else /* !IZ_CRCOPTIM_UNFOLDTBL */ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab) -# endif /* ?IZ_CRCOPTIM_UNFOLDTBL */ - -# define DO_OPT16(crc, buf4) DO_OPT4(crc, buf4); DO_OPT4(crc, buf4); \ - DO_OPT4(crc, buf4); DO_OPT4(crc, buf4); - -#endif /* (IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ - - -/* ========================================================================= */ -ulg crc32(crc, buf, len) - ulg crc; /* crc shift register */ - register ZCONST uch *buf; /* pointer to bytes to pump through */ - extent len; /* number of bytes in buf[] */ -/* Run a set of bytes through the crc shift register. If buf is a NULL - pointer, then initialize the crc shift register contents instead. - Return the current crc in either case. */ -{ - register z_uint4 c; - register ZCONST ulg near *crc_32_tab; - - if (buf == NULL) return 0L; - - crc_32_tab = get_crc_table(); - - c = (REV_BE((z_uint4)crc) ^ 0xffffffffL); - -#if (defined(IZ_CRC_BE_OPTIMIZ) || defined(IZ_CRC_LE_OPTIMIZ)) - /* Align buf pointer to next DWORD boundary. */ - while (len && ((ptrdiff_t)buf & 3)) { - DO1(c, buf); - len--; - } - { - ZCONST z_uint4 *buf4 = (ZCONST z_uint4 *)buf; - while (len >= 16) { - DO_OPT16(c, buf4); - len -= 16; - } - while (len >= 4) { - DO_OPT4(c, buf4); - len -= 4; - } - buf = (ZCONST uch *)buf4; - } -#else /* !(IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ -#ifndef NO_UNROLLED_LOOPS - while (len >= 8) { - DO8(c, buf); - len -= 8; - } -#endif /* !NO_UNROLLED_LOOPS */ -#endif /* ?(IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ - if (len) do { - DO1(c, buf); - } while (--len); - - return REV_BE(c) ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */ -} -#endif /* !ASM_CRC */ -#endif /* !CRC_TABLE_ONLY */ -#endif /* !USE_ZLIB */ -#endif /* !USE_ZLIB || USE_OWN_CRCTAB */ diff --git a/data/windows/unzipfx-catarina/crc32.h b/data/windows/unzipfx-catarina/crc32.h deleted file mode 100644 index 83af240..0000000 --- a/data/windows/unzipfx-catarina/crc32.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* crc32.h -- compute the CRC-32 of a data stream - * Copyright (C) 1995 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#ifndef __crc32_h -#define __crc32_h /* identifies this source module */ - -/* This header should be read AFTER zip.h resp. unzip.h - * (the latter with UNZIP_INTERNAL defined...). - */ - -#ifndef OF -# define OF(a) a -#endif -#ifndef ZCONST -# define ZCONST const -#endif - -#ifdef DYNALLOC_CRCTAB - void free_crc_table OF((void)); -#endif -#ifndef USE_ZLIB - ZCONST ulg near *get_crc_table OF((void)); -#endif -#if (defined(USE_ZLIB) || defined(CRC_TABLE_ONLY)) -# ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -# endif -#else /* !(USE_ZLIB || CRC_TABLE_ONLY) */ - ulg crc32 OF((ulg crc, ZCONST uch *buf, extent len)); -#endif /* ?(USE_ZLIB || CRC_TABLE_ONLY) */ - -#ifndef CRC_32_TAB -# define CRC_32_TAB crc_32_tab -#endif - -#ifdef CRC32 -# undef CRC32 -#endif -#ifdef IZ_CRC_BE_OPTIMIZ -# define CRC32UPD(c, crctab) (crctab[((c) >> 24)] ^ ((c) << 8)) -# define CRC32(c, b, crctab) (crctab[(((int)(c) >> 24) ^ (b))] ^ ((c) << 8)) -# define REV_BE(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ - (((w)&0xff00)<<8)+(((w)&0xff)<<24)) -#else -# define CRC32UPD(c, crctab) (crctab[((int)(c)) & 0xff] ^ ((c) >> 8)) -# define CRC32(c, b, crctab) (crctab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -# define REV_BE(w) w -#endif - -#endif /* !__crc32_h */ diff --git a/data/windows/unzipfx-catarina/crypt.c b/data/windows/unzipfx-catarina/crypt.c deleted file mode 100644 index 784e411..0000000 --- a/data/windows/unzipfx-catarina/crypt.c +++ /dev/null @@ -1,653 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in (un)zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The main encryption/decryption source code for Info-Zip software was - originally written in Europe. To the best of our knowledge, it can - be freely distributed in both source and object forms from any country, - including the USA under License Exception TSU of the U.S. Export - Administration Regulations (section 740.13(e)) of 6 June 2002. - - NOTE on copyright history: - Previous versions of this source package (up to version 2.8) were - not copyrighted and put in the public domain. If you cannot comply - with the Info-Zip LICENSE, you may want to look for one of those - public domain versions. - */ - -/* - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - */ - -#define ZCRYPT_INTERNAL -#include "zip.h" -#include "crypt.h" -#include "ttyio.h" - -#if CRYPT - -#ifndef FALSE -# define FALSE 0 -#endif - -#ifdef ZIP - /* For the encoding task used in Zip (and ZipCloak), we want to initialize - the crypt algorithm with some reasonably unpredictable bytes, see - the crypthead() function. The standard rand() library function is - used to supply these `random' bytes, which in turn is initialized by - a srand() call. The srand() function takes an "unsigned" (at least 16bit) - seed value as argument to determine the starting point of the rand() - pseudo-random number generator. - This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with - Seed1 supplied by the current time (= "(unsigned)time()") and Seed2 - as some (hopefully) nondeterministic bitmask. On many (most) systems, - we use some "process specific" number, as the PID or something similar, - but when nothing unpredictable is available, a fixed number may be - sufficient. - NOTE: - 1.) This implementation requires the availability of the following - standard UNIX C runtime library functions: time(), rand(), srand(). - On systems where some of them are missing, the environment that - incorporates the crypt routines must supply suitable replacement - functions. - 2.) It is a very bad idea to use a second call to time() to set the - "Seed2" number! In this case, both "Seed1" and "Seed2" would be - (almost) identical, resulting in a (mostly) "zero" constant seed - number passed to srand(). - - The implementation environment defined in the "zip.h" header should - supply a reasonable definition for ZCR_SEED2 (an unsigned number; for - most implementations of rand() and srand(), only the lower 16 bits are - significant!). An example that works on many systems would be - "#define ZCR_SEED2 (unsigned)getpid()". - The default definition for ZCR_SEED2 supplied below should be regarded - as a fallback to allow successful compilation in "beta state" - environments. - */ -# include /* time() function supplies first part of crypt seed */ - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */ -# endif -# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -# undef GLOBAL -# endif -# define GLOBAL(g) g -#else /* !ZIP */ -# define GLOBAL(g) G.g -#endif /* ?ZIP */ - - -#ifdef UNZIP - /* char *key = (char *)NULL; moved to globals.h */ -# ifndef FUNZIP - local int testp OF((__GPRO__ ZCONST uch *h)); - local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key)); -# endif -#endif /* UNZIP */ - -#ifndef UNZIP /* moved to globals.h for UnZip */ -# ifndef Z_UINT4_DEFINED -# if !defined(NO_LIMITS_H) -# if (defined(UINT_MAX) && (UINT_MAX == 0xffffffffUL)) - typedef unsigned int z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(ULONG_MAX) && (ULONG_MAX == 0xffffffffUL)) - typedef unsigned long z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(USHRT_MAX) && (USHRT_MAX == 0xffffffffUL)) - typedef unsigned short z_uint4; -# define Z_UINT4_DEFINED -# endif -# endif -# endif -# endif /* !NO_LIMITS_H */ -# endif /* !Z_UINT4_DEFINED */ -# ifndef Z_UINT4_DEFINED - typedef ulg z_uint4; -# define Z_UINT4_DEFINED -# endif - local z_uint4 keys[3]; /* keys defining the pseudo-random sequence */ -#endif /* !UNZIP */ - -#ifndef Trace -# ifdef CRYPT_DEBUG -# define Trace(x) fprintf x -# else -# define Trace(x) -# endif -#endif - -#include "crc32.h" - -#ifdef IZ_CRC_BE_OPTIMIZ - local z_uint4 near crycrctab[256]; - local z_uint4 near *cry_crctb_p = NULL; - local z_uint4 near *crytab_init OF((__GPRO)); -# define CRY_CRC_TAB cry_crctb_p -# undef CRC32 -# define CRC32(c, b, crctab) (crctab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -#else -# define CRY_CRC_TAB CRC_32_TAB -#endif /* ?IZ_CRC_BE_OPTIMIZ */ - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -int decrypt_byte(__G) - __GDEF -{ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -int update_keys(__G__ c) - __GDEF - int c; /* byte of plain text */ -{ - GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c, CRY_CRC_TAB); - GLOBAL(keys[1]) = (GLOBAL(keys[1]) - + (GLOBAL(keys[0]) & 0xff)) - * 134775813L + 1; - { - register int keyshift = (int)(GLOBAL(keys[1]) >> 24); - GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift, CRY_CRC_TAB); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -void init_keys(__G__ passwd) - __GDEF - ZCONST char *passwd; /* password string with which to modify keys */ -{ -#ifdef IZ_CRC_BE_OPTIMIZ - if (cry_crctb_p == NULL) { - cry_crctb_p = crytab_init(__G); - } -#endif - GLOBAL(keys[0]) = 305419896L; - GLOBAL(keys[1]) = 591751049L; - GLOBAL(keys[2]) = 878082192L; - while (*passwd != '\0') { - update_keys(__G__ (int)*passwd); - passwd++; - } -} - - -/*********************************************************************** - * Initialize the local copy of the table of precomputed crc32 values. - * Whereas the public crc32-table is optimized for crc32 calculations - * on arrays of bytes, the crypt code needs the crc32 values in an - * byte-order-independent form as 32-bit unsigned numbers. On systems - * with Big-Endian byte order using the optimized crc32 code, this - * requires inverting the byte-order of the values in the - * crypt-crc32-table. - */ -#ifdef IZ_CRC_BE_OPTIMIZ -local z_uint4 near *crytab_init(__G) - __GDEF -{ - int i; - - for (i = 0; i < 256; i++) { - crycrctab[i] = REV_BE(CRC_32_TAB[i]); - } - return crycrctab; -} -#endif - - -#ifdef ZIP - -/*********************************************************************** - * Write encryption header to file zfile using the password passwd - * and the cyclic redundancy check crc. - */ -void crypthead(passwd, crc, zfile) - ZCONST char *passwd; /* password string */ - ulg crc; /* crc of file being encrypted */ - FILE *zfile; /* where to write header */ -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - uch header[RAND_HEAD_LEN]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the - * output of rand() to get less predictability, since rand() is - * often poorly implemented. - */ - if (++calls == 1) { - srand((unsigned)time(NULL) ^ ZCR_SEED2); - } - init_keys(passwd); - for (n = 0; n < RAND_HEAD_LEN-2; n++) { - c = (rand() >> 7) & 0xff; - header[n] = (uch)zencode(c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd); - for (n = 0; n < RAND_HEAD_LEN-2; n++) { - header[n] = (uch)zencode(header[n], t); - } - header[RAND_HEAD_LEN-2] = (uch)zencode((int)(crc >> 16) & 0xff, t); - header[RAND_HEAD_LEN-1] = (uch)zencode((int)(crc >> 24) & 0xff, t); - fwrite(header, 1, RAND_HEAD_LEN, f); -} - - -#ifdef UTIL - -/*********************************************************************** - * Encrypt the zip entry described by z from file source to file dest - * using the password passwd. Return an error code in the ZE_ class. - */ -int zipcloak(z, source, dest, passwd) - struct zlist far *z; /* zip entry to encrypt */ - FILE *source, *dest; /* source and destination files */ - ZCONST char *passwd; /* password string */ -{ - int c; /* input byte */ - int res; /* result code */ - ulg n; /* holds offset and counts size */ - ush flag; /* previous flags */ - int t; /* temporary */ - int ztemp; /* temporary storage for zencode value */ - - /* Set encrypted bit, clear extended local header bit and write local - header to output file */ - if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; - z->off = n; - flag = z->flg; - z->flg |= 1, z->flg &= ~8; - z->lflg |= 1, z->lflg &= ~8; - z->siz += RAND_HEAD_LEN; - if ((res = putlocal(z, dest)) != ZE_OK) return res; - - /* Initialize keys with password and write random header */ - crypthead(passwd, z->crc, dest); - - /* Skip local header in input file */ - if (fseek(source, (long)((4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext), - SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - - /* Encrypt data */ - for (n = z->siz - RAND_HEAD_LEN; n; n--) { - if ((c = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - ztemp = zencode(c, t); - putc(ztemp, dest); - } - /* Skip extended local header in input file if there is one */ - if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if (fflush(dest) == EOF) return ZE_TEMP; - - /* Update number of bytes written to output file */ - tempzn += (4 + LOCHEAD) + z->nam + z->ext + z->siz; - - return ZE_OK; -} - -/*********************************************************************** - * Decrypt the zip entry described by z from file source to file dest - * using the password passwd. Return an error code in the ZE_ class. - */ -int zipbare(z, source, dest, passwd) - struct zlist far *z; /* zip entry to encrypt */ - FILE *source, *dest; /* source and destination files */ - ZCONST char *passwd; /* password string */ -{ -#ifdef ZIP10 - int c0 /* byte preceding the last input byte */ -#endif - int c1; /* last input byte */ - ulg offset; /* used for file offsets */ - ulg size; /* size of input data */ - int r; /* size of encryption header */ - int res; /* return code */ - ush flag; /* previous flags */ - - /* Save position and skip local header in input file */ - if ((offset = (ulg)ftell(source)) == (ulg)-1L || - fseek(source, (long)((4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext), - SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - /* Initialize keys with password */ - init_keys(passwd); - - /* Decrypt encryption header, save last two bytes */ - c1 = 0; - for (r = RAND_HEAD_LEN; r; r--) { -#ifdef ZIP10 - c0 = c1; -#endif - if ((c1 = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - Trace((stdout, " (%02x)", c1)); - zdecode(c1); - Trace((stdout, " %02x", c1)); - } - Trace((stdout, "\n")); - - /* If last two bytes of header don't match crc (or file time in the - * case of an extended local header), back up and just copy. For - * pkzip 2.0, the check has been reduced to one byte only. - */ -#ifdef ZIP10 - if ((ush)(c0 | (c1<<8)) != - (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) { -#else - if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) { -#endif - if (fseek(source, offset, SEEK_SET)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if ((res = zipcopy(z, source, dest)) != ZE_OK) return res; - return ZE_MISS; - } - - /* Clear encrypted bit and local header bit, and write local header to - output file */ - if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; - z->off = offset; - flag = z->flg; - z->flg &= ~9; - z->lflg &= ~9; - z->siz -= RAND_HEAD_LEN; - if ((res = putlocal(z, dest)) != ZE_OK) return res; - - /* Decrypt data */ - for (size = z->siz; size; size--) { - if ((c1 = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - zdecode(c1); - putc(c1, dest); - } - /* Skip extended local header in input file if there is one */ - if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if (fflush(dest) == EOF) return ZE_TEMP; - - /* Update number of bytes written to output file */ - tempzn += (4 + LOCHEAD) + z->nam + z->ext + z->siz; - - return ZE_OK; -} - - -#else /* !UTIL */ - -/*********************************************************************** - * If requested, encrypt the data in buf, and in any case call fwrite() - * with the arguments to zfwrite(). Return what fwrite() returns. - * - * A bug has been found when encrypting large files. See trees.c - * for details and the fix. - */ -unsigned zfwrite(buf, item_size, nb, f) - zvoid *buf; /* data buffer */ - extent item_size; /* size of each item in bytes */ - extent nb; /* number of items */ - FILE *f; /* file to write to */ -{ - int t; /* temporary */ - - if (key != (char *)NULL) { /* key is the global password pointer */ - ulg size; /* buffer size */ - char *p = (char*)buf; /* steps through buffer */ - - /* Encrypt data in buffer */ - for (size = item_size*(ulg)nb; size != 0; p++, size--) { - *p = (char)zencode(*p, t); - } - } - /* Write the buffer out */ - return fwrite(buf, item_size, nb, f); -} - -#endif /* ?UTIL */ -#endif /* ZIP */ - - -#if (defined(UNZIP) && !defined(FUNZIP)) - -/*********************************************************************** - * Get the password and set up keys for current zipfile member. - * Return PK_ class error. - */ -int decrypt(__G__ passwrd) - __GDEF - ZCONST char *passwrd; -{ - ush b; - int n, r; - uch h[RAND_HEAD_LEN]; - - Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt))); - - /* get header once (turn off "encrypted" flag temporarily so we don't - * try to decrypt the same data twice) */ - GLOBAL(pInfo->encrypted) = FALSE; - defer_leftover_input(__G); - for (n = 0; n < RAND_HEAD_LEN; n++) { - b = NEXTBYTE; - h[n] = (uch)b; - Trace((stdout, " (%02x)", h[n])); - } - undefer_input(__G); - GLOBAL(pInfo->encrypted) = TRUE; - - if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */ - GLOBAL(newzip) = FALSE; - if (passwrd != (char *)NULL) { /* user gave password on command line */ - if (!GLOBAL(key)) { - if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) == - (char *)NULL) - return PK_MEM2; - strcpy(GLOBAL(key), passwrd); - GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */ - } - } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */ - free(GLOBAL(key)); - GLOBAL(key) = (char *)NULL; - } - } - - /* if have key already, test it; else allocate memory for it */ - if (GLOBAL(key)) { - if (!testp(__G__ h)) - return PK_COOL; /* existing password OK (else prompt for new) */ - else if (GLOBAL(nopwd)) - return PK_WARN; /* user indicated no more prompting */ - } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) - return PK_MEM2; - - /* try a few keys */ - n = 0; - do { - r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1, - GLOBAL(zipfn), GLOBAL(filename)); - if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */ - free (GLOBAL(key)); - GLOBAL(key) = NULL; - return PK_MEM2; - } - if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */ - *GLOBAL(key) = '\0'; /* We try the NIL password, ... */ - n = 0; /* and cancel fetch for this item. */ - } - if (!testp(__G__ h)) - return PK_COOL; - if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */ - GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */ - } while (n > 0); - - return PK_WARN; - -} /* end function decrypt() */ - - - -/*********************************************************************** - * Test the password. Return -1 if bad, 0 if OK. - */ -local int testp(__G__ h) - __GDEF - ZCONST uch *h; -{ - int r; - char *key_translated; - - /* On systems with "obscure" native character coding (e.g., EBCDIC), - * the first test translates the password to the "main standard" - * character coding. */ - -#ifdef STR_TO_CP1 - /* allocate buffer for translated password */ - if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) - return -1; - /* first try, test password translated "standard" charset */ - r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key))); -#else /* !STR_TO_CP1 */ - /* first try, test password as supplied on the extractor's host */ - r = testkey(__G__ h, GLOBAL(key)); -#endif /* ?STR_TO_CP1 */ - -#ifdef STR_TO_CP2 - if (r != 0) { -#ifndef STR_TO_CP1 - /* now prepare for second (and maybe third) test with translated pwd */ - if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) - return -1; -#endif - /* second try, password translated to alternate ("standard") charset */ - r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key))); -#ifdef STR_TO_CP3 - if (r != 0) - /* third try, password translated to another "standard" charset */ - r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key))); -#endif -#ifndef STR_TO_CP1 - free(key_translated); -#endif - } -#endif /* STR_TO_CP2 */ - -#ifdef STR_TO_CP1 - free(key_translated); - if (r != 0) { - /* last resort, test password as supplied on the extractor's host */ - r = testkey(__G__ h, GLOBAL(key)); - } -#endif /* STR_TO_CP1 */ - - return r; - -} /* end function testp() */ - - -local int testkey(__G__ h, key) - __GDEF - ZCONST uch *h; /* decrypted header */ - ZCONST char *key; /* decryption password to test */ -{ - ush b; -#ifdef ZIP10 - ush c; -#endif - int n; - uch *p; - uch hh[RAND_HEAD_LEN]; /* decrypted header */ - - /* set keys and save the encrypted header */ - init_keys(__G__ key); - memcpy(hh, h, RAND_HEAD_LEN); - - /* check password */ - for (n = 0; n < RAND_HEAD_LEN; n++) { - zdecode(hh[n]); - Trace((stdout, " %02x", hh[n])); - } - - Trace((stdout, - "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", - GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), - GLOBAL(pInfo->ExtLocHdr) ? "true":"false")); - Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n", - GLOBAL(incnt), - GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf)))); - - /* same test as in zipbare(): */ - -#ifdef ZIP10 /* check two bytes */ - c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1]; - Trace((stdout, - " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n", - (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16), - ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff)))); - if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ? - ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) : - (ush)(GLOBAL(lrec.crc32) >> 16))) - return -1; /* bad */ -#else - b = hh[RAND_HEAD_LEN-1]; - Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", - b, (ush)(GLOBAL(lrec.crc32) >> 24), - ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff)); - if (b != (GLOBAL(pInfo->ExtLocHdr) ? - ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff : - (ush)(GLOBAL(lrec.crc32) >> 24))) - return -1; /* bad */ -#endif - /* password OK: decrypt current buffer contents before leaving */ - for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ? - (int)GLOBAL(csize) : GLOBAL(incnt), - p = GLOBAL(inptr); n--; p++) - zdecode(*p); - return 0; /* OK */ - -} /* end function testkey() */ - -#endif /* UNZIP && !FUNZIP */ - -#else /* !CRYPT */ - -/* something "externally visible" to shut up compiler/linker warnings */ -int zcr_dummy; - -#endif /* ?CRYPT */ diff --git a/data/windows/unzipfx-catarina/crypt.h b/data/windows/unzipfx-catarina/crypt.h deleted file mode 100644 index 0c533e9..0000000 --- a/data/windows/unzipfx-catarina/crypt.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in (un)zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE] - - The main encryption/decryption source code for Info-Zip software was - originally written in Europe. To the best of our knowledge, it can - be freely distributed in both source and object forms from any country, - including the USA under License Exception TSU of the U.S. Export - Administration Regulations (section 740.13(e)) of 6 June 2002. - - NOTE on copyright history: - Previous versions of this source package (up to version 2.8) were - not copyrighted and put in the public domain. If you cannot comply - with the Info-Zip LICENSE, you may want to look for one of those - public domain versions. - */ - -#ifndef __crypt_h /* don't include more than once */ -#define __crypt_h - -#ifdef CRYPT -# undef CRYPT -#endif -/* - Logic of selecting "full crypt" code: - a) default behaviour: - - dummy crypt code when compiling UnZipSFX stub, to minimize size - - full crypt code when used to compile Zip, UnZip and fUnZip - b) USE_CRYPT defined: - - always full crypt code - c) NO_CRYPT defined: - - never full crypt code - NO_CRYPT takes precedence over USE_CRYPT - */ -#if defined(NO_CRYPT) -# define CRYPT 0 /* dummy version */ -#else -#if defined(USE_CRYPT) -# define CRYPT 1 /* full version */ -#else -#if !defined(SFX) -# define CRYPT 1 /* full version for zip and main unzip */ -#else -# define CRYPT 0 /* dummy version for unzip sfx */ -#endif -#endif /* ?USE_CRYPT */ -#endif /* ?NO_CRYPT */ - -#if CRYPT -/* full version */ - -#ifdef CR_BETA -# undef CR_BETA /* this is not a beta release */ -#endif - -#define CR_MAJORVER 2 -#define CR_MINORVER 11 -#ifdef CR_BETA -# define CR_BETA_VER "c BETA" -# define CR_VERSION_DATE "05 Jan 2007" /* last real code change */ -#else -# define CR_BETA_VER "" -# define CR_VERSION_DATE "05 Jan 2007" /* last public release date */ -# define CR_RELEASE -#endif - -#ifndef __G /* UnZip only, for now (DLL stuff) */ -# define __G -# define __G__ -# define __GDEF -# define __GPRO void -# define __GPRO__ -#endif - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) -# ifndef DOS_OS2_W32 -# define DOS_OS2_W32 -# endif -#endif - -#if defined(DOS_OS2_W32) || defined(__human68k__) -# ifndef DOS_H68_OS2_W32 -# define DOS_H68_OS2_W32 -# endif -#endif - -#if defined(VM_CMS) || defined(MVS) -# ifndef CMS_MVS -# define CMS_MVS -# endif -#endif - -/* To allow combining of Zip and UnZip static libraries in a single binary, - * the Zip and UnZip versions of the crypt core functions have to be named - * differently. - */ -#ifdef ZIP -# ifdef REALLY_SHORT_SYMS -# define decrypt_byte zdcrby -# else -# define decrypt_byte zp_decrypt_byte -# endif -# define update_keys zp_update_keys -# define init_keys zp_init_keys -#else /* !ZIP */ -# ifdef REALLY_SHORT_SYMS -# define decrypt_byte dcrbyt -# endif -#endif /* ?ZIP */ - -#define IZ_PWLEN 80 /* input buffer size for reading encryption key */ -#ifndef PWLEN /* for compatibility with previous zcrypt release... */ -# define PWLEN IZ_PWLEN -#endif -#define RAND_HEAD_LEN 12 /* length of encryption random header */ - -/* the crc_32_tab array has to be provided externally for the crypt calculus */ - -/* encode byte c, using temp t. Warning: c must not have side effects. */ -#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c)) - -/* decode byte c in place */ -#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G)) - -int decrypt_byte OF((__GPRO)); -int update_keys OF((__GPRO__ int c)); -void init_keys OF((__GPRO__ ZCONST char *passwd)); - -#ifdef ZIP - void crypthead OF((ZCONST char *, ulg, FILE *)); -# ifdef UTIL - int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); - int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -# else - unsigned zfwrite OF((zvoid *, extent, extent, FILE *)); - extern char *key; -# endif -#endif /* ZIP */ - -#if (defined(UNZIP) && !defined(FUNZIP)) - int decrypt OF((__GPRO__ ZCONST char *passwrd)); -#endif - -#ifdef FUNZIP - extern int encrypted; -# ifdef NEXTBYTE -# undef NEXTBYTE -# endif -# define NEXTBYTE \ - (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in)) -#endif /* FUNZIP */ - -#else /* !CRYPT */ -/* dummy version */ - -#define zencode -#define zdecode - -#define zfwrite fwrite - -#endif /* ?CRYPT */ -#endif /* !__crypt_h */ diff --git a/data/windows/unzipfx-catarina/ebcdic.h b/data/windows/unzipfx-catarina/ebcdic.h deleted file mode 100644 index 3aa587e..0000000 --- a/data/windows/unzipfx-catarina/ebcdic.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ebcdic.h - - The CECP 1047 (Extended de-facto EBCDIC) <-> ISO 8859-1 conversion tables, - from ftp://aix1.segi.ulg.ac.be/pub/docs/iso8859/iso8859.networking - - NOTES: - (OS/390 port 12/97) - These table no longer represent the standard mappings (for example in the - OS/390 iconv utility). In order to follow current standards I remapped - ebcdic x0a to ascii x15 and - ebcdic x85 to ascii x25 (and vice-versa) - Without these changes, newlines in auto-convert text files appeared - as literal \045. - I'm not sure what effect this remap would have on the MVS and CMS ports, so - I ifdef'd these changes. Hopefully these ifdef's can be removed when the - MVS/CMS folks test the new mappings. - - Christian Spieler , 27-Apr-1998 - The problem mentioned by Paul von Behren was already observed previously - on VM/CMS, during the preparation of the CMS&MVS port of UnZip 5.20 in - 1996. At that point, the ebcdic tables were not changed since they seemed - to be an adopted standard (to my knowledge, these tables are still used - as presented in mainfraime KERMIT). Instead, the "end-of-line" conversion - feature of Zip's and UnZip's "text-translation" mode was used to force - correct mappings between ASCII and EBCDIC newline markers. - Before interchanging the ASCII mappings of the EBCDIC control characters - "NL" 0x25 and "LF" 0x15 according to the OS/390 setting, we have to - make sure that EBCDIC 0x15 is never used as line termination. - - ---------------------------------------------------------------------------*/ - -#ifndef __ebcdic_h /* prevent multiple inclusions */ -#define __ebcdic_h - - -#ifndef ZCONST -# define ZCONST const -#endif - -#ifdef EBCDIC -#ifndef MTS /* MTS uses a slightly "special" EBCDIC code page */ - -ZCONST uch ebcdic[] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ -#ifdef OS390 - 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#else - 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#endif - 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ - 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ - 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ - 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ - 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ - 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ - 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ - 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, /* 58 - 5F */ - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ - 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ - 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ -#ifdef OS390 - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, /* 80 - 87 */ -#else - 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ -#endif - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ - 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ - 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ - 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ - 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, /* A8 - AF */ - 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ - 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ - 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ - 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, /* D8 - DF */ - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ - 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ - 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ -}; - -#if (defined(ZIP) || CRYPT) -ZCONST uch ascii[] = { - 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ - 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#ifdef OS390 - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, /* 10 - 17 */ -#else - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ -#endif - 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ -#ifdef OS390 - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, /* 20 - 27 */ -#else - 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ -#endif - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ - 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ - 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ - 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ - 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ - 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E, /* 58 - 5F */ - 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ - 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ - 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ - 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ - 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ - 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ - 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ - 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ - 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ - 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE, /* A8 - AF */ - 0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ - 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7, /* B8 - BF */ - 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ - 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ - 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ - 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ - 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ - 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ - 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ -}; -#endif /* ZIP || CRYPT */ - -#else /* MTS */ - -/* - * This is the MTS ASCII->EBCDIC translation table. It provides a 1-1 - * translation from ISO 8859/1 8-bit ASCII to IBM Code Page 37 EBCDIC. - */ - -ZCONST uch ebcdic[] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ - 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ - 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ - 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ - 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ - 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ - 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ - 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ - 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ - 0xE7, 0xE8, 0xE9, 0xBA, 0xE0, 0xBB, 0xB0, 0x6D, /* 58 - 5F */ - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ - 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ - 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ - 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ - 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ - 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ - 0xBD, 0xB4, 0x9A, 0x8A, 0x5F, 0xCA, 0xAF, 0xBC, /* A8 - AF */ - 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ - 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ - 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ - 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xAD, 0xAE, 0x59, /* D8 - DF */ - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ - 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ - 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ -}; - -#if (defined(ZIP) || CRYPT) -ZCONST uch ascii[] = { - 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ - 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ - 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ - 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ - 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ - 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ - 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ - 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAC, /* 58 - 5F */ - 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ - 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ - 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ - 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ - 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ - 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ - 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ - 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ - 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ - 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0xDD, 0xDE, 0xAE, /* A8 - AF */ - 0x5E, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ - 0xBD, 0xBE, 0x5B, 0x5D, 0xAF, 0xA8, 0xB4, 0xD7, /* B8 - BF */ - 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ - 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ - 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ - 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ - 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ - 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ - 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ -}; -#endif /* ZIP || CRYPT */ - -#endif /* ?MTS */ -#endif /* EBCDIC */ - -/*--------------------------------------------------------------------------- - - The following conversion tables translate between IBM PC CP 850 - (OEM codepage) and the "Western Europe & America" Windows codepage 1252. - The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, - with some additional printable characters in the range (0x80 - 0x9F), - that is reserved to control codes in the ISO 8859-1 character table. - - The ISO <--> OEM conversion tables were constructed with the help - of the WIN32 (Win16?) API's OemToAnsi() and AnsiToOem() conversion - functions and have been checked against the CP850 and LATIN1 tables - provided in the MS-Kermit 3.14 distribution. - - ---------------------------------------------------------------------------*/ - -#ifdef IZ_ISO2OEM_ARRAY -ZCONST uch Far iso2oem_850[] = { - 0x3F, 0x3F, 0x27, 0x9F, 0x22, 0x2E, 0xC5, 0xCE, /* 80 - 87 */ - 0x5E, 0x25, 0x53, 0x3C, 0x4F, 0x3F, 0x3F, 0x3F, /* 88 - 8F */ - 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, /* 90 - 97 */ - 0x7E, 0x54, 0x73, 0x3E, 0x6F, 0x3F, 0x3F, 0x59, /* 98 - 9F */ - 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* A0 - A7 */ - 0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, /* A8 - AF */ - 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* B0 - B7 */ - 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, /* B8 - BF */ - 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* C0 - C7 */ - 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* C8 - CF */ - 0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* D0 - D7 */ - 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* D8 - DF */ - 0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* E0 - E7 */ - 0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B, /* E8 - EF */ - 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* F0 - F7 */ - 0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98 /* F8 - FF */ -}; -#endif /* IZ_ISO2OEM_ARRAY */ - -#ifdef IZ_OEM2ISO_ARRAY -ZCONST uch Far oem2iso_850[] = { - 0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7, /* 80 - 87 */ - 0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5, /* 88 - 8F */ - 0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9, /* 90 - 97 */ - 0xFF, 0xD6, 0xDC, 0xF8, 0xA3, 0xD8, 0xD7, 0x83, /* 98 - 9F */ - 0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA, /* A0 - A7 */ - 0xBF, 0xAE, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB, /* A8 - AF */ - 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xC1, 0xC2, 0xC0, /* B0 - B7 */ - 0xA9, 0xA6, 0xA6, 0x2B, 0x2B, 0xA2, 0xA5, 0x2B, /* B8 - BF */ - 0x2B, 0x2D, 0x2D, 0x2B, 0x2D, 0x2B, 0xE3, 0xC3, /* C0 - C7 */ - 0x2B, 0x2B, 0x2D, 0x2D, 0xA6, 0x2D, 0x2B, 0xA4, /* C8 - CF */ - 0xF0, 0xD0, 0xCA, 0xCB, 0xC8, 0x69, 0xCD, 0xCE, /* D0 - D7 */ - 0xCF, 0x2B, 0x2B, 0xA6, 0x5F, 0xA6, 0xCC, 0xAF, /* D8 - DF */ - 0xD3, 0xDF, 0xD4, 0xD2, 0xF5, 0xD5, 0xB5, 0xFE, /* E0 - E7 */ - 0xDE, 0xDA, 0xDB, 0xD9, 0xFD, 0xDD, 0xAF, 0xB4, /* E8 - EF */ - 0xAD, 0xB1, 0x3D, 0xBE, 0xB6, 0xA7, 0xF7, 0xB8, /* F0 - F7 */ - 0xB0, 0xA8, 0xB7, 0xB9, 0xB3, 0xB2, 0xA6, 0xA0 /* F8 - FF */ -}; -#endif /* IZ_OEM2ISO_ARRAY */ - -/* The following pointers to the OEM<-->ISO translation tables are used - by the translation code portions. They may get initialized at program - startup to point to the matching static translation tables, or to NULL - to disable OEM-ISO translation. - The compile-time initialization used here provides the backward compatible - setting, as can be found in UnZip 5.52 and earlier. - In case this mechanism will ever get used on a multithreading system that - allows different codepage setups for concurrently running threads, these - pointers should get moved into UnZip's thread-safe global data structure. - */ -#ifdef IZ_ISO2OEM_ARRAY -ZCONST uch Far *iso2oem = iso2oem_850; /* backward compatibility default */ -#endif /* IZ_ISO2OEM_ARRAY */ -#ifdef IZ_OEM2ISO_ARRAY -ZCONST uch Far *oem2iso = oem2iso_850; /* backward compatibility default */ -#endif /* IZ_OEM2ISO_ARRAY */ - -#if defined(THEOS) || defined(THEOS_SUPPORT) -# include "theos/charconv.h" -#endif - -#endif /* __ebcdic_h */ diff --git a/data/windows/unzipfx-catarina/extract.c b/data/windows/unzipfx-catarina/extract.c deleted file mode 100644 index 1acd769..0000000 --- a/data/windows/unzipfx-catarina/extract.c +++ /dev/null @@ -1,2820 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - extract.c - - This file contains the high-level routines ("driver routines") for extrac- - ting and testing zipfile members. It calls the low-level routines in files - explode.c, inflate.c, unreduce.c and unshrink.c. - - Contains: extract_or_test_files() - store_info() - find_compr_idx() - extract_or_test_entrylist() - extract_or_test_member() - TestExtraField() - test_compr_eb() - memextract() - memflush() - extract_izvms_block() (VMS or VMS_TEXT_CONV) - set_deferred_symlink() (SYMLINKS only) - fnfilter() - dircomp() (SET_DIR_ATTRIB only) - UZbunzip2() (USE_BZIP2 only) - - ---------------------------------------------------------------------------*/ - - -#define __EXTRACT_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif -#include "crc32.h" -#include "crypt.h" - -#define GRRDUMP(buf,len) { \ - int i, j; \ - \ - for (j = 0; j < (len)/16; ++j) { \ - printf(" "); \ - for (i = 0; i < 16; ++i) \ - printf("%02x ", (uch)(buf)[i+(j<<4)]); \ - printf("\n "); \ - for (i = 0; i < 16; ++i) { \ - char c = (char)(buf)[i+(j<<4)]; \ - \ - if (c == '\n') \ - printf("\\n "); \ - else if (c == '\r') \ - printf("\\r "); \ - else \ - printf(" %c ", c); \ - } \ - printf("\n"); \ - } \ - if ((len) % 16) { \ - printf(" "); \ - for (i = j<<4; i < (len); ++i) \ - printf("%02x ", (uch)(buf)[i]); \ - printf("\n "); \ - for (i = j<<4; i < (len); ++i) { \ - char c = (char)(buf)[i]; \ - \ - if (c == '\n') \ - printf("\\n "); \ - else if (c == '\r') \ - printf("\\r "); \ - else \ - printf(" %c ", c); \ - } \ - printf("\n"); \ - } \ -} - -static int store_info OF((__GPRO)); -#ifdef SET_DIR_ATTRIB -static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, - ulg *pfilnum, ulg *pnum_bad_pwd, zoff_t *pold_extra_bytes, - unsigned *pnum_dirs, direntry **pdirlist, - int error_in_archive)); -#else -static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, - ulg *pfilnum, ulg *pnum_bad_pwd, zoff_t *pold_extra_bytes, - int error_in_archive)); -#endif -static int extract_or_test_member OF((__GPRO)); -#ifndef SFX - static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); - static int test_compr_eb OF((__GPRO__ uch *eb, unsigned eb_size, - unsigned compr_offset, - int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize))); -#endif -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - static void decompress_bits OF((uch *outptr, unsigned needlen, - ZCONST uch *bitptr)); -#endif -#ifdef SYMLINKS - static void set_deferred_symlink OF((__GPRO__ slinkentry *slnk_entry)); -#endif -#ifdef SET_DIR_ATTRIB - static int Cdecl dircomp OF((ZCONST zvoid *a, ZCONST zvoid *b)); -#endif - - - -/*******************************/ -/* Strings used in extract.c */ -/*******************************/ - -static ZCONST char Far VersionMsg[] = - " skipping: %-22s need %s compat. v%u.%u (can do v%u.%u)\n"; -static ZCONST char Far ComprMsgNum[] = - " skipping: %-22s unsupported compression method %u\n"; -#ifndef SFX - static ZCONST char Far ComprMsgName[] = - " skipping: %-22s `%s' method not supported\n"; - static ZCONST char Far CmprNone[] = "store"; - static ZCONST char Far CmprShrink[] = "shrink"; - static ZCONST char Far CmprReduce[] = "reduce"; - static ZCONST char Far CmprImplode[] = "implode"; - static ZCONST char Far CmprTokenize[] = "tokenize"; - static ZCONST char Far CmprDeflate[] = "deflate"; - static ZCONST char Far CmprDeflat64[] = "deflate64"; - static ZCONST char Far CmprDCLImplode[] = "DCL implode"; - static ZCONST char Far CmprBzip[] = "bzip2"; - static ZCONST char Far CmprLZMA[] = "LZMA"; - static ZCONST char Far CmprIBMTerse[] = "IBM/Terse"; - static ZCONST char Far CmprIBMLZ77[] = "IBM LZ77"; - static ZCONST char Far CmprWavPack[] = "WavPack"; - static ZCONST char Far CmprPPMd[] = "PPMd"; - static ZCONST char Far *ComprNames[NUM_METHODS] = { - CmprNone, CmprShrink, CmprReduce, CmprReduce, CmprReduce, CmprReduce, - CmprImplode, CmprTokenize, CmprDeflate, CmprDeflat64, CmprDCLImplode, - CmprBzip, CmprLZMA, CmprIBMTerse, CmprIBMLZ77, CmprWavPack, CmprPPMd - }; - static ZCONST unsigned ComprIDs[NUM_METHODS] = { - STORED, SHRUNK, REDUCED1, REDUCED2, REDUCED3, REDUCED4, - IMPLODED, TOKENIZED, DEFLATED, ENHDEFLATED, DCLIMPLODED, - BZIPPED, LZMAED, IBMTERSED, IBMLZ77ED, WAVPACKED, PPMDED - }; -#endif /* !SFX */ -static ZCONST char Far FilNamMsg[] = - "%s: bad filename length (%s)\n"; -#ifndef SFX - static ZCONST char Far WarnNoMemCFName[] = - "%s: warning, no memory for comparison with local header\n"; - static ZCONST char Far LvsCFNamMsg[] = - "%s: mismatching \"local\" filename (%s),\n\ - continuing with \"central\" filename version\n"; -#endif /* !SFX */ -#if (!defined(SFX) && defined(UNICODE_SUPPORT)) - static ZCONST char Far GP11FlagsDiffer[] = - "file #%lu (%s):\n\ - mismatch between local and central GPF bit 11 (\"UTF-8\"),\n\ - continuing with central flag (IsUTF8 = %d)\n"; -#endif /* !SFX && UNICODE_SUPPORT */ -static ZCONST char Far WrnStorUCSizCSizDiff[] = - "%s: ucsize %s <> csize %s for STORED entry\n\ - continuing with \"compressed\" size value\n"; -static ZCONST char Far ExtFieldMsg[] = - "%s: bad extra field length (%s)\n"; -static ZCONST char Far OffsetMsg[] = - "file #%lu: bad zipfile offset (%s): %ld\n"; -static ZCONST char Far ExtractMsg[] = - "%8sing: %-22s %s%s"; -#ifndef SFX - static ZCONST char Far LengthMsg[] = - "%s %s: %s bytes required to uncompress to %s bytes;\n %s\ - supposed to require %s bytes%s%s%s\n"; -#endif - -static ZCONST char Far BadFileCommLength[] = "%s: bad file comment length\n"; -static ZCONST char Far LocalHdrSig[] = "local header sig"; -static ZCONST char Far BadLocalHdr[] = "file #%lu: bad local header\n"; -static ZCONST char Far AttemptRecompensate[] = - " (attempting to re-compensate)\n"; -#ifndef SFX - static ZCONST char Far BackslashPathSep[] = - "warning: %s appears to use backslashes as path separators\n"; -#endif -static ZCONST char Far AbsolutePathWarning[] = - "warning: stripped absolute path spec from %s\n"; -static ZCONST char Far SkipVolumeLabel[] = - " skipping: %-22s %svolume label\n"; - -#ifdef SET_DIR_ATTRIB /* messages of code for setting directory attributes */ - static ZCONST char Far DirlistEntryNoMem[] = - "warning: cannot alloc memory for dir times/permissions/UID/GID\n"; - static ZCONST char Far DirlistSortNoMem[] = - "warning: cannot alloc memory to sort dir times/perms/etc.\n"; - static ZCONST char Far DirlistSetAttrFailed[] = - "warning: set times/attribs failed for %s\n"; - static ZCONST char Far DirlistFailAttrSum[] = - " failed setting times/attribs for %lu dir entries"; -#endif - -#ifdef SYMLINKS /* messages of the deferred symlinks handler */ - static ZCONST char Far SymLnkWarnNoMem[] = - "warning: deferred symlink (%s) failed:\n\ - out of memory\n"; - static ZCONST char Far SymLnkWarnInvalid[] = - "warning: deferred symlink (%s) failed:\n\ - invalid placeholder file\n"; - static ZCONST char Far SymLnkDeferred[] = - "finishing deferred symbolic links:\n"; - static ZCONST char Far SymLnkFinish[] = - " %-22s -> %s\n"; -#endif - -#ifndef WINDLL - static ZCONST char Far ReplaceQuery[] = -# ifdef VMS - "new version of %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: "; -# else - "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: "; -# endif - static ZCONST char Far AssumeNone[] = - " NULL\n(EOF or read error, treating as \"[N]one\" ...)\n"; - static ZCONST char Far NewNameQuery[] = "new name: "; - static ZCONST char Far InvalidResponse[] = - "error: invalid response [%s]\n"; -#endif /* !WINDLL */ - -static ZCONST char Far ErrorInArchive[] = - "At least one %serror was detected in %s.\n"; -static ZCONST char Far ZeroFilesTested[] = - "Caution: zero files tested in %s.\n"; - -#ifndef VMS - static ZCONST char Far VMSFormatQuery[] = - "\n%s: stored in VMS format. Extract anyway? (y/n) "; -#endif - -#if CRYPT - static ZCONST char Far SkipCannotGetPasswd[] = - " skipping: %-22s unable to get password\n"; - static ZCONST char Far SkipIncorrectPasswd[] = - " skipping: %-22s incorrect password\n"; - static ZCONST char Far FilesSkipBadPasswd[] = - "%lu file%s skipped because of incorrect password.\n"; - static ZCONST char Far MaybeBadPasswd[] = - " (may instead be incorrect password)\n"; -#else - static ZCONST char Far SkipEncrypted[] = - " skipping: %-22s encrypted (not supported)\n"; -#endif - -static ZCONST char Far NoErrInCompData[] = - "No errors detected in compressed data of %s.\n"; -static ZCONST char Far NoErrInTestedFiles[] = - "No errors detected in %s for the %lu file%s tested.\n"; -static ZCONST char Far FilesSkipped[] = - "%lu file%s skipped because of unsupported compression or encoding.\n"; - -static ZCONST char Far ErrUnzipFile[] = " error: %s%s %s\n"; -static ZCONST char Far ErrUnzipNoFile[] = "\n error: %s%s\n"; -static ZCONST char Far NotEnoughMem[] = "not enough memory to "; -static ZCONST char Far InvalidComprData[] = "invalid compressed data to "; -static ZCONST char Far Inflate[] = "inflate"; -#ifdef USE_BZIP2 - static ZCONST char Far BUnzip[] = "bunzip"; -#endif - -#ifndef SFX - static ZCONST char Far Explode[] = "explode"; -#ifndef LZW_CLEAN - static ZCONST char Far Unshrink[] = "unshrink"; -#endif -#endif - -#if (!defined(DELETE_IF_FULL) || !defined(HAVE_UNLINK)) - static ZCONST char Far FileTruncated[] = - "warning: %s is probably truncated\n"; -#endif - -static ZCONST char Far FileUnknownCompMethod[] = - "%s: unknown compression method\n"; -static ZCONST char Far BadCRC[] = " bad CRC %08lx (should be %08lx)\n"; - - /* TruncEAs[] also used in OS/2 mapname(), close_outfile() */ -char ZCONST Far TruncEAs[] = " compressed EA data missing (%d bytes)%s"; -char ZCONST Far TruncNTSD[] = - " compressed WinNT security data missing (%d bytes)%s"; - -#ifndef SFX - static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ - EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; - static ZCONST char Far InvalidComprDataEAs[] = - " invalid compressed data for EAs\n"; -# if (defined(WIN32) && defined(NTSD_EAS)) - static ZCONST char Far InvalidSecurityEAs[] = - " EAs fail security check\n"; -# endif - static ZCONST char Far UnsuppNTSDVersEAs[] = - " unsupported NTSD EAs version %d\n"; - static ZCONST char Far BadCRC_EAs[] = " bad CRC for extended attributes\n"; - static ZCONST char Far UnknComprMethodEAs[] = - " unknown compression method for EAs (%u)\n"; - static ZCONST char Far NotEnoughMemEAs[] = - " out of memory while inflating EAs\n"; - static ZCONST char Far UnknErrorEAs[] = - " unknown error on extended attributes\n"; -#endif /* !SFX */ - -static ZCONST char Far UnsupportedExtraField[] = - "\nerror: unsupported extra-field compression type (%u)--skipping\n"; -static ZCONST char Far BadExtraFieldCRC[] = - "error [%s]: bad extra-field CRC %08lx (should be %08lx)\n"; - - - - - -/**************************************/ -/* Function extract_or_test_files() */ -/**************************************/ - -int extract_or_test_files(__G) /* return PK-type error code */ - __GDEF -{ - unsigned i, j; - zoff_t cd_bufstart; - uch *cd_inptr; - int cd_incnt; - ulg filnum=0L, blknum=0L; - int reached_end; -#ifndef SFX - int no_endsig_found; -#endif - int error, error_in_archive=PK_COOL; - int *fn_matched=NULL, *xn_matched=NULL; - zucn_t members_processed; - ulg num_skipped=0L, num_bad_pwd=0L; - zoff_t old_extra_bytes = 0L; -#ifdef SET_DIR_ATTRIB - unsigned num_dirs=0; - direntry *dirlist=(direntry *)NULL, **sorted_dirlist=(direntry **)NULL; -#endif - - /* - * First, two general initializations are applied. These have been moved - * here from process_zipfiles() because they are only needed for accessing - * and/or extracting the data content of the zip archive. - */ - - /* a) initialize the CRC table pointer (once) */ - if (CRC_32_TAB == NULL) { - if ((CRC_32_TAB = get_crc_table()) == NULL) { - return PK_MEM; - } - } - -#if (!defined(SFX) || defined(SFX_EXDIR)) - /* b) check out if specified extraction root directory exists */ - if (uO.exdir != (char *)NULL && G.extract_flag) { - G.create_dirs = !uO.fflag; - if ((error = checkdir(__G__ uO.exdir, ROOT)) > MPN_INF_SKIP) { - /* out of memory, or file in way */ - return (error == MPN_NOMEM ? PK_MEM : PK_ERR); - } - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - The basic idea of this function is as follows. Since the central di- - rectory lies at the end of the zipfile and the member files lie at the - beginning or middle or wherever, it is not very desirable to simply - read a central directory entry, jump to the member and extract it, and - then jump back to the central directory. In the case of a large zipfile - this would lead to a whole lot of disk-grinding, especially if each mem- - ber file is small. Instead, we read from the central directory the per- - tinent information for a block of files, then go extract/test the whole - block. Thus this routine contains two small(er) loops within a very - large outer loop: the first of the small ones reads a block of files - from the central directory; the second extracts or tests each file; and - the outer one loops over blocks. There's some file-pointer positioning - stuff in between, but that's about it. Btw, it's because of this jump- - ing around that we can afford to be lenient if an error occurs in one of - the member files: we should still be able to go find the other members, - since we know the offset of each from the beginning of the zipfile. - ---------------------------------------------------------------------------*/ - - G.pInfo = G.info; - -#if CRYPT - G.newzip = TRUE; -#endif -#ifndef SFX - G.reported_backslash = FALSE; -#endif - - /* malloc space for check on unmatched filespecs (OK if one or both NULL) */ - if (G.filespecs > 0 && - (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != (int *)NULL) - for (i = 0; i < G.filespecs; ++i) - fn_matched[i] = FALSE; - if (G.xfilespecs > 0 && - (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != (int *)NULL) - for (i = 0; i < G.xfilespecs; ++i) - xn_matched[i] = FALSE; - -/*--------------------------------------------------------------------------- - Begin main loop over blocks of member files. We know the entire central - directory is on this disk: we would not have any of this information un- - less the end-of-central-directory record was on this disk, and we would - not have gotten to this routine unless this is also the disk on which - the central directory starts. In practice, this had better be the ONLY - disk in the archive, but we'll add multi-disk support soon. - ---------------------------------------------------------------------------*/ - - members_processed = 0; -#ifndef SFX - no_endsig_found = FALSE; -#endif - reached_end = FALSE; - while (!reached_end) { - j = 0; -#ifdef AMIGA - memzero(G.filenotes, DIR_BLKSIZ * sizeof(char *)); -#endif - - /* - * Loop through files in central directory, storing offsets, file - * attributes, case-conversion and text-conversion flags until block - * size is reached. - */ - - while ((j < DIR_BLKSIZ)) { - G.pInfo = &G.info[j]; - - if (readbuf(__G__ G.sig, 4) == 0) { - error_in_archive = PK_EOF; - reached_end = TRUE; /* ...so no more left to do */ - break; - } - if (memcmp(G.sig, central_hdr_sig, 4)) { /* is it a new entry? */ - /* no new central directory entry - * -> is the number of processed entries compatible with the - * number of entries as stored in the end_central record? - */ - if ((members_processed - & (G.ecrec.have_ecr64 ? MASK_ZUCN64 : MASK_ZUCN16)) - == G.ecrec.total_entries_central_dir) { -#ifndef SFX - /* yes, so look if we ARE back at the end_central record - */ - no_endsig_found = - ( (memcmp(G.sig, - (G.ecrec.have_ecr64 ? - end_central64_sig : end_central_sig), - 4) != 0) - && (!G.ecrec.is_zip64_archive) - && (memcmp(G.sig, end_central_sig, 4) != 0) - ); -#endif /* !SFX */ - } else { - /* no; we have found an error in the central directory - * -> report it and stop searching for more Zip entries - */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; - } - reached_end = TRUE; /* ...so no more left to do */ - break; - } - /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag */ - if ((error = process_cdir_file_hdr(__G)) != PK_COOL) { - error_in_archive = error; /* only PK_EOF defined */ - reached_end = TRUE; /* ...so no more left to do */ - break; - } - if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal: no more left to do */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilNamMsg), - FnFilter1(G.filename), "central")); - reached_end = TRUE; - break; - } - } - if ((error = do_string(__G__ G.crec.extra_field_length, - EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtFieldMsg), - FnFilter1(G.filename), "central")); - reached_end = TRUE; - break; - } - } -#ifdef AMIGA - G.filenote_slot = j; - if ((error = do_string(__G__ G.crec.file_comment_length, - uO.N_flag ? FILENOTE : SKIP)) != PK_COOL) -#else - if ((error = do_string(__G__ G.crec.file_comment_length, SKIP)) - != PK_COOL) -#endif - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal */ - Info(slide, 0x421, ((char *)slide, - LoadFarString(BadFileCommLength), - FnFilter1(G.filename))); - reached_end = TRUE; - break; - } - } - if (G.process_all_files) { - if (store_info(__G)) - ++j; /* file is OK; info[] stored; continue with next */ - else - ++num_skipped; - } else { - int do_this_file; - - if (G.filespecs == 0) - do_this_file = TRUE; - else { /* check if this entry matches an `include' argument */ - do_this_file = FALSE; - for (i = 0; i < G.filespecs; i++) - if (match(G.filename, G.pfnames[i], uO.C_flag WISEP)) { - do_this_file = TRUE; /* ^-- ignore case or not? */ - if (fn_matched) - fn_matched[i] = TRUE; - break; /* found match, so stop looping */ - } - } - if (do_this_file) { /* check if this is an excluded file */ - for (i = 0; i < G.xfilespecs; i++) - if (match(G.filename, G.pxnames[i], uO.C_flag WISEP)) { - do_this_file = FALSE; /* ^-- ignore case or not? */ - if (xn_matched) - xn_matched[i] = TRUE; - break; - } - } - if (do_this_file) { - if (store_info(__G)) - ++j; /* file is OK */ - else - ++num_skipped; /* unsupp. compression or encryption */ - } - } /* end if (process_all_files) */ - - members_processed++; - - } /* end while-loop (adding files to current block) */ - - /* save position in central directory so can come back later */ - cd_bufstart = G.cur_zipfile_bufstart; - cd_inptr = G.inptr; - cd_incnt = G.incnt; - - /*----------------------------------------------------------------------- - Second loop: process files in current block, extracting or testing - each one. - -----------------------------------------------------------------------*/ - - error = extract_or_test_entrylist(__G__ j, - &filnum, &num_bad_pwd, &old_extra_bytes, -#ifdef SET_DIR_ATTRIB - &num_dirs, &dirlist, -#endif - error_in_archive); - if (error != PK_COOL) { - if (error > error_in_archive) - error_in_archive = error; - /* ...and keep going (unless disk full or user break) */ - if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { - /* clear reached_end to signal premature stop ... */ - reached_end = FALSE; - /* ... and cancel scanning the central directory */ - break; - } - } - - - /* - * Jump back to where we were in the central directory, then go and do - * the next batch of files. - */ - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, cd_bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = - zlseek(G.zipfd, cd_bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - read(G.zipfd, (char *)G.inbuf, INBUFSIZ); /* been here before... */ - G.inptr = cd_inptr; - G.incnt = cd_incnt; - ++blknum; - -#ifdef TEST - printf("\ncd_bufstart = %ld (%.8lXh)\n", cd_bufstart, cd_bufstart); - printf("cur_zipfile_bufstart = %ld (%.8lXh)\n", cur_zipfile_bufstart, - cur_zipfile_bufstart); - printf("inptr-inbuf = %d\n", G.inptr-G.inbuf); - printf("incnt = %d\n\n", G.incnt); -#endif - - } /* end while-loop (blocks of files in central directory) */ - -/*--------------------------------------------------------------------------- - Process the list of deferred symlink extractions and finish up - the symbolic links. - ---------------------------------------------------------------------------*/ - -#ifdef SYMLINKS - if (G.slink_last != NULL) { - if (QCOND2) - Info(slide, 0, ((char *)slide, LoadFarString(SymLnkDeferred))); - while (G.slink_head != NULL) { - set_deferred_symlink(__G__ G.slink_head); - /* remove the processed entry from the chain and free its memory */ - G.slink_last = G.slink_head; - G.slink_head = G.slink_last->next; - free(G.slink_last); - } - G.slink_last = NULL; - } -#endif /* SYMLINKS */ - -/*--------------------------------------------------------------------------- - Go back through saved list of directories, sort and set times/perms/UIDs - and GIDs from the deepest level on up. - ---------------------------------------------------------------------------*/ - -#ifdef SET_DIR_ATTRIB - if (num_dirs > 0) { - sorted_dirlist = (direntry **)malloc(num_dirs*sizeof(direntry *)); - if (sorted_dirlist == (direntry **)NULL) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(DirlistSortNoMem))); - while (dirlist != (direntry *)NULL) { - direntry *d = dirlist; - - dirlist = dirlist->next; - free(d); - } - } else { - ulg ndirs_fail = 0; - - if (num_dirs == 1) - sorted_dirlist[0] = dirlist; - else { - for (i = 0; i < num_dirs; ++i) { - sorted_dirlist[i] = dirlist; - dirlist = dirlist->next; - } - qsort((char *)sorted_dirlist, num_dirs, sizeof(direntry *), - dircomp); - } - - Trace((stderr, "setting directory times/perms/attributes\n")); - for (i = 0; i < num_dirs; ++i) { - direntry *d = sorted_dirlist[i]; - - Trace((stderr, "dir = %s\n", d->fn)); - if ((error = set_direc_attribs(__G__ d)) != PK_OK) { - ndirs_fail++; - Info(slide, 0x201, ((char *)slide, - LoadFarString(DirlistSetAttrFailed), d->fn)); - if (!error_in_archive) - error_in_archive = error; - } - free(d); - } - free(sorted_dirlist); - if (!uO.tflag && QCOND2) { - if (ndirs_fail > 0) - Info(slide, 0, ((char *)slide, - LoadFarString(DirlistFailAttrSum), ndirs_fail)); - } - } - } -#endif /* SET_DIR_ATTRIB */ - -/*--------------------------------------------------------------------------- - Check for unmatched filespecs on command line and print warning if any - found. Free allocated memory. (But suppress check when central dir - scan was interrupted prematurely.) - ---------------------------------------------------------------------------*/ - - if (fn_matched) { - if (reached_end) for (i = 0; i < G.filespecs; ++i) - if (!fn_matched[i]) { -#ifdef DLL - if (!G.redirect_data && !G.redirect_text) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[i])); - else - setFileNotFound(__G); -#else - Info(slide, 1, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[i])); -#endif - if (error_in_archive <= PK_WARN) - error_in_archive = PK_FIND; /* some files not found */ - } - free((zvoid *)fn_matched); - } - if (xn_matched) { - if (reached_end) for (i = 0; i < G.xfilespecs; ++i) - if (!xn_matched[i]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExclFilenameNotMatched), G.pxnames[i])); - free((zvoid *)xn_matched); - } - -/*--------------------------------------------------------------------------- - Now, all locally allocated memory has been released. When the central - directory processing has been interrupted prematurely, it is safe to - return immediately. All completeness checks and summary messages are - skipped in this case. - ---------------------------------------------------------------------------*/ - if (!reached_end) - return error_in_archive; - -/*--------------------------------------------------------------------------- - Double-check that we're back at the end-of-central-directory record, and - print quick summary of results, if we were just testing the archive. We - send the summary to stdout so that people doing the testing in the back- - ground and redirecting to a file can just do a "tail" on the output file. - ---------------------------------------------------------------------------*/ - -#ifndef SFX - if (no_endsig_found) { /* just to make sure */ - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); - Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg))); - if (!error_in_archive) /* don't overwrite stronger error */ - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - if (uO.tflag) { - ulg num = filnum - num_bad_pwd; - - if (uO.qflag < 2) { /* GRR 930710: was (uO.qflag == 1) */ - if (error_in_archive) - Info(slide, 0, ((char *)slide, LoadFarString(ErrorInArchive), - (error_in_archive == PK_WARN)? "warning-" : "", G.zipfn)); - else if (num == 0L) - Info(slide, 0, ((char *)slide, LoadFarString(ZeroFilesTested), - G.zipfn)); - else if (G.process_all_files && (num_skipped+num_bad_pwd == 0L)) - Info(slide, 0, ((char *)slide, LoadFarString(NoErrInCompData), - G.zipfn)); - else - Info(slide, 0, ((char *)slide, LoadFarString(NoErrInTestedFiles) - , G.zipfn, num, (num==1L)? "":"s")); - if (num_skipped > 0L) - Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipped), - num_skipped, (num_skipped==1L)? "":"s")); -#if CRYPT - if (num_bad_pwd > 0L) - Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipBadPasswd) - , num_bad_pwd, (num_bad_pwd==1L)? "":"s")); -#endif /* CRYPT */ - } - } - - /* give warning if files not tested or extracted (first condition can still - * happen if zipfile is empty and no files specified on command line) */ - - if ((filnum == 0) && error_in_archive <= PK_WARN) { - if (num_skipped > 0L) - error_in_archive = IZ_UNSUP; /* unsupport. compression/encryption */ - else - error_in_archive = PK_FIND; /* no files found at all */ - } -#if CRYPT - else if ((filnum == num_bad_pwd) && error_in_archive <= PK_WARN) - error_in_archive = IZ_BADPWD; /* bad passwd => all files skipped */ -#endif - else if ((num_skipped > 0L) && error_in_archive <= PK_WARN) - error_in_archive = IZ_UNSUP; /* was PK_WARN; Jean-loup complained */ -#if CRYPT - else if ((num_bad_pwd > 0L) && !error_in_archive) - error_in_archive = PK_WARN; -#endif - - return error_in_archive; - -} /* end function extract_or_test_files() */ - - - - - -/***************************/ -/* Function store_info() */ -/***************************/ - -static int store_info(__G) /* return 0 if skipping, 1 if OK */ - __GDEF -{ -#ifdef USE_BZIP2 -# define UNKN_BZ2 (G.crec.compression_method!=BZIPPED) -#else -# define UNKN_BZ2 TRUE /* bzip2 unknown */ -#endif - -#ifdef USE_LZMA -# define UNKN_LZMA (G.crec.compression_method!=LZMAED) -#else -# define UNKN_LZMA TRUE /* LZMA unknown */ -#endif - -#ifdef USE_WAVP -# define UNKN_WAVP (G.crec.compression_method!=WAVPACKED) -#else -# define UNKN_WAVP TRUE /* WavPack unknown */ -#endif - -#ifdef USE_PPMD -# define UNKN_PPMD (G.crec.compression_method!=PPMDED) -#else -# define UNKN_PPMD TRUE /* PPMd unknown */ -#endif - -#ifdef SFX -# ifdef USE_DEFLATE64 -# define UNKN_COMPR \ - (G.crec.compression_method!=STORED && G.crec.compression_methodENHDEFLATED \ - && UNKN_BZ2 && UNKN_LZMA && UNKN_WAVP && UNKN_PPMD) -# else -# define UNKN_COMPR \ - (G.crec.compression_method!=STORED && G.crec.compression_method!=DEFLATED\ - && UNKN_BZ2 && UNKN_LZMA && UNKN_WAVP && UNKN_PPMD) -# endif -#else -# ifdef COPYRIGHT_CLEAN /* no reduced files */ -# define UNKN_RED (G.crec.compression_method >= REDUCED1 && \ - G.crec.compression_method <= REDUCED4) -# else -# define UNKN_RED FALSE /* reducing not unknown */ -# endif -# ifdef LZW_CLEAN /* no shrunk files */ -# define UNKN_SHR (G.crec.compression_method == SHRUNK) -# else -# define UNKN_SHR FALSE /* unshrinking not unknown */ -# endif -# ifdef USE_DEFLATE64 -# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ - G.crec.compression_method==TOKENIZED || \ - (G.crec.compression_method>ENHDEFLATED && UNKN_BZ2 && UNKN_LZMA \ - && UNKN_WAVP && UNKN_PPMD)) -# else -# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ - G.crec.compression_method==TOKENIZED || \ - (G.crec.compression_method>DEFLATED && UNKN_BZ2 && UNKN_LZMA \ - && UNKN_WAVP && UNKN_PPMD)) -# endif -#endif - -#if (defined(USE_BZIP2) && (UNZIP_VERSION < UNZIP_BZ2VERS)) - int unzvers_support = (UNKN_BZ2 ? UNZIP_VERSION : UNZIP_BZ2VERS); -# define UNZVERS_SUPPORT unzvers_support -#else -# define UNZVERS_SUPPORT UNZIP_VERSION -#endif - -/*--------------------------------------------------------------------------- - Check central directory info for version/compatibility requirements. - ---------------------------------------------------------------------------*/ - - G.pInfo->encrypted = G.crec.general_purpose_bit_flag & 1; /* bit field */ - G.pInfo->ExtLocHdr = (G.crec.general_purpose_bit_flag & 8) == 8; /* bit */ - G.pInfo->textfile = G.crec.internal_file_attributes & 1; /* bit field */ - G.pInfo->crc = G.crec.crc32; - G.pInfo->compr_size = G.crec.csize; - G.pInfo->uncompr_size = G.crec.ucsize; - - switch (uO.aflag) { - case 0: - G.pInfo->textmode = FALSE; /* bit field */ - break; - case 1: - G.pInfo->textmode = G.pInfo->textfile; /* auto-convert mode */ - break; - default: /* case 2: */ - G.pInfo->textmode = TRUE; - break; - } - - if (G.crec.version_needed_to_extract[1] == VMS_) { - if (G.crec.version_needed_to_extract[0] > VMS_UNZIP_VERSION) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), - FnFilter1(G.filename), "VMS", - G.crec.version_needed_to_extract[0] / 10, - G.crec.version_needed_to_extract[0] % 10, - VMS_UNZIP_VERSION / 10, VMS_UNZIP_VERSION % 10)); - return 0; - } -#ifndef VMS /* won't be able to use extra field, but still have data */ - else if (!uO.tflag && !IS_OVERWRT_ALL) { /* if -o, extract anyway */ - Info(slide, 0x481, ((char *)slide, LoadFarString(VMSFormatQuery), - FnFilter1(G.filename))); - fgets(G.answerbuf, sizeof(G.answerbuf), stdin); - if ((*G.answerbuf != 'y') && (*G.answerbuf != 'Y')) - return 0; - } -#endif /* !VMS */ - /* usual file type: don't need VMS to extract */ - } else if (G.crec.version_needed_to_extract[0] > UNZVERS_SUPPORT) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), - FnFilter1(G.filename), "PK", - G.crec.version_needed_to_extract[0] / 10, - G.crec.version_needed_to_extract[0] % 10, - UNZVERS_SUPPORT / 10, UNZVERS_SUPPORT % 10)); - return 0; - } - - if (UNKN_COMPR) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) { -#ifndef SFX - unsigned cmpridx; - - if ((cmpridx = find_compr_idx(G.crec.compression_method)) - < NUM_METHODS) - Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgName), - FnFilter1(G.filename), - LoadFarStringSmall(ComprNames[cmpridx]))); - else -#endif - Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgNum), - FnFilter1(G.filename), - G.crec.compression_method)); - } - return 0; - } -#if (!CRYPT) - if (G.pInfo->encrypted) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(SkipEncrypted), - FnFilter1(G.filename))); - return 0; - } -#endif /* !CRYPT */ - -#ifndef SFX - /* store a copy of the central header filename for later comparison */ - if ((G.pInfo->cfilname = zfmalloc(strlen(G.filename) + 1)) == NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(WarnNoMemCFName), - FnFilter1(G.filename))); - } else - zfstrcpy(G.pInfo->cfilname, G.filename); -#endif /* !SFX */ - - /* map whatever file attributes we have into the local format */ - mapattr(__G); /* GRR: worry about return value later */ - - G.pInfo->diskstart = G.crec.disk_number_start; - G.pInfo->offset = (zoff_t)G.crec.relative_offset_local_header; - return 1; - -} /* end function store_info() */ - - - - - -#ifndef SFX -/*******************************/ -/* Function find_compr_idx() */ -/*******************************/ - -unsigned find_compr_idx(compr_methodnum) - unsigned compr_methodnum; -{ - unsigned i; - - for (i = 0; i < NUM_METHODS; i++) { - if (ComprIDs[i] == compr_methodnum) break; - } - return i; -} -#endif /* !SFX */ - - - - - -/******************************************/ -/* Function extract_or_test_entrylist() */ -/******************************************/ - -static int extract_or_test_entrylist(__G__ numchunk, - pfilnum, pnum_bad_pwd, pold_extra_bytes, -#ifdef SET_DIR_ATTRIB - pnum_dirs, pdirlist, -#endif - error_in_archive) /* return PK-type error code */ - __GDEF - unsigned numchunk; - ulg *pfilnum; - ulg *pnum_bad_pwd; - zoff_t *pold_extra_bytes; -#ifdef SET_DIR_ATTRIB - unsigned *pnum_dirs; - direntry **pdirlist; -#endif - int error_in_archive; -{ - unsigned i; - int renamed, query; - int skip_entry; - zoff_t bufstart, inbuf_offset, request; - int error, errcode; - -/* possible values for local skip_entry flag: */ -#define SKIP_NO 0 /* do not skip this entry */ -#define SKIP_Y_EXISTING 1 /* skip this entry, do not overwrite file */ -#define SKIP_Y_NONEXIST 2 /* skip this entry, do not create new file */ - - /*----------------------------------------------------------------------- - Second loop: process files in current block, extracting or testing - each one. - -----------------------------------------------------------------------*/ - - for (i = 0; i < numchunk; ++i) { - (*pfilnum)++; /* *pfilnum = i + blknum*DIR_BLKSIZ + 1; */ - G.pInfo = &G.info[i]; -#ifdef NOVELL_BUG_FAILSAFE - G.dne = FALSE; /* assume file exists until stat() says otherwise */ -#endif - - /* if the target position is not within the current input buffer - * (either haven't yet read far enough, or (maybe) skipping back- - * ward), skip to the target position and reset readbuf(). */ - - /* seek_zipf(__G__ pInfo->offset); */ - request = G.pInfo->offset + G.extra_bytes; - inbuf_offset = request % INBUFSIZ; - bufstart = request - inbuf_offset; - - Trace((stderr, "\ndebug: request = %ld, inbuf_offset = %ld\n", - (long)request, (long)inbuf_offset)); - Trace((stderr, - "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", - (long)bufstart, (long)G.cur_zipfile_bufstart)); - if (request < 0) { - Info(slide, 0x401, ((char *)slide, LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - error_in_archive = PK_ERR; - if (*pfilnum == 1 && G.extra_bytes != 0L) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AttemptRecompensate))); - *pold_extra_bytes = G.extra_bytes; - G.extra_bytes = 0L; - request = G.pInfo->offset; /* could also check if != 0 */ - inbuf_offset = request % INBUFSIZ; - bufstart = request - inbuf_offset; - Trace((stderr, "debug: request = %ld, inbuf_offset = %ld\n", - (long)request, (long)inbuf_offset)); - Trace((stderr, - "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", - (long)bufstart, (long)G.cur_zipfile_bufstart)); - /* try again */ - if (request < 0) { - Trace((stderr, - "debug: recompensated request still < 0\n")); - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; - continue; - } - } else { - error_in_archive = PK_BADERR; - continue; /* this one hosed; try next */ - } - } - - if (bufstart != G.cur_zipfile_bufstart) { - Trace((stderr, "debug: bufstart != cur_zipfile_bufstart\n")); -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = - zlseek(G.zipfd, bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, "lseek", (long)bufstart)); - error_in_archive = PK_BADERR; - continue; /* can still do next file */ - } - G.inptr = G.inbuf + (int)inbuf_offset; - G.incnt -= (int)inbuf_offset; - } else { - G.incnt += (int)(G.inptr-G.inbuf) - (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } - - /* should be in proper position now, so check for sig */ - if (readbuf(__G__ G.sig, 4) == 0) { /* bad offset */ - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, "EOF", (long)request)); - error_in_archive = PK_BADERR; - continue; /* but can still try next one */ - } - if (memcmp(G.sig, local_hdr_sig, 4)) { - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, LoadFarStringSmall(LocalHdrSig), (long)request)); - /* - GRRDUMP(G.sig, 4) - GRRDUMP(local_hdr_sig, 4) - */ - error_in_archive = PK_ERR; - if ((*pfilnum == 1 && G.extra_bytes != 0L) || - (G.extra_bytes == 0L && *pold_extra_bytes != 0L)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AttemptRecompensate))); - if (G.extra_bytes) { - *pold_extra_bytes = G.extra_bytes; - G.extra_bytes = 0L; - } else - G.extra_bytes = *pold_extra_bytes; /* third attempt */ - if (((error = seek_zipf(__G__ G.pInfo->offset)) != PK_OK) || - (readbuf(__G__ G.sig, 4) == 0)) { /* bad offset */ - if (error != PK_BADERR) - Info(slide, 0x401, ((char *)slide, - LoadFarString(OffsetMsg), *pfilnum, "EOF", - (long)request)); - error_in_archive = PK_BADERR; - continue; /* but can still try next one */ - } - if (memcmp(G.sig, local_hdr_sig, 4)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(OffsetMsg), *pfilnum, - LoadFarStringSmall(LocalHdrSig), (long)request)); - error_in_archive = PK_BADERR; - continue; - } - } else - continue; /* this one hosed; try next */ - } - if ((error = process_local_file_hdr(__G)) != PK_COOL) { - Info(slide, 0x421, ((char *)slide, LoadFarString(BadLocalHdr), - *pfilnum)); - error_in_archive = error; /* only PK_EOF defined */ - continue; /* can still try next one */ - } -#if (!defined(SFX) && defined(UNICODE_SUPPORT)) - if (((G.lrec.general_purpose_bit_flag & (1 << 11)) == (1 << 11)) - != (G.pInfo->GPFIsUTF8 != 0)) { - if (QCOND2) { -# ifdef SMALL_MEM - char *temp_cfilnam = slide + (7 * (WSIZE>>3)); - - zfstrcpy((char Far *)temp_cfilnam, G.pInfo->cfilname); -# define cFile_PrintBuf temp_cfilnam -# else -# define cFile_PrintBuf G.pInfo->cfilname -# endif - Info(slide, 0x421, ((char *)slide, - LoadFarStringSmall2(GP11FlagsDiffer), - *pfilnum, FnFilter1(cFile_PrintBuf), G.pInfo->GPFIsUTF8)); -# undef cFile_PrintBuf - } - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } -#endif /* !SFX && UNICODE_SUPPORT */ - if ((error = do_string(__G__ G.lrec.filename_length, DS_FN_L)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { - Info(slide, 0x401, ((char *)slide, LoadFarString(FilNamMsg), - FnFilter1(G.filename), "local")); - continue; /* go on to next one */ - } - } - if (G.extra_field != (uch *)NULL) { - free(G.extra_field); - G.extra_field = (uch *)NULL; - } - if ((error = - do_string(__G__ G.lrec.extra_field_length, EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtFieldMsg), - FnFilter1(G.filename), "local")); - continue; /* go on */ - } - } -#ifndef SFX - /* Filename consistency checks must come after reading in the local - * extra field, so that a UTF-8 entry name e.f. block has already - * been processed. - */ - if (G.pInfo->cfilname != (char Far *)NULL) { - if (zfstrcmp(G.pInfo->cfilname, G.filename) != 0) { -# ifdef SMALL_MEM - char *temp_cfilnam = slide + (7 * (WSIZE>>3)); - - zfstrcpy((char Far *)temp_cfilnam, G.pInfo->cfilname); -# define cFile_PrintBuf temp_cfilnam -# else -# define cFile_PrintBuf G.pInfo->cfilname -# endif - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall2(LvsCFNamMsg), - FnFilter2(cFile_PrintBuf), FnFilter1(G.filename))); -# undef cFile_PrintBuf - zfstrcpy(G.filename, G.pInfo->cfilname); - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } - zffree(G.pInfo->cfilname); - G.pInfo->cfilname = (char Far *)NULL; - } -#endif /* !SFX */ - /* Size consistency checks must come after reading in the local extra - * field, so that any Zip64 extension local e.f. block has already - * been processed. - */ - if (G.lrec.compression_method == STORED) { - zusz_t csiz_decrypted = G.lrec.csize; - - if (G.pInfo->encrypted) - csiz_decrypted -= 12; - if (G.lrec.ucsize != csiz_decrypted) { - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall2(WrnStorUCSizCSizDiff), - FnFilter1(G.filename), - FmZofft(G.lrec.ucsize, NULL, "u"), - FmZofft(csiz_decrypted, NULL, "u"))); - G.lrec.ucsize = csiz_decrypted; - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } - } - -#if CRYPT - if (G.pInfo->encrypted && - (error = decrypt(__G__ uO.pwdarg)) != PK_COOL) { - if (error == PK_WARN) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipIncorrectPasswd), - FnFilter1(G.filename))); - ++(*pnum_bad_pwd); - } else { /* (error > PK_WARN) */ - if (error > error_in_archive) - error_in_archive = error; - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipCannotGetPasswd), - FnFilter1(G.filename))); - } - continue; /* go on to next file */ - } -#endif /* CRYPT */ - - /* - * just about to extract file: if extracting to disk, check if - * already exists, and if so, take appropriate action according to - * fflag/uflag/overwrite_all/etc. (we couldn't do this in upper - * loop because we don't store the possibly renamed filename[] in - * info[]) - */ -#ifdef DLL - if (!uO.tflag && !uO.cflag && !G.redirect_data) -#else - if (!uO.tflag && !uO.cflag) -#endif - { - renamed = FALSE; /* user hasn't renamed output file yet */ - -startover: - query = FALSE; - skip_entry = SKIP_NO; - /* for files from DOS FAT, check for use of backslash instead - * of slash as directory separator (bug in some zipper(s); so - * far, not a problem in HPFS, NTFS or VFAT systems) - */ -#ifndef SFX - if (G.pInfo->hostnum == FS_FAT_ && !MBSCHR(G.filename, '/')) { - char *p=G.filename; - - if (*p) do { - if (*p == '\\') { - if (!G.reported_backslash) { - Info(slide, 0x21, ((char *)slide, - LoadFarString(BackslashPathSep), G.zipfn)); - G.reported_backslash = TRUE; - if (!error_in_archive) - error_in_archive = PK_WARN; - } - *p = '/'; - } - } while (*PREINCSTR(p)); - } -#endif /* !SFX */ - - if (!renamed) { - /* remove absolute path specs */ - if (G.filename[0] == '/') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AbsolutePathWarning), - FnFilter1(G.filename))); - if (!error_in_archive) - error_in_archive = PK_WARN; - do { - char *p = G.filename + 1; - do { - *(p-1) = *p; - } while (*p++ != '\0'); - } while (G.filename[0] == '/'); - } - } - - /* mapname can create dirs if not freshening or if renamed */ - error = mapname(__G__ renamed); - if ((errcode = error & ~MPN_MASK) != PK_OK && - error_in_archive < errcode) - error_in_archive = errcode; - if ((errcode = error & MPN_MASK) > MPN_INF_TRUNC) { - if (errcode == MPN_CREATED_DIR) { -#ifdef SET_DIR_ATTRIB - direntry *d_entry; - - error = defer_dir_attribs(__G__ &d_entry); - if (d_entry == (direntry *)NULL) { - /* There may be no dir_attribs info available, or - * we have encountered a mem allocation error. - * In case of an error, report it and set program - * error state to warning level. - */ - if (error) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(DirlistEntryNoMem))); - if (!error_in_archive) - error_in_archive = PK_WARN; - } - } else { - d_entry->next = (*pdirlist); - (*pdirlist) = d_entry; - ++(*pnum_dirs); - } -#endif /* SET_DIR_ATTRIB */ - } else if (errcode == MPN_VOL_LABEL) { -#ifdef DOS_OS2_W32 - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipVolumeLabel), - FnFilter1(G.filename), - uO.volflag? "hard disk " : "")); -#else - Info(slide, 1, ((char *)slide, - LoadFarString(SkipVolumeLabel), - FnFilter1(G.filename), "")); -#endif - } else if (errcode > MPN_INF_SKIP && - error_in_archive < PK_ERR) - error_in_archive = PK_ERR; - Trace((stderr, "mapname(%s) returns error code = %d\n", - FnFilter1(G.filename), error)); - continue; /* go on to next file */ - } - -#ifdef QDOS - QFilename(__G__ G.filename); -#endif - switch (check_for_newer(__G__ G.filename)) { - case DOES_NOT_EXIST: -#ifdef NOVELL_BUG_FAILSAFE - G.dne = TRUE; /* stat() says file DOES NOT EXIST */ -#endif - /* freshen (no new files): skip unless just renamed */ - if (uO.fflag && !renamed) - skip_entry = SKIP_Y_NONEXIST; - break; - case EXISTS_AND_OLDER: -#ifdef UNIXBACKUP - if (!uO.B_flag) -#endif - { - if (IS_OVERWRT_NONE) - /* never overwrite: skip file */ - skip_entry = SKIP_Y_EXISTING; - else if (!IS_OVERWRT_ALL) - query = TRUE; - } - break; - case EXISTS_AND_NEWER: /* (or equal) */ -#ifdef UNIXBACKUP - if ((!uO.B_flag && IS_OVERWRT_NONE) || -#else - if (IS_OVERWRT_NONE || -#endif - (uO.uflag && !renamed)) { - /* skip if update/freshen & orig name */ - skip_entry = SKIP_Y_EXISTING; - } else { -#ifdef UNIXBACKUP - if (!IS_OVERWRT_ALL && !uO.B_flag) -#else - if (!IS_OVERWRT_ALL) -#endif - query = TRUE; - } - break; - } -#ifdef VMS - /* 2008-07-24 SMS. - * On VMS, if the file name includes a version number, - * and "-V" ("retain VMS version numbers", V_flag) is in - * effect, then the VMS-specific code will handle any - * conflicts with an existing file, making this query - * redundant. (Implicit "y" response here.) - */ - if (query && uO.V_flag) { - /* Not discarding file versions. Look for one. */ - int cndx = strlen(G.filename) - 1; - - while ((cndx > 0) && (isdigit(G.filename[cndx]))) - cndx--; - if (G.filename[cndx] == ';') - /* File version found; skip the generic query, - * proceeding with its default response "y". - */ - query = FALSE; - } -#endif /* VMS */ - if (query) { -#ifdef WINDLL - switch (G.lpUserFunctions->replace != NULL ? - (*G.lpUserFunctions->replace)(G.filename, FILNAMSIZ) : - IDM_REPLACE_NONE) { - case IDM_REPLACE_RENAME: - _ISO_INTERN(G.filename); - renamed = TRUE; - goto startover; - case IDM_REPLACE_ALL: - G.overwrite_mode = OVERWRT_ALWAYS; - /* FALL THROUGH, extract */ - case IDM_REPLACE_YES: - break; - case IDM_REPLACE_NONE: - G.overwrite_mode = OVERWRT_NEVER; - /* FALL THROUGH, skip */ - case IDM_REPLACE_NO: - skip_entry = SKIP_Y_EXISTING; - break; - } -#else /* !WINDLL */ - extent fnlen; -reprompt: - Info(slide, 0x81, ((char *)slide, - LoadFarString(ReplaceQuery), - FnFilter1(G.filename))); - if (fgets(G.answerbuf, sizeof(G.answerbuf), stdin) - == (char *)NULL) { - Info(slide, 1, ((char *)slide, - LoadFarString(AssumeNone))); - *G.answerbuf = 'N'; - if (!error_in_archive) - error_in_archive = 1; /* not extracted: warning */ - } - switch (*G.answerbuf) { - case 'r': - case 'R': - do { - Info(slide, 0x81, ((char *)slide, - LoadFarString(NewNameQuery))); - fgets(G.filename, FILNAMSIZ, stdin); - /* usually get \n here: better check for it */ - fnlen = strlen(G.filename); - if (lastchar(G.filename, fnlen) == '\n') - G.filename[--fnlen] = '\0'; - } while (fnlen == 0); -#ifdef WIN32 /* WIN32 fgets( ... , stdin) returns OEM coded strings */ - _OEM_INTERN(G.filename); -#endif - renamed = TRUE; - goto startover; /* sorry for a goto */ - case 'A': /* dangerous option: force caps */ - G.overwrite_mode = OVERWRT_ALWAYS; - /* FALL THROUGH, extract */ - case 'y': - case 'Y': - break; - case 'N': - G.overwrite_mode = OVERWRT_NEVER; - /* FALL THROUGH, skip */ - case 'n': - /* skip file */ - skip_entry = SKIP_Y_EXISTING; - break; - case '\n': - case '\r': - /* Improve echo of '\n' and/or '\r' - (sizeof(G.answerbuf) == 10 (see globals.h), so - there is enough space for the provided text...) */ - strcpy(G.answerbuf, "{ENTER}"); - /* fall through ... */ - default: - /* usually get \n here: remove it for nice display - (fnlen can be re-used here, we are outside the - "enter new filename" loop) */ - fnlen = strlen(G.answerbuf); - if (lastchar(G.answerbuf, fnlen) == '\n') - G.answerbuf[--fnlen] = '\0'; - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidResponse), G.answerbuf)); - goto reprompt; /* yet another goto? */ - } /* end switch (*answerbuf) */ -#endif /* ?WINDLL */ - } /* end if (query) */ - if (skip_entry != SKIP_NO) { -#ifdef WINDLL - if (skip_entry == SKIP_Y_EXISTING) { - /* report skipping of an existing entry */ - Info(slide, 0, ((char *)slide, - ((IS_OVERWRT_NONE || !uO.uflag || renamed) ? - "Target file exists. Skipping %s\n" : - "Target file newer. Skipping %s\n"), - FnFilter1(G.filename))); - } -#endif /* WINDLL */ - continue; - } - } /* end if (extracting to disk) */ - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn, - G.filename, NULL)) { - return IZ_CTRLC; /* cancel operation by user request */ - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif -#ifdef AMIGA - G.filenote_slot = i; -#endif - G.disk_full = 0; - if ((error = extract_or_test_member(__G)) != PK_COOL) { - if (error > error_in_archive) - error_in_archive = error; /* ...and keep going */ -#ifdef DLL - if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { -#else - if (G.disk_full > 1) { -#endif - return error_in_archive; /* (unless disk full) */ - } - } -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, - G.filename, (zvoid *)&G.lrec.ucsize)) { - return IZ_CTRLC; /* cancel operation by user request */ - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif - } /* end for-loop (i: files in current block) */ - - return error_in_archive; - -} /* end function extract_or_test_entrylist() */ - - - - - -/* wsize is used in extract_or_test_member() and UZbunzip2() */ -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define wsize G._wsize /* wsize is a variable */ -#else -# define wsize WSIZE /* wsize is a constant */ -#endif - -/***************************************/ -/* Function extract_or_test_member() */ -/***************************************/ - -static int extract_or_test_member(__G) /* return PK-type error code */ - __GDEF -{ - char *nul="[empty] ", *txt="[text] ", *bin="[binary]"; -#ifdef CMS_MVS - char *ebc="[ebcdic]"; -#endif - register int b; - int r, error=PK_COOL; - - -/*--------------------------------------------------------------------------- - Initialize variables, buffers, etc. - ---------------------------------------------------------------------------*/ - - G.bits_left = 0; - G.bitbuf = 0L; /* unreduce and unshrink only */ - G.zipeof = 0; - G.newfile = TRUE; - G.crc32val = CRCVAL_INITIAL; - -#ifdef SYMLINKS - /* If file is a (POSIX-compatible) symbolic link and we are extracting - * to disk, prepare to restore the link. */ - G.symlnk = (G.pInfo->symlink && - !uO.tflag && !uO.cflag && (G.lrec.ucsize > 0)); -#endif /* SYMLINKS */ - - if (uO.tflag) { - if (!uO.qflag) - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), "test", - FnFilter1(G.filename), "", "")); - } else { -#ifdef DLL - if (uO.cflag && !G.redirect_data) -#else - if (uO.cflag) -#endif - { -#if (defined(OS2) && defined(__IBMC__) && (__IBMC__ >= 200)) - G.outfile = freopen("", "wb", stdout); /* VAC++ ignores setmode */ -#else - G.outfile = stdout; -#endif -#ifdef DOS_FLX_NLM_OS2_W32 -#if (defined(__HIGHC__) && !defined(FLEXOS)) - setmode(G.outfile, _BINARY); -#else /* !(defined(__HIGHC__) && !defined(FLEXOS)) */ - setmode(fileno(G.outfile), O_BINARY); -#endif /* ?(defined(__HIGHC__) && !defined(FLEXOS)) */ -# define NEWLINE "\r\n" -#else /* !DOS_FLX_NLM_OS2_W32 */ -# define NEWLINE "\n" -#endif /* ?DOS_FLX_NLM_OS2_W32 */ -#ifdef VMS - /* VMS: required even for stdout! */ - if ((r = open_outfile(__G)) != 0) - switch (r) { - case OPENOUT_SKIPOK: - return PK_OK; - case OPENOUT_SKIPWARN: - return PK_WARN; - default: - return PK_DISK; - } - } else if ((r = open_outfile(__G)) != 0) - switch (r) { - case OPENOUT_SKIPOK: - return PK_OK; - case OPENOUT_SKIPWARN: - return PK_WARN; - default: - return PK_DISK; - } -#else /* !VMS */ - } else if (open_outfile(__G)) - return PK_DISK; -#endif /* ?VMS */ - } - -/*--------------------------------------------------------------------------- - Unpack the file. - ---------------------------------------------------------------------------*/ - - defer_leftover_input(__G); /* so NEXTBYTE bounds check will work */ - switch (G.lrec.compression_method) { - case STORED: - if (!uO.tflag && QCOND2) { -#ifdef SYMLINKS - if (G.symlnk) /* can also be deflated, but rarer... */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "link", FnFilter1(G.filename), "", "")); - else -#endif /* SYMLINKS */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "extract", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.lrec.ucsize == 0L? nul : (G.pInfo->textfile? txt : - bin)), uO.cflag? NEWLINE : "")); - } -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) { - wsize = G.redirect_size; redirSlide = G.redirect_buffer; - } else { - wsize = WSIZE; redirSlide = slide; - } -#endif - G.outptr = redirSlide; - G.outcnt = 0L; - while ((b = NEXTBYTE) != EOF) { - *G.outptr++ = (uch)b; - if (++G.outcnt == wsize) { - error = flush(__G__ redirSlide, G.outcnt, 0); - G.outptr = redirSlide; - G.outcnt = 0L; - if (error != PK_COOL || G.disk_full) break; - } - } - if (G.outcnt) { /* flush final (partial) buffer */ - r = flush(__G__ redirSlide, G.outcnt, 0); - if (error < r) error = r; - } - break; - -#ifndef SFX -#ifndef LZW_CLEAN - case SHRUNK: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - LoadFarStringSmall(Unshrink), FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = unshrink(__G)) != PK_COOL) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == PK_MEM3 ? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Unshrink), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == PK_MEM3 ? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Unshrink))); - } - error = r; - } - break; -#endif /* !LZW_CLEAN */ - -#ifndef COPYRIGHT_CLEAN - case REDUCED1: - case REDUCED2: - case REDUCED3: - case REDUCED4: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "unreduc", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = unreduce(__G)) != PK_COOL) { - /* unreduce() returns only PK_COOL, PK_DISK, or IZ_CTRLC */ - error = r; - } - break; -#endif /* !COPYRIGHT_CLEAN */ - - case IMPLODED: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "explod", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = explode(__G)) != 0) { - if (r == 5) { /* treat 5 specially */ - int warning = ((zusz_t)G.used_csize <= G.lrec.csize); - - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarString(LengthMsg), - "", warning ? "warning" : "error", - FmZofft(G.used_csize, NULL, NULL), - FmZofft(G.lrec.ucsize, NULL, "u"), - warning ? " " : "", - FmZofft(G.lrec.csize, NULL, "u"), - " [", FnFilter1(G.filename), "]")); - else - Info(slide, 0x401, ((char *)slide, - LoadFarString(LengthMsg), - "\n", warning ? "warning" : "error", - FmZofft(G.used_csize, NULL, NULL), - FmZofft(G.lrec.ucsize, NULL, "u"), - warning ? " " : "", - FmZofft(G.lrec.csize, NULL, "u"), - "", "", ".")); - error = warning ? PK_WARN : PK_ERR; - } else if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Explode), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Explode))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; -#endif /* !SFX */ - - case DEFLATED: -#ifdef USE_DEFLATE64 - case ENHDEFLATED: -#endif - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "inflat", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } -#ifndef USE_ZLIB /* zlib's function is called inflate(), too */ -# define UZinflate inflate -#endif - if ((r = UZinflate(__G__ - (G.lrec.compression_method == ENHDEFLATED))) - != 0) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; - -#ifdef USE_BZIP2 - case BZIPPED: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "bunzipp", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = UZbunzip2(__G)) != 0) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(BUnzip), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(BUnzip))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; -#endif /* USE_BZIP2 */ - - default: /* should never get to this point */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(FileUnknownCompMethod), FnFilter1(G.filename))); - /* close and delete file before return? */ - undefer_input(__G); - return PK_WARN; - - } /* end switch (compression method) */ - -/*--------------------------------------------------------------------------- - Close the file and set its date and time (not necessarily in that order), - and make sure the CRC checked out OK. Logical-AND the CRC for 64-bit - machines (redundant on 32-bit machines). - ---------------------------------------------------------------------------*/ - -#ifdef VMS /* VMS: required even for stdout! (final flush) */ - if (!uO.tflag) /* don't close NULL file */ - close_outfile(__G); -#else -#ifdef DLL - if (!uO.tflag && (!uO.cflag || G.redirect_data)) { - if (G.redirect_data) - FINISH_REDIRECT(); - else - close_outfile(__G); - } -#else - if (!uO.tflag && !uO.cflag) /* don't close NULL file or stdout */ - close_outfile(__G); -#endif -#endif /* VMS */ - - /* GRR: CONVERT close_outfile() TO NON-VOID: CHECK FOR ERRORS! */ - - - if (G.disk_full) { /* set by flush() */ - if (G.disk_full > 1) { -#if (defined(DELETE_IF_FULL) && defined(HAVE_UNLINK)) - /* delete the incomplete file if we can */ - if (unlink(G.filename) != 0) - Trace((stderr, "extract.c: could not delete %s\n", - FnFilter1(G.filename))); -#else - /* warn user about the incomplete file */ - Info(slide, 0x421, ((char *)slide, LoadFarString(FileTruncated), - FnFilter1(G.filename))); -#endif - error = PK_DISK; - } else { - error = PK_WARN; - } - } - - if (error > PK_WARN) {/* don't print redundant CRC error if error already */ - undefer_input(__G); - return error; - } - if (G.crc32val != G.lrec.crc32) { - /* if quiet enough, we haven't output the filename yet: do it */ - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 0x401, ((char *)slide, LoadFarString(BadCRC), G.crc32val, - G.lrec.crc32)); -#if CRYPT - if (G.pInfo->encrypted) - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeBadPasswd))); -#endif - error = PK_ERR; - } else if (uO.tflag) { -#ifndef SFX - if (G.extra_field) { - if ((r = TestExtraField(__G__ G.extra_field, - G.lrec.extra_field_length)) > error) - error = r; - } else -#endif /* !SFX */ - if (!uO.qflag) - Info(slide, 0, ((char *)slide, " OK\n")); - } else { - if (QCOND2 && !error) /* GRR: is stdout reset to text mode yet? */ - Info(slide, 0, ((char *)slide, "\n")); - } - - undefer_input(__G); - return error; - -} /* end function extract_or_test_member() */ - - - - - -#ifndef SFX - -/*******************************/ -/* Function TestExtraField() */ -/*******************************/ - -static int TestExtraField(__G__ ef, ef_len) - __GDEF - uch *ef; - unsigned ef_len; -{ - ush ebID; - unsigned ebLen; - unsigned eb_cmpr_offs = 0; - int r; - - /* we know the regular compressed file data tested out OK, or else we - * wouldn't be here ==> print filename if any extra-field errors found - */ - while (ef_len >= EB_HEADSIZE) { - ebID = makeword(ef); - ebLen = (unsigned)makeword(ef+EB_LEN); - - if (ebLen > (ef_len - EB_HEADSIZE)) { - /* Discovered some extra field inconsistency! */ - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 1, ((char *)slide, LoadFarString(InconsistEFlength), - ebLen, (ef_len - EB_HEADSIZE))); - return PK_ERR; - } - - switch (ebID) { - case EF_OS2: - case EF_ACL: - case EF_MAC3: - case EF_BEOS: - case EF_ATHEOS: - switch (ebID) { - case EF_OS2: - case EF_ACL: - eb_cmpr_offs = EB_OS2_HLEN; - break; - case EF_MAC3: - if (ebLen >= EB_MAC3_HLEN && - (makeword(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) - & EB_M3_FL_UNCMPR) && - (makelong(ef+EB_HEADSIZE) == ebLen - EB_MAC3_HLEN)) - eb_cmpr_offs = 0; - else - eb_cmpr_offs = EB_MAC3_HLEN; - break; - case EF_BEOS: - case EF_ATHEOS: - if (ebLen >= EB_BEOS_HLEN && - (*(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) & EB_BE_FL_UNCMPR) && - (makelong(ef+EB_HEADSIZE) == ebLen - EB_BEOS_HLEN)) - eb_cmpr_offs = 0; - else - eb_cmpr_offs = EB_BEOS_HLEN; - break; - } - if ((r = test_compr_eb(__G__ ef, ebLen, eb_cmpr_offs, NULL)) - != PK_OK) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - switch (r) { - case IZ_EF_TRUNC: - Info(slide, 1, ((char *)slide, - LoadFarString(TruncEAs), - ebLen-(eb_cmpr_offs+EB_CMPRHEADLEN), "\n")); - break; - case PK_ERR: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidComprDataEAs))); - break; - case PK_MEM3: - case PK_MEM4: - Info(slide, 1, ((char *)slide, - LoadFarString(NotEnoughMemEAs))); - break; - default: - if ((r & 0xff) != PK_ERR) - Info(slide, 1, ((char *)slide, - LoadFarString(UnknErrorEAs))); - else { - ush m = (ush)(r >> 8); - if (m == DEFLATED) /* GRR KLUDGE! */ - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - else - Info(slide, 1, ((char *)slide, - LoadFarString(UnknComprMethodEAs), m)); - } - break; - } - return r; - } - break; - - case EF_NTSD: - Trace((stderr, "ebID: %i / ebLen: %u\n", ebID, ebLen)); - r = ebLen < EB_NTSD_L_LEN ? IZ_EF_TRUNC : - ((ef[EB_HEADSIZE+EB_NTSD_VERSION] > EB_NTSD_MAX_VER) ? - (PK_WARN | 0x4000) : - test_compr_eb(__G__ ef, ebLen, EB_NTSD_L_LEN, TEST_NTSD)); - if (r != PK_OK) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - switch (r) { - case IZ_EF_TRUNC: - Info(slide, 1, ((char *)slide, - LoadFarString(TruncNTSD), - ebLen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n")); - break; -#if (defined(WIN32) && defined(NTSD_EAS)) - case PK_WARN: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidSecurityEAs))); - break; -#endif - case PK_ERR: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidComprDataEAs))); - break; - case PK_MEM3: - case PK_MEM4: - Info(slide, 1, ((char *)slide, - LoadFarString(NotEnoughMemEAs))); - break; - case (PK_WARN | 0x4000): - Info(slide, 1, ((char *)slide, - LoadFarString(UnsuppNTSDVersEAs), - (int)ef[EB_HEADSIZE+EB_NTSD_VERSION])); - r = PK_WARN; - break; - default: - if ((r & 0xff) != PK_ERR) - Info(slide, 1, ((char *)slide, - LoadFarString(UnknErrorEAs))); - else { - ush m = (ush)(r >> 8); - if (m == DEFLATED) /* GRR KLUDGE! */ - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - else - Info(slide, 1, ((char *)slide, - LoadFarString(UnknComprMethodEAs), m)); - } - break; - } - return r; - } - break; - case EF_PKVMS: - if (makelong(ef+EB_HEADSIZE) != - crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4), - (extent)(ebLen-4))) - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - break; - case EF_PKW32: - case EF_PKUNIX: - case EF_ASIUNIX: - case EF_IZVMS: - case EF_IZUNIX: - case EF_VMCMS: - case EF_MVS: - case EF_SPARK: - case EF_TANDEM: - case EF_THEOS: - case EF_AV: - default: - break; - } - ef_len -= (ebLen + EB_HEADSIZE); - ef += (ebLen + EB_HEADSIZE); - } - - if (!uO.qflag) - Info(slide, 0, ((char *)slide, " OK\n")); - - return PK_COOL; - -} /* end function TestExtraField() */ - - - - - -/******************************/ -/* Function test_compr_eb() */ -/******************************/ - -#ifdef PROTO -static int test_compr_eb( - __GPRO__ - uch *eb, - unsigned eb_size, - unsigned compr_offset, - int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize)) -#else /* !PROTO */ -static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata) - __GDEF - uch *eb; - unsigned eb_size; - unsigned compr_offset; - int (*test_uc_ebdata)(); -#endif /* ?PROTO */ -{ - ulg eb_ucsize; - uch *eb_ucptr; - int r; - - if (compr_offset < 4) /* field is not compressed: */ - return PK_OK; /* do nothing and signal OK */ - - if ((eb_size < (EB_UCSIZE_P + 4)) || - ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L && - eb_size <= (compr_offset + EB_CMPRHEADLEN))) - return IZ_EF_TRUNC; /* no compressed data! */ - - if ( -#ifdef INT_16BIT - (((ulg)(extent)eb_ucsize) != eb_ucsize) || -#endif - (eb_ucptr = (uch *)malloc((extent)eb_ucsize)) == (uch *)NULL) - return PK_MEM4; - - r = memextract(__G__ eb_ucptr, eb_ucsize, - eb + (EB_HEADSIZE + compr_offset), - (ulg)(eb_size - compr_offset)); - - if (r == PK_OK && test_uc_ebdata != NULL) - r = (*test_uc_ebdata)(__G__ eb, eb_size, eb_ucptr, eb_ucsize); - - free(eb_ucptr); - return r; - -} /* end function test_compr_eb() */ - -#endif /* !SFX */ - - - - - -/***************************/ -/* Function memextract() */ -/***************************/ - -int memextract(__G__ tgt, tgtsize, src, srcsize) /* extract compressed */ - __GDEF /* extra field block; */ - uch *tgt; /* return PK-type error */ - ulg tgtsize; /* level */ - ZCONST uch *src; - ulg srcsize; -{ - zoff_t old_csize=G.csize; - uch *old_inptr=G.inptr; - int old_incnt=G.incnt; - int r, error=PK_OK; - ush method; - ulg extra_field_crc; - - - method = makeword(src); - extra_field_crc = makelong(src+2); - - /* compressed extra field exists completely in memory at this location: */ - G.inptr = (uch *)src + (2 + 4); /* method and extra_field_crc */ - G.incnt = (int)(G.csize = (long)(srcsize - (2 + 4))); - G.mem_mode = TRUE; - G.outbufptr = tgt; - G.outsize = tgtsize; - - switch (method) { - case STORED: - memcpy((char *)tgt, (char *)G.inptr, (extent)G.incnt); - G.outcnt = (ulg)G.csize; /* for CRC calculation */ - break; - case DEFLATED: -#ifdef USE_DEFLATE64 - case ENHDEFLATED: -#endif - G.outcnt = 0L; - if ((r = UZinflate(__G__ (method == ENHDEFLATED))) != 0) { - if (!uO.tflag) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate))); - error = (r == 3)? PK_MEM3 : PK_ERR; - } - if (G.outcnt == 0L) /* inflate's final FLUSH sets outcnt */ - break; - break; - default: - if (uO.tflag) - error = PK_ERR | ((int)method << 8); - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnsupportedExtraField), method)); - error = PK_ERR; /* GRR: should be passed on up via SetEAs() */ - } - break; - } - - G.inptr = old_inptr; - G.incnt = old_incnt; - G.csize = old_csize; - G.mem_mode = FALSE; - - if (!error) { - register ulg crcval = crc32(CRCVAL_INITIAL, tgt, (extent)G.outcnt); - - if (crcval != extra_field_crc) { - if (uO.tflag) - error = PK_ERR | (DEFLATED << 8); /* kludge for now */ - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(BadExtraFieldCRC), G.zipfn, crcval, - extra_field_crc)); - error = PK_ERR; - } - } - } - return error; - -} /* end function memextract() */ - - - - - -/*************************/ -/* Function memflush() */ -/*************************/ - -int memflush(__G__ rawbuf, size) - __GDEF - ZCONST uch *rawbuf; - ulg size; -{ - if (size > G.outsize) - /* Here, PK_DISK is a bit off-topic, but in the sense of marking - "overflow of output space", its use may be tolerated. */ - return PK_DISK; /* more data than output buffer can hold */ - - - - memcpy((char *)G.outbufptr, (char *)rawbuf, (extent)size); - G.outbufptr += (unsigned int)size; - G.outsize -= size; - G.outcnt += size; - - return 0; - -} /* end function memflush() */ - - - - - -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - -/************************************/ -/* Function extract_izvms_block() */ -/************************************/ - -/* - * Extracts block from p. If resulting length is less than needed, fill - * extra space with corresponding bytes from 'init'. - * Currently understands 3 formats of block compression: - * - Simple storing - * - Compression of zero bytes to zero bits - * - Deflation (see memextract()) - * The IZVMS block data is returned in malloc'd space. - */ -uch *extract_izvms_block(__G__ ebdata, size, retlen, init, needlen) - __GDEF - ZCONST uch *ebdata; - unsigned size; - unsigned *retlen; - ZCONST uch *init; - unsigned needlen; -{ - uch *ucdata; /* Pointer to block allocated */ - int cmptype; - unsigned usiz, csiz; - - cmptype = (makeword(ebdata+EB_IZVMS_FLGS) & EB_IZVMS_BCMASK); - csiz = size - EB_IZVMS_HLEN; - usiz = (cmptype == EB_IZVMS_BCSTOR ? - csiz : makeword(ebdata+EB_IZVMS_UCSIZ)); - - if (retlen) - *retlen = usiz; - - if ((ucdata = (uch *)malloc(MAX(needlen, usiz))) == NULL) - return NULL; - - if (init && (usiz < needlen)) - memcpy((char *)ucdata, (ZCONST char *)init, needlen); - - switch (cmptype) - { - case EB_IZVMS_BCSTOR: /* The simplest case */ - memcpy(ucdata, ebdata+EB_IZVMS_HLEN, usiz); - break; - case EB_IZVMS_BC00: - decompress_bits(ucdata, usiz, ebdata+EB_IZVMS_HLEN); - break; - case EB_IZVMS_BCDEFL: - memextract(__G__ ucdata, (ulg)usiz, - ebdata+EB_IZVMS_HLEN, (ulg)csiz); - break; - default: - free(ucdata); - ucdata = NULL; - } - return ucdata; - -} /* end of extract_izvms_block */ - - - - - -/********************************/ -/* Function decompress_bits() */ -/********************************/ -/* - * Simple uncompression routine. The compression uses bit stream. - * Compression scheme: - * - * if (byte!=0) - * putbit(1),putbyte(byte) - * else - * putbit(0) - */ -static void decompress_bits(outptr, needlen, bitptr) - uch *outptr; /* Pointer into output block */ - unsigned needlen; /* Size of uncompressed block */ - ZCONST uch *bitptr; /* Pointer into compressed data */ -{ - ulg bitbuf = 0; - int bitcnt = 0; - -#define _FILL { bitbuf |= (*bitptr++) << bitcnt;\ - bitcnt += 8; \ - } - - while (needlen--) - { - if (bitcnt <= 0) - _FILL; - - if (bitbuf & 1) - { - bitbuf >>= 1; - if ((bitcnt -= 1) < 8) - _FILL; - *outptr++ = (uch)bitbuf; - bitcnt -= 8; - bitbuf >>= 8; - } - else - { - *outptr++ = '\0'; - bitcnt -= 1; - bitbuf >>= 1; - } - } -} /* end function decompress_bits() */ - -#endif /* VMS || VMS_TEXT_CONV */ - - - - - -#ifdef SYMLINKS -/***********************************/ -/* Function set_deferred_symlink() */ -/***********************************/ - -static void set_deferred_symlink(__G__ slnk_entry) - __GDEF - slinkentry *slnk_entry; -{ - extent ucsize = slnk_entry->targetlen; - char *linkfname = slnk_entry->fname; - char *linktarget = (char *)malloc(ucsize+1); - - if (!linktarget) { - Info(slide, 0x201, ((char *)slide, - LoadFarString(SymLnkWarnNoMem), FnFilter1(linkfname))); - return; - } - linktarget[ucsize] = '\0'; - G.outfile = zfopen(linkfname, FOPR); /* open link placeholder for reading */ - /* Check that the following conditions are all fulfilled: - * a) the placeholder file exists, - * b) the placeholder file contains exactly "ucsize" bytes - * (read the expected placeholder content length + 1 extra byte, this - * should return the expected content length), - * c) the placeholder content matches the link target specification as - * stored in the symlink control structure. - */ - if (!G.outfile || - fread(linktarget, 1, ucsize+1, G.outfile) != ucsize || - strcmp(slnk_entry->target, linktarget)) - { - Info(slide, 0x201, ((char *)slide, - LoadFarString(SymLnkWarnInvalid), FnFilter1(linkfname))); - free(linktarget); - if (G.outfile) - fclose(G.outfile); - return; - } - fclose(G.outfile); /* close "data" file for good... */ - unlink(linkfname); /* ...and delete it */ - if (QCOND2) - Info(slide, 0, ((char *)slide, LoadFarString(SymLnkFinish), - FnFilter1(linkfname), FnFilter2(linktarget))); - if (symlink(linktarget, linkfname)) /* create the real link */ - perror("symlink error"); - free(linktarget); -#ifdef SET_SYMLINK_ATTRIBS - set_symlnk_attribs(__G__ slnk_entry); -#endif - return; /* can't set time on symlinks */ - -} /* end function set_deferred_symlink() */ -#endif /* SYMLINKS */ - - - - -/*************************/ -/* Function fnfilter() */ /* here instead of in list.c for SFX */ -/*************************/ - -char *fnfilter(raw, space, size) /* convert name to safely printable form */ - ZCONST char *raw; - uch *space; - extent size; -{ -#ifndef NATIVE /* ASCII: filter ANSI escape codes, etc. */ - ZCONST uch *r=(ZCONST uch *)raw; - uch *s=space; - uch *slim=NULL; - uch *se=NULL; - int have_overflow = FALSE; - - if (size > 0) { - slim = space + size -#ifdef _MBCS - - (MB_CUR_MAX - 1) -#endif - - 4; - } - while (*r) { - if (size > 0 && s >= slim && se == NULL) { - se = s; - } -#ifdef QDOS - if (qlflag & 2) { - if (*r == '/' || *r == '.') { - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - ++r; - *s++ = '_'; - continue; - } - } else -#endif -#ifdef HAVE_WORKING_ISPRINT -# ifndef UZ_FNFILTER_REPLACECHAR - /* A convenient choice for the replacement of unprintable char codes is - * the "single char wildcard", as this character is quite unlikely to - * appear in filenames by itself. The following default definition - * sets the replacement char to a question mark as the most common - * "single char wildcard"; this setting should be overridden in the - * appropiate system-specific configuration header when needed. - */ -# define UZ_FNFILTER_REPLACECHAR '?' -# endif - if (!isprint(*r)) { - if (*r < 32) { - /* ASCII control codes are escaped as "^{letter}". */ - if (se != NULL && (s > (space + (size-4)))) { - have_overflow = TRUE; - break; - } - *s++ = '^', *s++ = (uch)(64 + *r++); - } else { - /* Other unprintable codes are replaced by the - * placeholder character. */ - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - *s++ = UZ_FNFILTER_REPLACECHAR; - INCSTR(r); - } -#else /* !HAVE_WORKING_ISPRINT */ - if (*r < 32) { - /* ASCII control codes are escaped as "^{letter}". */ - if (se != NULL && (s > (space + (size-4)))) { - have_overflow = TRUE; - break; - } - *s++ = '^', *s++ = (uch)(64 + *r++); -#endif /* ?HAVE_WORKING_ISPRINT */ - } else { -#ifdef _MBCS - unsigned i = CLEN(r); - if (se != NULL && (s > (space + (size-i-2)))) { - have_overflow = TRUE; - break; - } - for (; i > 0; i--) - *s++ = *r++; -#else - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - *s++ = *r++; -#endif - } - } - if (have_overflow) { - strcpy((char *)se, "..."); - } else { - *s = '\0'; - } - -#ifdef WINDLL - INTERN_TO_ISO((char *)space, (char *)space); /* translate to ANSI */ -#else -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM((char *)space, (char *)space); -#endif /* (WIN32 && !_WIN32_WCE) */ -#endif /* ?WINDLL */ - - return (char *)space; - -#else /* NATIVE: EBCDIC or whatever */ - return (char *)raw; -#endif - -} /* end function fnfilter() */ - - - - -#ifdef SET_DIR_ATTRIB -/* must sort saved directories so can set perms from bottom up */ - -/************************/ -/* Function dircomp() */ -/************************/ - -static int Cdecl dircomp(a, b) /* used by qsort(); swiped from Zip */ - ZCONST zvoid *a, *b; -{ - /* order is significant: this sorts in reverse order (deepest first) */ - return strcmp((*(direntry **)b)->fn, (*(direntry **)a)->fn); - /* return namecmp((*(direntry **)b)->fn, (*(direntry **)a)->fn); */ -} - -#endif /* SET_DIR_ATTRIB */ - - -#ifdef USE_BZIP2 - -/**************************/ -/* Function UZbunzip2() */ -/**************************/ - -int UZbunzip2(__G) -__GDEF -/* decompress a bzipped entry using the libbz2 routines */ -{ - int retval = 0; /* return code: 0 = "no error" */ - int err=BZ_OK; - int repeated_buf_err; - bz_stream bstrm; - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - - bstrm.next_in = (char *)G.inptr; - bstrm.avail_in = G.incnt; - - { - /* local buffer for efficiency */ - /* $TODO Check for BZIP LIB version? */ - - bstrm.bzalloc = NULL; - bstrm.bzfree = NULL; - bstrm.opaque = NULL; - - Trace((stderr, "initializing bzlib()\n")); - err = BZ2_bzDecompressInit(&bstrm, 0, 0); - - if (err == BZ_MEM_ERROR) - return 3; - else if (err != BZ_OK) - Trace((stderr, "oops! (BZ2_bzDecompressInit() err = %d)\n", err)); - } - -#ifdef FUNZIP - while (err != BZ_STREAM_END) { -#else /* !FUNZIP */ - while (G.csize > 0) { - Trace((stderr, "first loop: G.csize = %ld\n", G.csize)); -#endif /* ?FUNZIP */ - while (bstrm.avail_out > 0) { - err = BZ2_bzDecompress(&bstrm); - - if (err == BZ_DATA_ERROR) { - retval = 2; goto uzbunzip_cleanup_exit; - } else if (err == BZ_MEM_ERROR) { - retval = 3; goto uzbunzip_cleanup_exit; - } else if (err != BZ_OK && err != BZ_STREAM_END) - Trace((stderr, "oops! (bzip(first loop) err = %d)\n", err)); - -#ifdef FUNZIP - if (err == BZ_STREAM_END) /* "END-of-entry-condition" ? */ -#else /* !FUNZIP */ - if (G.csize <= 0L) /* "END-of-entry-condition" ? */ -#endif /* ?FUNZIP */ - break; - - if (bstrm.avail_in == 0) { - if (fillinbuf(__G) == 0) { - /* no "END-condition" yet, but no more data */ - retval = 2; goto uzbunzip_cleanup_exit; - } - - bstrm.next_in = (char *)G.inptr; - bstrm.avail_in = G.incnt; - } - Trace((stderr, " avail_in = %u\n", bstrm.avail_in)); - } - /* flush slide[] */ - if ((retval = FLUSH(wsize - bstrm.avail_out)) != 0) - goto uzbunzip_cleanup_exit; - Trace((stderr, "inside loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - bstrm.avail_out), - (long)(bstrm.next_out-(char *)redirSlide))); - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - } - - /* no more input, so loop until we have all output */ - Trace((stderr, "beginning final loop: err = %d\n", err)); - repeated_buf_err = FALSE; - while (err != BZ_STREAM_END) { - err = BZ2_bzDecompress(&bstrm); - if (err == BZ_DATA_ERROR) { - retval = 2; goto uzbunzip_cleanup_exit; - } else if (err == BZ_MEM_ERROR) { - retval = 3; goto uzbunzip_cleanup_exit; - } else if (err != BZ_OK && err != BZ_STREAM_END) { - Trace((stderr, "oops! (bzip(final loop) err = %d)\n", err)); - DESTROYGLOBALS(); - EXIT(PK_MEM3); - } - /* final flush of slide[] */ - if ((retval = FLUSH(wsize - bstrm.avail_out)) != 0) - goto uzbunzip_cleanup_exit; - Trace((stderr, "final loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - bstrm.avail_out), - (long)(bstrm.next_out-(char *)redirSlide))); - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - } -#ifdef LARGE_FILE_SUPPORT - Trace((stderr, "total in = %llu, total out = %llu\n", - (zusz_t)(bstrm.total_in_lo32) + ((zusz_t)(bstrm.total_in_hi32))<<32, - (zusz_t)(bstrm.total_out_lo32) + ((zusz_t)(bstrm.total_out_hi32))<<32)); -#else - Trace((stderr, "total in = %lu, total out = %lu\n", bstrm.total_in_lo32, - bstrm.total_out_lo32)); -#endif - - G.inptr = (uch *)bstrm.next_in; - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */ - -uzbunzip_cleanup_exit: - err = BZ2_bzDecompressEnd(&bstrm); - if (err != BZ_OK) - Trace((stderr, "oops! (BZ2_bzDecompressEnd() err = %d)\n", err)); - - return retval; -} /* end function UZbunzip2() */ -#endif /* USE_BZIP2 */ diff --git a/data/windows/unzipfx-catarina/fileio.c b/data/windows/unzipfx-catarina/fileio.c deleted file mode 100644 index ba0a1d0..0000000 --- a/data/windows/unzipfx-catarina/fileio.c +++ /dev/null @@ -1,2855 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - fileio.c - - This file contains routines for doing direct but relatively generic input/ - output, file-related sorts of things, plus some miscellaneous stuff. Most - of the stuff has to do with opening, closing, reading and/or writing files. - - Contains: open_input_file() - open_outfile() (not: VMS, AOS/VS, CMSMVS, MACOS, TANDEM) - undefer_input() - defer_leftover_input() - readbuf() - readbyte() - fillinbuf() - seek_zipf() - flush() (non-VMS) - is_vms_varlen_txt() (non-VMS, VMS_TEXT_CONV only) - disk_error() (non-VMS) - UzpMessagePrnt() - UzpMessageNull() (DLL only) - UzpInput() - UzpMorePause() - UzpPassword() (non-WINDLL) - handler() - dos_to_unix_time() (non-VMS, non-VM/CMS, non-MVS) - check_for_newer() (non-VMS, non-OS/2, non-VM/CMS, non-MVS) - do_string() - makeword() - makelong() - makeint64() - fzofft() - str2iso() (CRYPT && NEED_STR2ISO, only) - str2oem() (CRYPT && NEED_STR2OEM, only) - memset() (ZMEM only) - memcpy() (ZMEM only) - zstrnicmp() (NO_STRNICMP only) - zstat() (REGULUS only) - plastchar() (_MBCS only) - uzmbclen() (_MBCS && NEED_UZMBCLEN, only) - uzmbschr() (_MBCS && NEED_UZMBSCHR, only) - uzmbsrchr() (_MBCS && NEED_UZMBSRCHR, only) - fLoadFarString() (SMALL_MEM only) - fLoadFarStringSmall() (SMALL_MEM only) - fLoadFarStringSmall2() (SMALL_MEM only) - zfstrcpy() (SMALL_MEM only) - zfstrcmp() (SMALL_MEM && !(SFX || FUNZIP) only) - - ---------------------------------------------------------------------------*/ - - -#define __FILEIO_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -# include -#endif -#include "crc32.h" -#include "crypt.h" -#include "ttyio.h" - -/* setup of codepage conversion for decryption passwords */ -#if CRYPT -# if (defined(CRYP_USES_ISO2OEM) && !defined(IZ_ISO2OEM_ARRAY)) -# define IZ_ISO2OEM_ARRAY /* pull in iso2oem[] table */ -# endif -# if (defined(CRYP_USES_OEM2ISO) && !defined(IZ_OEM2ISO_ARRAY)) -# define IZ_OEM2ISO_ARRAY /* pull in oem2iso[] table */ -# endif -#endif -#include "ebcdic.h" /* definition/initialization of ebcdic[] */ - - -/* - Note: Under Windows, the maximum size of the buffer that can be used - with any of the *printf calls is 16,384, so win_fprintf was used to - feed the fprintf clone no more than 16K chunks at a time. This should - be valid for anything up to 64K (and probably beyond, assuming your - buffers are that big). -*/ -#ifdef WINDLL -# define WriteError(buf,len,strm) \ - (win_fprintf(pG, strm, (extent)len, (char far *)buf) != (int)(len)) -#else /* !WINDLL */ -# ifdef USE_FWRITE -# define WriteError(buf,len,strm) \ - ((extent)fwrite((char *)(buf),1,(extent)(len),strm) != (extent)(len)) -# else -# define WriteError(buf,len,strm) \ - ((extent)write(fileno(strm),(char *)(buf),(extent)(len)) != (extent)(len)) -# endif -#endif /* ?WINDLL */ - -/* - 2005-09-16 SMS. - On VMS, when output is redirected to a file, as in a command like - "PIPE UNZIP -v > X.OUT", the output file is created with VFC record - format, and multiple calls to write() or fwrite() will produce multiple - records, even when there's no newline terminator in the buffer. - The result is unsightly output with spurious newlines. Using fprintf() - instead of write() here, and disabling a fflush(stdout) in UzpMessagePrnt() - below, together seem to solve the problem. - - According to the C RTL manual, "The write and decc$record_write - functions always generate at least one record." Also, "[T]he fwrite - function always generates at least records." So, - "fwrite(buf, len, 1, strm)" is much better ("1" record) than - "fwrite(buf, 1, len, strm)" ("len" (1-character) records, _really_ - ugly), but neither is better than write(). Similarly, "The fflush - function always generates a record if there is unwritten data in the - buffer." Apparently fprintf() buffers the stuff somewhere, and puts - out a record (only) when it sees a newline. -*/ -#ifdef VMS -# define WriteTxtErr(buf,len,strm) \ - ((extent)fprintf(strm, "%.*s", len, buf) != (extent)(len)) -#else -# define WriteTxtErr(buf,len,strm) WriteError(buf,len,strm) -#endif - -#if (defined(USE_DEFLATE64) && defined(__16BIT__)) -static int partflush OF((__GPRO__ uch *rawbuf, ulg size, int unshrink)); -#endif -#ifdef VMS_TEXT_CONV -static int is_vms_varlen_txt OF((__GPRO__ uch *ef_buf, unsigned ef_len)); -#endif -static int disk_error OF((__GPRO)); - - -/****************************/ -/* Strings used in fileio.c */ -/****************************/ - -static ZCONST char Far CannotOpenZipfile[] = - "error: cannot open zipfile [ %s ]\n %s\n"; - -#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) -#if (!defined(TANDEM)) -#if (defined(ATH_BEO_THS_UNX) || defined(DOS_FLX_NLM_OS2_W32)) - static ZCONST char Far CannotDeleteOldFile[] = - "error: cannot delete old %s\n %s\n"; -#ifdef UNIXBACKUP - static ZCONST char Far CannotRenameOldFile[] = - "error: cannot rename old %s\n %s\n"; - static ZCONST char Far BackupSuffix[] = "~"; -#endif -#endif /* ATH_BEO_THS_UNX || DOS_FLX_NLM_OS2_W32 */ -#ifdef NOVELL_BUG_FAILSAFE - static ZCONST char Far NovellBug[] = - "error: %s: stat() says does not exist, but fopen() found anyway\n"; -#endif - static ZCONST char Far CannotCreateFile[] = - "error: cannot create %s\n %s\n"; -#endif /* !TANDEM */ -#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ - -static ZCONST char Far ReadError[] = "error: zipfile read error\n"; -static ZCONST char Far FilenameTooLongTrunc[] = - "warning: filename too long--truncating.\n"; -#ifdef UNICODE_SUPPORT - static ZCONST char Far UFilenameTooLongTrunc[] = - "warning: Converted unicode filename too long--truncating.\n"; -#endif -static ZCONST char Far ExtraFieldTooLong[] = - "warning: extra field too long (%d). Ignoring...\n"; - -#ifdef WINDLL - static ZCONST char Far DiskFullQuery[] = - "%s: write error (disk full?).\n"; -#else - static ZCONST char Far DiskFullQuery[] = - "%s: write error (disk full?). Continue? (y/n/^C) "; - static ZCONST char Far ZipfileCorrupt[] = - "error: zipfile probably corrupt (%s)\n"; -# ifdef SYMLINKS - static ZCONST char Far FileIsSymLink[] = - "%s exists and is a symbolic link%s.\n"; -# endif -# ifdef MORE - static ZCONST char Far MorePrompt[] = "--More--(%lu)"; -# endif - static ZCONST char Far QuitPrompt[] = - "--- Press `Q' to quit, or any other key to continue ---"; - static ZCONST char Far HidePrompt[] = /* "\r \r"; */ - "\r \r"; -# if CRYPT -# ifdef MACOS - /* SPC: are names on MacOS REALLY so much longer than elsewhere ??? */ - static ZCONST char Far PasswPrompt[] = "[%s]\n %s password: "; -# else - static ZCONST char Far PasswPrompt[] = "[%s] %s password: "; -# endif - static ZCONST char Far PasswPrompt2[] = "Enter password: "; - static ZCONST char Far PasswRetry[] = "password incorrect--reenter: "; -# endif /* CRYPT */ -#endif /* !WINDLL */ - - - - - -/******************************/ -/* Function open_input_file() */ -/******************************/ - -int open_input_file(__G) /* return 1 if open failed */ - __GDEF -{ - /* - * open the zipfile for reading and in BINARY mode to prevent cr/lf - * translation, which would corrupt the bitstreams - */ - -#ifdef VMS - G.zipfd = open(G.zipfn, O_RDONLY, 0, OPNZIP_RMS_ARGS); -#else /* !VMS */ -#ifdef MACOS - G.zipfd = open(G.zipfn, 0); -#else /* !MACOS */ -#ifdef CMS_MVS - G.zipfd = vmmvs_open_infile(__G); -#else /* !CMS_MVS */ -#ifdef USE_STRM_INPUT - G.zipfd = fopen(G.zipfn, FOPR); -#else /* !USE_STRM_INPUT */ - G.zipfd = open(G.zipfn, O_RDONLY | O_BINARY); -#endif /* ?USE_STRM_INPUT */ -#endif /* ?CMS_MVS */ -#endif /* ?MACOS */ -#endif /* ?VMS */ - -#ifdef USE_STRM_INPUT - if (G.zipfd == NULL) -#else - /* if (G.zipfd < 0) */ /* no good for Windows CE port */ - if (G.zipfd == -1) -#endif - { - Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile), - G.zipfn, strerror(errno))); - return 1; - } - return 0; - -} /* end function open_input_file() */ - - - - -#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) -#if (!defined(TANDEM)) - -/***************************/ -/* Function open_outfile() */ -/***************************/ - -int open_outfile(__G) /* return 1 if fail */ - __GDEF -{ -#ifdef DLL - if (G.redirect_data) - return (redirect_outfile(__G) == FALSE); -#endif -#ifdef QDOS - QFilename(__G__ G.filename); -#endif -#if (defined(DOS_FLX_NLM_OS2_W32) || defined(ATH_BEO_THS_UNX)) -#ifdef BORLAND_STAT_BUG - /* Borland 5.0's stat() barfs if the filename has no extension and the - * file doesn't exist. */ - if (access(G.filename, 0) == -1) { - FILE *tmp = fopen(G.filename, "wb+"); - - /* file doesn't exist, so create a dummy file to keep stat() from - * failing (will be over-written anyway) */ - fputc('0', tmp); /* just to have something in the file */ - fclose(tmp); - } -#endif /* BORLAND_STAT_BUG */ -#ifdef SYMLINKS - if (SSTAT(G.filename, &G.statbuf) == 0 || - lstat(G.filename, &G.statbuf) == 0) -#else - if (SSTAT(G.filename, &G.statbuf) == 0) -#endif /* ?SYMLINKS */ - { - Trace((stderr, "open_outfile: stat(%s) returns 0: file exists\n", - FnFilter1(G.filename))); -#ifdef UNIXBACKUP - if (uO.B_flag) { /* do backup */ - char *tname; - z_stat tmpstat; - int blen, flen, tlen; - - blen = strlen(BackupSuffix); - flen = strlen(G.filename); - tlen = flen + blen + 6; /* includes space for 5 digits */ - if (tlen >= FILNAMSIZ) { /* in case name is too long, truncate */ - tname = (char *)malloc(FILNAMSIZ); - if (tname == NULL) - return 1; /* in case we run out of space */ - tlen = FILNAMSIZ - 1 - blen; - strcpy(tname, G.filename); /* make backup name */ - tname[tlen] = '\0'; - if (flen > tlen) flen = tlen; - tlen = FILNAMSIZ; - } else { - tname = (char *)malloc(tlen); - if (tname == NULL) - return 1; /* in case we run out of space */ - strcpy(tname, G.filename); /* make backup name */ - } - strcpy(tname+flen, BackupSuffix); - - if (IS_OVERWRT_ALL) { - /* If there is a previous backup file, delete it, - * otherwise the following rename operation may fail. - */ - if (SSTAT(tname, &tmpstat) == 0) - unlink(tname); - } else { - /* Check if backupname exists, and, if it's true, try - * appending numbers of up to 5 digits (or the maximum - * "unsigned int" number on 16-bit systems) to the - * BackupSuffix, until an unused name is found. - */ - unsigned maxtail, i; - char *numtail = tname + flen + blen; - - /* take account of the "unsigned" limit on 16-bit systems: */ - maxtail = ( ((~0) >= 99999L) ? 99999 : (~0) ); - switch (tlen - flen - blen - 1) { - case 4: maxtail = 9999; break; - case 3: maxtail = 999; break; - case 2: maxtail = 99; break; - case 1: maxtail = 9; break; - case 0: maxtail = 0; break; - } - /* while filename exists */ - for (i = 0; (i < maxtail) && (SSTAT(tname, &tmpstat) == 0);) - sprintf(numtail,"%u", ++i); - } - - if (rename(G.filename, tname) != 0) { /* move file */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotRenameOldFile), - FnFilter1(G.filename), strerror(errno))); - free(tname); - return 1; - } - Trace((stderr, "open_outfile: %s now renamed into %s\n", - FnFilter1(G.filename), FnFilter2(tname))); - free(tname); - } else -#endif /* UNIXBACKUP */ - { -#ifdef DOS_FLX_OS2_W32 - if (!(G.statbuf.st_mode & S_IWRITE)) { - Trace((stderr, - "open_outfile: existing file %s is read-only\n", - FnFilter1(G.filename))); - chmod(G.filename, S_IREAD | S_IWRITE); - Trace((stderr, "open_outfile: %s now writable\n", - FnFilter1(G.filename))); - } -#endif /* DOS_FLX_OS2_W32 */ -#ifdef NLM - /* Give the file read/write permission (non-POSIX shortcut) */ - chmod(G.filename, 0); -#endif /* NLM */ - if (unlink(G.filename) != 0) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotDeleteOldFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } - Trace((stderr, "open_outfile: %s now deleted\n", - FnFilter1(G.filename))); - } - } -#endif /* DOS_FLX_NLM_OS2_W32 || ATH_BEO_THS_UNX */ -#ifdef RISCOS - if (SWI_OS_File_7(G.filename,0xDEADDEAD,0xDEADDEAD,G.lrec.ucsize)!=NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } -#endif /* RISCOS */ -#ifdef TOPS20 - char *tfilnam; - - if ((tfilnam = (char *)malloc(2*strlen(G.filename)+1)) == (char *)NULL) - return 1; - strcpy(tfilnam, G.filename); - upper(tfilnam); - enquote(tfilnam); - if ((G.outfile = fopen(tfilnam, FOPW)) == (FILE *)NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - tfilnam, strerror(errno))); - free(tfilnam); - return 1; - } - free(tfilnam); -#else /* !TOPS20 */ -#ifdef MTS - if (uO.aflag) - G.outfile = zfopen(G.filename, FOPWT); - else - G.outfile = zfopen(G.filename, FOPW); - if (G.outfile == (FILE *)NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } -#else /* !MTS */ -#ifdef DEBUG - Info(slide, 1, ((char *)slide, - "open_outfile: doing fopen(%s) for reading\n", FnFilter1(G.filename))); - if ((G.outfile = zfopen(G.filename, FOPR)) == (FILE *)NULL) - Info(slide, 1, ((char *)slide, - "open_outfile: fopen(%s) for reading failed: does not exist\n", - FnFilter1(G.filename))); - else { - Info(slide, 1, ((char *)slide, - "open_outfile: fopen(%s) for reading succeeded: file exists\n", - FnFilter1(G.filename))); - fclose(G.outfile); - } -#endif /* DEBUG */ -#ifdef NOVELL_BUG_FAILSAFE - if (G.dne && ((G.outfile = zfopen(G.filename, FOPR)) != (FILE *)NULL)) { - Info(slide, 0x401, ((char *)slide, LoadFarString(NovellBug), - FnFilter1(G.filename))); - fclose(G.outfile); - return 1; /* with "./" fix in checkdir(), should never reach here */ - } -#endif /* NOVELL_BUG_FAILSAFE */ - Trace((stderr, "open_outfile: doing fopen(%s) for writing\n", - FnFilter1(G.filename))); - { -#if defined(ATH_BE_UNX) || defined(AOS_VS) || defined(QDOS) || defined(TANDEM) - mode_t umask_sav = umask(0077); -#endif -#if defined(SYMLINKS) || defined(QLZIP) - /* These features require the ability to re-read extracted data from - the output files. Output files are created with Read&Write access. - */ - G.outfile = zfopen(G.filename, FOPWR); -#else - G.outfile = zfopen(G.filename, FOPW); -#endif -#if defined(ATH_BE_UNX) || defined(AOS_VS) || defined(QDOS) || defined(TANDEM) - umask(umask_sav); -#endif - } - if (G.outfile == (FILE *)NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } - Trace((stderr, "open_outfile: fopen(%s) for writing succeeded\n", - FnFilter1(G.filename))); -#endif /* !MTS */ -#endif /* !TOPS20 */ - -#ifdef USE_FWRITE -#ifdef DOS_NLM_OS2_W32 - /* 16-bit MSC: buffer size must be strictly LESS than 32K (WSIZE): bogus */ - setbuf(G.outfile, (char *)NULL); /* make output unbuffered */ -#else /* !DOS_NLM_OS2_W32 */ -#ifndef RISCOS -#ifdef _IOFBF /* make output fully buffered (works just about like write()) */ - setvbuf(G.outfile, (char *)slide, _IOFBF, WSIZE); -#else - setbuf(G.outfile, (char *)slide); -#endif -#endif /* !RISCOS */ -#endif /* ?DOS_NLM_OS2_W32 */ -#endif /* USE_FWRITE */ -#ifdef OS2_W32 - /* preallocate the final file size to prevent file fragmentation */ - SetFileSize(G.outfile, G.lrec.ucsize); -#endif - return 0; - -} /* end function open_outfile() */ - -#endif /* !TANDEM */ -#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ - - - - - -/* - * These functions allow NEXTBYTE to function without needing two bounds - * checks. Call defer_leftover_input() if you ever have filled G.inbuf - * by some means other than readbyte(), and you then want to start using - * NEXTBYTE. When going back to processing bytes without NEXTBYTE, call - * undefer_input(). For example, extract_or_test_member brackets its - * central section that does the decompression with these two functions. - * If you need to check the number of bytes remaining in the current - * file while using NEXTBYTE, check (G.csize + G.incnt), not G.csize. - */ - -/****************************/ -/* function undefer_input() */ -/****************************/ - -void undefer_input(__G) - __GDEF -{ - if (G.incnt > 0) - G.csize += G.incnt; - if (G.incnt_leftover > 0) { - /* We know that "(G.csize < MAXINT)" so we can cast G.csize to int: - * This condition was checked when G.incnt_leftover was set > 0 in - * defer_leftover_input(), and it is NOT allowed to touch G.csize - * before calling undefer_input() when (G.incnt_leftover > 0) - * (single exception: see read_byte()'s "G.csize <= 0" handling) !! - */ - G.incnt = G.incnt_leftover + (int)G.csize; - G.inptr = G.inptr_leftover - (int)G.csize; - G.incnt_leftover = 0; - } else if (G.incnt < 0) - G.incnt = 0; -} /* end function undefer_input() */ - - - - - -/***********************************/ -/* function defer_leftover_input() */ -/***********************************/ - -void defer_leftover_input(__G) - __GDEF -{ - if ((zoff_t)G.incnt > G.csize) { - /* (G.csize < MAXINT), we can safely cast it to int !! */ - if (G.csize < 0L) - G.csize = 0L; - G.inptr_leftover = G.inptr + (int)G.csize; - G.incnt_leftover = G.incnt - (int)G.csize; - G.incnt = (int)G.csize; - } else - G.incnt_leftover = 0; - G.csize -= G.incnt; -} /* end function defer_leftover_input() */ - - - - - -/**********************/ -/* Function readbuf() */ -/**********************/ - -unsigned readbuf(__G__ buf, size) /* return number of bytes read into buf */ - __GDEF - char *buf; - register unsigned size; -{ - register unsigned count; - unsigned n; - - n = size; - while (size) { - if (G.incnt <= 0) { - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) - return (n-size); - else if (G.incnt < 0) { - /* another hack, but no real harm copying same thing twice */ - (*G.message)((zvoid *)&G, - (uch *)LoadFarString(ReadError), /* CANNOT use slide */ - (ulg)strlen(LoadFarString(ReadError)), 0x401); - return 0; /* discarding some data; better than lock-up */ - } - /* buffer ALWAYS starts on a block boundary: */ - G.cur_zipfile_bufstart += INBUFSIZ; - G.inptr = G.inbuf; - } - count = MIN(size, (unsigned)G.incnt); - memcpy(buf, G.inptr, count); - buf += count; - G.inptr += count; - G.incnt -= count; - size -= count; - } - return n; - -} /* end function readbuf() */ - - - - - -/***********************/ -/* Function readbyte() */ -/***********************/ - -int readbyte(__G) /* refill inbuf and return a byte if available, else EOF */ - __GDEF -{ - if (G.mem_mode) - return EOF; - if (G.csize <= 0) { - G.csize--; /* for tests done after exploding */ - G.incnt = 0; - return EOF; - } - if (G.incnt <= 0) { - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) { - return EOF; - } else if (G.incnt < 0) { /* "fail" (abort, retry, ...) returns this */ - /* another hack, but no real harm copying same thing twice */ - (*G.message)((zvoid *)&G, - (uch *)LoadFarString(ReadError), - (ulg)strlen(LoadFarString(ReadError)), 0x401); - echon(); -#ifdef WINDLL - longjmp(dll_error_return, 1); -#else - DESTROYGLOBALS(); - EXIT(PK_BADERR); /* totally bailing; better than lock-up */ -#endif - } - G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on block bndry */ - G.inptr = G.inbuf; - defer_leftover_input(__G); /* decrements G.csize */ - } - -#if CRYPT - if (G.pInfo->encrypted) { - uch *p; - int n; - - /* This was previously set to decrypt one byte beyond G.csize, when - * incnt reached that far. GRR said, "but it's required: why?" This - * was a bug in fillinbuf() -- was it also a bug here? - */ - for (n = G.incnt, p = G.inptr; n--; p++) - zdecode(*p); - } -#endif /* CRYPT */ - - --G.incnt; - return *G.inptr++; - -} /* end function readbyte() */ - - - - - -#if defined(USE_ZLIB) || defined(USE_BZIP2) - -/************************/ -/* Function fillinbuf() */ -/************************/ - -int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */ - __GDEF -{ - if (G.mem_mode || - (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - return 0; - G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on a block boundary */ - G.inptr = G.inbuf; - defer_leftover_input(__G); /* decrements G.csize */ - -#if CRYPT - if (G.pInfo->encrypted) { - uch *p; - int n; - - for (n = G.incnt, p = G.inptr; n--; p++) - zdecode(*p); - } -#endif /* CRYPT */ - - return G.incnt; - -} /* end function fillinbuf() */ - -#endif /* USE_ZLIB || USE_BZIP2 */ - - - - - -/************************/ -/* Function seek_zipf() */ -/************************/ - -int seek_zipf(__G__ abs_offset) - __GDEF - zoff_t abs_offset; -{ -/* - * Seek to the block boundary of the block which includes abs_offset, - * then read block into input buffer and set pointers appropriately. - * If block is already in the buffer, just set the pointers. This function - * is used by do_seekable (process.c), extract_or_test_entrylist (extract.c) - * and do_string (fileio.c). Also, a slightly modified version is embedded - * within extract_or_test_entrylist (extract.c). readbyte() and readbuf() - * (fileio.c) are compatible. NOTE THAT abs_offset is intended to be the - * "proper offset" (i.e., if there were no extra bytes prepended); - * cur_zipfile_bufstart contains the corrected offset. - * - * Since seek_zipf() is never used during decompression, it is safe to - * use the slide[] buffer for the error message. - * - * returns PK error codes: - * PK_BADERR if effective offset in zipfile is negative - * PK_EOF if seeking past end of zipfile - * PK_OK when seek was successful - */ - zoff_t request = abs_offset + G.extra_bytes; - zoff_t inbuf_offset = request % INBUFSIZ; - zoff_t bufstart = request - inbuf_offset; - - if (request < 0) { - Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - return(PK_BADERR); - } else if (bufstart != G.cur_zipfile_bufstart) { - Trace((stderr, - "fpos_zip: abs_offset = %s, G.extra_bytes = %s\n", - FmZofft(abs_offset, NULL, NULL), - FmZofft(G.extra_bytes, NULL, NULL))); -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - Trace((stderr, - " request = %s, (abs+extra) = %s, inbuf_offset = %s\n", - FmZofft(request, NULL, NULL), - FmZofft((abs_offset+G.extra_bytes), NULL, NULL), - FmZofft(inbuf_offset, NULL, NULL))); - Trace((stderr, " bufstart = %s, cur_zipfile_bufstart = %s\n", - FmZofft(bufstart, NULL, NULL), - FmZofft(G.cur_zipfile_bufstart, NULL, NULL))); - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - return(PK_EOF); - G.incnt -= (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } else { - G.incnt += (G.inptr-G.inbuf) - (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } - return(PK_OK); -} /* end function seek_zipf() */ - - - - - -#ifndef VMS /* for VMS use code in vms.c */ - -/********************/ -/* Function flush() */ /* returns PK error codes: */ -/********************/ /* if tflag => always 0; PK_DISK if write error */ - -int flush(__G__ rawbuf, size, unshrink) - __GDEF - uch *rawbuf; - ulg size; - int unshrink; -#if (defined(USE_DEFLATE64) && defined(__16BIT__)) -{ - int ret; - - /* On 16-bit systems (MSDOS, OS/2 1.x), the standard C library functions - * cannot handle writes of 64k blocks at once. For these systems, the - * blocks to flush are split into pieces of 32k or less. - */ - while (size > 0x8000L) { - ret = partflush(__G__ rawbuf, 0x8000L, unshrink); - if (ret != PK_OK) - return ret; - size -= 0x8000L; - rawbuf += (extent)0x8000; - } - return partflush(__G__ rawbuf, size, unshrink); -} /* end function flush() */ - - -/************************/ -/* Function partflush() */ /* returns PK error codes: */ -/************************/ /* if tflag => always 0; PK_DISK if write error */ - -static int partflush(__G__ rawbuf, size, unshrink) - __GDEF - uch *rawbuf; /* cannot be ZCONST, gets passed to (*G.message)() */ - ulg size; - int unshrink; -#endif /* USE_DEFLATE64 && __16BIT__ */ -{ - register uch *p; - register uch *q; - uch *transbuf; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - ulg transbufsiz; -#endif - /* static int didCRlast = FALSE; moved to globals.h */ - - -/*--------------------------------------------------------------------------- - Compute the CRC first; if testing or if disk is full, that's it. - ---------------------------------------------------------------------------*/ - - G.crc32val = crc32(G.crc32val, rawbuf, (extent)size); - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_IN_PROGRESS, G.zipfn, G.filename, NULL)) - return IZ_CTRLC; /* cancel operation by user request */ -#endif - - if (uO.tflag || size == 0L) /* testing or nothing to write: all done */ - return PK_OK; - - if (G.disk_full) - return PK_DISK; /* disk already full: ignore rest of file */ - -/*--------------------------------------------------------------------------- - Write the bytes rawbuf[0..size-1] to the output device, first converting - end-of-lines and ASCII/EBCDIC as needed. If SMALL_MEM or MED_MEM are NOT - defined, outbuf is assumed to be at least as large as rawbuf and is not - necessarily checked for overflow. - ---------------------------------------------------------------------------*/ - - if (!G.pInfo->textmode) { /* write raw binary data */ - /* GRR: note that for standard MS-DOS compilers, size argument to - * fwrite() can never be more than 65534, so WriteError macro will - * have to be rewritten if size can ever be that large. For now, - * never more than 32K. Also note that write() returns an int, which - * doesn't necessarily limit size to 32767 bytes if write() is used - * on 16-bit systems but does make it more of a pain; however, because - * at least MSC 5.1 has a lousy implementation of fwrite() (as does - * DEC Ultrix cc), write() is used anyway. - */ -#ifdef DLL - if (G.redirect_data) { -#ifdef NO_SLIDE_REDIR - if (writeToMemory(__G__ rawbuf, (extent)size)) return PK_ERR; -#else - writeToMemory(__G__ rawbuf, (extent)size); -#endif - } else -#endif - if (!uO.cflag && WriteError(rawbuf, size, G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, rawbuf, size, 0)) - return PK_OK; - } else { /* textmode: aflag is true */ - if (unshrink) { - /* rawbuf = outbuf */ - transbuf = G.outbuf2; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - transbufsiz = TRANSBUFSIZ; -#endif - } else { - /* rawbuf = slide */ - transbuf = G.outbuf; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - transbufsiz = OUTBUFSIZ; - Trace((stderr, "\ntransbufsiz = OUTBUFSIZ = %u\n", - (unsigned)OUTBUFSIZ)); -#endif - } - if (G.newfile) { -#ifdef VMS_TEXT_CONV - if (G.pInfo->hostnum == VMS_ && G.extra_field && - is_vms_varlen_txt(__G__ G.extra_field, - G.lrec.extra_field_length)) - G.VMS_line_state = 0; /* 0: ready to read line length */ - else - G.VMS_line_state = -1; /* -1: don't treat as VMS text */ -#endif - G.didCRlast = FALSE; /* no previous buffers written */ - G.newfile = FALSE; - } - -#ifdef VMS_TEXT_CONV - if (G.VMS_line_state >= 0) - { - p = rawbuf; - q = transbuf; - while ((extent)(p-rawbuf) < (extent)size) { - switch (G.VMS_line_state) { - - /* 0: ready to read line length */ - case 0: - G.VMS_line_length = 0; - if ((extent)(p-rawbuf) == (extent)size-1) { - /* last char */ - G.VMS_line_length = (unsigned)(*p++); - G.VMS_line_state = 1; - } else { - G.VMS_line_length = makeword(p); - p += 2; - G.VMS_line_state = 2; - } - G.VMS_line_pad = - ((G.VMS_line_length & 1) != 0); /* odd */ - break; - - /* 1: read one byte of length, need second */ - case 1: - G.VMS_line_length += ((unsigned)(*p++) << 8); - G.VMS_line_state = 2; - break; - - /* 2: ready to read VMS_line_length chars */ - case 2: - { - extent remaining = (extent)size+(rawbuf-p); - extent outroom; - - if (G.VMS_line_length < remaining) { - remaining = G.VMS_line_length; - G.VMS_line_state = 3; - } - - outroom = transbuf+(extent)transbufsiz-q; - if (remaining >= outroom) { - remaining -= outroom; - for (;outroom > 0; p++, outroom--) - *q++ = native(*p); -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, - (extent)(q-transbuf))) return PK_ERR; - } else -#endif - if (!uO.cflag && WriteError(transbuf, - (extent)(q-transbuf), G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - /* fall through to normal case */ - } - G.VMS_line_length -= remaining; - for (;remaining > 0; p++, remaining--) - *q++ = native(*p); - } - break; - - /* 3: ready to PutNativeEOL */ - case 3: - if (q > transbuf+(extent)transbufsiz-lenEOL) { -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, - (extent)(q-transbuf))) return PK_ERR; - } else -#endif - if (!uO.cflag && - WriteError(transbuf, (extent)(q-transbuf), - G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - } - PutNativeEOL - G.VMS_line_state = G.VMS_line_pad ? 4 : 0; - break; - - /* 4: ready to read pad byte */ - case 4: - ++p; - G.VMS_line_state = 0; - break; - } - } /* end while */ - - } else -#endif /* VMS_TEXT_CONV */ - - /*----------------------------------------------------------------------- - Algorithm: CR/LF => native; lone CR => native; lone LF => native. - This routine is only for non-raw-VMS, non-raw-VM/CMS files (i.e., - stream-oriented files, not record-oriented). - -----------------------------------------------------------------------*/ - - /* else not VMS text */ { - p = rawbuf; - if (*p == LF && G.didCRlast) - ++p; - G.didCRlast = FALSE; - for (q = transbuf; (extent)(p-rawbuf) < (extent)size; ++p) { - if (*p == CR) { /* lone CR or CR/LF: treat as EOL */ - PutNativeEOL - if ((extent)(p-rawbuf) == (extent)size-1) - /* last char in buffer */ - G.didCRlast = TRUE; - else if (p[1] == LF) /* get rid of accompanying LF */ - ++p; - } else if (*p == LF) /* lone LF */ - PutNativeEOL - else -#ifndef DOS_FLX_OS2_W32 - if (*p != CTRLZ) /* lose all ^Z's */ -#endif - *q++ = native(*p); - -#if (defined(SMALL_MEM) || defined(MED_MEM)) -# if (lenEOL == 1) /* don't check unshrink: both buffers small but equal */ - if (!unshrink) -# endif - /* check for danger of buffer overflow and flush */ - if (q > transbuf+(extent)transbufsiz-lenEOL) { - Trace((stderr, - "p - rawbuf = %u q-transbuf = %u size = %lu\n", - (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); - if (!uO.cflag && WriteError(transbuf, - (extent)(q-transbuf), G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - continue; - } -#endif /* SMALL_MEM || MED_MEM */ - } - } - - /*----------------------------------------------------------------------- - Done translating: write whatever we've got to file (or screen). - -----------------------------------------------------------------------*/ - - Trace((stderr, "p - rawbuf = %u q-transbuf = %u size = %lu\n", - (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); - if (q > transbuf) { -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, (extent)(q-transbuf))) - return PK_ERR; - } else -#endif - if (!uO.cflag && WriteError(transbuf, (extent)(q-transbuf), - G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, transbuf, - (ulg)(q-transbuf), 0)) - return PK_OK; - } - } - - return PK_OK; - -} /* end function flush() [resp. partflush() for 16-bit Deflate64 support] */ - - - - - -#ifdef VMS_TEXT_CONV - -/********************************/ -/* Function is_vms_varlen_txt() */ -/********************************/ - -static int is_vms_varlen_txt(__G__ ef_buf, ef_len) - __GDEF - uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - uch *eb_data; - unsigned eb_datlen; -#define VMSREC_C_UNDEF 0 -#define VMSREC_C_VAR 2 - uch vms_rectype = VMSREC_C_UNDEF; - /* uch vms_fileorg = 0; */ /* currently, fileorg is not used... */ - -#define VMSPK_ITEMID 0 -#define VMSPK_ITEMLEN 2 -#define VMSPK_ITEMHEADSZ 4 - -#define VMSATR_C_RECATTR 4 -#define VMS_FABSIG 0x42414656 /* "VFAB" */ -/* offsets of interesting fields in VMS fabdef structure */ -#define VMSFAB_B_RFM 31 /* record format byte */ -#define VMSFAB_B_ORG 29 /* file organization byte */ - - if (ef_len == 0 || ef_buf == NULL) - return FALSE; - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "is_vms_varlen_txt: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_PKVMS: - /* The PKVMS e.f. raw data part consists of: - * a) 4 bytes CRC checksum - * b) list of uncompressed variable-length data items - * Each data item is introduced by a fixed header - * - 2 bytes data type ID - * - 2 bytes of data - * - bytes of actual attribute data - */ - - /* get pointer to start of data and its total length */ - eb_data = ef_buf+(EB_HEADSIZE+4); - eb_datlen = eb_len-4; - - /* test the CRC checksum */ - if (makelong(ef_buf+EB_HEADSIZE) != - crc32(CRCVAL_INITIAL, eb_data, (extent)eb_datlen)) - { - Info(slide, 1, ((char *)slide, - "[Warning: CRC error, discarding PKWARE extra field]\n")); - /* skip over the data analysis code */ - break; - } - - /* scan through the attribute data items */ - while (eb_datlen > 4) - { - unsigned fldsize = makeword(&eb_data[VMSPK_ITEMLEN]); - - /* check the item type word */ - switch (makeword(&eb_data[VMSPK_ITEMID])) { - case VMSATR_C_RECATTR: - /* we have found the (currently only) interesting - * data item */ - if (fldsize >= 1) { - vms_rectype = eb_data[VMSPK_ITEMHEADSZ] & 15; - /* vms_fileorg = eb_data[VMSPK_ITEMHEADSZ] >> 4; */ - } - break; - default: - break; - } - /* skip to next data item */ - eb_datlen -= fldsize + VMSPK_ITEMHEADSZ; - eb_data += fldsize + VMSPK_ITEMHEADSZ; - } - break; - - case EF_IZVMS: - if (makelong(ef_buf+EB_HEADSIZE) == VMS_FABSIG) { - if ((eb_data = extract_izvms_block(__G__ - ef_buf+EB_HEADSIZE, eb_len, - &eb_datlen, NULL, 0)) - != NULL) - { - if (eb_datlen >= VMSFAB_B_RFM+1) { - vms_rectype = eb_data[VMSFAB_B_RFM] & 15; - /* vms_fileorg = eb_data[VMSFAB_B_ORG] >> 4; */ - } - free(eb_data); - } - } - break; - - default: - break; - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return (vms_rectype == VMSREC_C_VAR); - -} /* end function is_vms_varlen_txtfile() */ - -#endif /* VMS_TEXT_CONV */ - - - - -/*************************/ -/* Function disk_error() */ -/*************************/ - -static int disk_error(__G) - __GDEF -{ - /* OK to use slide[] here because this file is finished regardless */ - Info(slide, 0x4a1, ((char *)slide, LoadFarString(DiskFullQuery), - FnFilter1(G.filename))); - -#ifndef WINDLL - fgets(G.answerbuf, sizeof(G.answerbuf), stdin); - if (*G.answerbuf == 'y') /* stop writing to this file */ - G.disk_full = 1; /* (outfile bad?), but new OK */ - else -#endif - G.disk_full = 2; /* no: exit program */ - - return PK_DISK; - -} /* end function disk_error() */ - -#endif /* !VMS */ - - - - - -/*****************************/ -/* Function UzpMessagePrnt() */ -/*****************************/ - -int UZ_EXP UzpMessagePrnt(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - ulg size; /* length of string (may include nulls) */ - int flag; /* flag bits */ -{ - /* IMPORTANT NOTE: - * The name of the first parameter of UzpMessagePrnt(), which passes - * the "Uz_Globs" address, >>> MUST <<< be identical to the string - * expansion of the __G__ macro in the REENTRANT case (see globals.h). - * This name identity is mandatory for the LoadFarString() macro - * (in the SMALL_MEM case) !!! - */ - int error; - uch *q=buf, *endbuf=buf+(unsigned)size; -#ifdef MORE - uch *p=buf; -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - int islinefeed = FALSE; -#endif -#endif - FILE *outfp; - - -/*--------------------------------------------------------------------------- - These tests are here to allow fine-tuning of UnZip's output messages, - but none of them will do anything without setting the appropriate bit - in the flag argument of every Info() statement which is to be turned - *off*. That is, all messages are currently turned on for all ports. - To turn off *all* messages, use the UzpMessageNull() function instead - of this one. - ---------------------------------------------------------------------------*/ - -#if (defined(OS2) && defined(DLL)) - if (MSG_NO_DLL2(flag)) /* if OS/2 DLL bit is set, do NOT print this msg */ - return 0; -#endif -#ifdef WINDLL - if (MSG_NO_WDLL(flag)) - return 0; -#endif -#ifdef WINDLL - if (MSG_NO_WGUI(flag)) - return 0; -#endif -/* -#ifdef ACORN_GUI - if (MSG_NO_AGUI(flag)) - return 0; -#endif - */ -#ifdef DLL /* don't display message if data is redirected */ - if (((Uz_Globs *)pG)->redirect_data && - !((Uz_Globs *)pG)->redirect_text) - return 0; -#endif - - if (MSG_STDERR(flag) && !((Uz_Globs *)pG)->UzO.tflag) - outfp = (FILE *)stderr; - else - outfp = (FILE *)stdout; - -#ifdef QUERY_TRNEWLN - /* some systems require termination of query prompts with '\n' to force - * immediate display */ - if (MSG_MNEWLN(flag)) { /* assumes writable buffer (e.g., slide[]) */ - *endbuf++ = '\n'; /* with room for one more char at end of buf */ - ++size; /* (safe assumption: only used for four */ - } /* short queries in extract.c and fileio.c) */ -#endif - - if (MSG_TNEWLN(flag)) { /* again assumes writable buffer: fragile... */ - if ((!size && !((Uz_Globs *)pG)->sol) || - (size && (endbuf[-1] != '\n'))) - { - *endbuf++ = '\n'; - ++size; - } - } - -#ifdef MORE -# ifdef SCREENSIZE - /* room for --More-- and one line of overlap: */ -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - SCREENSIZE(&((Uz_Globs *)pG)->height, &((Uz_Globs *)pG)->width); -# else - SCREENSIZE(&((Uz_Globs *)pG)->height, (int *)NULL); -# endif - ((Uz_Globs *)pG)->height -= 2; -# else - /* room for --More-- and one line of overlap: */ - ((Uz_Globs *)pG)->height = SCREENLINES - 2; -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - ((Uz_Globs *)pG)->width = SCREENWIDTH; -# endif -# endif -#endif /* MORE */ - - if (MSG_LNEWLN(flag) && !((Uz_Globs *)pG)->sol) { - /* not at start of line: want newline */ -#ifdef OS2DLL - if (!((Uz_Globs *)pG)->redirect_text) { -#endif - putc('\n', outfp); - fflush(outfp); -#ifdef MORE - if (((Uz_Globs *)pG)->M_flag) - { -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - ((Uz_Globs *)pG)->chars = 0; -#endif - ++((Uz_Globs *)pG)->numlines; - ++((Uz_Globs *)pG)->lines; - if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) - (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, - LoadFarString(MorePrompt), 1); - } -#endif /* MORE */ - if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && - !isatty(1) && isatty(2)) - { - /* error output from testing redirected: also send to stderr */ - putc('\n', stderr); - fflush(stderr); - } -#ifdef OS2DLL - } else - REDIRECTC('\n'); -#endif - ((Uz_Globs *)pG)->sol = TRUE; - } - - /* put zipfile name, filename and/or error/warning keywords here */ - -#ifdef MORE - if (((Uz_Globs *)pG)->M_flag -#ifdef OS2DLL - && !((Uz_Globs *)pG)->redirect_text -#endif - ) - { - while (p < endbuf) { - if (*p == '\n') { -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - islinefeed = TRUE; - } else if (SCREENLWRAP) { - if (*p == '\r') { - ((Uz_Globs *)pG)->chars = 0; - } else { -# ifdef TABSIZE - if (*p == '\t') - ((Uz_Globs *)pG)->chars += - (TABSIZE - (((Uz_Globs *)pG)->chars % TABSIZE)); - else -# endif - ++((Uz_Globs *)pG)->chars; - - if (((Uz_Globs *)pG)->chars >= ((Uz_Globs *)pG)->width) - islinefeed = TRUE; - } - } - if (islinefeed) { - islinefeed = FALSE; - ((Uz_Globs *)pG)->chars = 0; -#endif /* (SCREENWIDTH && SCREEN_LWRAP) */ - ++((Uz_Globs *)pG)->numlines; - ++((Uz_Globs *)pG)->lines; - if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) - { - if ((error = WriteTxtErr(q, p-q+1, outfp)) != 0) - return error; - fflush(outfp); - ((Uz_Globs *)pG)->sol = TRUE; - q = p + 1; - (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, - LoadFarString(MorePrompt), 1); - } - } - INCSTR(p); - } /* end while */ - size = (ulg)(p - q); /* remaining text */ - } -#endif /* MORE */ - - if (size) { -#ifdef OS2DLL - if (!((Uz_Globs *)pG)->redirect_text) { -#endif - if ((error = WriteTxtErr(q, size, outfp)) != 0) - return error; -#ifndef VMS /* 2005-09-16 SMS. See note at "WriteTxtErr()", above. */ - fflush(outfp); -#endif - if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && - !isatty(1) && isatty(2)) - { - /* error output from testing redirected: also send to stderr */ - if ((error = WriteTxtErr(q, size, stderr)) != 0) - return error; - fflush(stderr); - } -#ifdef OS2DLL - } else { /* GRR: this is ugly: hide with macro */ - if ((error = REDIRECTPRINT(q, size)) != 0) - return error; - } -#endif /* OS2DLL */ - ((Uz_Globs *)pG)->sol = (endbuf[-1] == '\n'); - } - return 0; - -} /* end function UzpMessagePrnt() */ - - - - - -#ifdef DLL - -/*****************************/ -/* Function UzpMessageNull() */ /* convenience routine for no output at all */ -/*****************************/ - -int UZ_EXP UzpMessageNull(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - ulg size; /* length of string (may include nulls) */ - int flag; /* flag bits */ -{ - return 0; - -} /* end function UzpMessageNull() */ - -#endif /* DLL */ - - - - - -/***********************/ -/* Function UzpInput() */ /* GRR: this is a placeholder for now */ -/***********************/ - -int UZ_EXP UzpInput(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - int *size; /* (address of) size of buf and of returned string */ - int flag; /* flag bits (bit 0: no echo) */ -{ - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; buf = buf; flag = flag; - - *size = 0; - return 0; - -} /* end function UzpInput() */ - - - - - -#if (!defined(WINDLL) && !defined(MACOS)) - -/***************************/ -/* Function UzpMorePause() */ -/***************************/ - -void UZ_EXP UzpMorePause(pG, prompt, flag) - zvoid *pG; /* globals struct: always passed */ - ZCONST char *prompt; /* "--More--" prompt */ - int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */ -{ - uch c; - -/*--------------------------------------------------------------------------- - Print a prompt and wait for the user to press a key, then erase prompt - if possible. - ---------------------------------------------------------------------------*/ - - if (!((Uz_Globs *)pG)->sol) - fprintf(stderr, "\n"); - /* numlines may or may not be used: */ - fprintf(stderr, prompt, ((Uz_Globs *)pG)->numlines); - fflush(stderr); - if (flag & 1) { - do { - c = (uch)FGETCH(0); - } while ( -#ifdef THEOS - c != 17 && /* standard QUIT key */ -#endif - c != '\r' && c != '\n' && c != ' ' && c != 'q' && c != 'Q'); - } else - c = (uch)FGETCH(0); - - /* newline was not echoed, so cover up prompt line */ - fprintf(stderr, LoadFarString(HidePrompt)); - fflush(stderr); - - if ( -#ifdef THEOS - (c == 17) || /* standard QUIT key */ -#endif - (ToLower(c) == 'q')) { - DESTROYGLOBALS(); - EXIT(PK_COOL); - } - - ((Uz_Globs *)pG)->sol = TRUE; - -#ifdef MORE - /* space for another screen, enter for another line. */ - if ((flag & 1) && c == ' ') - ((Uz_Globs *)pG)->lines = 0; -#endif /* MORE */ - -} /* end function UzpMorePause() */ - -#endif /* !WINDLL && !MACOS */ - - - - -#ifndef WINDLL - -/**************************/ -/* Function UzpPassword() */ -/**************************/ - -int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) - zvoid *pG; /* pointer to UnZip's internal global vars */ - int *rcnt; /* retry counter */ - char *pwbuf; /* buffer for password */ - int size; /* size of password buffer */ - ZCONST char *zfn; /* name of zip archive */ - ZCONST char *efn; /* name of archive entry being processed */ -{ -#if CRYPT - int r = IZ_PW_ENTERED; - char *m; - char *prompt; - -#ifndef REENTRANT - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; -#endif - - if (*rcnt == 0) { /* First call for current entry */ - *rcnt = 2; - if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) { - sprintf(prompt, LoadFarString(PasswPrompt), - FnFilter1(zfn), FnFilter2(efn)); - m = prompt; - } else - m = (char *)LoadFarString(PasswPrompt2); - } else { /* Retry call, previous password was wrong */ - (*rcnt)--; - prompt = NULL; - m = (char *)LoadFarString(PasswRetry); - } - - m = getp(__G__ m, pwbuf, size); - if (prompt != (char *)NULL) { - free(prompt); - } - if (m == (char *)NULL) { - r = IZ_PW_ERROR; - } - else if (*pwbuf == '\0') { - r = IZ_PW_CANCELALL; - } - return r; - -#else /* !CRYPT */ - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn; - - return IZ_PW_ERROR; /* internal error; function should never get called */ -#endif /* ?CRYPT */ - -} /* end function UzpPassword() */ - - - - - -/**********************/ -/* Function handler() */ -/**********************/ - -void handler(signal) /* upon interrupt, turn on echo and exit cleanly */ - int signal; -{ - GETGLOBALS(); - -#if !(defined(SIGBUS) || defined(SIGSEGV)) /* add a newline if not at */ - (*G.message)((zvoid *)&G, slide, 0L, 0x41); /* start of line (to stderr; */ -#endif /* slide[] should be safe) */ - - echon(); - -#ifdef SIGBUS - if (signal == SIGBUS) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "bus error")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGBUS */ - -#ifdef SIGILL - if (signal == SIGILL) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "illegal instruction")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGILL */ - -#ifdef SIGSEGV - if (signal == SIGSEGV) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "segmentation violation")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGSEGV */ - - /* probably ctrl-C */ - DESTROYGLOBALS(); -#if defined(AMIGA) && defined(__SASC) - _abort(); -#endif - EXIT(IZ_CTRLC); /* was EXIT(0), then EXIT(PK_ERR) */ -} - -#endif /* !WINDLL */ - - - - -#if (!defined(VMS) && !defined(CMS_MVS)) -#if (!defined(OS2) || defined(TIMESTAMP)) - -#if (!defined(HAVE_MKTIME) || defined(WIN32)) -/* also used in amiga/filedate.c and win32/win32.c */ -ZCONST ush ydays[] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -#endif - -/*******************************/ -/* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */ -/*******************************/ - -time_t dos_to_unix_time(dosdatetime) - ulg dosdatetime; -{ - time_t m_time; - -#ifdef HAVE_MKTIME - - ZCONST time_t now = time(NULL); - struct tm *tm; -# define YRBASE 1900 - - tm = localtime(&now); - tm->tm_isdst = -1; /* let mktime determine if DST is in effect */ - - /* dissect date */ - tm->tm_year = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); - tm->tm_mon = ((int)(dosdatetime >> 21) & 0x0f) - 1; - tm->tm_mday = ((int)(dosdatetime >> 16) & 0x1f); - - /* dissect time */ - tm->tm_hour = (int)((unsigned)dosdatetime >> 11) & 0x1f; - tm->tm_min = (int)((unsigned)dosdatetime >> 5) & 0x3f; - tm->tm_sec = (int)((unsigned)dosdatetime << 1) & 0x3e; - - m_time = mktime(tm); - NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ - TTrace((stderr, " final m_time = %lu\n", (ulg)m_time)); - -#else /* !HAVE_MKTIME */ - - int yr, mo, dy, hh, mm, ss; -#ifdef TOPS20 -# define YRBASE 1900 - struct tmx *tmx; - char temp[20]; -#else /* !TOPS20 */ -# define YRBASE 1970 - int leap; - unsigned days; - struct tm *tm; -#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) -#ifdef WIN32 - TIME_ZONE_INFORMATION tzinfo; - DWORD res; -#else /* ! WIN32 */ -#ifndef BSD4_4 /* GRR: change to !defined(MODERN) ? */ -#if (defined(BSD) || defined(MTS) || defined(__GO32__)) - struct timeb tbp; -#else /* !(BSD || MTS || __GO32__) */ -#ifdef DECLARE_TIMEZONE - extern time_t timezone; -#endif -#endif /* ?(BSD || MTS || __GO32__) */ -#endif /* !BSD4_4 */ -#endif /* ?WIN32 */ -#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ -#endif /* ?TOPS20 */ - - - /* dissect date */ - yr = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); - mo = ((int)(dosdatetime >> 21) & 0x0f) - 1; - dy = ((int)(dosdatetime >> 16) & 0x1f) - 1; - - /* dissect time */ - hh = (int)((unsigned)dosdatetime >> 11) & 0x1f; - mm = (int)((unsigned)dosdatetime >> 5) & 0x3f; - ss = (int)((unsigned)dosdatetime & 0x1f) * 2; - -#ifdef TOPS20 - tmx = (struct tmx *)malloc(sizeof(struct tmx)); - sprintf (temp, "%02d/%02d/%02d %02d:%02d:%02d", mo+1, dy+1, yr, hh, mm, ss); - time_parse(temp, tmx, (char *)0); - m_time = time_make(tmx); - free(tmx); - -#else /* !TOPS20 */ - -/*--------------------------------------------------------------------------- - Calculate the number of seconds since the epoch, usually 1 January 1970. - ---------------------------------------------------------------------------*/ - - /* leap = # of leap yrs from YRBASE up to but not including current year */ - leap = ((yr + YRBASE - 1) / 4); /* leap year base factor */ - - /* calculate days from BASE to this year and add expired days this year */ - days = (yr * 365) + (leap - 492) + ydays[mo]; - - /* if year is a leap year and month is after February, add another day */ - if ((mo > 1) && ((yr+YRBASE)%4 == 0) && ((yr+YRBASE) != 2100)) - ++days; /* OK through 2199 */ - - /* convert date & time to seconds relative to 00:00:00, 01/01/YRBASE */ - m_time = (time_t)((unsigned long)(days + dy) * 86400L + - (unsigned long)hh * 3600L + - (unsigned long)(mm * 60 + ss)); - /* - 1; MS-DOS times always rounded up to nearest even second */ - TTrace((stderr, "dos_to_unix_time:\n")); - TTrace((stderr, " m_time before timezone = %lu\n", (ulg)m_time)); - -/*--------------------------------------------------------------------------- - Adjust for local standard timezone offset. - ---------------------------------------------------------------------------*/ - -#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) -#ifdef WIN32 - /* account for timezone differences */ - res = GetTimeZoneInformation(&tzinfo); - if (res != TIME_ZONE_ID_INVALID) - { - m_time += 60*(tzinfo.Bias); -#else /* !WIN32 */ -#if (defined(BSD) || defined(MTS) || defined(__GO32__)) -#ifdef BSD4_4 - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - if ((tm = localtime(&m_time)) != (struct tm *)NULL) - m_time -= tm->tm_gmtoff; /* sec. EAST of GMT: subtr. */ -#else /* !(BSD4_4 */ - ftime(&tbp); /* get `timezone' */ - m_time += tbp.timezone * 60L; /* seconds WEST of GMT: add */ -#endif /* ?(BSD4_4 || __EMX__) */ -#else /* !(BSD || MTS || __GO32__) */ - /* tzset was already called at start of process_zipfiles() */ - /* tzset(); */ /* set `timezone' variable */ -#ifndef __BEOS__ /* BeOS DR8 has no timezones... */ - m_time += timezone; /* seconds WEST of GMT: add */ -#endif -#endif /* ?(BSD || MTS || __GO32__) */ -#endif /* ?WIN32 */ - TTrace((stderr, " m_time after timezone = %lu\n", (ulg)m_time)); - -/*--------------------------------------------------------------------------- - Adjust for local daylight savings (summer) time. - ---------------------------------------------------------------------------*/ - -#ifndef BSD4_4 /* (DST already added to tm_gmtoff, so skip tm_isdst) */ - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - TIMET_TO_NATIVE(m_time) /* NOP unless MSC 7.0 or Macintosh */ - if (((tm = localtime((time_t *)&m_time)) != NULL) && tm->tm_isdst) -#ifdef WIN32 - m_time += 60L * tzinfo.DaylightBias; /* adjust with DST bias */ - else - m_time += 60L * tzinfo.StandardBias; /* add StdBias (normally 0) */ -#else - m_time -= 60L * 60L; /* adjust for daylight savings time */ -#endif - NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ - TTrace((stderr, " m_time after DST = %lu\n", (ulg)m_time)); -#endif /* !BSD4_4 */ -#ifdef WIN32 - } -#endif -#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ -#endif /* ?TOPS20 */ - -#endif /* ?HAVE_MKTIME */ - - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - - return m_time; - -} /* end function dos_to_unix_time() */ - -#endif /* !OS2 || TIMESTAMP */ -#endif /* !VMS && !CMS_MVS */ - - - -#if (!defined(VMS) && !defined(OS2) && !defined(CMS_MVS)) - -/******************************/ -/* Function check_for_newer() */ /* used for overwriting/freshening/updating */ -/******************************/ - -int check_for_newer(__G__ filename) /* return 1 if existing file is newer */ - __GDEF /* or equal; 0 if older; -1 if doesn't */ - char *filename; /* exist yet */ -{ - time_t existing, archive; -#ifdef USE_EF_UT_TIME - iztimes z_utime; -#endif -#ifdef AOS_VS - long dyy, dmm, ddd, dhh, dmin, dss; - - - dyy = (lrec.last_mod_dos_datetime >> 25) + 1980; - dmm = (lrec.last_mod_dos_datetime >> 21) & 0x0f; - ddd = (lrec.last_mod_dos_datetime >> 16) & 0x1f; - dhh = (lrec.last_mod_dos_datetime >> 11) & 0x1f; - dmin = (lrec.last_mod_dos_datetime >> 5) & 0x3f; - dss = (lrec.last_mod_dos_datetime & 0x1f) * 2; - - /* under AOS/VS, file times can only be set at creation time, - * with the info in a special DG format. Make sure we can create - * it here - we delete it later & re-create it, whether or not - * it exists now. - */ - if (!zvs_create(filename, (((ulg)dgdate(dmm, ddd, dyy)) << 16) | - (dhh*1800L + dmin*30L + dss/2L), -1L, -1L, (char *) -1, -1, -1, -1)) - return DOES_NOT_EXIST; -#endif /* AOS_VS */ - - Trace((stderr, "check_for_newer: doing stat(%s)\n", FnFilter1(filename))); - if (SSTAT(filename, &G.statbuf)) { - Trace((stderr, - "check_for_newer: stat(%s) returns %d: file does not exist\n", - FnFilter1(filename), SSTAT(filename, &G.statbuf))); -#ifdef SYMLINKS - Trace((stderr, "check_for_newer: doing lstat(%s)\n", - FnFilter1(filename))); - /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ - if (lstat(filename, &G.statbuf) == 0) { - Trace((stderr, - "check_for_newer: lstat(%s) returns 0: symlink does exist\n", - FnFilter1(filename))); - if (QCOND2 && !IS_OVERWRT_ALL) - Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), - FnFilter1(filename), " with no real file")); - return EXISTS_AND_OLDER; /* symlink dates are meaningless */ - } -#endif /* SYMLINKS */ - return DOES_NOT_EXIST; - } - Trace((stderr, "check_for_newer: stat(%s) returns 0: file exists\n", - FnFilter1(filename))); - -#ifdef SYMLINKS - /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ - if (lstat(filename, &G.statbuf) == 0 && S_ISLNK(G.statbuf.st_mode)) { - Trace((stderr, "check_for_newer: %s is a symbolic link\n", - FnFilter1(filename))); - if (QCOND2 && !IS_OVERWRT_ALL) - Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), - FnFilter1(filename), "")); - return EXISTS_AND_OLDER; /* symlink dates are meaningless */ - } -#endif /* SYMLINKS */ - - NATIVE_TO_TIMET(G.statbuf.st_mtime) /* NOP unless MSC 7.0 or Macintosh */ - -#ifdef USE_EF_UT_TIME - /* The `Unix extra field mtime' should be used for comparison with the - * time stamp of the existing file >>>ONLY<<< when the EF info is also - * used to set the modification time of the extracted file. - */ - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0, - G.lrec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME)) - { - TTrace((stderr, "check_for_newer: using Unix extra field mtime\n")); - existing = G.statbuf.st_mtime; - archive = z_utime.mtime; - } else { - /* round up existing filetime to nearest 2 seconds for comparison, - * but saturate in case of arithmetic overflow - */ - existing = ((G.statbuf.st_mtime & 1) && - (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? - G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; - archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - } -#else /* !USE_EF_UT_TIME */ - /* round up existing filetime to nearest 2 seconds for comparison, - * but saturate in case of arithmetic overflow - */ - existing = ((G.statbuf.st_mtime & 1) && - (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? - G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; - archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); -#endif /* ?USE_EF_UT_TIME */ - - TTrace((stderr, "check_for_newer: existing %lu, archive %lu, e-a %ld\n", - (ulg)existing, (ulg)archive, (long)(existing-archive))); - - return (existing >= archive); - -} /* end function check_for_newer() */ - -#endif /* !VMS && !OS2 && !CMS_MVS */ - - - - - -/************************/ -/* Function do_string() */ -/************************/ - -int do_string(__G__ length, option) /* return PK-type error code */ - __GDEF - unsigned int length; /* without prototype, ush converted to this */ - int option; -{ - unsigned comment_bytes_left; - unsigned int block_len; - int error=PK_OK; -#ifdef AMIGA - char tmp_fnote[2 * AMIGA_FILENOTELEN]; /* extra room for squozen chars */ -#endif - - -/*--------------------------------------------------------------------------- - This function processes arbitrary-length (well, usually) strings. Four - major options are allowed: SKIP, wherein the string is skipped (pretty - logical, eh?); DISPLAY, wherein the string is printed to standard output - after undergoing any necessary or unnecessary character conversions; - DS_FN, wherein the string is put into the filename[] array after under- - going appropriate conversions (including case-conversion, if that is - indicated: see the global variable pInfo->lcflag); and EXTRA_FIELD, - wherein the `string' is assumed to be an extra field and is copied to - the (freshly malloced) buffer G.extra_field. The third option should - be OK since filename is dimensioned at 1025, but we check anyway. - - The string, by the way, is assumed to start at the current file-pointer - position; its length is given by 'length'. So start off by checking the - length of the string: if zero, we're already done. - ---------------------------------------------------------------------------*/ - - if (!length) - return PK_COOL; - - switch (option) { - -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - /* - * Special case: See if the comment begins with an autorun command line. - * Save that and display (or skip) the remainder. - */ - - case CHECK_AUTORUN: - case CHECK_AUTORUN_Q: - comment_bytes_left = length; - if (length >= 10) - { - block_len = readbuf(__G__ (char *)G.outbuf, 10); - if (block_len == 0) - return PK_EOF; - comment_bytes_left -= block_len; - G.outbuf[block_len] = '\0'; - if (!strcmp((char *)G.outbuf, "$AUTORUN$>")) { - char *eol; - length -= 10; - block_len = readbuf(__G__ G.autorun_command, - MIN(length, sizeof(G.autorun_command)-1)); - if (block_len == 0) - return PK_EOF; - comment_bytes_left -= block_len; - G.autorun_command[block_len] = '\0'; - A_TO_N(G.autorun_command); - eol = strchr(G.autorun_command, '\n'); - if (!eol) - eol = G.autorun_command + strlen(G.autorun_command) - 1; - length -= eol + 1 - G.autorun_command; - while (eol >= G.autorun_command && isspace(*eol)) - *eol-- = '\0'; -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM(G.autorun_command, G.autorun_command); -#endif /* (WIN32 && !_WIN32_WCE) */ - } - } - if (option == CHECK_AUTORUN_Q) /* don't display the remainder */ - length = 0; - /* seek to beginning of remaining part of comment -- rewind if */ - /* displaying entire comment, or skip to end if discarding it */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr - G.inbuf) + comment_bytes_left - length); - if (!length) - break; - /* FALL THROUGH... */ -#endif /* SFX && CHEAP_SFX_AUTORUN */ - - /* - * First normal case: print string on standard output. First set loop - * variables, then loop through the comment in chunks of OUTBUFSIZ bytes, - * converting formats and printing as we go. The second half of the - * loop conditional was added because the file might be truncated, in - * which case comment_bytes_left will remain at some non-zero value for - * all time. outbuf and slide are used as scratch buffers because they - * are available (we should be either before or in between any file pro- - * cessing). - */ - - case DISPLAY: - case DISPL_8: - comment_bytes_left = length; - block_len = OUTBUFSIZ; /* for the while statement, first time */ - while (comment_bytes_left > 0 && block_len > 0) { - register uch *p = G.outbuf; - register uch *q = G.outbuf; - - if ((block_len = readbuf(__G__ (char *)G.outbuf, - MIN((unsigned)OUTBUFSIZ, comment_bytes_left))) == 0) - return PK_EOF; - comment_bytes_left -= block_len; - - /* this is why we allocated an extra byte for outbuf: terminate - * with zero (ASCIIZ) */ - G.outbuf[block_len] = '\0'; - - /* remove all ASCII carriage returns from comment before printing - * (since used before A_TO_N(), check for CR instead of '\r') - */ - while (*p) { - while (*p == CR) - ++p; - *q++ = *p++; - } - /* could check whether (p - outbuf) == block_len here */ - *q = '\0'; - - if (option == DISPL_8) { - /* translate the text coded in the entry's host-dependent - "extended ASCII" charset into the compiler's (system's) - internal text code page */ - Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum, - G.pInfo->hostver, G.pInfo->HasUxAtt, - FALSE); -#ifdef WINDLL - /* translate to ANSI (RTL internal codepage may be OEM) */ - INTERN_TO_ISO((char *)G.outbuf, (char *)G.outbuf); -#else /* !WINDLL */ -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM((char *)G.outbuf, (char *)G.outbuf); -#endif /* (WIN32 && !_WIN32_WCE) */ -#endif /* ?WINDLL */ - } else { - A_TO_N(G.outbuf); /* translate string to native */ - } - -#ifdef WINDLL - /* ran out of local mem -- had to cheat */ - win_fprintf((zvoid *)&G, stdout, (extent)(q-G.outbuf), - (char *)G.outbuf); - win_fprintf((zvoid *)&G, stdout, 2, (char *)"\n\n"); -#else /* !WINDLL */ -#ifdef NOANSIFILT /* GRR: can ANSI be used with EBCDIC? */ - (*G.message)((zvoid *)&G, G.outbuf, (ulg)(q-G.outbuf), 0); -#else /* ASCII, filter out ANSI escape sequences and handle ^S (pause) */ - p = G.outbuf - 1; - q = slide; - while (*++p) { - int pause = FALSE; - - if (*p == 0x1B) { /* ASCII escape char */ - *q++ = '^'; - *q++ = '['; - } else if (*p == 0x13) { /* ASCII ^S (pause) */ - pause = TRUE; - if (p[1] == LF) /* ASCII LF */ - *q++ = *++p; - else if (p[1] == CR && p[2] == LF) { /* ASCII CR LF */ - *q++ = *++p; - *q++ = *++p; - } - } else - *q++ = *p; - if ((unsigned)(q-slide) > WSIZE-3 || pause) { /* flush */ - (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); - q = slide; - if (pause && G.extract_flag) /* don't pause for list/test */ - (*G.mpause)((zvoid *)&G, LoadFarString(QuitPrompt), 0); - } - } - (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); -#endif /* ?NOANSIFILT */ -#endif /* ?WINDLL */ - } - /* add '\n' if not at start of line */ - (*G.message)((zvoid *)&G, slide, 0L, 0x40); - break; - - /* - * Second case: read string into filename[] array. The filename should - * never ever be longer than FILNAMSIZ-1 (1024), but for now we'll check, - * just to be sure. - */ - - case DS_FN: - case DS_FN_L: -#ifdef UNICODE_SUPPORT - /* get the whole filename as need it for Unicode checksum */ - if (G.fnfull_bufsize <= length) { - extent fnbufsiz = FILNAMSIZ; - - if (fnbufsiz <= length) - fnbufsiz = length + 1; - if (G.filename_full) - free(G.filename_full); - G.filename_full = malloc(fnbufsiz); - if (G.filename_full == NULL) - return PK_MEM; - G.fnfull_bufsize = fnbufsiz; - } - if (readbuf(__G__ G.filename_full, length) == 0) - return PK_EOF; - G.filename_full[length] = '\0'; /* terminate w/zero: ASCIIZ */ - - /* if needed, chop off end so standard filename is a valid length */ - if (length >= FILNAMSIZ) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameTooLongTrunc))); - error = PK_WARN; - length = FILNAMSIZ - 1; - } - /* no excess size */ - block_len = 0; - strncpy(G.filename, G.filename_full, length); - G.filename[length] = '\0'; /* terminate w/zero: ASCIIZ */ -#else /* !UNICODE_SUPPORT */ - if (length >= FILNAMSIZ) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameTooLongTrunc))); - error = PK_WARN; - /* remember excess length in block_len */ - block_len = length - (FILNAMSIZ - 1); - length = FILNAMSIZ - 1; - } else - /* no excess size */ - block_len = 0; - if (readbuf(__G__ G.filename, length) == 0) - return PK_EOF; - G.filename[length] = '\0'; /* terminate w/zero: ASCIIZ */ -#endif /* ?UNICODE_SUPPORT */ - - /* translate the Zip entry filename coded in host-dependent "extended - ASCII" into the compiler's (system's) internal text code page */ - Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, - G.pInfo->HasUxAtt, (option == DS_FN_L)); - - if (G.pInfo->lcflag) /* replace with lowercase filename */ - STRLOWER(G.filename, G.filename); - - if (G.pInfo->vollabel && length > 8 && G.filename[8] == '.') { - char *p = G.filename+8; - while (*p++) - p[-1] = *p; /* disk label, and 8th char is dot: remove dot */ - } - - if (!block_len) /* no overflow, we're done here */ - break; - - /* - * We truncated the filename, so print what's left and then fall - * through to the SKIP routine. - */ - Info(slide, 0x401, ((char *)slide, "[ %s ]\n", FnFilter1(G.filename))); - length = block_len; /* SKIP the excess bytes... */ - /* FALL THROUGH... */ - - /* - * Third case: skip string, adjusting readbuf's internal variables - * as necessary (and possibly skipping to and reading a new block of - * data). - */ - - case SKIP: - /* cur_zipfile_bufstart already takes account of extra_bytes, so don't - * correct for it twice: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr-G.inbuf) + length); - break; - - /* - * Fourth case: assume we're at the start of an "extra field"; malloc - * storage for it and read data into the allocated space. - */ - - case EXTRA_FIELD: - if (G.extra_field != (uch *)NULL) - free(G.extra_field); - if ((G.extra_field = (uch *)malloc(length)) == (uch *)NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(ExtraFieldTooLong), - length)); - /* cur_zipfile_bufstart already takes account of extra_bytes, - * so don't correct for it twice: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr-G.inbuf) + length); - } else { - if (readbuf(__G__ (char *)G.extra_field, length) == 0) - return PK_EOF; - /* Looks like here is where extra fields are read */ - getZip64Data(__G__ G.extra_field, length); -#ifdef UNICODE_SUPPORT - G.unipath_filename = NULL; - if (G.UzO.U_flag < 2) { - /* check if GPB11 (General Purpuse Bit 11) is set indicating - the standard path and comment are UTF-8 */ - if (G.pInfo->GPFIsUTF8) { - /* if GPB11 set then filename_full is untruncated UTF-8 */ - G.unipath_filename = G.filename_full; - } else { - /* Get the Unicode fields if exist */ - getUnicodeData(__G__ G.extra_field, length); - if (G.unipath_filename && strlen(G.unipath_filename) == 0) { - /* the standard filename field is UTF-8 */ - free(G.unipath_filename); - G.unipath_filename = G.filename_full; - } - } - if (G.unipath_filename) { -# ifdef UTF8_MAYBE_NATIVE - if (G.native_is_utf8 -# ifdef UNICODE_WCHAR - && (!G.unicode_escape_all) -# endif - ) { - strncpy(G.filename, G.unipath_filename, FILNAMSIZ - 1); - /* make sure filename is short enough */ - if (strlen(G.unipath_filename) >= FILNAMSIZ) { - G.filename[FILNAMSIZ - 1] = '\0'; - Info(slide, 0x401, ((char *)slide, - LoadFarString(UFilenameTooLongTrunc))); - error = PK_WARN; - } - } -# ifdef UNICODE_WCHAR - else -# endif -# endif /* UTF8_MAYBE_NATIVE */ -# ifdef UNICODE_WCHAR - { - char *fn; - - /* convert UTF-8 to local character set */ - fn = utf8_to_local_string(G.unipath_filename, - G.unicode_escape_all); - /* make sure filename is short enough */ - if (strlen(fn) >= FILNAMSIZ) { - fn[FILNAMSIZ - 1] = '\0'; - Info(slide, 0x401, ((char *)slide, - LoadFarString(UFilenameTooLongTrunc))); - error = PK_WARN; - } - /* replace filename with converted UTF-8 */ - strcpy(G.filename, fn); - free(fn); - } -# endif /* UNICODE_WCHAR */ - if (G.unipath_filename != G.filename_full) - free(G.unipath_filename); - G.unipath_filename = NULL; - } - } -#endif /* UNICODE_SUPPORT */ - } - break; - -#ifdef AMIGA - /* - * Fifth case, for the Amiga only: take the comment that would ordinarily - * be skipped over, and turn it into a 79 character string that will be - * attached to the file as a "filenote" after it is extracted. - */ - - case FILENOTE: - if ((block_len = readbuf(__G__ tmp_fnote, (unsigned) - MIN(length, 2 * AMIGA_FILENOTELEN - 1))) == 0) - return PK_EOF; - if ((length -= block_len) > 0) /* treat remainder as in case SKIP: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes - + (G.inptr - G.inbuf) + length); - /* convert multi-line text into single line with no ctl-chars: */ - tmp_fnote[block_len] = '\0'; - while ((short int) --block_len >= 0) - if ((unsigned) tmp_fnote[block_len] < ' ') - if (tmp_fnote[block_len+1] == ' ') /* no excess */ - strcpy(tmp_fnote+block_len, tmp_fnote+block_len+1); - else - tmp_fnote[block_len] = ' '; - tmp_fnote[AMIGA_FILENOTELEN - 1] = '\0'; - if (G.filenotes[G.filenote_slot]) - free(G.filenotes[G.filenote_slot]); /* should not happen */ - G.filenotes[G.filenote_slot] = NULL; - if (tmp_fnote[0]) { - if (!(G.filenotes[G.filenote_slot] = malloc(strlen(tmp_fnote)+1))) - return PK_MEM; - strcpy(G.filenotes[G.filenote_slot], tmp_fnote); - } - break; -#endif /* AMIGA */ - - } /* end switch (option) */ - - return error; - -} /* end function do_string() */ - - - - - -/***********************/ -/* Function makeword() */ -/***********************/ - -ush makeword(b) - ZCONST uch *b; -{ - /* - * Convert Intel style 'short' integer to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (ush)((b[1] << 8) | b[0]); -} - - - - - -/***********************/ -/* Function makelong() */ -/***********************/ - -ulg makelong(sig) - ZCONST uch *sig; -{ - /* - * Convert intel style 'long' variable to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (ulg)((((unsigned)sig[1]) << 8) - + ((unsigned)sig[0])); -} - - - - - -/************************/ -/* Function makeint64() */ -/************************/ - -zusz_t makeint64(sig) - ZCONST uch *sig; -{ -#ifdef LARGE_FILE_SUPPORT - /* - * Convert intel style 'int64' variable to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (((zusz_t)sig[7]) << 56) - + (((zusz_t)sig[6]) << 48) - + (((zusz_t)sig[4]) << 32) - + (zusz_t)((((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (((unsigned)sig[1]) << 8) - + (sig[0])); - -#else /* !LARGE_FILE_SUPPORT */ - - if ((sig[7] | sig[6] | sig[5] | sig[4]) != 0) - return (zusz_t)0xffffffffL; - else - return (zusz_t)((((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (((unsigned)sig[1]) << 8) - + (sig[0])); - -#endif /* ?LARGE_FILE_SUPPORT */ -} - - - - - -/*********************/ -/* Function fzofft() */ -/*********************/ - -/* Format a zoff_t value in a cylindrical buffer set. */ -char *fzofft(__G__ val, pre, post) - __GDEF - zoff_t val; - ZCONST char *pre; - ZCONST char *post; -{ - /* Storage cylinder. (now in globals.h) */ - /*static char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];*/ - /*static int fzofft_index = 0;*/ - - /* Temporary format string storage. */ - char fmt[16]; - - /* Assemble the format string. */ - fmt[0] = '%'; - fmt[1] = '\0'; /* Start after initial "%". */ - if (pre == FZOFFT_HEX_WID) /* Special hex width. */ - { - strcat(fmt, FZOFFT_HEX_WID_VALUE); - } - else if (pre == FZOFFT_HEX_DOT_WID) /* Special hex ".width". */ - { - strcat(fmt, "."); - strcat(fmt, FZOFFT_HEX_WID_VALUE); - } - else if (pre != NULL) /* Caller's prefix (width). */ - { - strcat(fmt, pre); - } - - strcat(fmt, FZOFFT_FMT); /* Long or long-long or whatever. */ - - if (post == NULL) - strcat(fmt, "d"); /* Default radix = decimal. */ - else - strcat(fmt, post); /* Caller's radix. */ - - /* Advance the cylinder. */ - G.fzofft_index = (G.fzofft_index + 1) % FZOFFT_NUM; - - /* Write into the current chamber. */ - sprintf(G.fzofft_buf[G.fzofft_index], fmt, val); - - /* Return a pointer to this chamber. */ - return G.fzofft_buf[G.fzofft_index]; -} - - - - -#if CRYPT - -#ifdef NEED_STR2ISO -/**********************/ -/* Function str2iso() */ -/**********************/ - -char *str2iso(dst, src) - char *dst; /* destination buffer */ - register ZCONST char *src; /* source string */ -{ -#ifdef INTERN_TO_ISO - INTERN_TO_ISO(src, dst); -#else - register uch c; - register char *dstp = dst; - - do { - c = (uch)foreign(*src++); - *dstp++ = (char)ASCII2ISO(c); - } while (c != '\0'); -#endif - - return dst; -} -#endif /* NEED_STR2ISO */ - - -#ifdef NEED_STR2OEM -/**********************/ -/* Function str2oem() */ -/**********************/ - -char *str2oem(dst, src) - char *dst; /* destination buffer */ - register ZCONST char *src; /* source string */ -{ -#ifdef INTERN_TO_OEM - INTERN_TO_OEM(src, dst); -#else - register uch c; - register char *dstp = dst; - - do { - c = (uch)foreign(*src++); - *dstp++ = (char)ASCII2OEM(c); - } while (c != '\0'); -#endif - - return dst; -} -#endif /* NEED_STR2OEM */ - -#endif /* CRYPT */ - - -#ifdef ZMEM /* memset/memcmp/memcpy for systems without either them or */ - /* bzero/bcmp/bcopy */ - /* (no known systems as of 960211) */ - -/*********************/ -/* Function memset() */ -/*********************/ - -zvoid *memset(buf, init, len) - register zvoid *buf; /* buffer location */ - register int init; /* initializer character */ - register unsigned int len; /* length of the buffer */ -{ - zvoid *start; - - start = buf; - while (len--) - *((char *)buf++) = (char)init; - return start; -} - - - -/*********************/ -/* Function memcmp() */ -/*********************/ - -int memcmp(b1, b2, len) - register ZCONST zvoid *b1; - register ZCONST zvoid *b2; - register unsigned int len; -{ - register int c; - - if (len > 0) do { - if ((c = (int)(*((ZCONST unsigned char *)b1)++) - - (int)(*((ZCONST unsigned char *)b2)++)) != 0) - return c; - } while (--len > 0) - return 0; -} - - - -/*********************/ -/* Function memcpy() */ -/*********************/ - -zvoid *memcpy(dst, src, len) - register zvoid *dst; - register ZCONST zvoid *src; - register unsigned int len; -{ - zvoid *start; - - start = dst; - while (len-- > 0) - *((char *)dst)++ = *((ZCONST char *)src)++; - return start; -} - -#endif /* ZMEM */ - - - - -#ifdef NO_STRNICMP - -/************************/ -/* Function zstrnicmp() */ -/************************/ - -int zstrnicmp(s1, s2, n) - register ZCONST char *s1, *s2; - register unsigned n; -{ - for (; n > 0; --n, ++s1, ++s2) { - - if (ToLower(*s1) != ToLower(*s2)) - /* test includes early termination of one string */ - return ((uch)ToLower(*s1) < (uch)ToLower(*s2))? -1 : 1; - - if (*s1 == '\0') /* both strings terminate early */ - return 0; - } - return 0; -} - -#endif /* NO_STRNICMP */ - - - - -#ifdef REGULUS /* returns the inode number on success(!)...argh argh argh */ -# undef stat - -/********************/ -/* Function zstat() */ -/********************/ - -int zstat(p, s) - ZCONST char *p; - struct stat *s; -{ - return (stat((char *)p,s) >= 0? 0 : (-1)); -} - -#endif /* REGULUS */ - - - - -#ifdef _MBCS - -/* DBCS support for Info-ZIP's zip (mainly for japanese (-: ) - * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) - * This code is public domain! Date: 1998/12/20 - */ - -/************************/ -/* Function plastchar() */ -/************************/ - -char *plastchar(ptr, len) - ZCONST char *ptr; - extent len; -{ - unsigned clen; - ZCONST char *oldptr = ptr; - while(*ptr != '\0' && len > 0){ - oldptr = ptr; - clen = CLEN(ptr); - ptr += clen; - len -= clen; - } - return (char *)oldptr; -} - - -#ifdef NEED_UZMBCLEN -/***********************/ -/* Function uzmbclen() */ -/***********************/ - -extent uzmbclen(ptr) - ZCONST unsigned char *ptr; -{ - int mbl; - - mbl = mblen((ZCONST char *)ptr, MB_CUR_MAX); - /* For use in code scanning through MBCS strings, we need a strictly - positive "MB char bytes count". For our scanning purpose, it is not - not relevant whether the MB character is valid or not. And, the NUL - char '\0' has a byte count of 1, but mblen() returns 0. So, we make - sure that the uzmbclen() return value is not less than 1. - */ - return (extent)(mbl > 0 ? mbl : 1); -} -#endif /* NEED_UZMBCLEN */ - - -#ifdef NEED_UZMBSCHR -/***********************/ -/* Function uzmbschr() */ -/***********************/ - -unsigned char *uzmbschr(str, c) - ZCONST unsigned char *str; - unsigned int c; -{ - while(*str != '\0'){ - if (*str == c) {return (unsigned char *)str;} - INCSTR(str); - } - return NULL; -} -#endif /* NEED_UZMBSCHR */ - - -#ifdef NEED_UZMBSRCHR -/************************/ -/* Function uzmbsrchr() */ -/************************/ - -unsigned char *uzmbsrchr(str, c) - ZCONST unsigned char *str; - unsigned int c; -{ - unsigned char *match = NULL; - while(*str != '\0'){ - if (*str == c) {match = (unsigned char *)str;} - INCSTR(str); - } - return match; -} -#endif /* NEED_UZMBSRCHR */ -#endif /* _MBCS */ - - - - - -#ifdef SMALL_MEM - -/*******************************/ -/* Function fLoadFarString() */ /* (and friends...) */ -/*******************************/ - -char *fLoadFarString(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchBigBuffer, sz); - return G.rgchBigBuffer; -} - -char *fLoadFarStringSmall(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchSmallBuffer, sz); - return G.rgchSmallBuffer; -} - -char *fLoadFarStringSmall2(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchSmallBuffer2, sz); - return G.rgchSmallBuffer2; -} - - - - -#if (!defined(_MSC_VER) || (_MSC_VER < 600)) -/*************************/ -/* Function zfstrcpy() */ /* portable clone of _fstrcpy() */ -/*************************/ - -char Far * Far zfstrcpy(char Far *s1, const char Far *s2) -{ - char Far *p = s1; - - while ((*s1++ = *s2++) != '\0'); - return p; -} - -#if (!(defined(SFX) || defined(FUNZIP))) -/*************************/ -/* Function zfstrcmp() */ /* portable clone of _fstrcmp() */ -/*************************/ - -int Far zfstrcmp(const char Far *s1, const char Far *s2) -{ - int ret; - - while ((ret = (int)(uch)*s1 - (int)(uch)*s2) == 0 - && *s2 != '\0') { - ++s2; ++s1; - } - return ret; -} -#endif /* !(SFX || FUNZIP) */ -#endif /* !_MSC_VER || (_MSC_VER < 600) */ - -#endif /* SMALL_MEM */ diff --git a/data/windows/unzipfx-catarina/globals.c b/data/windows/unzipfx-catarina/globals.c deleted file mode 100644 index fa8cca5..0000000 --- a/data/windows/unzipfx-catarina/globals.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2003-May-08 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - globals.c - - Routines to allocate and initialize globals, with or without threads. - - Contents: registerGlobalPointer() - deregisterGlobalPointer() - getGlobalPointer() - globalsCtor() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifndef FUNZIP -/* initialization of sigs is completed at runtime so unzip(sfx) executable - * won't look like a zipfile - */ -char central_hdr_sig[4] = {0, 0, 0x01, 0x02}; -char local_hdr_sig[4] = {0, 0, 0x03, 0x04}; -char end_central_sig[4] = {0, 0, 0x05, 0x06}; -char end_central64_sig[4] = {0, 0, 0x06, 0x06}; -char end_centloc64_sig[4] = {0, 0, 0x06, 0x07}; -/* extern char extd_local_sig[4] = {0, 0, 0x07, 0x08}; NOT USED YET */ - -ZCONST char *fnames[2] = {"*", NULL}; /* default filenames vector */ -#endif - - -#ifndef REENTRANT - Uz_Globs G; -#else /* REENTRANT */ - -# ifndef USETHREADID - Uz_Globs *GG; -# else /* USETHREADID */ -# define THREADID_ENTRIES 0x40 - - int lastScan; - Uz_Globs *threadPtrTable[THREADID_ENTRIES]; - ulg threadIdTable [THREADID_ENTRIES] = { - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* Make sure there are */ - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* THREADID_ENTRIES 0s */ - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 - }; - - static ZCONST char Far TooManyThreads[] = - "error: more than %d simultaneous threads.\n\ - Some threads are probably not calling DESTROYTHREAD()\n"; - static ZCONST char Far EntryNotFound[] = - "error: couldn't find global pointer in table.\n\ - Maybe somebody accidentally called DESTROYTHREAD() twice.\n"; - static ZCONST char Far GlobalPointerMismatch[] = - "error: global pointer in table does not match pointer passed as\ - parameter\n"; - -static void registerGlobalPointer OF((__GPRO)); - - - -static void registerGlobalPointer(__G) - __GDEF -{ - int scan=0; - ulg tid = GetThreadId(); - - while (threadIdTable[scan] && scan < THREADID_ENTRIES) - scan++; - - if (scan == THREADID_ENTRIES) { - ZCONST char *tooMany = LoadFarString(TooManyThreads); - Info(slide, 0x421, ((char *)slide, tooMany, THREADID_ENTRIES)); - free(pG); - EXIT(PK_MEM); /* essentially memory error before we've started */ - } - - threadIdTable [scan] = tid; - threadPtrTable[scan] = pG; - lastScan = scan; -} - - - -void deregisterGlobalPointer(__G) - __GDEF -{ - int scan=0; - ulg tid = GetThreadId(); - - - while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) - scan++; - -/*--------------------------------------------------------------------------- - There are two things we can do if we can't find the entry: ignore it or - scream. The most likely reason for it not to be here is the user calling - this routine twice. Since this could cause BIG problems if any globals - are accessed after the first call, we'd better scream. - ---------------------------------------------------------------------------*/ - - if (scan == THREADID_ENTRIES || threadPtrTable[scan] != pG) { - ZCONST char *noEntry; - if (scan == THREADID_ENTRIES) - noEntry = LoadFarString(EntryNotFound); - else - noEntry = LoadFarString(GlobalPointerMismatch); - Info(slide, 0x421, ((char *)slide, noEntry)); - EXIT(PK_WARN); /* programming error, but after we're all done */ - } - - threadIdTable [scan] = 0; - lastScan = scan; - free(threadPtrTable[scan]); -} - - - -Uz_Globs *getGlobalPointer() -{ - int scan=0; - ulg tid = GetThreadId(); - - while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) - scan++; - -/*--------------------------------------------------------------------------- - There are two things we can do if we can't find the entry: ignore it or - scream. The most likely reason for it not to be here is the user calling - this routine twice. Since this could cause BIG problems if any globals - are accessed after the first call, we'd better scream. - ---------------------------------------------------------------------------*/ - - if (scan == THREADID_ENTRIES) { - ZCONST char *noEntry = LoadFarString(EntryNotFound); - fprintf(stderr, noEntry); /* can't use Info w/o a global pointer */ - EXIT(PK_ERR); /* programming error while still working */ - } - - return threadPtrTable[scan]; -} - -# endif /* ?USETHREADID */ -#endif /* ?REENTRANT */ - - - -Uz_Globs *globalsCtor() -{ -#ifdef REENTRANT - Uz_Globs *pG = (Uz_Globs *)malloc(sizeof(Uz_Globs)); - - if (!pG) - return (Uz_Globs *)NULL; -#endif /* REENTRANT */ - - /* for REENTRANT version, G is defined as (*pG) */ - - memzero(&G, sizeof(Uz_Globs)); - -#ifndef FUNZIP -#ifdef CMS_MVS - uO.aflag=1; - uO.C_flag=1; -#endif -#ifdef TANDEM - uO.aflag=1; /* default to '-a' auto create Text Files as type 101 */ -#endif -#ifdef VMS -# if (!defined(NO_TIMESTAMPS)) - uO.D_flag=1; /* default to '-D', no restoration of dir timestamps */ -# endif -#endif - - uO.lflag=(-1); - G.wildzipfn = ""; - G.pfnames = (char **)fnames; - G.pxnames = (char **)&fnames[1]; - G.pInfo = G.info; - G.sol = TRUE; /* at start of line */ - - G.message = UzpMessagePrnt; - G.input = UzpInput; /* not used by anyone at the moment... */ -#if defined(WINDLL) || defined(MACOS) - G.mpause = NULL; /* has scrollbars: no need for pausing */ -#else - G.mpause = UzpMorePause; -#endif - G.decr_passwd = UzpPassword; -#endif /* !FUNZIP */ - -#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) -#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) - G.echofd = -1; -#endif /* !(MACOS || ATARI || VMS) */ -#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ - -#ifdef SYSTEM_SPECIFIC_CTOR - SYSTEM_SPECIFIC_CTOR(__G); -#endif - -#ifdef REENTRANT -#ifdef USETHREADID - registerGlobalPointer(__G); -#else - GG = &G; -#endif /* ?USETHREADID */ -#endif /* REENTRANT */ - - return &G; -} diff --git a/data/windows/unzipfx-catarina/globals.h b/data/windows/unzipfx-catarina/globals.h deleted file mode 100644 index 11b7215..0000000 --- a/data/windows/unzipfx-catarina/globals.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - globals.h - - There is usually no need to include this file since unzip.h includes it. - - This header file is used by all of the UnZip source files. It contains - a struct definition that is used to "house" all of the global variables. - This is done to allow for multithreaded environments (OS/2, NT, Win95, - Unix) to call UnZip through an API without a semaphore. REENTRANT should - be defined for all platforms that require this. - - GLOBAL CONSTRUCTOR AND DESTRUCTOR (API WRITERS READ THIS!!!) - ------------------------------------------------------------ - - No, it's not C++, but it's as close as we can get with K&R. - - The main() of each process that uses these globals must include the - CONSTRUCTGLOBALS; statement. This will malloc enough memory for the - structure and initialize any variables that require it. This must - also be done by any API function that jumps into the middle of the - code. - - The DESTROYGLOBALS(); statement should be inserted before EVERY "EXIT(n)". - Naturally, it also needs to be put before any API returns as well. - In fact, it's much more important in API functions since the process - will NOT end, and therefore the memory WON'T automatically be freed - by the operating system. - - USING VARIABLES FROM THE STRUCTURE - ---------------------------------- - - All global variables must now be prefixed with `G.' which is either a - global struct (in which case it should be the only global variable) or - a macro for the value of a local pointer variable that is passed from - function to function. Yes, this is a pain. But it's the only way to - allow full reentrancy. - - ADDING VARIABLES TO THE STRUCTURE - --------------------------------- - - If you make the inclusion of any variables conditional, be sure to only - check macros that are GUARANTEED to be included in every module. - For instance, newzip and pwdarg are needed only if CRYPT is TRUE, - but this is defined after unzip.h has been read. If you are not careful, - some modules will expect your variable to be part of this struct while - others won't. This will cause BIG problems. (Inexplicable crashes at - strange times, car fires, etc.) When in doubt, always include it! - - Note also that UnZipSFX needs a few variables that UnZip doesn't. However, - it also includes some object files from UnZip. If we were to conditionally - include the extra variables that UnZipSFX needs, the object files from - UnZip would not mesh with the UnZipSFX object files. Result: we just - include the UnZipSFX variables every time. (It's only an extra 4 bytes - so who cares!) - - ADDING FUNCTIONS - ---------------- - - To support this new global struct, all functions must now conditionally - pass the globals pointer (pG) to each other. This is supported by 5 macros: - __GPRO, __GPRO__, __G, __G__ and __GDEF. A function that needs no other - parameters would look like this: - - int extract_or_test_files(__G) - __GDEF - { - ... stuff ... - } - - A function with other parameters would look like: - - int memextract(__G__ tgt, tgtsize, src, srcsize) - __GDEF - uch *tgt, *src; - ulg tgtsize, srcsize; - { - ... stuff ... - } - - In the Function Prototypes section of unzpriv.h, you should use __GPRO and - __GPRO__ instead: - - int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); - int process_zipfiles OF((__GPRO)); - - Note that there is NO comma after __G__ or __GPRO__ and no semi-colon after - __GDEF. I wish there was another way but I don't think there is. - - - TESTING THE CODE - ----------------- - - Whether your platform requires reentrancy or not, you should always try - building with REENTRANT defined if any functions have been added. It is - pretty easy to forget a __G__ or a __GDEF and this mistake will only show - up if REENTRANT is defined. All platforms should run with REENTRANT - defined. Platforms that can't take advantage of it will just be paying - a performance penalty needlessly. - - SIGNAL MADNESS - -------------- - - This whole pointer passing scheme falls apart when it comes to SIGNALs. - I handle this situation 2 ways right now. If you define USETHREADID, - UnZip will include a 64-entry table. Each entry can hold a global - pointer and thread ID for one thread. This should allow up to 64 - threads to access UnZip simultaneously. Calling DESTROYGLOBALS() - will free the global struct and zero the table entry. If somebody - forgets to call DESTROYGLOBALS(), this table will eventually fill up - and UnZip will exit with an error message. A good way to test your - code to make sure you didn't forget a DESTROYGLOBALS() is to change - THREADID_ENTRIES to 3 or 4 in globals.c, making the table real small. - Then make a small test program that calls your API a dozen times. - - Those platforms that don't have threads still need to be able to compile - with REENTRANT defined to test and see if new code is correctly written - to work either way. For these platforms, I simply keep a global pointer - called GG that points to the Globals structure. Good enough for testing. - - I believe that NT has thread level storage. This could probably be used - to store a global pointer for the sake of the signal handler more cleanly - than my table approach. - - ---------------------------------------------------------------------------*/ - -#ifndef __globals_h -#define __globals_h - -#ifdef USE_ZLIB -# include "zlib.h" -# ifdef zlib_version /* This name is used internally in unzip */ -# undef zlib_version /* and must not be defined as a macro. */ -# endif -#endif - -#ifdef USE_BZIP2 -# include "bzlib.h" -#endif - - -/*************/ -/* Globals */ -/*************/ - -typedef struct Globals { -#ifdef DLL - zvoid *callerglobs; /* pointer to structure of pass-through global vars */ -#endif - - /* command options of general use */ - UzpOpts UzO; /* command options of general use */ - -#ifndef FUNZIP - /* command options specific to the high level command line interface */ -#ifdef MORE - int M_flag; /* -M: built-in "more" function */ -#endif - - /* internal flags and general globals */ -#ifdef MORE - int height; /* check for SIGWINCH, etc., eventually... */ - int lines; /* count of lines displayed on current screen */ -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - int width; - int chars; /* count of screen characters in current line */ -# endif -#endif /* MORE */ -#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) - int tz_is_valid; /* indicates that timezone info can be used */ -#endif - int noargs; /* did true command line have *any* arguments? */ - unsigned filespecs; /* number of real file specifications to be matched */ - unsigned xfilespecs; /* number of excluded filespecs to be matched */ - int process_all_files; - int overwrite_mode; /* 0 - query, 1 - always, 2 - never */ - int create_dirs; /* used by main(), mapname(), checkdir() */ - int extract_flag; - int newzip; /* reset in extract.c; used in crypt.c */ - zoff_t real_ecrec_offset; - zoff_t expect_ecrec_offset; - zoff_t csize; /* used by decompr. (NEXTBYTE): must be signed */ - zoff_t used_csize; /* used by extract_or_test_member(), explode() */ - -#ifdef DLL - int fValidate; /* true if only validating an archive */ - int filenotfound; - int redirect_data; /* redirect data to memory buffer */ - int redirect_text; /* redirect text output to buffer */ -# ifndef NO_SLIDE_REDIR - int redirect_slide; /* redirect decompression area to mem buffer */ -# if (defined(USE_DEFLATE64) && defined(INT_16BIT)) - ulg _wsize; /* size of sliding window exceeds "unsigned" range */ -# else - unsigned _wsize; /* sliding window size can be hold in unsigned */ -# endif -# endif - ulg redirect_size; /* size of redirected output buffer */ - uch *redirect_buffer; /* pointer to head of allocated buffer */ - uch *redirect_pointer; /* pointer past end of written data */ -# ifndef NO_SLIDE_REDIR - uch *redirect_sldptr; /* head of decompression slide buffer */ -# endif -# ifdef OS2DLL - cbList(processExternally); /* call-back list */ -# endif -#endif /* DLL */ - - char **pfnames; - char **pxnames; - char sig[4]; - char answerbuf[10]; - min_info info[DIR_BLKSIZ]; - min_info *pInfo; -#endif /* !FUNZIP */ - union work area; /* see unzpriv.h for definition of work */ - -#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) - ZCONST ulg near *crc_32_tab; -#else - ZCONST ulg Far *crc_32_tab; -#endif - ulg crc32val; /* CRC shift reg. (was static in funzip) */ - -#ifdef FUNZIP - FILE *in; /* file descriptor of compressed stream */ -#endif - uch *inbuf; /* input buffer (any size is OK) */ - uch *inptr; /* pointer into input buffer */ - int incnt; - -#ifndef FUNZIP - ulg bitbuf; - int bits_left; /* unreduce and unshrink only */ - int zipeof; - char *argv0; /* used for NT and EXE_EXTENSION */ - char *wildzipfn; - char *zipfn; /* GRR: WINDLL: must nuke any malloc'd zipfn... */ -#ifdef USE_STRM_INPUT - FILE *zipfd; /* zipfile file descriptor */ -#else - int zipfd; /* zipfile file handle */ -#endif - zoff_t ziplen; - zoff_t cur_zipfile_bufstart; /* extract_or_test, readbuf, ReadByte */ - zoff_t extra_bytes; /* used in unzip.c, misc.c */ - uch *extra_field; /* Unix, VMS, Mac, OS/2, Acorn, ... */ - uch *hold; - - local_file_hdr lrec; /* used in unzip.c, extract.c */ - cdir_file_hdr crec; /* used in unzip.c, extract.c, misc.c */ - ecdir_rec ecrec; /* used in unzip.c, extract.c */ - z_stat statbuf; /* used by main, mapname, check_for_newer */ - - int mem_mode; - uch *outbufptr; /* extract.c static */ - ulg outsize; /* extract.c static */ - int reported_backslash; /* extract.c static */ - int disk_full; - int newfile; - - int didCRlast; /* fileio static */ - ulg numlines; /* fileio static: number of lines printed */ - int sol; /* fileio static: at start of line */ - int no_ecrec; /* process static */ -#ifdef SYMLINKS - int symlnk; - slinkentry *slink_head; /* pointer to head of symlinks list */ - slinkentry *slink_last; /* pointer to last entry in symlinks list */ -#endif -#ifdef NOVELL_BUG_FAILSAFE - int dne; /* true if stat() says file doesn't exist */ -#endif - - FILE *outfile; - uch *outbuf; - uch *realbuf; - -#ifndef VMS /* if SMALL_MEM, outbuf2 is initialized in */ - uch *outbuf2; /* process_zipfiles() (never changes); */ -#endif /* else malloc'd ONLY if unshrink and -a */ -#endif /* !FUNZIP */ - uch *outptr; - ulg outcnt; /* number of chars stored in outbuf */ -#ifndef FUNZIP - char filename[FILNAMSIZ]; /* also used by NT for temporary SFX path */ -#ifdef UNICODE_SUPPORT - char *filename_full; /* the full path so Unicode checks work */ - extent fnfull_bufsize; /* size of allocated filename buffer */ - int unicode_escape_all; - int unicode_mismatch; -#ifdef UTF8_MAYBE_NATIVE - int native_is_utf8; /* bool, TRUE => native charset == UTF-8 */ -#endif - - int unipath_version; /* version of Unicode field */ - ulg unipath_checksum; /* Unicode field checksum */ - char *unipath_filename; /* UTF-8 path */ -#endif /* UNICODE_SUPPORT */ - -#ifdef CMS_MVS - char *tempfn; /* temp file used; erase on close */ -#endif - - char *key; /* crypt static: decryption password or NULL */ - int nopwd; /* crypt static */ -#endif /* !FUNZIP */ - z_uint4 keys[3]; /* crypt static: keys defining pseudo-random sequence */ - -#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) -#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) - int echofd; /* ttyio static: file descriptor whose echo is off */ -#endif /* !(MACOS || ATARI || VMS) */ -#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ - - unsigned hufts; /* track memory usage */ - -#ifdef USE_ZLIB - int inflInit; /* inflate static: zlib inflate() initialized */ - z_stream dstrm; /* inflate global: decompression stream */ -#else - struct huft *fixed_tl; /* inflate static */ - struct huft *fixed_td; /* inflate static */ - unsigned fixed_bl, fixed_bd; /* inflate static */ -#ifdef USE_DEFLATE64 - struct huft *fixed_tl64; /* inflate static */ - struct huft *fixed_td64; /* inflate static */ - unsigned fixed_bl64, fixed_bd64; /* inflate static */ - struct huft *fixed_tl32; /* inflate static */ - struct huft *fixed_td32; /* inflate static */ - unsigned fixed_bl32, fixed_bd32; /* inflate static */ - ZCONST ush *cplens; /* inflate static */ - ZCONST uch *cplext; /* inflate static */ - ZCONST uch *cpdext; /* inflate static */ -#endif - unsigned wp; /* inflate static: current position in slide */ - ulg bb; /* inflate static: bit buffer */ - unsigned bk; /* inflate static: bits count in bit buffer */ -#endif /* ?USE_ZLIB */ - -#ifndef FUNZIP - /* cylindric buffer space for formatting zoff_t values (fileio static) */ - char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN]; - int fzofft_index; - -#ifdef SMALL_MEM - char rgchBigBuffer[512]; - char rgchSmallBuffer[96]; - char rgchSmallBuffer2[160]; /* boosted to 160 for local3[] in unzip.c */ -#endif - - MsgFn *message; - InputFn *input; - PauseFn *mpause; - PasswdFn *decr_passwd; - StatCBFn *statreportcb; -#ifdef WINDLL - LPUSERFUNCTIONS lpUserFunctions; -#endif - - int incnt_leftover; /* so improved NEXTBYTE does not waste input */ - uch *inptr_leftover; - -#ifdef VMS_TEXT_CONV - unsigned VMS_line_length; /* so native VMS variable-length text files */ - int VMS_line_state; /* are readable on other platforms */ - int VMS_line_pad; -#endif - -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - char autorun_command[FILNAMSIZ]; -#endif -#endif /* !FUNZIP */ - -#ifdef SYSTEM_SPECIFIC_GLOBALS - SYSTEM_SPECIFIC_GLOBALS -#endif - -} Uz_Globs; /* end of struct Globals */ - - -/***************************************************************************/ - - -#define CRC_32_TAB G.crc_32_tab - - -Uz_Globs *globalsCtor OF((void)); - -/* pseudo constant sigs; they are initialized at runtime so unzip executable - * won't look like a zipfile - */ -extern char local_hdr_sig[4]; -extern char central_hdr_sig[4]; -extern char end_central_sig[4]; -extern char end_central32_sig[4]; -extern char end_central64_sig[4]; -extern char end_centloc64_sig[4]; -/* extern char extd_local_sig[4]; NOT USED YET */ - -#ifdef REENTRANT -# define G (*(Uz_Globs *)pG) -# define __G pG -# define __G__ pG, -# define __GPRO Uz_Globs *pG -# define __GPRO__ Uz_Globs *pG, -# define __GDEF Uz_Globs *pG; -# ifdef USETHREADID - extern int lastScan; - void deregisterGlobalPointer OF((__GPRO)); - Uz_Globs *getGlobalPointer OF((void)); -# define GETGLOBALS() Uz_Globs *pG = getGlobalPointer() -# define DESTROYGLOBALS() do {free_G_buffers(pG); \ - deregisterGlobalPointer(pG);} while (0) -# else - extern Uz_Globs *GG; -# define GETGLOBALS() Uz_Globs *pG = GG -# define DESTROYGLOBALS() do {free_G_buffers(pG); free(pG);} while (0) -# endif /* ?USETHREADID */ -# define CONSTRUCTGLOBALS() Uz_Globs *pG = globalsCtor() -#else /* !REENTRANT */ - extern Uz_Globs G; -# define __G -# define __G__ -# define __GPRO void -# define __GPRO__ -# define __GDEF -# define GETGLOBALS() -# define CONSTRUCTGLOBALS() globalsCtor() -# define DESTROYGLOBALS() -#endif /* ?REENTRANT */ - -#define uO G.UzO - -#endif /* __globals_h */ diff --git a/data/windows/unzipfx-catarina/inflate.c b/data/windows/unzipfx-catarina/inflate.c deleted file mode 100644 index f2f6864..0000000 --- a/data/windows/unzipfx-catarina/inflate.c +++ /dev/null @@ -1,1775 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* inflate.c -- by Mark Adler - version c17e, 30 Mar 2007 */ - - -/* Copyright history: - - Starting with UnZip 5.41 of 16-April-2000, this source file - is covered by the Info-Zip LICENSE cited above. - - Prior versions of this source file, found in UnZip source packages - up to UnZip 5.40, were put in the public domain. - The original copyright note by Mark Adler was: - "You can do whatever you like with this source file, - though I would prefer that if you modify it and - redistribute it that you include comments to that effect - with your name and the date. Thank you." - - History: - vers date who what - ---- --------- -------------- ------------------------------------ - a ~~ Feb 92 M. Adler used full (large, one-step) lookup table - b1 21 Mar 92 M. Adler first version with partial lookup tables - b2 21 Mar 92 M. Adler fixed bug in fixed-code blocks - b3 22 Mar 92 M. Adler sped up match copies, cleaned up some - b4 25 Mar 92 M. Adler added prototypes; removed window[] (now - is the responsibility of unzip.h--also - changed name to slide[]), so needs diffs - for unzip.c and unzip.h (this allows - compiling in the small model on MSDOS); - fixed cast of q in huft_build(); - b5 26 Mar 92 M. Adler got rid of unintended macro recursion. - b6 27 Mar 92 M. Adler got rid of nextbyte() routine. fixed - bug in inflate_fixed(). - c1 30 Mar 92 M. Adler removed lbits, dbits environment variables. - changed BMAX to 16 for explode. Removed - OUTB usage, and replaced it with flush()-- - this was a 20% speed improvement! Added - an explode.c (to replace unimplod.c) that - uses the huft routines here. Removed - register union. - c2 4 Apr 92 M. Adler fixed bug for file sizes a multiple of 32k. - c3 10 Apr 92 M. Adler reduced memory of code tables made by - huft_build significantly (factor of two to - three). - c4 15 Apr 92 M. Adler added NOMEMCPY do kill use of memcpy(). - worked around a Turbo C optimization bug. - c5 21 Apr 92 M. Adler added the WSIZE #define to allow reducing - the 32K window size for specialized - applications. - c6 31 May 92 M. Adler added some typecasts to eliminate warnings - c7 27 Jun 92 G. Roelofs added some more typecasts (444: MSC bug). - c8 5 Oct 92 J-l. Gailly added ifdef'd code to deal with PKZIP bug. - c9 9 Oct 92 M. Adler removed a memory error message (~line 416). - c10 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch, - removed old inflate, renamed inflate_entry - to inflate, added Mark's fix to a comment. - c10.5 14 Dec 92 M. Adler fix up error messages for incomplete trees. - c11 2 Jan 93 M. Adler fixed bug in detection of incomplete - tables, and removed assumption that EOB is - the longest code (bad assumption). - c12 3 Jan 93 M. Adler make tables for fixed blocks only once. - c13 5 Jan 93 M. Adler allow all zero length codes (pkzip 2.04c - outputs one zero length code for an empty - distance tree). - c14 12 Mar 93 M. Adler made inflate.c standalone with the - introduction of inflate.h. - c14b 16 Jul 93 G. Roelofs added (unsigned) typecast to w at 470. - c14c 19 Jul 93 J. Bush changed v[N_MAX], l[288], ll[28x+3x] arrays - to static for Amiga. - c14d 13 Aug 93 J-l. Gailly de-complicatified Mark's c[*p++]++ thing. - c14e 8 Oct 93 G. Roelofs changed memset() to memzero(). - c14f 22 Oct 93 G. Roelofs renamed quietflg to qflag; made Trace() - conditional; added inflate_free(). - c14g 28 Oct 93 G. Roelofs changed l/(lx+1) macro to pointer (Cray bug) - c14h 7 Dec 93 C. Ghisler huft_build() optimizations. - c14i 9 Jan 94 A. Verheijen set fixed_t{d,l} to NULL after freeing; - G. Roelofs check NEXTBYTE macro for EOF. - c14j 23 Jan 94 G. Roelofs removed Ghisler "optimizations"; ifdef'd - EOF check. - c14k 27 Feb 94 G. Roelofs added some typecasts to avoid warnings. - c14l 9 Apr 94 G. Roelofs fixed split comments on preprocessor lines - to avoid bug in Encore compiler. - c14m 7 Jul 94 P. Kienitz modified to allow assembler version of - inflate_codes() (define ASM_INFLATECODES) - c14n 22 Jul 94 G. Roelofs changed fprintf to macro for DLL versions - c14o 23 Aug 94 C. Spieler added a newline to a debug statement; - G. Roelofs added another typecast to avoid MSC warning - c14p 4 Oct 94 G. Roelofs added (voidp *) cast to free() argument - c14q 30 Oct 94 G. Roelofs changed fprintf macro to MESSAGE() - c14r 1 Nov 94 G. Roelofs fixed possible redefinition of CHECK_EOF - c14s 7 May 95 S. Maxwell OS/2 DLL globals stuff incorporated; - P. Kienitz "fixed" ASM_INFLATECODES macro/prototype - c14t 18 Aug 95 G. Roelofs added UZinflate() to use zlib functions; - changed voidp to zvoid; moved huft_build() - and huft_free() to end of file - c14u 1 Oct 95 G. Roelofs moved G into definition of MESSAGE macro - c14v 8 Nov 95 P. Kienitz changed ASM_INFLATECODES to use a regular - call with __G__ instead of a macro - c15 3 Aug 96 M. Adler fixed bomb-bug on random input data (Adobe) - c15b 24 Aug 96 M. Adler more fixes for random input data - c15c 28 Mar 97 G. Roelofs changed USE_ZLIB fatal exit code from - PK_MEM2 to PK_MEM3 - c16 20 Apr 97 J. Altman added memzero(v[]) in huft_build() - c16b 29 Mar 98 C. Spieler modified DLL code for slide redirection - c16c 04 Apr 99 C. Spieler fixed memory leaks when processing gets - stopped because of input data errors - c16d 05 Jul 99 C. Spieler take care of FLUSH() return values and - stop processing in case of errors - c17 31 Dec 00 C. Spieler added preliminary support for Deflate64 - c17a 04 Feb 01 C. Spieler complete integration of Deflate64 support - c17b 16 Feb 02 C. Spieler changed type of "extra bits" arrays and - corresponding huft_build() parameter e from - ush into uch, to save space - c17c 9 Mar 02 C. Spieler fixed NEEDBITS() "read beyond EOF" problem - with CHECK_EOF enabled - c17d 23 Jul 05 C. Spieler fixed memory leaks in inflate_dynamic() - when processing invalid compressed literal/ - distance table data - c17e 30 Mar 07 C. Spieler in inflate_dynamic(), initialize tl and td - to prevent freeing unallocated huft tables - when processing invalid compressed data and - hitting premature EOF, do not reuse td as - temp work ptr during tables decoding - */ - - -/* - Inflate deflated (PKZIP's method 8 compressed) data. The compression - method searches for as much of the current string of bytes (up to a - length of 258) in the previous 32K bytes. If it doesn't find any - matches (of at least length 3), it codes the next byte. Otherwise, it - codes the length of the matched string and its distance backwards from - the current position. There is a single Huffman code that codes both - single bytes (called "literals") and match lengths. A second Huffman - code codes the distance information, which follows a length code. Each - length or distance code actually represents a base value and a number - of "extra" (sometimes zero) bits to get to add to the base value. At - the end of each deflated block is a special end-of-block (EOB) literal/ - length code. The decoding process is basically: get a literal/length - code; if EOB then done; if a literal, emit the decoded byte; if a - length then get the distance and emit the referred-to bytes from the - sliding window of previously emitted data. - - There are (currently) three kinds of inflate blocks: stored, fixed, and - dynamic. The compressor outputs a chunk of data at a time and decides - which method to use on a chunk-by-chunk basis. A chunk might typically - be 32K to 64K, uncompressed. If the chunk is uncompressible, then the - "stored" method is used. In this case, the bytes are simply stored as - is, eight bits per byte, with none of the above coding. The bytes are - preceded by a count, since there is no longer an EOB code. - - If the data are compressible, then either the fixed or dynamic methods - are used. In the dynamic method, the compressed data are preceded by - an encoding of the literal/length and distance Huffman codes that are - to be used to decode this block. The representation is itself Huffman - coded, and so is preceded by a description of that code. These code - descriptions take up a little space, and so for small blocks, there is - a predefined set of codes, called the fixed codes. The fixed method is - used if the block ends up smaller that way (usually for quite small - chunks); otherwise the dynamic method is used. In the latter case, the - codes are customized to the probabilities in the current block and so - can code it much better than the pre-determined fixed codes can. - - The Huffman codes themselves are decoded using a multi-level table - lookup, in order to maximize the speed of decoding plus the speed of - building the decoding tables. See the comments below that precede the - lbits and dbits tuning parameters. - - GRR: return values(?) - 0 OK - 1 incomplete table - 2 bad input - 3 not enough memory - the following return codes are passed through from FLUSH() errors - 50 (PK_DISK) "overflow of output space" - 80 (IZ_CTRLC) "canceled by user's request" - */ - - -/* - Notes beyond the 1.93a appnote.txt: - - 1. Distance pointers never point before the beginning of the output - stream. - 2. Distance pointers can point back across blocks, up to 32k away. - 3. There is an implied maximum of 7 bits for the bit length table and - 15 bits for the actual data. - 4. If only one code exists, then it is encoded using one bit. (Zero - would be more efficient, but perhaps a little confusing.) If two - codes exist, they are coded using one bit each (0 and 1). - 5. There is no way of sending zero distance codes--a dummy must be - sent if there are none. (History: a pre 2.0 version of PKZIP would - store blocks with no distance codes, but this was discovered to be - too harsh a criterion.) Valid only for 1.93a. 2.04c does allow - zero distance codes, which is sent as one code of zero bits in - length. - 6. There are up to 286 literal/length codes. Code 256 represents the - end-of-block. Note however that the static length tree defines - 288 codes just to fill out the Huffman codes. Codes 286 and 287 - cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. - However, static trees define 32 codes (all 5 bits) to fill out the - Huffman codes, but the last two had better not show up in the data. - 7. Unzip can check dynamic Huffman blocks for complete code sets. - The exception is that a single code would not be complete (see #4). - 8. The five bits following the block type is really the number of - literal codes sent minus 257. - 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits - (1+6+6). Therefore, to output three times the length, you output - three codes (1+1+1), whereas to output four times the same length, - you only need two codes (1+3). Hmm. - 10. In the tree reconstruction algorithm, Code = Code + Increment - only if BitLength(i) is not zero. (Pretty obvious.) - 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) - 12. Note: length code 284 can represent 227-258, but length code 285 - really is 258. The last length deserves its own, short code - since it gets used a lot in very redundant files. The length - 258 is special since 258 - 3 (the min match length) is 255. - 13. The literal/length and distance code bit lengths are read as a - single stream of lengths. It is possible (and advantageous) for - a repeat code (16, 17, or 18) to go across the boundary between - the two sets of lengths. - 14. The Deflate64 (PKZIP method 9) variant of the compression algorithm - differs from "classic" deflate in the following 3 aspect: - a) The size of the sliding history window is expanded to 64 kByte. - b) The previously unused distance codes #30 and #31 code distances - from 32769 to 49152 and 49153 to 65536. Both codes take 14 bits - of extra data to determine the exact position in their 16 kByte - range. - c) The last lit/length code #285 gets a different meaning. Instead - of coding a fixed maximum match length of 258, it is used as a - "generic" match length code, capable of coding any length from - 3 (min match length + 0) to 65538 (min match length + 65535). - This means that the length code #285 takes 16 bits (!) of uncoded - extra data, added to a fixed min length of 3. - Changes a) and b) would have been transparent for valid deflated - data, but change c) requires to switch decoder configurations between - Deflate and Deflate64 modes. - */ - - -#define PKZIP_BUG_WORKAROUND /* PKZIP 1.93a problem--live with it */ - -/* - inflate.h must supply the uch slide[WSIZE] array, the zvoid typedef - (void if (void *) is accepted, else char) and the NEXTBYTE, - FLUSH() and memzero macros. If the window size is not 32K, it - should also define WSIZE. If INFMOD is defined, it can include - compiled functions to support the NEXTBYTE and/or FLUSH() macros. - There are defaults for NEXTBYTE and FLUSH() below for use as - examples of what those functions need to do. Normally, you would - also want FLUSH() to compute a crc on the data. inflate.h also - needs to provide these typedefs: - - typedef unsigned char uch; - typedef unsigned short ush; - typedef unsigned long ulg; - - This module uses the external functions malloc() and free() (and - probably memset() or bzero() in the memzero() macro). Their - prototypes are normally found in and . - */ - -#define __INFLATE_C /* identifies this source module */ - -/* #define DEBUG */ -#define INFMOD /* tell inflate.h to include code to be compiled */ -#include "inflate.h" - - -/* marker for "unused" huft code, and corresponding check macro */ -#define INVALID_CODE 99 -#define IS_INVALID_CODE(c) ((c) == INVALID_CODE) - -#ifndef WSIZE /* default is 32K resp. 64K */ -# ifdef USE_DEFLATE64 -# define WSIZE 65536L /* window size--must be a power of two, and */ -# else /* at least 64K for PKZip's deflate64 method */ -# define WSIZE 0x8000 /* window size--must be a power of two, and */ -# endif /* at least 32K for zip's deflate method */ -#endif - -/* some buffer counters must be capable of holding 64k for Deflate64 */ -#if (defined(USE_DEFLATE64) && defined(INT_16BIT)) -# define UINT_D64 ulg -#else -# define UINT_D64 unsigned -#endif - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define wsize G._wsize /* wsize is a variable */ -#else -# define wsize WSIZE /* wsize is a constant */ -#endif - - -#ifndef NEXTBYTE /* default is to simply get a byte from stdin */ -# define NEXTBYTE getchar() -#endif - -#ifndef MESSAGE /* only used twice, for fixed strings--NOT general-purpose */ -# define MESSAGE(str,len,flag) fprintf(stderr,(char *)(str)) -#endif - -#ifndef FLUSH /* default is to simply write the buffer to stdout */ -# define FLUSH(n) \ - (((extent)fwrite(redirSlide, 1, (extent)(n), stdout) == (extent)(n)) ? \ - 0 : PKDISK) -#endif -/* Warning: the fwrite above might not work on 16-bit compilers, since - 0x8000 might be interpreted as -32,768 by the library function. When - support for Deflate64 is enabled, the window size is 64K and the - simple fwrite statement is definitely broken for 16-bit compilers. */ - -#ifndef Trace -# ifdef DEBUG -# define Trace(x) fprintf x -# else -# define Trace(x) -# endif -#endif - - -/*---------------------------------------------------------------------------*/ -#ifdef USE_ZLIB - -/* Beginning with zlib version 1.2.0, a new inflate callback interface is - provided that allows tighter integration of the zlib inflate service - into unzip's extraction framework. - The advantages are: - - uses the windows buffer supplied by the unzip code; this saves one - copy process between zlib's internal decompression buffer and unzip's - post-decompression output buffer and improves performance. - - does not pull in unused checksum code (adler32). - The preprocessor flag NO_ZLIBCALLBCK can be set to force usage of the - old zlib 1.1.x interface, for testing purpose. - */ -#ifdef USE_ZLIB_INFLATCB -# undef USE_ZLIB_INFLATCB -#endif -#if (defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1200 && !defined(NO_ZLIBCALLBCK)) -# define USE_ZLIB_INFLATCB 1 -#else -# define USE_ZLIB_INFLATCB 0 -#endif - -/* Check for incompatible combinations of zlib and Deflate64 support. */ -#if defined(USE_DEFLATE64) -# if !USE_ZLIB_INFLATCB - #error Deflate64 is incompatible with traditional (pre-1.2.x) zlib interface! -# else - /* The Deflate64 callback function in the framework of zlib 1.2.x requires - the inclusion of the unsupported infback9 header file: - */ -# include "infback9.h" -# endif -#endif /* USE_DEFLATE64 */ - - -#if USE_ZLIB_INFLATCB - -static unsigned zlib_inCB OF((void FAR *pG, unsigned char FAR * FAR * pInbuf)); -static int zlib_outCB OF((void FAR *pG, unsigned char FAR *outbuf, - unsigned outcnt)); - -static unsigned zlib_inCB(pG, pInbuf) - void FAR *pG; - unsigned char FAR * FAR * pInbuf; -{ - *pInbuf = G.inbuf; - return fillinbuf(__G); -} - -static int zlib_outCB(pG, outbuf, outcnt) - void FAR *pG; - unsigned char FAR *outbuf; - unsigned outcnt; -{ -#ifdef FUNZIP - return flush(__G__ (ulg)(outcnt)); -#else - return ((G.mem_mode) ? memflush(__G__ outbuf, (ulg)(outcnt)) - : flush(__G__ outbuf, (ulg)(outcnt), 0)); -#endif -} -#endif /* USE_ZLIB_INFLATCB */ - - -/* - GRR: return values for both original inflate() and UZinflate() - 0 OK - 1 incomplete table(?) - 2 bad input - 3 not enough memory - */ - -/**************************/ -/* Function UZinflate() */ -/**************************/ - -int UZinflate(__G__ is_defl64) - __GDEF - int is_defl64; -/* decompress an inflated entry using the zlib routines */ -{ - int retval = 0; /* return code: 0 = "no error" */ - int err=Z_OK; -#if USE_ZLIB_INFLATCB - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - if (!G.inflInit) { - /* local buffer for efficiency */ - ZCONST char *zlib_RtVersion = zlibVersion(); - - /* only need to test this stuff once */ - if ((zlib_RtVersion[0] != ZLIB_VERSION[0]) || - (zlib_RtVersion[2] != ZLIB_VERSION[2])) { - Info(slide, 0x21, ((char *)slide, - "error: incompatible zlib version (expected %s, found %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - return 3; - } else if (strcmp(zlib_RtVersion, ZLIB_VERSION) != 0) - Info(slide, 0x21, ((char *)slide, - "warning: different zlib version (expected %s, using %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - - G.dstrm.zalloc = (alloc_func)Z_NULL; - G.dstrm.zfree = (free_func)Z_NULL; - - G.inflInit = 1; - } - -#ifdef USE_DEFLATE64 - if (is_defl64) - { - Trace((stderr, "initializing inflate9()\n")); - err = inflateBack9Init(&G.dstrm, redirSlide); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) { - Trace((stderr, "oops! (inflateBack9Init() err = %d)\n", err)); - return 2; - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - err = inflateBack9(&G.dstrm, zlib_inCB, &G, zlib_outCB, &G); - if (err != Z_STREAM_END) { - if (err == Z_DATA_ERROR || err == Z_STREAM_ERROR) { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - retval = 2; - } else if (err == Z_MEM_ERROR) { - retval = 3; - } else if (err == Z_BUF_ERROR) { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - if (G.dstrm.next_in == Z_NULL) { - /* input failure */ - Trace((stderr, " inflateBack9() input failure\n")); - retval = 2; - } else { - /* output write failure */ - retval = (G.disk_full != 0 ? PK_DISK : IZ_CTRLC); - } - } else { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - retval = 2; - } - } - if (G.dstrm.next_in != NULL) { - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = G.dstrm.avail_in; - } - - err = inflateBack9End(&G.dstrm); - if (err != Z_OK) { - Trace((stderr, "oops! (inflateBack9End() err = %d)\n", err)); - if (retval == 0) - retval = 2; - } - } - else -#endif /* USE_DEFLATE64 */ - { - /* For the callback interface, inflate initialization has to - be called before each decompression call. - */ - { - unsigned i; - int windowBits; - /* windowBits = log2(wsize) */ - for (i = (unsigned)wsize, windowBits = 0; - !(i & 1); i >>= 1, ++windowBits); - if ((unsigned)windowBits > (unsigned)15) - windowBits = 15; - else if (windowBits < 8) - windowBits = 8; - - Trace((stderr, "initializing inflate()\n")); - err = inflateBackInit(&G.dstrm, windowBits, redirSlide); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) { - Trace((stderr, "oops! (inflateBackInit() err = %d)\n", err)); - return 2; - } - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - err = inflateBack(&G.dstrm, zlib_inCB, &G, zlib_outCB, &G); - if (err != Z_STREAM_END) { - if (err == Z_DATA_ERROR || err == Z_STREAM_ERROR) { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - retval = 2; - } else if (err == Z_MEM_ERROR) { - retval = 3; - } else if (err == Z_BUF_ERROR) { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - if (G.dstrm.next_in == Z_NULL) { - /* input failure */ - Trace((stderr, " inflateBack() input failure\n")); - retval = 2; - } else { - /* output write failure */ - retval = (G.disk_full != 0 ? PK_DISK : IZ_CTRLC); - } - } else { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - retval = 2; - } - } - if (G.dstrm.next_in != NULL) { - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = G.dstrm.avail_in; - } - - err = inflateBackEnd(&G.dstrm); - if (err != Z_OK) { - Trace((stderr, "oops! (inflateBackEnd() err = %d)\n", err)); - if (retval == 0) - retval = 2; - } - } - -#else /* !USE_ZLIB_INFLATCB */ - int repeated_buf_err; - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - if (!G.inflInit) { - unsigned i; - int windowBits; - /* local buffer for efficiency */ - ZCONST char *zlib_RtVersion = zlibVersion(); - - /* only need to test this stuff once */ - if (zlib_RtVersion[0] != ZLIB_VERSION[0]) { - Info(slide, 0x21, ((char *)slide, - "error: incompatible zlib version (expected %s, found %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - return 3; - } else if (strcmp(zlib_RtVersion, ZLIB_VERSION) != 0) - Info(slide, 0x21, ((char *)slide, - "warning: different zlib version (expected %s, using %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - - /* windowBits = log2(wsize) */ - for (i = (unsigned)wsize, windowBits = 0; - !(i & 1); i >>= 1, ++windowBits); - if ((unsigned)windowBits > (unsigned)15) - windowBits = 15; - else if (windowBits < 8) - windowBits = 8; - - G.dstrm.zalloc = (alloc_func)Z_NULL; - G.dstrm.zfree = (free_func)Z_NULL; - - Trace((stderr, "initializing inflate()\n")); - err = inflateInit2(&G.dstrm, -windowBits); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) - Trace((stderr, "oops! (inflateInit2() err = %d)\n", err)); - G.inflInit = 1; - } - -#ifdef FUNZIP - while (err != Z_STREAM_END) { -#else /* !FUNZIP */ - while (G.csize > 0) { - Trace((stderr, "first loop: G.csize = %ld\n", G.csize)); -#endif /* ?FUNZIP */ - while (G.dstrm.avail_out > 0) { - err = inflate(&G.dstrm, Z_PARTIAL_FLUSH); - - if (err == Z_DATA_ERROR) { - retval = 2; goto uzinflate_cleanup_exit; - } else if (err == Z_MEM_ERROR) { - retval = 3; goto uzinflate_cleanup_exit; - } else if (err != Z_OK && err != Z_STREAM_END) - Trace((stderr, "oops! (inflate(first loop) err = %d)\n", err)); - -#ifdef FUNZIP - if (err == Z_STREAM_END) /* "END-of-entry-condition" ? */ -#else /* !FUNZIP */ - if (G.csize <= 0L) /* "END-of-entry-condition" ? */ -#endif /* ?FUNZIP */ - break; - - if (G.dstrm.avail_in == 0) { - if (fillinbuf(__G) == 0) { - /* no "END-condition" yet, but no more data */ - retval = 2; goto uzinflate_cleanup_exit; - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - } - Trace((stderr, " avail_in = %u\n", G.dstrm.avail_in)); - } - /* flush slide[] */ - if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) - goto uzinflate_cleanup_exit; - Trace((stderr, "inside loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - G.dstrm.avail_out), - (long)(G.dstrm.next_out-(Bytef *)redirSlide))); - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - } - - /* no more input, so loop until we have all output */ - Trace((stderr, "beginning final loop: err = %d\n", err)); - repeated_buf_err = FALSE; - while (err != Z_STREAM_END) { - err = inflate(&G.dstrm, Z_PARTIAL_FLUSH); - if (err == Z_DATA_ERROR) { - retval = 2; goto uzinflate_cleanup_exit; - } else if (err == Z_MEM_ERROR) { - retval = 3; goto uzinflate_cleanup_exit; - } else if (err == Z_BUF_ERROR) { /* DEBUG */ -#ifdef FUNZIP - Trace((stderr, - "zlib inflate() did not detect stream end\n")); -#else - Trace((stderr, - "zlib inflate() did not detect stream end (%s, %s)\n", - G.zipfn, G.filename)); -#endif - if ((!repeated_buf_err) && (G.dstrm.avail_in == 0)) { - /* when detecting this problem for the first time, - try to provide one fake byte beyond "EOF"... */ - G.dstrm.next_in = ""; - G.dstrm.avail_in = 1; - repeated_buf_err = TRUE; - } else - break; - } else if (err != Z_OK && err != Z_STREAM_END) { - Trace((stderr, "oops! (inflate(final loop) err = %d)\n", err)); - DESTROYGLOBALS(); - EXIT(PK_MEM3); - } - /* final flush of slide[] */ - if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) - goto uzinflate_cleanup_exit; - Trace((stderr, "final loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - G.dstrm.avail_out), - (long)(G.dstrm.next_out-(Bytef *)redirSlide))); - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - } - Trace((stderr, "total in = %lu, total out = %lu\n", G.dstrm.total_in, - G.dstrm.total_out)); - - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */ - -uzinflate_cleanup_exit: - err = inflateReset(&G.dstrm); - if (err != Z_OK) - Trace((stderr, "oops! (inflateReset() err = %d)\n", err)); - -#endif /* ?USE_ZLIB_INFLATCB */ - return retval; -} - - -/*---------------------------------------------------------------------------*/ -#else /* !USE_ZLIB */ - - -/* Function prototypes */ -#ifndef OF -# ifdef __STDC__ -# define OF(a) a -# else -# define OF(a) () -# endif -#endif /* !OF */ -int inflate_codes OF((__GPRO__ struct huft *tl, struct huft *td, - unsigned bl, unsigned bd)); -static int inflate_stored OF((__GPRO)); -static int inflate_fixed OF((__GPRO)); -static int inflate_dynamic OF((__GPRO)); -static int inflate_block OF((__GPRO__ int *e)); - - -/* The inflate algorithm uses a sliding 32K byte window on the uncompressed - stream to find repeated byte strings. This is implemented here as a - circular buffer. The index is updated simply by incrementing and then - and'ing with 0x7fff (32K-1). */ -/* It is left to other modules to supply the 32K area. It is assumed - to be usable as if it were declared "uch slide[32768];" or as just - "uch *slide;" and then malloc'ed in the latter case. The definition - must be in unzip.h, included above. */ - - -/* unsigned wp; moved to globals.h */ /* current position in slide */ - -/* Tables for deflate from PKZIP's appnote.txt. */ -/* - Order of the bit length code lengths */ -static ZCONST unsigned border[] = { - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -/* - Copy lengths for literal codes 257..285 */ -#ifdef USE_DEFLATE64 -static ZCONST ush cplens64[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 3, 0, 0}; - /* For Deflate64, the code 285 is defined differently. */ -#else -# define cplens32 cplens -#endif -static ZCONST ush cplens32[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* note: see note #13 above about the 258 in this list. */ -/* - Extra bits for literal codes 257..285 */ -#ifdef USE_DEFLATE64 -static ZCONST uch cplext64[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 16, INVALID_CODE, INVALID_CODE}; -#else -# define cplext32 cplext -#endif -static ZCONST uch cplext32[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, INVALID_CODE, INVALID_CODE}; - -/* - Copy offsets for distance codes 0..29 (0..31 for Deflate64) */ -static ZCONST ush cpdist[] = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, -#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) - 8193, 12289, 16385, 24577, 32769, 49153}; -#else - 8193, 12289, 16385, 24577}; -#endif - -/* - Extra bits for distance codes 0..29 (0..31 for Deflate64) */ -#ifdef USE_DEFLATE64 -static ZCONST uch cpdext64[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13, 14, 14}; -#else -# define cpdext32 cpdext -#endif -static ZCONST uch cpdext32[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, -#ifdef PKZIP_BUG_WORKAROUND - 12, 12, 13, 13, INVALID_CODE, INVALID_CODE}; -#else - 12, 12, 13, 13}; -#endif - -#ifdef PKZIP_BUG_WORKAROUND -# define MAXLITLENS 288 -#else -# define MAXLITLENS 286 -#endif -#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) -# define MAXDISTS 32 -#else -# define MAXDISTS 30 -#endif - - -/* moved to consts.h (included in unzip.c), resp. funzip.c */ -#if 0 -/* And'ing with mask_bits[n] masks the lower n bits */ -ZCONST unsigned near mask_bits[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; -#endif /* 0 */ - - -/* Macros for inflate() bit peeking and grabbing. - The usage is: - - NEEDBITS(j) - x = b & mask_bits[j]; - DUMPBITS(j) - - where NEEDBITS makes sure that b has at least j bits in it, and - DUMPBITS removes the bits from b. The macros use the variable k - for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the beginning of a - routine that uses these macros from a global bit buffer and count. - - In order to not ask for more bits than there are in the compressed - stream, the Huffman tables are constructed to only ask for just - enough bits to make up the end-of-block code (value 256). Then no - bytes need to be "returned" to the buffer at the end of the last - block. See the huft_build() routine. - - Actually, the precautions mentioned above are not sufficient to - prevent fetches of bits beyound the end of the last block in every - case. When the last code fetched before the end-of-block code was - a very short distance code (shorter than "distance-prefetch-bits" - - "end-of-block code bits"), this last distance code fetch already - exausts the available data. To prevent failure of extraction in this - case, the "read beyond EOF" check delays the raise of the "invalid - data" error until an actual overflow of "used data" is detected. - This error condition is only fulfilled when the "number of available - bits" counter k is found to be negative in the NEEDBITS() macro. - - An alternate fix for that problem adjusts the size of the distance code - base table so that it does not exceed the length of the end-of-block code - plus the minimum length of a distance code. This alternate fix can be - enabled by defining the preprocessor symbol FIX_PAST_EOB_BY_TABLEADJUST. - */ - -/* These have been moved to globals.h */ -#if 0 -ulg bb; /* bit buffer */ -unsigned bk; /* bits in bit buffer */ -#endif - -#ifndef CHECK_EOF -# define CHECK_EOF /* default as of 5.13/5.2 */ -#endif - -#ifndef CHECK_EOF -# define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<=0)break;retval=1;goto cleanup_and_exit;}\ - b|=((ulg)c)<>=(n);k-=(n);} - - -/* - Huffman code decoding is performed using a multi-level table lookup. - The fastest way to decode is to simply build a lookup table whose - size is determined by the longest code. However, the time it takes - to build this table can also be a factor if the data being decoded - are not very long. The most common codes are necessarily the - shortest codes, so those codes dominate the decoding time, and hence - the speed. The idea is you can have a shorter table that decodes the - shorter, more probable codes, and then point to subsidiary tables for - the longer codes. The time it costs to decode the longer codes is - then traded against the time it takes to make longer tables. - - This results of this trade are in the variables lbits and dbits - below. lbits is the number of bits the first level table for literal/ - length codes can decode in one step, and dbits is the same thing for - the distance codes. Subsequent tables are also less than or equal to - those sizes. These values may be adjusted either when all of the - codes are shorter than that, in which case the longest code length in - bits is used, or when the shortest code is *longer* than the requested - table size, in which case the length of the shortest code in bits is - used. - - There are two different values for the two tables, since they code a - different number of possibilities each. The literal/length table - codes 286 possible values, or in a flat code, a little over eight - bits. The distance table codes 30 possible values, or a little less - than five bits, flat. The optimum values for speed end up being - about one bit more than those, so lbits is 8+1 and dbits is 5+1. - The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. - */ - - -/* bits in base literal/length lookup table */ -static ZCONST unsigned lbits = 9; -/* bits in base distance lookup table */ -static ZCONST unsigned dbits = 6; - - -#ifndef ASM_INFLATECODES - -int inflate_codes(__G__ tl, td, bl, bd) - __GDEF -struct huft *tl, *td; /* literal/length and distance decoder tables */ -unsigned bl, bd; /* number of bits decoded by tl[] and td[] */ -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ -{ - register unsigned e; /* table entry flag/number of extra bits */ - unsigned d; /* index for copy */ - UINT_D64 n; /* length for copy (deflate64: might be 64k+2) */ - UINT_D64 w; /* current window position (deflate64: up to 64k) */ - struct huft *t; /* pointer to table entry */ - unsigned ml, md; /* masks for bl and bd bits */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local copies of globals */ - b = G.bb; /* initialize bit buffer */ - k = G.bk; - w = G.wp; /* initialize window position */ - - - /* inflate the coded data */ - ml = mask_bits[bl]; /* precompute masks for speed */ - md = mask_bits[bd]; - while (1) /* do until end of block */ - { - NEEDBITS(bl) - t = tl + ((unsigned)b & ml); - while (1) { - DUMPBITS(t->b) - - if ((e = t->e) == 32) /* then it's a literal */ - { - redirSlide[w++] = (uch)t->v.n; - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - break; - } - - if (e < 31) /* then it's a length */ - { - /* get length of block to copy */ - NEEDBITS(e) - n = t->v.n + ((unsigned)b & mask_bits[e]); - DUMPBITS(e) - - /* decode distance of block to copy */ - NEEDBITS(bd) - t = td + ((unsigned)b & md); - while (1) { - DUMPBITS(t->b) - if ((e = t->e) < 32) - break; - if (IS_INVALID_CODE(e)) - return 1; - e &= 31; - NEEDBITS(e) - t = t->v.t + ((unsigned)b & mask_bits[e]); - } - NEEDBITS(e) - d = (unsigned)w - t->v.n - ((unsigned)b & mask_bits[e]); - DUMPBITS(e) - - /* do the copy */ - do { -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) { - /* &= w/ wsize unnecessary & wrong if redirect */ - if ((UINT_D64)d >= wsize) - return 1; /* invalid compressed data */ - e = (unsigned)(wsize - (d > (unsigned)w ? (UINT_D64)d : w)); - } - else -#endif - e = (unsigned)(wsize - - ((d &= (unsigned)(wsize-1)) > (unsigned)w ? - (UINT_D64)d : w)); - if ((UINT_D64)e > n) e = (unsigned)n; - n -= e; -#ifndef NOMEMCPY - if ((unsigned)w - d >= e) - /* (this test assumes unsigned comparison) */ - { - memcpy(redirSlide + (unsigned)w, redirSlide + d, e); - w += e; - d += e; - } - else /* do it slowly to avoid memcpy() overlap */ -#endif /* !NOMEMCPY */ - do { - redirSlide[w++] = redirSlide[d++]; - } while (--e); - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - } while (n); - break; - } - - if (e == 31) /* it's the EOB signal */ - { - /* sorry for this goto, but we have to exit two loops at once */ - goto cleanup_decode; - } - - if (IS_INVALID_CODE(e)) - return 1; - - e &= 31; - NEEDBITS(e) - t = t->v.t + ((unsigned)b & mask_bits[e]); - } - } -cleanup_decode: - - /* restore the globals from the locals */ - G.wp = (unsigned)w; /* restore global window pointer */ - G.bb = b; /* restore global bit buffer */ - G.bk = k; - - -cleanup_and_exit: - /* done */ - return retval; -} - -#endif /* ASM_INFLATECODES */ - - - -static int inflate_stored(__G) - __GDEF -/* "decompress" an inflated type 0 (stored) block. */ -{ - UINT_D64 w; /* current window position (deflate64: up to 64k!) */ - unsigned n; /* number of bytes in block */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local copies of globals */ - Trace((stderr, "\nstored block")); - b = G.bb; /* initialize bit buffer */ - k = G.bk; - w = G.wp; /* initialize window position */ - - - /* go to byte boundary */ - n = k & 7; - DUMPBITS(n); - - - /* get the length and its complement */ - NEEDBITS(16) - n = ((unsigned)b & 0xffff); - DUMPBITS(16) - NEEDBITS(16) - if (n != (unsigned)((~b) & 0xffff)) - return 1; /* error in compressed data */ - DUMPBITS(16) - - - /* read and output the compressed data */ - while (n--) - { - NEEDBITS(8) - redirSlide[w++] = (uch)b; - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - DUMPBITS(8) - } - - - /* restore the globals from the locals */ - G.wp = (unsigned)w; /* restore global window pointer */ - G.bb = b; /* restore global bit buffer */ - G.bk = k; - -cleanup_and_exit: - return retval; -} - - -/* Globals for literal tables (built once) */ -/* Moved to globals.h */ -#if 0 -struct huft *fixed_tl = (struct huft *)NULL; -struct huft *fixed_td; -int fixed_bl, fixed_bd; -#endif - -static int inflate_fixed(__G) - __GDEF -/* decompress an inflated type 1 (fixed Huffman codes) block. We should - either replace this with a custom decoder, or at least precompute the - Huffman tables. */ -{ - /* if first time, set up tables for fixed blocks */ - Trace((stderr, "\nliteral block")); - if (G.fixed_tl == (struct huft *)NULL) - { - int i; /* temporary variable */ - unsigned l[288]; /* length list for huft_build */ - - /* literal table */ - for (i = 0; i < 144; i++) - l[i] = 8; - for (; i < 256; i++) - l[i] = 9; - for (; i < 280; i++) - l[i] = 7; - for (; i < 288; i++) /* make a complete, but wrong code set */ - l[i] = 8; - G.fixed_bl = 7; -#ifdef USE_DEFLATE64 - if ((i = huft_build(__G__ l, 288, 257, G.cplens, G.cplext, - &G.fixed_tl, &G.fixed_bl)) != 0) -#else - if ((i = huft_build(__G__ l, 288, 257, cplens, cplext, - &G.fixed_tl, &G.fixed_bl)) != 0) -#endif - { - G.fixed_tl = (struct huft *)NULL; - return i; - } - - /* distance table */ - for (i = 0; i < MAXDISTS; i++) /* make an incomplete code set */ - l[i] = 5; - G.fixed_bd = 5; -#ifdef USE_DEFLATE64 - if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, G.cpdext, - &G.fixed_td, &G.fixed_bd)) > 1) -#else - if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, cpdext, - &G.fixed_td, &G.fixed_bd)) > 1) -#endif - { - huft_free(G.fixed_tl); - G.fixed_td = G.fixed_tl = (struct huft *)NULL; - return i; - } - } - - /* decompress until an end-of-block code */ - return inflate_codes(__G__ G.fixed_tl, G.fixed_td, - G.fixed_bl, G.fixed_bd); -} - - - -static int inflate_dynamic(__G) - __GDEF -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ -{ - unsigned i; /* temporary variables */ - unsigned j; - unsigned l; /* last length */ - unsigned m; /* mask for bit lengths table */ - unsigned n; /* number of lengths to get */ - struct huft *tl = (struct huft *)NULL; /* literal/length code table */ - struct huft *td = (struct huft *)NULL; /* distance code table */ - struct huft *th; /* temp huft table pointer used in tables decoding */ - unsigned bl; /* lookup bits for tl */ - unsigned bd; /* lookup bits for td */ - unsigned nb; /* number of bit length codes */ - unsigned nl; /* number of literal/length codes */ - unsigned nd; /* number of distance codes */ - unsigned ll[MAXLITLENS+MAXDISTS]; /* lit./length and distance code lengths */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local bit buffer */ - Trace((stderr, "\ndynamic block")); - b = G.bb; - k = G.bk; - - - /* read in table lengths */ - NEEDBITS(5) - nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ - DUMPBITS(5) - NEEDBITS(5) - nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ - DUMPBITS(5) - NEEDBITS(4) - nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ - DUMPBITS(4) - if (nl > MAXLITLENS || nd > MAXDISTS) - return 1; /* bad lengths */ - - - /* read in bit-length-code lengths */ - for (j = 0; j < nb; j++) - { - NEEDBITS(3) - ll[border[j]] = (unsigned)b & 7; - DUMPBITS(3) - } - for (; j < 19; j++) - ll[border[j]] = 0; - - - /* build decoding table for trees--single level, 7 bit lookup */ - bl = 7; - retval = huft_build(__G__ ll, 19, 19, NULL, NULL, &tl, &bl); - if (bl == 0) /* no bit lengths */ - retval = 1; - if (retval) - { - if (retval == 1) - huft_free(tl); - return retval; /* incomplete code set */ - } - - - /* read in literal and distance code lengths */ - n = nl + nd; - m = mask_bits[bl]; - i = l = 0; - while (i < n) - { - NEEDBITS(bl) - j = (th = tl + ((unsigned)b & m))->b; - DUMPBITS(j) - j = th->v.n; - if (j < 16) /* length of code in bits (0..15) */ - ll[i++] = l = j; /* save last length in l */ - else if (j == 16) /* repeat last length 3 to 6 times */ - { - NEEDBITS(2) - j = 3 + ((unsigned)b & 3); - DUMPBITS(2) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = l; - } - else if (j == 17) /* 3 to 10 zero length codes */ - { - NEEDBITS(3) - j = 3 + ((unsigned)b & 7); - DUMPBITS(3) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = 0; - l = 0; - } - else /* j == 18: 11 to 138 zero length codes */ - { - NEEDBITS(7) - j = 11 + ((unsigned)b & 0x7f); - DUMPBITS(7) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = 0; - l = 0; - } - } - - - /* free decoding table for trees */ - huft_free(tl); - - - /* restore the global bit buffer */ - G.bb = b; - G.bk = k; - - - /* build the decoding tables for literal/length and distance codes */ - bl = lbits; -#ifdef USE_DEFLATE64 - retval = huft_build(__G__ ll, nl, 257, G.cplens, G.cplext, &tl, &bl); -#else - retval = huft_build(__G__ ll, nl, 257, cplens, cplext, &tl, &bl); -#endif - if (bl == 0) /* no literals or lengths */ - retval = 1; - if (retval) - { - if (retval == 1) { - if (!uO.qflag) - MESSAGE((uch *)"(incomplete l-tree) ", 21L, 1); - huft_free(tl); - } - return retval; /* incomplete code set */ - } -#ifdef FIX_PAST_EOB_BY_TABLEADJUST - /* Adjust the requested distance base table size so that a distance code - fetch never tries to get bits behind an immediatly following end-of-block - code. */ - bd = (dbits <= bl+1 ? dbits : bl+1); -#else - bd = dbits; -#endif -#ifdef USE_DEFLATE64 - retval = huft_build(__G__ ll + nl, nd, 0, cpdist, G.cpdext, &td, &bd); -#else - retval = huft_build(__G__ ll + nl, nd, 0, cpdist, cpdext, &td, &bd); -#endif -#ifdef PKZIP_BUG_WORKAROUND - if (retval == 1) - retval = 0; -#endif - if (bd == 0 && nl > 257) /* lengths but no distances */ - retval = 1; - if (retval) - { - if (retval == 1) { - if (!uO.qflag) - MESSAGE((uch *)"(incomplete d-tree) ", 21L, 1); - huft_free(td); - } - huft_free(tl); - return retval; - } - - /* decompress until an end-of-block code */ - retval = inflate_codes(__G__ tl, td, bl, bd); - -cleanup_and_exit: - /* free the decoding tables, return */ - if (tl != (struct huft *)NULL) - huft_free(tl); - if (td != (struct huft *)NULL) - huft_free(td); - return retval; -} - - - -static int inflate_block(__G__ e) - __GDEF - int *e; /* last block flag */ -/* decompress an inflated block */ -{ - unsigned t; /* block type */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local bit buffer */ - b = G.bb; - k = G.bk; - - - /* read in last block bit */ - NEEDBITS(1) - *e = (int)b & 1; - DUMPBITS(1) - - - /* read in block type */ - NEEDBITS(2) - t = (unsigned)b & 3; - DUMPBITS(2) - - - /* restore the global bit buffer */ - G.bb = b; - G.bk = k; - - - /* inflate that block type */ - if (t == 2) - return inflate_dynamic(__G); - if (t == 0) - return inflate_stored(__G); - if (t == 1) - return inflate_fixed(__G); - - - /* bad block type */ - retval = 2; - -cleanup_and_exit: - return retval; -} - - - -int inflate(__G__ is_defl64) - __GDEF - int is_defl64; -/* decompress an inflated entry */ -{ - int e; /* last block flag */ - int r; /* result code */ -#ifdef DEBUG - unsigned h = 0; /* maximum struct huft's malloc'ed */ -#endif - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; /* how they're #defined if !DLL */ -#endif - - /* initialize window, bit buffer */ - G.wp = 0; - G.bk = 0; - G.bb = 0; - -#ifdef USE_DEFLATE64 - if (is_defl64) { - G.cplens = cplens64; - G.cplext = cplext64; - G.cpdext = cpdext64; - G.fixed_tl = G.fixed_tl64; - G.fixed_bl = G.fixed_bl64; - G.fixed_td = G.fixed_td64; - G.fixed_bd = G.fixed_bd64; - } else { - G.cplens = cplens32; - G.cplext = cplext32; - G.cpdext = cpdext32; - G.fixed_tl = G.fixed_tl32; - G.fixed_bl = G.fixed_bl32; - G.fixed_td = G.fixed_td32; - G.fixed_bd = G.fixed_bd32; - } -#else /* !USE_DEFLATE64 */ - if (is_defl64) { - /* This should not happen unless UnZip is built from object files - * compiled with inconsistent option setting. Handle this by - * returning with "bad input" error code. - */ - Trace((stderr, "\nThis inflate() cannot handle Deflate64!\n")); - return 2; - } -#endif /* ?USE_DEFLATE64 */ - - /* decompress until the last block */ - do { -#ifdef DEBUG - G.hufts = 0; -#endif - if ((r = inflate_block(__G__ &e)) != 0) - return r; -#ifdef DEBUG - if (G.hufts > h) - h = G.hufts; -#endif - } while (!e); - - Trace((stderr, "\n%u bytes in Huffman tables (%u/entry)\n", - h * (unsigned)sizeof(struct huft), (unsigned)sizeof(struct huft))); - -#ifdef USE_DEFLATE64 - if (is_defl64) { - G.fixed_tl64 = G.fixed_tl; - G.fixed_bl64 = G.fixed_bl; - G.fixed_td64 = G.fixed_td; - G.fixed_bd64 = G.fixed_bd; - } else { - G.fixed_tl32 = G.fixed_tl; - G.fixed_bl32 = G.fixed_bl; - G.fixed_td32 = G.fixed_td; - G.fixed_bd32 = G.fixed_bd; - } -#endif - - /* flush out redirSlide and return (success, unless final FLUSH failed) */ - return (FLUSH(G.wp)); -} - - - -int inflate_free(__G) - __GDEF -{ - if (G.fixed_tl != (struct huft *)NULL) - { - huft_free(G.fixed_td); - huft_free(G.fixed_tl); - G.fixed_td = G.fixed_tl = (struct huft *)NULL; - } - return 0; -} - -#endif /* ?USE_ZLIB */ - - -/* - * GRR: moved huft_build() and huft_free() down here; used by explode() - * and fUnZip regardless of whether USE_ZLIB defined or not - */ - - -/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ -#define BMAX 16 /* maximum bit length of any code (16 for explode) */ -#define N_MAX 288 /* maximum number of codes in any set */ - - -int huft_build(__G__ b, n, s, d, e, t, m) - __GDEF - ZCONST unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ - unsigned n; /* number of codes (assumed <= N_MAX) */ - unsigned s; /* number of simple-valued codes (0..s-1) */ - ZCONST ush *d; /* list of base values for non-simple codes */ - ZCONST uch *e; /* list of extra bits for non-simple codes */ - struct huft **t; /* result: starting table */ - unsigned *m; /* maximum lookup bits, returns actual */ -/* Given a list of code lengths and a maximum table size, make a set of - tables to decode that set of codes. Return zero on success, one if - the given code set is incomplete (the tables are still built in this - case), two if the input is invalid (all zero length codes or an - oversubscribed set of lengths), and three if not enough memory. - The code with value 256 is special, and the tables are constructed - so that no bits beyond that code are fetched when that code is - decoded. */ -{ - unsigned a; /* counter for codes of length k */ - unsigned c[BMAX+1]; /* bit length count table */ - unsigned el; /* length of EOB code (value 256) */ - unsigned f; /* i repeats in table every f entries */ - int g; /* maximum code length */ - int h; /* table level */ - register unsigned i; /* counter, current code */ - register unsigned j; /* counter */ - register int k; /* number of bits in current code */ - int lx[BMAX+1]; /* memory for l[-1..BMAX-1] */ - int *l = lx+1; /* stack of bits per table */ - register unsigned *p; /* pointer into c[], b[], or v[] */ - register struct huft *q; /* points to current table */ - struct huft r; /* table entry for structure assignment */ - struct huft *u[BMAX]; /* table stack */ - unsigned v[N_MAX]; /* values in order of bit length */ - register int w; /* bits before this table == (l * h) */ - unsigned x[BMAX+1]; /* bit offsets, then code stack */ - unsigned *xp; /* pointer into x */ - int y; /* number of dummy codes added */ - unsigned z; /* number of entries in current table */ - - - /* Generate counts for each bit length */ - el = n > 256 ? b[256] : BMAX; /* set length of EOB code, if any */ - memzero((char *)c, sizeof(c)); - p = (unsigned *)b; i = n; - do { - c[*p]++; p++; /* assume all entries <= BMAX */ - } while (--i); - if (c[0] == n) /* null input--all zero length codes */ - { - *t = (struct huft *)NULL; - *m = 0; - return 0; - } - - - /* Find minimum and maximum length, bound *m by those */ - for (j = 1; j <= BMAX; j++) - if (c[j]) - break; - k = j; /* minimum code length */ - if (*m < j) - *m = j; - for (i = BMAX; i; i--) - if (c[i]) - break; - g = i; /* maximum code length */ - if (*m > i) - *m = i; - - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= c[j]) < 0) - return 2; /* bad input: more codes than bits */ - if ((y -= c[i]) < 0) - return 2; - c[i] += y; - - - /* Generate starting offsets into the value table for each length */ - x[1] = j = 0; - p = c + 1; xp = x + 2; - while (--i) { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - - /* Make a table of values in order of bit lengths */ - memzero((char *)v, sizeof(v)); - p = (unsigned *)b; i = 0; - do { - if ((j = *p++) != 0) - v[x[j]++] = i; - } while (++i < n); - n = x[g]; /* set n to length of v */ - - - /* Generate the Huffman codes and for each, make the table entries */ - x[0] = i = 0; /* first Huffman code is zero */ - p = v; /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = l[-1] = 0; /* no bits decoded yet */ - u[0] = (struct huft *)NULL; /* just to keep compilers happy */ - q = (struct huft *)NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = c[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l[h]) - { - w += l[h++]; /* add bits already decoded */ - - /* compute minimum size table less than or equal to *m bits */ - z = (z = g - w) > *m ? *m : z; /* upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = c + k; - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - if ((unsigned)w + j > el && (unsigned)w < el) - j = el - w; /* make EOB code end at table */ - z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ - - /* allocate and link in new table */ - if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == - (struct huft *)NULL) - { - if (h) - huft_free(u[0]); - return 3; /* not enough memory */ - } -#ifdef DEBUG - G.hufts += z + 1; /* track memory usage */ -#endif - *t = q + 1; /* link to list for huft_free() */ - *(t = &(q->v.t)) = (struct huft *)NULL; - u[h] = ++q; /* table starts after link */ - - /* connect to last table, if there is one */ - if (h) - { - x[h] = i; /* save pattern for backing up */ - r.b = (uch)l[h-1]; /* bits to dump before this table */ - r.e = (uch)(32 + j); /* bits in this table */ - r.v.t = q; /* pointer to this table */ - j = (i & ((1 << w) - 1)) >> (w - l[h-1]); - u[h-1][j] = r; /* connect to last table */ - } - } - - /* set up table entry in r */ - r.b = (uch)(k - w); - if (p >= v + n) - r.e = INVALID_CODE; /* out of values--invalid code */ - else if (*p < s) - { - r.e = (uch)(*p < 256 ? 32 : 31); /* 256 is end-of-block code */ - r.v.n = (ush)*p++; /* simple code is just the value */ - } - else - { - r.e = e[*p - s]; /* non-simple--look up in lists */ - r.v.n = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - while ((i & ((1 << w) - 1)) != x[h]) - w -= l[--h]; /* don't need to update q */ - } - } - - - /* return actual size of base table */ - *m = l[0]; - - - /* Return true (1) if we were given an incomplete table */ - return y != 0 && g != 1; -} - - - -int huft_free(t) -struct huft *t; /* table to free */ -/* Free the malloc'ed tables built by huft_build(), which makes a linked - list of the tables it made, with the links in a dummy first entry of - each table. */ -{ - register struct huft *p, *q; - - - /* Go through linked list, freeing from the malloced (t[-1]) address. */ - p = t; - while (p != (struct huft *)NULL) - { - q = (--p)->v.t; - free((zvoid *)p); - p = q; - } - return 0; -} diff --git a/data/windows/unzipfx-catarina/inflate.h b/data/windows/unzipfx-catarina/inflate.h deleted file mode 100644 index 9ce48af..0000000 --- a/data/windows/unzipfx-catarina/inflate.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* inflate.h for UnZip -- by Mark Adler - version c14f, 23 November 1995 */ - - -/* Copyright history: - - Starting with UnZip 5.41 of 16-April-2000, this source file - is covered by the Info-Zip LICENSE cited above. - - Prior versions of this source file, found in UnZip source packages - up to UnZip 5.40, were put in the public domain. - The original copyright note by Mark Adler was: - "You can do whatever you like with this source file, - though I would prefer that if you modify it and - redistribute it that you include comments to that effect - with your name and the date. Thank you." - - History: - vers date who what - ---- --------- -------------- ------------------------------------ - c14 12 Mar 93 M. Adler made inflate.c standalone with the - introduction of inflate.h. - c14d 28 Aug 93 G. Roelofs replaced flush/FlushOutput with new version - c14e 29 Sep 93 G. Roelofs moved everything into unzip.h; added crypt.h - c14f 23 Nov 95 G. Roelofs added UNZIP_INTERNAL to accommodate newly - split unzip.h - */ - -#define UNZIP_INTERNAL -#include "unzip.h" /* provides slide[], typedefs and macros */ -#ifdef FUNZIP -# include "crypt.h" /* provides NEXTBYTE macro for crypt version of funzip */ -#endif diff --git a/data/windows/unzipfx-catarina/match.c b/data/windows/unzipfx-catarina/match.c deleted file mode 100644 index f634409..0000000 --- a/data/windows/unzipfx-catarina/match.c +++ /dev/null @@ -1,442 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - match.c - - The match() routine recursively compares a string to a "pattern" (regular - expression), returning TRUE if a match is found or FALSE if not. This - version is specifically for use with unzip.c: as did the previous match() - routines from SEA and J. Kercheval, it leaves the case (upper, lower, or - mixed) of the string alone, but converts any uppercase characters in the - pattern to lowercase if indicated by the global var pInfo->lcflag (which - is to say, string is assumed to have been converted to lowercase already, - if such was necessary). - - GRR: reversed order of text, pattern in matche() (now same as match()); - added ignore_case/ic flags, Case() macro. - - PaulK: replaced matche() with recmatch() from Zip, modified to have an - ignore_case argument; replaced test frame with simpler one. - - --------------------------------------------------------------------------- - - Copyright on recmatch() from Zip's util.c (although recmatch() was almost - certainly written by Mark Adler...ask me how I can tell :-) ): - - Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, - Kai Uwe Rommel and Igor Mandrichenko. - - Permission is granted to any individual or institution to use, copy, - or redistribute this software so long as all of the original files are - included unmodified, that it is not sold for profit, and that this copy- - right notice is retained. - - --------------------------------------------------------------------------- - - Match the pattern (wildcard) against the string (fixed): - - match(string, pattern, ignore_case, sepc); - - returns TRUE if string matches pattern, FALSE otherwise. In the pattern: - - `*' matches any sequence of characters (zero or more) - `?' matches any single character - [SET] matches any character in the specified set, - [!SET] or [^SET] matches any character not in the specified set. - - A set is composed of characters or ranges; a range looks like ``character - hyphen character'' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of - characters allowed in the [..] pattern construct. Other characters are - allowed (i.e., 8-bit characters) if your system will support them. - - To suppress the special syntactic significance of any of ``[]*?!^-\'', in- - side or outside a [..] construct, and match the character exactly, precede - it with a ``\'' (backslash). - - Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is - defined. See the DOSWILD section below for an explanation. Note also - that with VMSWILD defined, '%' is used instead of '?', and sets (ranges) - are delimited by () instead of []. - - ---------------------------------------------------------------------------*/ - - -#define __MATCH_C /* identifies this source module */ - -/* define ToLower() in here (for Unix, define ToLower to be macro (using - * isupper()); otherwise just use tolower() */ -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifndef THEOS /* the Theos port defines its own variant of match() */ - -#if 0 /* this is not useful until it matches Amiga names insensitively */ -#ifdef AMIGA /* some other platforms might also want to use this */ -# define ANSI_CHARSET /* MOVE INTO UNZIP.H EVENTUALLY */ -#endif -#endif /* 0 */ - -#ifdef ANSI_CHARSET -# ifdef ToLower -# undef ToLower -# endif - /* uppercase letters are values 41 thru 5A, C0 thru D6, and D8 thru DE */ -# define IsUpper(c) (c>=0xC0 ? c<=0xDE && c!=0xD7 : c>=0x41 && c<=0x5A) -# define ToLower(c) (IsUpper((uch) c) ? (unsigned) c | 0x20 : (unsigned) c) -#endif -#define Case(x) (ic? ToLower(x) : (x)) - -#ifdef VMSWILD -# define WILDCHAR '%' -# define BEG_RANGE '(' -# define END_RANGE ')' -#else -# define WILDCHAR '?' -# define BEG_RANGE '[' -# define END_RANGE ']' -#endif - -#if 0 /* GRR: add this to unzip.h someday... */ -#if !(defined(MSDOS) && defined(DOSWILD)) -#ifdef WILD_STOP_AT_DIR -#define match(s,p,ic,sc) (recmatch((ZCONST uch *)p,(ZCONST uch *)s,ic,sc) == 1) -#else -#define match(s,p,ic) (recmatch((ZCONST uch *)p,(ZCONST uch *)s,ic) == 1) -#endif -int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, - int ignore_case __WDLPRO)); -#endif -#endif /* 0 */ -static int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, - int ignore_case __WDLPRO)); -static char *isshexp OF((ZCONST char *p)); -static int namecmp OF((ZCONST char *s1, ZCONST char *s2)); - - -/* match() is a shell to recmatch() to return only Boolean values. */ - -int match(string, pattern, ignore_case __WDL) - ZCONST char *string, *pattern; - int ignore_case; - __WDLDEF -{ -#if (defined(MSDOS) && defined(DOSWILD)) - char *dospattern; - int j = strlen(pattern); - -/*--------------------------------------------------------------------------- - Optional MS-DOS preprocessing section: compare last three chars of the - wildcard to "*.*" and translate to "*" if found; else compare the last - two characters to "*." and, if found, scan the non-wild string for dots. - If in the latter case a dot is found, return failure; else translate the - "*." to "*". In either case, continue with the normal (Unix-like) match - procedure after translation. (If not enough memory, default to normal - match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. - ---------------------------------------------------------------------------*/ - - if ((dospattern = (char *)malloc(j+1)) != NULL) { - strcpy(dospattern, pattern); - if (!strcmp(dospattern+j-3, "*.*")) { - dospattern[j-2] = '\0'; /* nuke the ".*" */ - } else if (!strcmp(dospattern+j-2, "*.")) { - char *p = MBSCHR(string, '.'); - - if (p) { /* found a dot: match fails */ - free(dospattern); - return 0; - } - dospattern[j-1] = '\0'; /* nuke the end "." */ - } - j = recmatch((uch *)dospattern, (uch *)string, ignore_case __WDL); - free(dospattern); - return j == 1; - } else -#endif /* MSDOS && DOSWILD */ - return recmatch((uch *)pattern, (uch *)string, ignore_case __WDL) == 1; -} - - - -static int recmatch(p, s, ic __WDL) - ZCONST uch *p; /* sh pattern to match */ - ZCONST uch *s; /* string to which to match it */ - int ic; /* true for case insensitivity */ - __WDLDEF /* directory sepchar for WildStopAtDir mode, or 0 */ -/* Recursively compare the sh pattern p with the string s and return 1 if - * they match, and 0 or 2 if they don't or if there is a syntax error in the - * pattern. This routine recurses on itself no more deeply than the number - * of characters in the pattern. */ -{ - unsigned int c; /* pattern char or start of range in [-] loop */ - - /* Get first character, the pattern for new recmatch calls follows */ - c = *p; INCSTR(p); - - /* If that was the end of the pattern, match if string empty too */ - if (c == 0) - return *s == 0; - - /* '?' (or '%') matches any character (but not an empty string). */ - if (c == WILDCHAR) -#ifdef WILD_STOP_AT_DIR - /* If uO.W_flag is non-zero, it won't match '/' */ - return (*s && (!sepc || *s != (uch)sepc)) - ? recmatch(p, s + CLEN(s), ic, sepc) : 0; -#else - return *s ? recmatch(p, s + CLEN(s), ic) : 0; -#endif - - /* '*' matches any number of characters, including zero */ -#ifdef AMIGA - if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ - c = '*', p++; -#endif /* AMIGA */ - if (c == '*') { -#ifdef WILD_STOP_AT_DIR - if (sepc) { - /* check for single "*" or double "**" */ -# ifdef AMIGA - if ((c = p[0]) == '#' && p[1] == '?') /* "#?" is Amiga-ese for "*" */ - c = '*', p++; - if (c != '*') { -# else /* !AMIGA */ - if (*p != '*') { -# endif /* ?AMIGA */ - /* single "*": this doesn't match the dirsep character */ - for (; *s && *s != (uch)sepc; INCSTR(s)) - if ((c = recmatch(p, s, ic, sepc)) != 0) - return (int)c; - /* end of pattern: matched if at end of string, else continue */ - if (*p == '\0') - return (*s == 0); - /* continue to match if at sepc in pattern, else give up */ - return (*p == (uch)sepc || (*p == '\\' && p[1] == (uch)sepc)) - ? recmatch(p, s, ic, sepc) : 2; - } - /* "**": this matches slashes */ - ++p; /* move p behind the second '*' */ - /* and continue with the non-W_flag code variant */ - } -#endif /* WILD_STOP_AT_DIR */ - if (*p == 0) - return 1; - if (isshexp((ZCONST char *)p) == NULL) { - /* Optimization for rest of pattern being a literal string: - * If there are no other shell expression chars in the rest - * of the pattern behind the multi-char wildcard, then just - * compare the literal string tail. - */ - ZCONST uch *srest; - - srest = s + (strlen((ZCONST char *)s) - strlen((ZCONST char *)p)); - if (srest - s < 0) - /* remaining literal string from pattern is longer than rest - * of test string, there can't be a match - */ - return 0; - else - /* compare the remaining literal pattern string with the last - * bytes of the test string to check for a match - */ -#ifdef _MBCS - { - ZCONST uch *q = s; - - /* MBCS-aware code must not scan backwards into a string from - * the end. - * So, we have to move forward by character from our well-known - * character position s in the test string until we have - * advanced to the srest position. - */ - while (q < srest) - INCSTR(q); - /* In case the byte *srest is a trailing byte of a multibyte - * character in the test string s, we have actually advanced - * past the position (srest). - * For this case, the match has failed! - */ - if (q != srest) - return 0; - return ((ic - ? namecmp((ZCONST char *)p, (ZCONST char *)q) - : strcmp((ZCONST char *)p, (ZCONST char *)q) - ) == 0); - } -#else /* !_MBCS */ - return ((ic - ? namecmp((ZCONST char *)p, (ZCONST char *)srest) - : strcmp((ZCONST char *)p, (ZCONST char *)srest) - ) == 0); -#endif /* ?_MBCS */ - } else { - /* pattern contains more wildcards, continue with recursion... */ - for (; *s; INCSTR(s)) - if ((c = recmatch(p, s, ic __WDL)) != 0) - return (int)c; - return 2; /* 2 means give up--match will return false */ - } - } - - /* Parse and process the list of characters and ranges in brackets */ - if (c == BEG_RANGE) { - int e; /* flag true if next char to be taken literally */ - ZCONST uch *q; /* pointer to end of [-] group */ - int r; /* flag true to match anything but the range */ - - if (*s == 0) /* need a character to match */ - return 0; - p += (r = (*p == '!' || *p == '^')); /* see if reverse */ - for (q = p, e = 0; *q; INCSTR(q)) /* find closing bracket */ - if (e) - e = 0; - else - if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ - e = 1; - else if (*q == END_RANGE) - break; - if (*q != END_RANGE) /* nothing matches if bad syntax */ - return 0; - for (c = 0, e = (*p == '-'); p < q; INCSTR(p)) { - /* go through the list */ - if (!e && *p == '\\') /* set escape flag if \ */ - e = 1; - else if (!e && *p == '-') /* set start of range if - */ - c = *(p-1); - else { - unsigned int cc = Case(*s); - - if (*(p+1) != '-') - for (c = c ? c : *p; c <= *p; c++) /* compare range */ - if ((unsigned)Case(c) == cc) /* typecast for MSC bug */ - return r ? 0 : recmatch(q + 1, s + 1, ic __WDL); - c = e = 0; /* clear range, escape flags */ - } - } - return r ? recmatch(q + CLEN(q), s + CLEN(s), ic __WDL) : 0; - /* bracket match failed */ - } - - /* if escape ('\\'), just compare next character */ - if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ - return 0; - - /* just a character--compare it */ -#ifdef QDOS - return QMatch(Case((uch)c), Case(*s)) ? - recmatch(p, s + CLEN(s), ic __WDL) : 0; -#else - return Case((uch)c) == Case(*s) ? - recmatch(p, s + CLEN(s), ic __WDL) : 0; -#endif - -} /* end function recmatch() */ - - - -static char *isshexp(p) -ZCONST char *p; -/* If p is a sh expression, a pointer to the first special character is - returned. Otherwise, NULL is returned. */ -{ - for (; *p; INCSTR(p)) - if (*p == '\\' && *(p+1)) - p++; - else if (*p == WILDCHAR || *p == '*' || *p == BEG_RANGE) - return (char *)p; - return NULL; -} /* end function isshexp() */ - - - -static int namecmp(s1, s2) - ZCONST char *s1, *s2; -{ - int d; - - for (;;) { - d = (int)ToLower((uch)*s1) - - (int)ToLower((uch)*s2); - - if (d || *s1 == 0 || *s2 == 0) - return d; - - s1++; - s2++; - } -} /* end function namecmp() */ - -#endif /* !THEOS */ - - - - -int iswild(p) /* originally only used for stat()-bug workaround in */ - ZCONST char *p; /* VAX C, Turbo/Borland C, Watcom C, Atari MiNT libs; */ -{ /* now used in process_zipfiles() as well */ - for (; *p; INCSTR(p)) - if (*p == '\\' && *(p+1)) - ++p; -#ifdef THEOS - else if (*p == '?' || *p == '*' || *p=='#'|| *p == '@') -#else /* !THEOS */ -#ifdef VMS - else if (*p == '%' || *p == '*') -#else /* !VMS */ -#ifdef AMIGA - else if (*p == '?' || *p == '*' || (*p=='#' && p[1]=='?') || *p == '[') -#else /* !AMIGA */ - else if (*p == '?' || *p == '*' || *p == '[') -#endif /* ?AMIGA */ -#endif /* ?VMS */ -#endif /* ?THEOS */ -#ifdef QDOS - return (int)p; -#else - return TRUE; -#endif - - return FALSE; - -} /* end function iswild() */ - - - - - -#ifdef TEST_MATCH - -#define put(s) {fputs(s,stdout); fflush(stdout);} -#ifdef main -# undef main -#endif - -int main(int argc, char **argv) -{ - char pat[256], str[256]; - - for (;;) { - put("Pattern (return to exit): "); - gets(pat); - if (!pat[0]) - break; - for (;;) { - put("String (return for new pattern): "); - gets(str); - if (!str[0]) - break; - printf("Case sensitive: %s insensitive: %s\n", - match(str, pat, 0) ? "YES" : "NO", - match(str, pat, 1) ? "YES" : "NO"); - } - } - EXIT(0); -} - -#endif /* TEST_MATCH */ diff --git a/data/windows/unzipfx-catarina/process.c b/data/windows/unzipfx-catarina/process.c deleted file mode 100644 index c62c5f0..0000000 --- a/data/windows/unzipfx-catarina/process.c +++ /dev/null @@ -1,3092 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - process.c - - This file contains the top-level routines for processing multiple zipfiles. - - Contains: process_zipfiles() - free_G_buffers() - do_seekable() - file_size() - rec_find() - find_ecrec64() - find_ecrec() - process_zip_cmmnt() - process_cdir_file_hdr() - get_cdir_ent() - process_local_file_hdr() - getZip64Data() - ef_scan_for_izux() - getRISCOSexfield() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif -#if defined(DYNALLOC_CRCTAB) || defined(UNICODE_SUPPORT) -# include "crc32.h" -#endif - -#include "unzipfx/appDetails.h" - -static int do_seekable OF((__GPRO__ int lastchance)); -#ifdef DO_SAFECHECK_2GB -# ifdef USE_STRM_INPUT -static zoff_t file_size OF((FILE *file)); -# else -static zoff_t file_size OF((int fh)); -# endif -#endif /* DO_SAFECHECK_2GB */ -static int rec_find OF((__GPRO__ zoff_t, char *, int)); -static int find_ecrec64 OF((__GPRO__ zoff_t searchlen)); -static int find_ecrec OF((__GPRO__ zoff_t searchlen)); -static int process_zip_cmmnt OF((__GPRO)); -static int get_cdir_ent OF((__GPRO)); -#ifdef IZ_HAVE_UXUIDGID -static int read_ux3_value OF((ZCONST uch *dbuf, unsigned uidgid_sz, - ulg *p_uidgid)); -#endif /* IZ_HAVE_UXUIDGID */ - - -static ZCONST char Far CannotAllocateBuffers[] = - "error: cannot allocate unzip buffers\n"; - -#ifdef SFX - static ZCONST char Far CannotFindMyself[] = - "unzipsfx: cannot find myself! [%s]\n"; -# ifdef CHEAP_SFX_AUTORUN - static ZCONST char Far AutorunPrompt[] = - "\nAuto-run command: %s\nExecute this command? [y/n] "; - static ZCONST char Far NotAutoRunning[] = - "Not executing auto-run command."; -# endif - -#else /* !SFX */ - /* process_zipfiles() strings */ -# if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) - static ZCONST char Far WarnInvalidTZ[] = - "Warning: TZ environment variable not found, cannot use UTC times!!\n"; -# endif -# if !(defined(UNIX) || defined(AMIGA)) - static ZCONST char Far CannotFindWildcardMatch[] = - "%s: cannot find any matches for wildcard specification \"%s\".\n"; -# endif /* !(UNIX || AMIGA) */ - static ZCONST char Far FilesProcessOK[] = - "%d archive%s successfully processed.\n"; - static ZCONST char Far ArchiveWarning[] = - "%d archive%s had warnings but no fatal errors.\n"; - static ZCONST char Far ArchiveFatalError[] = - "%d archive%s had fatal errors.\n"; - static ZCONST char Far FileHadNoZipfileDir[] = - "%d file%s had no zipfile directory.\n"; - static ZCONST char Far ZipfileWasDir[] = "1 \"zipfile\" was a directory.\n"; - static ZCONST char Far ManyZipfilesWereDir[] = - "%d \"zipfiles\" were directories.\n"; - static ZCONST char Far NoZipfileFound[] = "No zipfiles found.\n"; - - /* do_seekable() strings */ -# ifdef UNIX - static ZCONST char Far CannotFindZipfileDirMsg[] = - "%s: cannot find zipfile directory in one of %s or\n\ - %s%s.zip, and cannot find %s, period.\n"; - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find or open %s, %s.zip or %s.\n"; -# else /* !UNIX */ - static ZCONST char Far CannotFindZipfileDirMsg[] = - "%s: cannot find zipfile directory in %s,\n\ - %sand cannot find %s, period.\n"; -# ifdef VMS - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find %s (%s).\n"; -# else /* !VMS */ - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find either %s or %s.\n"; -# endif /* ?VMS */ -# endif /* ?UNIX */ - extern ZCONST char Far Zipnfo[]; /* in unzip.c */ -#ifndef WINDLL - static ZCONST char Far Unzip[] = "unzip"; -#else - static ZCONST char Far Unzip[] = "UnZip DLL"; -#endif -#ifdef DO_SAFECHECK_2GB - static ZCONST char Far ZipfileTooBig[] = - "Trying to read large file (> 2 GiB) without large file support\n"; -#endif /* DO_SAFECHECK_2GB */ - static ZCONST char Far MaybeExe[] = - "note: %s may be a plain executable, not an archive\n"; - static ZCONST char Far CentDirNotInZipMsg[] = "\n\ - [%s]:\n\ - Zipfile is disk %lu of a multi-disk archive, and this is not the disk on\n\ - which the central zipfile directory begins (disk %lu).\n"; - static ZCONST char Far EndCentDirBogus[] = - "\nwarning [%s]: end-of-central-directory record claims this\n\ - is disk %lu but that the central directory starts on disk %lu; this is a\n\ - contradiction. Attempting to process anyway.\n"; -# ifdef NO_MULTIPART - static ZCONST char Far NoMultiDiskArcSupport[] = - "\nerror [%s]: zipfile is part of multi-disk archive\n\ - (sorry, not yet supported).\n"; - static ZCONST char Far MaybePakBug[] = "warning [%s]:\ - zipfile claims to be 2nd disk of a 2-part archive;\n\ - attempting to process anyway. If no further errors occur, this archive\n\ - was probably created by PAK v2.51 or earlier. This bug was reported to\n\ - NoGate in March 1991 and was supposed to have been fixed by mid-1991; as\n\ - of mid-1992 it still hadn't been. (If further errors do occur, archive\n\ - was probably created by PKZIP 2.04c or later; UnZip does not yet support\n\ - multi-part archives.)\n"; -# else - static ZCONST char Far MaybePakBug[] = "warning [%s]:\ - zipfile claims to be last disk of a multi-part archive;\n\ - attempting to process anyway, assuming all parts have been concatenated\n\ - together in order. Expect \"errors\" and warnings...true multi-part support\ -\n doesn't exist yet (coming soon).\n"; -# endif - static ZCONST char Far ExtraBytesAtStart[] = - "warning [%s]: %s extra byte%s at beginning or within zipfile\n\ - (attempting to process anyway)\n"; -#endif /* ?SFX */ - -#if ((!defined(WINDLL) && !defined(SFX)) || !defined(NO_ZIPINFO)) - static ZCONST char Far LogInitline[] = "Archive: %s\n"; -#endif - -static ZCONST char Far MissingBytes[] = - "error [%s]: missing %s bytes in zipfile\n\ - (attempting to process anyway)\n"; -static ZCONST char Far NullCentDirOffset[] = - "error [%s]: NULL central directory offset\n\ - (attempting to process anyway)\n"; -static ZCONST char Far ZipfileEmpty[] = "warning [%s]: zipfile is empty\n"; -static ZCONST char Far CentDirStartNotFound[] = - "error [%s]: start of central directory not found;\n\ - zipfile corrupt.\n%s"; -static ZCONST char Far Cent64EndSigSearchErr[] = - "fatal error: read failure while seeking for End-of-centdir-64 signature.\n\ - This zipfile is corrupt.\n"; -static ZCONST char Far Cent64EndSigSearchOff[] = - "error: End-of-centdir-64 signature not where expected (prepended bytes?)\n\ - (attempting to process anyway)\n"; -#ifndef SFX - static ZCONST char Far CentDirTooLong[] = - "error [%s]: reported length of central directory is\n\ - %s bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1\n\ - zipfile?). Compensating...\n"; - static ZCONST char Far CentDirEndSigNotFound[] = "\ - End-of-central-directory signature not found. Either this file is not\n\ - a zipfile, or it constitutes one disk of a multi-part archive. In the\n\ - latter case the central directory and zipfile comment will be found on\n\ - the last disk(s) of this archive.\n"; -#else /* SFX */ - static ZCONST char Far CentDirEndSigNotFound[] = - " End-of-central-directory signature not found.\n"; -#endif /* ?SFX */ -#ifdef TIMESTAMP - static ZCONST char Far ZipTimeStampFailed[] = - "warning: cannot set time for %s\n"; - static ZCONST char Far ZipTimeStampSuccess[] = - "Updated time stamp for %s.\n"; -#endif -static ZCONST char Far ZipfileCommTrunc1[] = - "\ncaution: zipfile comment truncated\n"; -#ifndef NO_ZIPINFO - static ZCONST char Far NoZipfileComment[] = - "There is no zipfile comment.\n"; - static ZCONST char Far ZipfileCommentDesc[] = - "The zipfile comment is %u bytes long and contains the following text:\n"; - static ZCONST char Far ZipfileCommBegin[] = - "======================== zipfile comment begins\ - ==========================\n"; - static ZCONST char Far ZipfileCommEnd[] = - "========================= zipfile comment ends\ - ===========================\n"; - static ZCONST char Far ZipfileCommTrunc2[] = - "\n The zipfile comment is truncated.\n"; -#endif /* !NO_ZIPINFO */ -#ifdef UNICODE_SUPPORT - static ZCONST char Far UnicodeVersionError[] = - "\nwarning: Unicode Path version > 1\n"; - static ZCONST char Far UnicodeMismatchError[] = - "\nwarning: Unicode Path checksum invalid\n"; -#endif - - - - -/*******************************/ -/* Function process_zipfiles() */ -/*******************************/ - -int process_zipfiles(__G) /* return PK-type error code */ - __GDEF -{ -#ifndef SFX - char *lastzipfn = (char *)NULL; - int NumWinFiles, NumLoseFiles, NumWarnFiles; - int NumMissDirs, NumMissFiles; -#endif - int error=0, error_in_archive=0; - - -/*--------------------------------------------------------------------------- - Start by allocating buffers and (re)constructing the various PK signature - strings. - ---------------------------------------------------------------------------*/ - - G.inbuf = (uch *)malloc(INBUFSIZ + 4); /* 4 extra for hold[] (below) */ - G.outbuf = (uch *)malloc(OUTBUFSIZ + 1); /* 1 extra for string term. */ - - if ((G.inbuf == (uch *)NULL) || (G.outbuf == (uch *)NULL)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotAllocateBuffers))); - return(PK_MEM); - } - G.hold = G.inbuf + INBUFSIZ; /* to check for boundary-spanning sigs */ -#ifndef VMS /* VMS uses its own buffer scheme for textmode flush(). */ -#ifdef SMALL_MEM - G.outbuf2 = G.outbuf+RAWBUFSIZ; /* never changes */ -#endif -#endif /* !VMS */ - -#if 0 /* CRC_32_TAB has been NULLified by CONSTRUCTGLOBALS !!!! */ - /* allocate the CRC table later when we know we can read zipfile data */ - CRC_32_TAB = NULL; -#endif /* 0 */ - - /* finish up initialization of magic signature strings */ - local_hdr_sig[0] /* = extd_local_sig[0] */ = /* ASCII 'P', */ - central_hdr_sig[0] = end_central_sig[0] = /* not EBCDIC */ - end_centloc64_sig[0] = end_central64_sig[0] = 0x50; - - local_hdr_sig[1] /* = extd_local_sig[1] */ = /* ASCII 'K', */ - central_hdr_sig[1] = end_central_sig[1] = /* not EBCDIC */ - end_centloc64_sig[1] = end_central64_sig[1] = 0x4B; - -/*--------------------------------------------------------------------------- - Make sure timezone info is set correctly; localtime() returns GMT on some - OSes (e.g., Solaris 2.x) if this isn't done first. The ifdefs around - tzset() were initially copied from dos_to_unix_time() in fileio.c. They - may still be too strict; any listed OS that supplies tzset(), regardless - of whether the function does anything, should be removed from the ifdefs. - ---------------------------------------------------------------------------*/ - -#if (defined(WIN32) && defined(USE_EF_UT_TIME)) - /* For the Win32 environment, we may have to "prepare" the environment - prior to the tzset() call, to work around tzset() implementation bugs. - */ - iz_w32_prepareTZenv(); -#endif - -#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) -# ifndef VALID_TIMEZONE -# define VALID_TIMEZONE(tmp) \ - (((tmp = getenv("TZ")) != NULL) && (*tmp != '\0')) -# endif - { - char *p; - G.tz_is_valid = VALID_TIMEZONE(p); -# ifndef SFX - if (!G.tz_is_valid) { - Info(slide, 0x401, ((char *)slide, LoadFarString(WarnInvalidTZ))); - error_in_archive = error = PK_WARN; - } -# endif /* !SFX */ - } -#endif /* IZ_CHECK_TZ && USE_EF_UT_TIME */ - -/* For systems that do not have tzset() but supply this function using another - name (_tzset() or something similar), an appropiate "#define tzset ..." - should be added to the system specifc configuration section. */ -#if (!defined(T20_VMS) && !defined(MACOS) && !defined(RISCOS) && !defined(QDOS)) -#if (!defined(BSD) && !defined(MTS) && !defined(CMS_MVS) && !defined(TANDEM)) - tzset(); -#endif -#endif - -/* Initialize UnZip's built-in pseudo hard-coded "ISO <--> OEM" translation, - depending on the detected codepage setup. */ -#ifdef NEED_ISO_OEM_INIT - prepare_ISO_OEM_translat(__G); -#endif - -/*--------------------------------------------------------------------------- - Initialize the internal flag holding the mode of processing "overwrite - existing file" cases. We do not use the calling interface flags directly - because the overwrite mode may be changed by user interaction while - processing archive files. Such a change should not affect the option - settings as passed through the DLL calling interface. - In case of conflicting options, the 'safer' flag uO.overwrite_none takes - precedence. - ---------------------------------------------------------------------------*/ - G.overwrite_mode = (uO.overwrite_none ? OVERWRT_NEVER : - (uO.overwrite_all ? OVERWRT_ALWAYS : OVERWRT_QUERY)); - -/*--------------------------------------------------------------------------- - Match (possible) wildcard zipfile specification with existing files and - attempt to process each. If no hits, try again after appending ".zip" - suffix. If still no luck, give up. - ---------------------------------------------------------------------------*/ - -#ifdef SFX - if ((error = do_seekable(__G__ 0)) == PK_NOZIP) { -#ifdef EXE_EXTENSION - int len=strlen(G.argv0); - - /* append .exe if appropriate; also .sfx? */ - if ( (G.zipfn = (char *)malloc(len+sizeof(EXE_EXTENSION))) != - (char *)NULL ) { - strcpy(G.zipfn, G.argv0); - strcpy(G.zipfn+len, EXE_EXTENSION); - error = do_seekable(__G__ 0); - free(G.zipfn); - G.zipfn = G.argv0; /* for "cannot find myself" message only */ - } -#endif /* EXE_EXTENSION */ -#ifdef WIN32 - G.zipfn = G.argv0; /* for "cannot find myself" message only */ -#endif - } - if (error) { - if (error == IZ_DIR) - error_in_archive = PK_NOZIP; - else - error_in_archive = error; - if (error == PK_NOZIP) - Info(slide, 1, ((char *)slide, LoadFarString(CannotFindMyself), - G.zipfn)); - } -#ifdef CHEAP_SFX_AUTORUN - if (G.autorun_command[0] && !uO.qflag) { /* NO autorun without prompt! */ - Info(slide, 0x81, ((char *)slide, LoadFarString(AutorunPrompt), - FnFilter1(G.autorun_command))); - if (fgets(G.answerbuf, 9, stdin) != (char *)NULL - && toupper(*G.answerbuf) == 'Y') - system(G.autorun_command); - else - Info(slide, 1, ((char *)slide, LoadFarString(NotAutoRunning))); - } -#endif /* CHEAP_SFX_AUTORUN */ - - int sfx_app_ret = sfx_app_autorun_now(); - -#else /* !SFX */ - NumWinFiles = NumLoseFiles = NumWarnFiles = 0; - NumMissDirs = NumMissFiles = 0; - - while ((G.zipfn = do_wild(__G__ G.wildzipfn)) != (char *)NULL) { - Trace((stderr, "do_wild( %s ) returns %s\n", G.wildzipfn, G.zipfn)); - - lastzipfn = G.zipfn; - - /* print a blank line between the output of different zipfiles */ - if (!uO.qflag && error != PK_NOZIP && error != IZ_DIR -#ifdef TIMESTAMP - && (!uO.T_flag || uO.zipinfo_mode) -#endif - && (NumWinFiles+NumLoseFiles+NumWarnFiles+NumMissFiles) > 0) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - - if ((error = do_seekable(__G__ 0)) == PK_WARN) - ++NumWarnFiles; - else if (error == IZ_DIR) - ++NumMissDirs; - else if (error == PK_NOZIP) - ++NumMissFiles; - else if (error != PK_OK) - ++NumLoseFiles; - else - ++NumWinFiles; - - Trace((stderr, "do_seekable(0) returns %d\n", error)); - if (error != IZ_DIR && error > error_in_archive) - error_in_archive = error; -#ifdef WINDLL - if (error == IZ_CTRLC) { - free_G_buffers(__G); - return error; - } -#endif - - } /* end while-loop (wildcard zipfiles) */ - - if ((NumWinFiles + NumWarnFiles + NumLoseFiles) == 0 && - (NumMissDirs + NumMissFiles) == 1 && lastzipfn != (char *)NULL) - { -#if (!defined(UNIX) && !defined(AMIGA)) /* filenames with wildcard characters */ - if (iswild(G.wildzipfn)) { - if (iswild(lastzipfn)) { - NumMissDirs = NumMissFiles = 0; - error_in_archive = PK_COOL; - if (uO.qflag < 3) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindWildcardMatch), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn)); - } - } else -#endif - { -#ifndef VMS - /* 2004-11-24 SMS. - * VMS has already tried a default file type of ".zip" in - * do_wild(), so adding ZSUFX here only causes confusion by - * corrupting some valid (though nonexistent) file names. - * Complaining below about "fred;4.zip" is unlikely to be - * helpful to the victim. - */ - /* 2005-08-14 Chr. Spieler - * Although we already "know" the failure result, we call - * do_seekable() again with the same zipfile name (and the - * lastchance flag set), just to trigger the error report... - */ -#if defined(UNIX) || defined(QDOS) - char *p = -#endif - strcpy(lastzipfn + strlen(lastzipfn), ZSUFX); -#endif /* !VMS */ - - G.zipfn = lastzipfn; - - NumMissDirs = NumMissFiles = 0; - error_in_archive = PK_COOL; - -#if defined(UNIX) || defined(QDOS) - /* only Unix has case-sensitive filesystems */ - /* Well FlexOS (sometimes) also has them, but support is per media */ - /* and a pig to code for, so treat as case insensitive for now */ - /* we do this under QDOS to check for .zip as well as _zip */ - if ((error = do_seekable(__G__ 0)) == PK_NOZIP || error == IZ_DIR) { - if (error == IZ_DIR) - ++NumMissDirs; - strcpy(p, ALT_ZSUFX); - error = do_seekable(__G__ 1); - } -#else - error = do_seekable(__G__ 1); -#endif - Trace((stderr, "do_seekable(1) returns %d\n", error)); - switch (error) { - case PK_WARN: - ++NumWarnFiles; - break; - case IZ_DIR: - ++NumMissDirs; - error = PK_NOZIP; - break; - case PK_NOZIP: - /* increment again => bug: - "1 file had no zipfile directory." */ - /* ++NumMissFiles */ ; - break; - default: - if (error) - ++NumLoseFiles; - else - ++NumWinFiles; - break; - } - - if (error > error_in_archive) - error_in_archive = error; -#ifdef WINDLL - if (error == IZ_CTRLC) { - free_G_buffers(__G); - return error; - } -#endif - } - } -#endif /* ?SFX */ - -/*--------------------------------------------------------------------------- - Print summary of all zipfiles, assuming zipfile spec was a wildcard (no - need for a summary if just one zipfile). - ---------------------------------------------------------------------------*/ - -#ifndef SFX - if (iswild(G.wildzipfn) && uO.qflag < 3 -#ifdef TIMESTAMP - && !(uO.T_flag && !uO.zipinfo_mode && uO.qflag > 1) -#endif - ) - { - if ((NumMissFiles + NumLoseFiles + NumWarnFiles > 0 || NumWinFiles != 1) -#ifdef TIMESTAMP - && !(uO.T_flag && !uO.zipinfo_mode && uO.qflag) -#endif - && !(uO.tflag && uO.qflag > 1)) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0x401); - if ((NumWinFiles > 1) || - (NumWinFiles == 1 && - NumMissDirs + NumMissFiles + NumLoseFiles + NumWarnFiles > 0)) - Info(slide, 0x401, ((char *)slide, LoadFarString(FilesProcessOK), - NumWinFiles, (NumWinFiles == 1)? " was" : "s were")); - if (NumWarnFiles > 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveWarning), - NumWarnFiles, (NumWarnFiles == 1)? "" : "s")); - if (NumLoseFiles > 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveFatalError), - NumLoseFiles, (NumLoseFiles == 1)? "" : "s")); - if (NumMissFiles > 0) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FileHadNoZipfileDir), NumMissFiles, - (NumMissFiles == 1)? "" : "s")); - if (NumMissDirs == 1) - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileWasDir))); - else if (NumMissDirs > 0) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ManyZipfilesWereDir), NumMissDirs)); - if (NumWinFiles + NumLoseFiles + NumWarnFiles == 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(NoZipfileFound))); - } -#endif /* !SFX */ - - /* free allocated memory */ - free_G_buffers(__G); - - return sfx_app_ret; - -} /* end function process_zipfiles() */ - - - - - -/*****************************/ -/* Function free_G_buffers() */ -/*****************************/ - -void free_G_buffers(__G) /* releases all memory allocated in global vars */ - __GDEF -{ -#ifndef SFX - unsigned i; -#endif - -#ifdef SYSTEM_SPECIFIC_DTOR - SYSTEM_SPECIFIC_DTOR(__G); -#endif - - inflate_free(__G); - checkdir(__G__ (char *)NULL, END); - -#ifdef DYNALLOC_CRCTAB - if (CRC_32_TAB) { - free_crc_table(); - CRC_32_TAB = NULL; - } -#endif - - if (G.key != (char *)NULL) { - free(G.key); - G.key = (char *)NULL; - } - - if (G.extra_field != (uch *)NULL) { - free(G.extra_field); - G.extra_field = (uch *)NULL; - } - -#if (!defined(VMS) && !defined(SMALL_MEM)) - /* VMS uses its own buffer scheme for textmode flush() */ - if (G.outbuf2) { - free(G.outbuf2); /* malloc'd ONLY if unshrink and -a */ - G.outbuf2 = (uch *)NULL; - } -#endif - - if (G.outbuf) - free(G.outbuf); - if (G.inbuf) - free(G.inbuf); - G.inbuf = G.outbuf = (uch *)NULL; - -#ifdef UNICODE_SUPPORT - if (G.filename_full) { - free(G.filename_full); - G.filename_full = (char *)NULL; - G.fnfull_bufsize = 0; - } -#endif /* UNICODE_SUPPORT */ - -#ifndef SFX - for (i = 0; i < DIR_BLKSIZ; i++) { - if (G.info[i].cfilname != (char Far *)NULL) { - zffree(G.info[i].cfilname); - G.info[i].cfilname = (char Far *)NULL; - } - } -#endif - -#ifdef MALLOC_WORK - if (G.area.Slide) { - free(G.area.Slide); - G.area.Slide = (uch *)NULL; - } -#endif - -} /* end function free_G_buffers() */ - - - - - -/**************************/ -/* Function do_seekable() */ -/**************************/ - -static int do_seekable(__G__ lastchance) /* return PK-type error code */ - __GDEF - int lastchance; -{ -#ifndef SFX - /* static int no_ecrec = FALSE; SKM: moved to globals.h */ - int maybe_exe=FALSE; - int too_weird_to_continue=FALSE; -#ifdef TIMESTAMP - time_t uxstamp; - ulg nmember = 0L; -#endif -#endif - int error=0, error_in_archive; - - -/*--------------------------------------------------------------------------- - Open the zipfile for reading in BINARY mode to prevent CR/LF translation, - which would corrupt the bit streams. - ---------------------------------------------------------------------------*/ - - if (SSTAT(G.zipfn, &G.statbuf) || -#ifdef THEOS - (error = S_ISLIB(G.statbuf.st_mode)) != 0 || -#endif - (error = S_ISDIR(G.statbuf.st_mode)) != 0) - { -#ifndef SFX - if (lastchance && (uO.qflag < 3)) { -#if defined(UNIX) || defined(QDOS) - if (G.no_ecrec) - Info(slide, 1, ((char *)slide, - LoadFarString(CannotFindZipfileDirMsg), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, uO.zipinfo_mode? " " : "", G.wildzipfn, - G.zipfn)); - else - Info(slide, 1, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, G.wildzipfn, G.zipfn)); -#else /* !(UNIX || QDOS) */ - if (G.no_ecrec) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindZipfileDirMsg), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, uO.zipinfo_mode? " " : "", G.zipfn)); - else -#ifdef VMS - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, - (*G.zipfn ? G.zipfn : vms_msg_text()))); -#else /* !VMS */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, G.zipfn)); -#endif /* ?VMS */ -#endif /* ?(UNIX || QDOS) */ - } -#endif /* !SFX */ - return error? IZ_DIR : PK_NOZIP; - } - G.ziplen = G.statbuf.st_size; - -#ifndef SFX -#if defined(UNIX) || defined(DOS_OS2_W32) || defined(THEOS) - if (G.statbuf.st_mode & S_IEXEC) /* no extension on Unix exes: might */ - maybe_exe = TRUE; /* find unzip, not unzip.zip; etc. */ -#endif -#endif /* !SFX */ - -#ifdef VMS - if (check_format(__G)) /* check for variable-length format */ - return PK_ERR; -#endif - - if (open_input_file(__G)) /* this should never happen, given */ - return PK_NOZIP; /* the stat() test above, but... */ - -#ifdef DO_SAFECHECK_2GB - /* Need more care: Do not trust the size returned by stat() but - determine it by reading beyond the end of the file. */ - G.ziplen = file_size(G.zipfd); - - if (G.ziplen == EOF) { - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileTooBig))); - /* - printf( -" We need a better error message for: 64-bit file, 32-bit program.\n"); - */ - CLOSE_INFILE(); - return IZ_ERRBF; - } -#endif /* DO_SAFECHECK_2GB */ - -/*--------------------------------------------------------------------------- - Find and process the end-of-central-directory header. UnZip need only - check last 65557 bytes of zipfile: comment may be up to 65535, end-of- - central-directory record is 18 bytes, and signature itself is 4 bytes; - add some to allow for appended garbage. Since ZipInfo is often used as - a debugging tool, search the whole zipfile if zipinfo_mode is true. - ---------------------------------------------------------------------------*/ - - G.cur_zipfile_bufstart = 0; - G.inptr = G.inbuf; - -#if ((!defined(WINDLL) && !defined(SFX)) || !defined(NO_ZIPINFO)) -# if (!defined(WINDLL) && !defined(SFX)) - if ( (!uO.zipinfo_mode && !uO.qflag -# ifdef TIMESTAMP - && !uO.T_flag -# endif - ) -# ifndef NO_ZIPINFO - || (uO.zipinfo_mode && uO.hflag) -# endif - ) -# else /* not (!WINDLL && !SFX) ==> !NO_ZIPINFO !! */ - if (uO.zipinfo_mode && uO.hflag) -# endif /* if..else..: (!WINDLL && !SFX) */ -# ifdef WIN32 /* Win32 console may require codepage conversion for G.zipfn */ - Info(slide, 0, ((char *)slide, LoadFarString(LogInitline), - FnFilter1(G.zipfn))); -# else - Info(slide, 0, ((char *)slide, LoadFarString(LogInitline), G.zipfn)); -# endif -#endif /* (!WINDLL && !SFX) || !NO_ZIPINFO */ - - if ( (error_in_archive = find_ecrec(__G__ -#ifndef NO_ZIPINFO - uO.zipinfo_mode ? G.ziplen : -#endif - MIN(G.ziplen, 66000L))) - > PK_WARN ) - { - CLOSE_INFILE(); - -#ifdef SFX - ++lastchance; /* avoid picky compiler warnings */ - return error_in_archive; -#else - if (maybe_exe) - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeExe), - G.zipfn)); - if (lastchance) - return error_in_archive; - else { - G.no_ecrec = TRUE; /* assume we found wrong file: e.g., */ - return PK_NOZIP; /* unzip instead of unzip.zip */ - } -#endif /* ?SFX */ - } - - if ((uO.zflag > 0) && !uO.zipinfo_mode) { /* unzip: zflag = comment ONLY */ - CLOSE_INFILE(); - return error_in_archive; - } - -/*--------------------------------------------------------------------------- - Test the end-of-central-directory info for incompatibilities (multi-disk - archives) or inconsistencies (missing or extra bytes in zipfile). - ---------------------------------------------------------------------------*/ - -#ifdef NO_MULTIPART - error = !uO.zipinfo_mode && (G.ecrec.number_this_disk == 1) && - (G.ecrec.num_disk_start_cdir == 1); -#else - error = !uO.zipinfo_mode && (G.ecrec.number_this_disk != 0); -#endif - -#ifndef SFX - if (uO.zipinfo_mode && - G.ecrec.number_this_disk != G.ecrec.num_disk_start_cdir) - { - if (G.ecrec.number_this_disk > G.ecrec.num_disk_start_cdir) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirNotInZipMsg), G.zipfn, - (ulg)G.ecrec.number_this_disk, - (ulg)G.ecrec.num_disk_start_cdir)); - error_in_archive = PK_FIND; - too_weird_to_continue = TRUE; - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(EndCentDirBogus), G.zipfn, - (ulg)G.ecrec.number_this_disk, - (ulg)G.ecrec.num_disk_start_cdir)); - error_in_archive = PK_WARN; - } -#ifdef NO_MULTIPART /* concatenation of multiple parts works in some cases */ - } else if (!uO.zipinfo_mode && !error && G.ecrec.number_this_disk != 0) { - Info(slide, 0x401, ((char *)slide, LoadFarString(NoMultiDiskArcSupport), - G.zipfn)); - error_in_archive = PK_FIND; - too_weird_to_continue = TRUE; -#endif - } - - if (!too_weird_to_continue) { /* (relatively) normal zipfile: go for it */ - if (error) { - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybePakBug), - G.zipfn)); - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - if ((G.extra_bytes = G.real_ecrec_offset-G.expect_ecrec_offset) < - (zoff_t)0) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(MissingBytes), - G.zipfn, FmZofft((-G.extra_bytes), NULL, NULL))); - error_in_archive = PK_ERR; - } else if (G.extra_bytes > 0) { - if ((G.ecrec.offset_start_central_directory == 0) && - (G.ecrec.size_central_directory != 0)) /* zip 1.5 -go bug */ - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(NullCentDirOffset), G.zipfn)); - G.ecrec.offset_start_central_directory = G.extra_bytes; - G.extra_bytes = 0; - error_in_archive = PK_ERR; - } -#ifndef SFX - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtraBytesAtStart), G.zipfn, - FmZofft(G.extra_bytes, NULL, NULL), - (G.extra_bytes == 1)? "":"s")); - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - } - - /*----------------------------------------------------------------------- - Check for empty zipfile and exit now if so. - -----------------------------------------------------------------------*/ - - if (G.expect_ecrec_offset==0L && G.ecrec.size_central_directory==0) { - if (uO.zipinfo_mode) - Info(slide, 0, ((char *)slide, "%sEmpty zipfile.\n", - uO.lflag>9? "\n " : "")); - else - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileEmpty), - G.zipfn)); - CLOSE_INFILE(); - return (error_in_archive > PK_WARN)? error_in_archive : PK_WARN; - } - - /*----------------------------------------------------------------------- - Compensate for missing or extra bytes, and seek to where the start - of central directory should be. If header not found, uncompensate - and try again (necessary for at least some Atari archives created - with STZip, as well as archives created by J.H. Holm's ZIPSPLIT 1.1). - -----------------------------------------------------------------------*/ - - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if (error == PK_BADERR) { - CLOSE_INFILE(); - return PK_BADERR; - } -#ifdef OLD_SEEK_TEST - if (error != PK_OK || readbuf(__G__ G.sig, 4) == 0) { - CLOSE_INFILE(); - return PK_ERR; /* file may be locked, or possibly disk error(?) */ - } - if (memcmp(G.sig, central_hdr_sig, 4)) -#else - if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || - memcmp(G.sig, central_hdr_sig, 4)) -#endif - { -#ifndef SFX - zoff_t tmp = G.extra_bytes; -#endif - - G.extra_bytes = 0; - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || - memcmp(G.sig, central_hdr_sig, 4)) - { - if (error != PK_BADERR) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirStartNotFound), G.zipfn, - LoadFarStringSmall(ReportMsg))); - CLOSE_INFILE(); - return (error != PK_OK ? error : PK_BADERR); - } -#ifndef SFX - Info(slide, 0x401, ((char *)slide, LoadFarString(CentDirTooLong), - G.zipfn, FmZofft((-tmp), NULL, NULL))); -#endif - error_in_archive = PK_ERR; - } - - /*----------------------------------------------------------------------- - Seek to the start of the central directory one last time, since we - have just read the first entry's signature bytes; then list, extract - or test member files as instructed, and close the zipfile. - -----------------------------------------------------------------------*/ - - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if (error != PK_OK) { - CLOSE_INFILE(); - return error; - } - - Trace((stderr, "about to extract/list files (error = %d)\n", - error_in_archive)); - -#ifdef DLL - /* G.fValidate is used only to look at an archive to see if - it appears to be a valid archive. There is no interest - in what the archive contains, nor in validating that the - entries in the archive are in good condition. This is - currently used only in the Windows DLLs for purposes of - checking archives within an archive to determine whether - or not to display the inner archives. - */ - if (!G.fValidate) -#endif - { -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) - error = zipinfo(__G); /* ZIPINFO 'EM */ - else -#endif -#ifndef SFX -#ifdef TIMESTAMP - if (uO.T_flag) - error = get_time_stamp(__G__ &uxstamp, &nmember); - else -#endif - if (uO.vflag && !uO.tflag && !uO.cflag) - error = list_files(__G); /* LIST 'EM */ - else -#endif /* !SFX */ - error = extract_or_test_files(__G); /* EXTRACT OR TEST 'EM */ - - Trace((stderr, "done with extract/list files (error = %d)\n", - error)); - } - - if (error > error_in_archive) /* don't overwrite stronger error */ - error_in_archive = error; /* with (for example) a warning */ -#ifndef SFX - } /* end if (!too_weird_to_continue) */ -#endif - - CLOSE_INFILE(); - -#ifdef TIMESTAMP - if (uO.T_flag && !uO.zipinfo_mode && (nmember > 0L)) { -# ifdef WIN32 - if (stamp_file(__G__ G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ -# else - if (stamp_file(G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ -# endif - if (uO.qflag < 3) - Info(slide, 0x201, ((char *)slide, - LoadFarString(ZipTimeStampFailed), G.zipfn)); - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } else { - if (!uO.qflag) - Info(slide, 0, ((char *)slide, - LoadFarString(ZipTimeStampSuccess), G.zipfn)); - } - } -#endif - return error_in_archive; - -} /* end function do_seekable() */ - - - - -#ifdef DO_SAFECHECK_2GB -/************************/ -/* Function file_size() */ -/************************/ -/* File size determination which does not mislead for large files in a - small-file program. Probably should be somewhere else. - The file has to be opened previously -*/ -#ifdef USE_STRM_INPUT -static zoff_t file_size(file) - FILE *file; -{ - int sts; - size_t siz; -#else /* !USE_STRM_INPUT */ -static zoff_t file_size(fh) - int fh; -{ - int siz; -#endif /* ?USE_STRM_INPUT */ - zoff_t ofs; - char waste[4]; - -#ifdef USE_STRM_INPUT - /* Seek to actual EOF. */ - sts = zfseeko(file, 0, SEEK_END); - if (sts != 0) { - /* fseeko() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Get apparent offset at EOF. */ - ofs = zftello(file); - if (ofs < 0) { - /* Offset negative (overflow). File too big. */ - ofs = EOF; - } else { - /* Seek to apparent EOF offset. - Won't be at actual EOF if offset was truncated. - */ - sts = zfseeko(file, ofs, SEEK_SET); - if (sts != 0) { - /* fseeko() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Read a byte at apparent EOF. Should set EOF flag. */ - siz = fread(waste, 1, 1, file); - if (feof(file) == 0) { - /* Not at EOF, but should be. File too big. */ - ofs = EOF; - } - } - } - } -#else /* !USE_STRM_INPUT */ - /* Seek to actual EOF. */ - ofs = zlseek(fh, 0, SEEK_END); - if (ofs == (zoff_t) -1) { - /* zlseek() failed. (Unlikely.) */ - ofs = EOF; - } else if (ofs < 0) { - /* Offset negative (overflow). File too big. */ - ofs = EOF; - } else { - /* Seek to apparent EOF offset. - Won't be at actual EOF if offset was truncated. - */ - ofs = zlseek(fh, ofs, SEEK_SET); - if (ofs == (zoff_t) -1) { - /* zlseek() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Read a byte at apparent EOF. Should set EOF flag. */ - siz = read(fh, waste, 1); - if (siz != 0) { - /* Not at EOF, but should be. File too big. */ - ofs = EOF; - } - } - } -#endif /* ?USE_STRM_INPUT */ - return ofs; -} /* end function file_size() */ -#endif /* DO_SAFECHECK_2GB */ - - - - -/***********************/ -/* Function rec_find() */ -/***********************/ - -static int rec_find(__G__ searchlen, signature, rec_size) - /* return 0 when rec found, 1 when not found, 2 in case of read error */ - __GDEF - zoff_t searchlen; - char* signature; - int rec_size; -{ - int i, numblks, found=FALSE; - zoff_t tail_len; - -/*--------------------------------------------------------------------------- - Zipfile is longer than INBUFSIZ: may need to loop. Start with short - block at end of zipfile (if not TOO short). - ---------------------------------------------------------------------------*/ - - if ((tail_len = G.ziplen % INBUFSIZ) > rec_size) { -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, G.ziplen-tail_len, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, G.ziplen-tail_len, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, - (unsigned int)tail_len)) != (int)tail_len) - return 2; /* it's expedient... */ - - /* 'P' must be at least (rec_size+4) bytes from end of zipfile */ - for (G.inptr = G.inbuf+(int)tail_len-(rec_size+4); - G.inptr >= G.inbuf; - --G.inptr) { - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, signature, 4) ) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - } - /* sig may span block boundary: */ - memcpy((char *)G.hold, (char *)G.inbuf, 3); - } else - G.cur_zipfile_bufstart = G.ziplen - tail_len; - -/*----------------------------------------------------------------------- - Loop through blocks of zipfile data, starting at the end and going - toward the beginning. In general, need not check whole zipfile for - signature, but may want to do so if testing. - -----------------------------------------------------------------------*/ - - numblks = (int)((searchlen - tail_len + (INBUFSIZ-1)) / INBUFSIZ); - /* ==amount= ==done== ==rounding== =blksiz= */ - - for (i = 1; !found && (i <= numblks); ++i) { - G.cur_zipfile_bufstart -= INBUFSIZ; -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET); -#else /* !USE_STRM_INPUT */ - zlseek(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd,(char *)G.inbuf,INBUFSIZ)) - != INBUFSIZ) - return 2; /* read error is fatal failure */ - - for (G.inptr = G.inbuf+INBUFSIZ-1; G.inptr >= G.inbuf; --G.inptr) - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, signature, 4) ) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - /* sig may span block boundary: */ - memcpy((char *)G.hold, (char *)G.inbuf, 3); - } - return (found ? 0 : 1); -} /* end function rec_find() */ - - - - -#if 0 -/********************************/ -/* Function check_ecrec_zip64() */ -/********************************/ - -static int check_ecrec_zip64(__G) - __GDEF -{ - return G.ecrec.offset_start_central_directory == 0xFFFFFFFFL - || G.ecrec.size_central_directory == 0xFFFFFFFFL - || G.ecrec.total_entries_central_dir == 0xFFFF - || G.ecrec.num_entries_centrl_dir_ths_disk == 0xFFFF - || G.ecrec.num_disk_start_cdir == 0xFFFF - || G.ecrec.number_this_disk == 0xFFFF; -} /* end function check_ecrec_zip64() */ -#endif /* never */ - - - -/***************************/ -/* Function find_ecrec64() */ -/***************************/ - -static int find_ecrec64(__G__ searchlen) /* return PK-class error */ - __GDEF - zoff_t searchlen; -{ - ec_byte_rec64 byterec; /* buf for ecrec64 */ - ec_byte_loc64 byterecL; /* buf for ecrec64 locator */ - zoff_t ecloc64_start_offset; /* start offset of ecrec64 locator */ - zusz_t ecrec64_start_offset; /* start offset of ecrec64 */ - zuvl_t ecrec64_start_disk; /* start disk of ecrec64 */ - zuvl_t ecloc64_total_disks; /* total disks */ - zuvl_t ecrec64_disk_cdstart; /* disk number of central dir start */ - zucn_t ecrec64_this_entries; /* entries on disk with ecrec64 */ - zucn_t ecrec64_tot_entries; /* total number of entries */ - zusz_t ecrec64_cdirsize; /* length of central dir */ - zusz_t ecrec64_offs_cdstart; /* offset of central dir start */ - - /* First, find the ecrec64 locator. By definition, this must be before - ecrec with nothing in between. We back up the size of the ecrec64 - locator and check. */ - - ecloc64_start_offset = G.real_ecrec_offset - (ECLOC64_SIZE+4); - if (ecloc64_start_offset < 0) - /* Seeking would go past beginning, so probably empty archive */ - return PK_COOL; - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecloc64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecloc64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterecL, ECLOC64_SIZE+4)) - != (ECLOC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterecL, end_centloc64_sig, 4) ) { - /* not found */ - return PK_COOL; - } - - /* Read the locator. */ - ecrec64_start_disk = (zuvl_t)makelong(&byterecL[NUM_DISK_START_EOCDR64]); - ecrec64_start_offset = (zusz_t)makeint64(&byterecL[OFFSET_START_EOCDR64]); - ecloc64_total_disks = (zuvl_t)makelong(&byterecL[NUM_THIS_DISK_LOC64]); - - /* Check for consistency */ -#ifdef TEST - fprintf(stdout,"\nnumber of disks (ECR) %u, (ECLOC64) %lu\n", - G.ecrec.number_this_disk, ecloc64_total_disks); fflush(stdout); -#endif - if ((G.ecrec.number_this_disk != 0xFFFF) && - (G.ecrec.number_this_disk != ecloc64_total_disks - 1)) { - /* Note: For some unknown reason, the developers at PKWARE decided to - store the "zip64 total disks" value as a counter starting from 1, - whereas all other "split/span volume" related fields use 0-based - volume numbers. Sigh... */ - /* When the total number of disks as found in the traditional ecrec - is not 0xFFFF, the disk numbers in ecrec and ecloc64 must match. - When this is not the case, the found ecrec64 locator cannot be valid. - -> This is not a Zip64 archive. - */ - Trace((stderr, - "\ninvalid ECLOC64, differing disk# (ECR %u, ECL64 %lu)\n", - G.ecrec.number_this_disk, ecloc64_total_disks - 1)); - return PK_COOL; - } - - /* If found locator, look for ecrec64 where the locator says it is. */ - - /* For now assume that ecrec64 is on the same disk as ecloc64 and ecrec, - which is usually the case and is how Zip writes it. To do this right, - however, we should allow the ecrec64 to be on another disk since - the AppNote allows it and the ecrec64 can be large, especially if - Version 2 is used (AppNote uses 8 bytes for the size of this record). */ - - /* FIX BELOW IF ADD SUPPORT FOR MULTIPLE DISKS */ - - if (ecrec64_start_offset > (zusz_t)ecloc64_start_offset) { - /* ecrec64 has to be before ecrec64 locator */ - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4)) - != (ECREC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterec, end_central64_sig, 4) ) { - /* Zip64 EOCD Record not found */ - /* Since we already have seen the Zip64 EOCD Locator, it's - possible we got here because there are bytes prepended - to the archive, like the sfx prefix. */ - - /* Make a guess as to where the Zip64 EOCD Record might be */ - ecrec64_start_offset = ecloc64_start_offset - ECREC64_SIZE - 4; - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4)) - != (ECREC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterec, end_central64_sig, 4) ) { - /* Zip64 EOCD Record not found */ - /* Probably something not so easy to handle so exit */ - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchOff))); - } - - /* Check consistency of found ecrec64 with ecloc64 (and ecrec): */ - if ( (zuvl_t)makelong(&byterec[NUMBER_THIS_DSK_REC64]) - != ecrec64_start_disk ) - /* found ecrec64 does not match ecloc64 info -> no Zip64 archive */ - return PK_COOL; - /* Read all relevant ecrec64 fields and compare them to the corresponding - ecrec fields unless those are set to "all-ones". - */ - ecrec64_disk_cdstart = - (zuvl_t)makelong(&byterec[NUM_DISK_START_CEN_DIR64]); - if ( (G.ecrec.num_disk_start_cdir != 0xFFFF) && - (G.ecrec.num_disk_start_cdir != ecrec64_disk_cdstart) ) - return PK_COOL; - ecrec64_this_entries - = makeint64(&byterec[NUM_ENTRIES_CEN_DIR_THS_DISK64]); - if ( (G.ecrec.num_entries_centrl_dir_ths_disk != 0xFFFF) && - (G.ecrec.num_entries_centrl_dir_ths_disk != ecrec64_this_entries) ) - return PK_COOL; - ecrec64_tot_entries - = makeint64(&byterec[TOTAL_ENTRIES_CENTRAL_DIR64]); - if ( (G.ecrec.total_entries_central_dir != 0xFFFF) && - (G.ecrec.total_entries_central_dir != ecrec64_tot_entries) ) - return PK_COOL; - ecrec64_cdirsize - = makeint64(&byterec[SIZE_CENTRAL_DIRECTORY64]); - if ( (G.ecrec.size_central_directory != 0xFFFFFFFFL) && - (G.ecrec.size_central_directory != ecrec64_cdirsize) ) - return PK_COOL; - ecrec64_offs_cdstart - = makeint64(&byterec[OFFSET_START_CENTRAL_DIRECT64]); - if ( (G.ecrec.offset_start_central_directory != 0xFFFFFFFFL) && - (G.ecrec.offset_start_central_directory != ecrec64_offs_cdstart) ) - return PK_COOL; - - /* Now, we are (almost) sure that we have a Zip64 archive. */ - G.ecrec.have_ecr64 = 1; - - /* Update the "end-of-central-dir offset" for later checks. */ - G.real_ecrec_offset = ecrec64_start_offset; - - /* Update all ecdir_rec data that are flagged to be invalid - in Zip64 mode. Set the ecrec64-mandatory flag when such a - case is found. */ - if (G.ecrec.number_this_disk == 0xFFFF) { - G.ecrec.number_this_disk = ecrec64_start_disk; - if (ecrec64_start_disk != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.num_disk_start_cdir == 0xFFFF) { - G.ecrec.num_disk_start_cdir = ecrec64_disk_cdstart; - if (ecrec64_disk_cdstart != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.num_entries_centrl_dir_ths_disk == 0xFFFF) { - G.ecrec.num_entries_centrl_dir_ths_disk = ecrec64_this_entries; - if (ecrec64_this_entries != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.total_entries_central_dir == 0xFFFF) { - G.ecrec.total_entries_central_dir = ecrec64_tot_entries; - if (ecrec64_tot_entries != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.size_central_directory == 0xFFFFFFFFL) { - G.ecrec.size_central_directory = ecrec64_cdirsize; - if (ecrec64_cdirsize != 0xFFFFFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.offset_start_central_directory == 0xFFFFFFFFL) { - G.ecrec.offset_start_central_directory = ecrec64_offs_cdstart; - if (ecrec64_offs_cdstart != 0xFFFFFFFF) G.ecrec.is_zip64_archive = TRUE; - } - - return PK_COOL; -} /* end function find_ecrec64() */ - - - -/*************************/ -/* Function find_ecrec() */ -/*************************/ - -static int find_ecrec(__G__ searchlen) /* return PK-class error */ - __GDEF - zoff_t searchlen; -{ - int found = FALSE; - int error_in_archive; - int result; - ec_byte_rec byterec; - -/*--------------------------------------------------------------------------- - Treat case of short zipfile separately. - ---------------------------------------------------------------------------*/ - - if (G.ziplen <= INBUFSIZ) { -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, 0L, SEEK_SET); -#else /* !USE_STRM_INPUT */ - zlseek(G.zipfd, 0L, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd,(char *)G.inbuf,(unsigned int)G.ziplen)) - == (int)G.ziplen) - - /* 'P' must be at least (ECREC_SIZE+4) bytes from end of zipfile */ - for (G.inptr = G.inbuf+(int)G.ziplen-(ECREC_SIZE+4); - G.inptr >= G.inbuf; - --G.inptr) { - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, end_central_sig, 4)) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - } - -/*--------------------------------------------------------------------------- - Zipfile is longer than INBUFSIZ: - - MB - this next block of code moved to rec_find so that same code can be - used to look for zip64 ec record. No need to include code above since - a zip64 ec record will only be looked for if it is a BIG file. - ---------------------------------------------------------------------------*/ - - } else { - found = - (rec_find(__G__ searchlen, end_central_sig, ECREC_SIZE) == 0 - ? TRUE : FALSE); - } /* end if (ziplen > INBUFSIZ) */ - -/*--------------------------------------------------------------------------- - Searched through whole region where signature should be without finding - it. Print informational message and die a horrible death. - ---------------------------------------------------------------------------*/ - - if (!found) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirEndSigNotFound))); - return PK_ERR; /* failed */ - } - -/*--------------------------------------------------------------------------- - Found the signature, so get the end-central data before returning. Do - any necessary machine-type conversions (byte ordering, structure padding - compensation) by reading data into character array and copying to struct. - ---------------------------------------------------------------------------*/ - - G.real_ecrec_offset = G.cur_zipfile_bufstart + (G.inptr-G.inbuf); -#ifdef TEST - printf("\n found end-of-central-dir signature at offset %s (%sh)\n", - FmZofft(G.real_ecrec_offset, NULL, NULL), - FmZofft(G.real_ecrec_offset, FZOFFT_HEX_DOT_WID, "X")); - printf(" from beginning of file; offset %d (%.4Xh) within block\n", - G.inptr-G.inbuf, G.inptr-G.inbuf); -#endif - - if (readbuf(__G__ (char *)byterec, ECREC_SIZE+4) == 0) - return PK_EOF; - - G.ecrec.number_this_disk = - makeword(&byterec[NUMBER_THIS_DISK]); - G.ecrec.num_disk_start_cdir = - makeword(&byterec[NUM_DISK_WITH_START_CEN_DIR]); - G.ecrec.num_entries_centrl_dir_ths_disk = - makeword(&byterec[NUM_ENTRIES_CEN_DIR_THS_DISK]); - G.ecrec.total_entries_central_dir = - makeword(&byterec[TOTAL_ENTRIES_CENTRAL_DIR]); - G.ecrec.size_central_directory = - makelong(&byterec[SIZE_CENTRAL_DIRECTORY]); - G.ecrec.offset_start_central_directory = - makelong(&byterec[OFFSET_START_CENTRAL_DIRECTORY]); - G.ecrec.zipfile_comment_length = - makeword(&byterec[ZIPFILE_COMMENT_LENGTH]); - - /* Now, we have to read the archive comment, BEFORE the file pointer - is moved away backwards to seek for a Zip64 ECLOC64 structure. - */ - if ( (error_in_archive = process_zip_cmmnt(__G)) > PK_WARN ) - return error_in_archive; - - /* Next: Check for existence of Zip64 end-of-cent-dir locator - ECLOC64. This structure must reside on the same volume as the - classic ECREC, at exactly (ECLOC64_SIZE+4) bytes in front - of the ECREC. - The ECLOC64 structure directs to the longer ECREC64 structure - A ECREC64 will ALWAYS exist for a proper Zip64 archive, as - the "Version Needed To Extract" field is required to be set - to 4.5 or higher whenever any Zip64 features are used anywhere - in the archive, so just check for that to see if this is a - Zip64 archive. - */ - result = find_ecrec64(__G__ searchlen+76); - /* 76 bytes for zip64ec & zip64 locator */ - if (result != PK_COOL) { - if (error_in_archive < result) - error_in_archive = result; - return error_in_archive; - } - - G.expect_ecrec_offset = G.ecrec.offset_start_central_directory + - G.ecrec.size_central_directory; - -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) { - /* In ZipInfo mode, additional info about the data found in the - end-of-central-directory areas is printed out. - */ - zi_end_central(__G); - } -#endif - - return error_in_archive; - -} /* end function find_ecrec() */ - - - - - -/********************************/ -/* Function process_zip_cmmnt() */ -/********************************/ - -static int process_zip_cmmnt(__G) /* return PK-type error code */ - __GDEF -{ - int error = PK_COOL; - - -/*--------------------------------------------------------------------------- - Get the zipfile comment (up to 64KB long), if any, and print it out. - ---------------------------------------------------------------------------*/ - -#ifdef WINDLL - /* for comment button: */ - if ((!G.fValidate) && (G.lpUserFunctions != NULL)) - G.lpUserFunctions->cchComment = G.ecrec.zipfile_comment_length; -#endif /* WINDLL */ - -#ifndef NO_ZIPINFO - /* ZipInfo, verbose format */ - if (uO.zipinfo_mode && uO.lflag > 9) { - /*------------------------------------------------------------------- - Get the zipfile comment, if any, and print it out. - (Comment may be up to 64KB long. May the fleas of a thousand - camels infest the arm-pits of anyone who actually takes advantage - of this fact.) - -------------------------------------------------------------------*/ - - if (!G.ecrec.zipfile_comment_length) - Info(slide, 0, ((char *)slide, LoadFarString(NoZipfileComment))); - else { - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommentDesc), - G.ecrec.zipfile_comment_length)); - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommBegin))); - if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) - error = PK_WARN; - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommEnd))); - if (error) - Info(slide, 0, ((char *)slide, - LoadFarString(ZipfileCommTrunc2))); - } /* endif (comment exists) */ - - /* ZipInfo, non-verbose mode: print zipfile comment only if requested */ - } else if (G.ecrec.zipfile_comment_length && - (uO.zflag > 0) && uO.zipinfo_mode) { - if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } else -#endif /* !NO_ZIPINFO */ - if ( G.ecrec.zipfile_comment_length && - (uO.zflag > 0 -#ifndef WINDLL - || (uO.zflag == 0 -# ifndef NO_ZIPINFO - && !uO.zipinfo_mode -# endif -# ifdef TIMESTAMP - && !uO.T_flag -# endif - && !uO.qflag) -#endif /* !WINDLL */ - ) ) - { - if (do_string(__G__ G.ecrec.zipfile_comment_length, -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) -# ifndef NO_ZIPINFO - (oU.zipinfo_mode ? DISPLAY : CHECK_AUTORUN) -# else - CHECK_AUTORUN -# endif -#else - DISPLAY -#endif - )) - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - else if (G.ecrec.zipfile_comment_length) { - if (do_string(__G__ G.ecrec.zipfile_comment_length, CHECK_AUTORUN_Q)) - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } -#endif - return error; - -} /* end function process_zip_cmmnt() */ - - - - - -/************************************/ -/* Function process_cdir_file_hdr() */ -/************************************/ - -int process_cdir_file_hdr(__G) /* return PK-type error code */ - __GDEF -{ - int error; - - -/*--------------------------------------------------------------------------- - Get central directory info, save host and method numbers, and set flag - for lowercase conversion of filename, depending on the OS from which the - file is coming. - ---------------------------------------------------------------------------*/ - - if ((error = get_cdir_ent(__G)) != 0) - return error; - - G.pInfo->hostver = G.crec.version_made_by[0]; - G.pInfo->hostnum = MIN(G.crec.version_made_by[1], NUM_HOSTS); -/* extnum = MIN(crec.version_needed_to_extract[1], NUM_HOSTS); */ - - G.pInfo->lcflag = 0; - if (uO.L_flag == 1) /* name conversion for monocase systems */ - switch (G.pInfo->hostnum) { - case FS_FAT_: /* PKZIP and zip -k store in uppercase */ - case CPM_: /* like MS-DOS, right? */ - case VM_CMS_: /* all caps? */ - case MVS_: /* all caps? */ - case TANDEM_: - case TOPS20_: - case VMS_: /* our Zip uses lowercase, but ASi's doesn't */ - /* case Z_SYSTEM_: ? */ - /* case QDOS_: ? */ - G.pInfo->lcflag = 1; /* convert filename to lowercase */ - break; - - default: /* AMIGA_, FS_HPFS_, FS_NTFS_, MAC_, UNIX_, ATARI_, */ - break; /* FS_VFAT_, ATHEOS_, BEOS_ (Z_SYSTEM_), THEOS_: */ - /* no conversion */ - } - else if (uO.L_flag > 1) /* let -LL force lower case for all names */ - G.pInfo->lcflag = 1; - - /* do Amigas (AMIGA_) also have volume labels? */ - if (IS_VOLID(G.crec.external_file_attributes) && - (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ || - G.pInfo->hostnum == FS_NTFS_ || G.pInfo->hostnum == ATARI_)) - { - G.pInfo->vollabel = TRUE; - G.pInfo->lcflag = 0; /* preserve case of volume labels */ - } else - G.pInfo->vollabel = FALSE; - - /* this flag is needed to detect archives made by "PKZIP for Unix" when - deciding which kind of codepage conversion has to be applied to - strings (see do_string() function in fileio.c) */ - G.pInfo->HasUxAtt = (G.crec.external_file_attributes & 0xffff0000L) != 0L; - -#ifdef UNICODE_SUPPORT - /* remember the state of GPB11 (General Purpuse Bit 11) which indicates - that the standard path and comment are UTF-8. */ - G.pInfo->GPFIsUTF8 - = (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11); -#endif - - return PK_COOL; - -} /* end function process_cdir_file_hdr() */ - - - - - -/***************************/ -/* Function get_cdir_ent() */ -/***************************/ - -static int get_cdir_ent(__G) /* return PK-type error code */ - __GDEF -{ - cdir_byte_hdr byterec; - - -/*--------------------------------------------------------------------------- - Read the next central directory entry and do any necessary machine-type - conversions (byte ordering, structure padding compensation--do so by - copying the data from the array into which it was read (byterec) to the - usable struct (crec)). - ---------------------------------------------------------------------------*/ - - if (readbuf(__G__ (char *)byterec, CREC_SIZE) == 0) - return PK_EOF; - - G.crec.version_made_by[0] = byterec[C_VERSION_MADE_BY_0]; - G.crec.version_made_by[1] = byterec[C_VERSION_MADE_BY_1]; - G.crec.version_needed_to_extract[0] = - byterec[C_VERSION_NEEDED_TO_EXTRACT_0]; - G.crec.version_needed_to_extract[1] = - byterec[C_VERSION_NEEDED_TO_EXTRACT_1]; - - G.crec.general_purpose_bit_flag = - makeword(&byterec[C_GENERAL_PURPOSE_BIT_FLAG]); - G.crec.compression_method = - makeword(&byterec[C_COMPRESSION_METHOD]); - G.crec.last_mod_dos_datetime = - makelong(&byterec[C_LAST_MOD_DOS_DATETIME]); - G.crec.crc32 = - makelong(&byterec[C_CRC32]); - G.crec.csize = - makelong(&byterec[C_COMPRESSED_SIZE]); - G.crec.ucsize = - makelong(&byterec[C_UNCOMPRESSED_SIZE]); - G.crec.filename_length = - makeword(&byterec[C_FILENAME_LENGTH]); - G.crec.extra_field_length = - makeword(&byterec[C_EXTRA_FIELD_LENGTH]); - G.crec.file_comment_length = - makeword(&byterec[C_FILE_COMMENT_LENGTH]); - G.crec.disk_number_start = - makeword(&byterec[C_DISK_NUMBER_START]); - G.crec.internal_file_attributes = - makeword(&byterec[C_INTERNAL_FILE_ATTRIBUTES]); - G.crec.external_file_attributes = - makelong(&byterec[C_EXTERNAL_FILE_ATTRIBUTES]); /* LONG, not word! */ - G.crec.relative_offset_local_header = - makelong(&byterec[C_RELATIVE_OFFSET_LOCAL_HEADER]); - - return PK_COOL; - -} /* end function get_cdir_ent() */ - - - - - -/*************************************/ -/* Function process_local_file_hdr() */ -/*************************************/ - -int process_local_file_hdr(__G) /* return PK-type error code */ - __GDEF -{ - local_byte_hdr byterec; - - -/*--------------------------------------------------------------------------- - Read the next local file header and do any necessary machine-type con- - versions (byte ordering, structure padding compensation--do so by copy- - ing the data from the array into which it was read (byterec) to the - usable struct (lrec)). - ---------------------------------------------------------------------------*/ - - if (readbuf(__G__ (char *)byterec, LREC_SIZE) == 0) - return PK_EOF; - - G.lrec.version_needed_to_extract[0] = - byterec[L_VERSION_NEEDED_TO_EXTRACT_0]; - G.lrec.version_needed_to_extract[1] = - byterec[L_VERSION_NEEDED_TO_EXTRACT_1]; - - G.lrec.general_purpose_bit_flag = - makeword(&byterec[L_GENERAL_PURPOSE_BIT_FLAG]); - G.lrec.compression_method = makeword(&byterec[L_COMPRESSION_METHOD]); - G.lrec.last_mod_dos_datetime = makelong(&byterec[L_LAST_MOD_DOS_DATETIME]); - G.lrec.crc32 = makelong(&byterec[L_CRC32]); - G.lrec.csize = makelong(&byterec[L_COMPRESSED_SIZE]); - G.lrec.ucsize = makelong(&byterec[L_UNCOMPRESSED_SIZE]); - G.lrec.filename_length = makeword(&byterec[L_FILENAME_LENGTH]); - G.lrec.extra_field_length = makeword(&byterec[L_EXTRA_FIELD_LENGTH]); - - if ((G.lrec.general_purpose_bit_flag & 8) != 0) { - /* can't trust local header, use central directory: */ - G.lrec.crc32 = G.pInfo->crc; - G.lrec.csize = G.pInfo->compr_size; - G.lrec.ucsize = G.pInfo->uncompr_size; - } - - G.csize = G.lrec.csize; - - return PK_COOL; - -} /* end function process_local_file_hdr() */ - - -/*******************************/ -/* Function getZip64Data() */ -/*******************************/ - -int getZip64Data(__G__ ef_buf, ef_len) - __GDEF - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for zip64 information, ie 8-byte - versions of compressed file size, uncompressed file size, relative offset - and a 4-byte version of disk start number. - Sets both local header and central header fields. Not terribly clever, - but it means that this procedure is only called in one place. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL) - return PK_COOL; - - Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getZip64Data: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - if (eb_id == EF_PKSZ64) { - - int offset = EB_HEADSIZE; - - if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){ - G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf); - offset += sizeof(G.crec.ucsize); - } - if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){ - G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf); - offset += sizeof(G.crec.csize); - } - if (G.crec.relative_offset_local_header == 0xffffffff){ - G.crec.relative_offset_local_header = makeint64(offset + ef_buf); - offset += sizeof(G.crec.relative_offset_local_header); - } - if (G.crec.disk_number_start == 0xffff){ - G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf); - offset += sizeof(G.crec.disk_number_start); - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return PK_COOL; -} /* end function getZip64Data() */ - - -#ifdef UNICODE_SUPPORT - -/*******************************/ -/* Function getUnicodeData() */ -/*******************************/ - -int getUnicodeData(__G__ ef_buf, ef_len) - __GDEF - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for Unicode information, ie UTF-8 - path extra fields. - - On return, G.unipath_filename = - NULL, if no Unicode path extra field or error - "", if the standard path is UTF-8 (free when done) - null-terminated UTF-8 path (free when done) - Return PK_COOL if no error. - ---------------------------------------------------------------------------*/ - - G.unipath_filename = NULL; - - if (ef_len == 0 || ef_buf == NULL) - return PK_COOL; - - Trace((stderr,"\ngetUnicodeData: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getUnicodeData: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - if (eb_id == EF_UNIPATH) { - - int offset = EB_HEADSIZE; - ush ULen = eb_len - 5; - ulg chksum = CRCVAL_INITIAL; - - /* version */ - G.unipath_version = (uch) *(offset + ef_buf); - offset += 1; - if (G.unipath_version > 1) { - /* can do only version 1 */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnicodeVersionError))); - return PK_ERR; - } - - /* filename CRC */ - G.unipath_checksum = makelong(offset + ef_buf); - offset += 4; - - /* - * Compute 32-bit crc - */ - - chksum = crc32(chksum, (uch *)(G.filename_full), - strlen(G.filename_full)); - - /* If the checksums's don't match then likely filename has been - * modified and the Unicode Path is no longer valid. - */ - if (chksum != G.unipath_checksum) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnicodeMismatchError))); - if (G.unicode_mismatch == 1) { - /* warn and continue */ - } else if (G.unicode_mismatch == 2) { - /* ignore and continue */ - } else if (G.unicode_mismatch == 0) { - } - return PK_ERR; - } - - /* UTF-8 Path */ - if ((G.unipath_filename = malloc(ULen + 1)) == NULL) { - return PK_ERR; - } - if (ULen == 0) { - /* standard path is UTF-8 so use that */ - G.unipath_filename[0] = '\0'; - } else { - /* UTF-8 path */ - strncpy(G.unipath_filename, - (ZCONST char *)(offset + ef_buf), ULen); - G.unipath_filename[ULen] = '\0'; - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return PK_COOL; -} /* end function getUnicodeData() */ - - - - -#ifdef UNICODE_WCHAR - /*--------------------------------------------- - * Unicode conversion functions - * - * Based on functions provided by Paul Kienitz - * - *--------------------------------------------- - */ - -/* - NOTES APPLICABLE TO ALL STRING FUNCTIONS: - - All of the x_to_y functions take parameters for an output buffer and - its available length, and return an int. The value returned is the - length of the string that the input produces, which may be larger than - the provided buffer length. If the returned value is less than the - buffer length, then the contents of the buffer will be null-terminated; - otherwise, it will not be terminated and may be invalid, possibly - stopping in the middle of a multibyte sequence. - - In all cases you may pass NULL as the buffer and/or 0 as the length, if - you just want to learn how much space the string is going to require. - - The functions will return -1 if the input is invalid UTF-8 or cannot be - encoded as UTF-8. -*/ - -static int utf8_char_bytes OF((ZCONST char *utf8)); -static ulg ucs4_char_from_utf8 OF((ZCONST char **utf8)); -static int utf8_to_ucs4_string OF((ZCONST char *utf8, ulg *ucs4buf, - int buflen)); - -/* utility functions for managing UTF-8 and UCS-4 strings */ - - -/* utf8_char_bytes - * - * Returns the number of bytes used by the first character in a UTF-8 - * string, or -1 if the UTF-8 is invalid or null. - */ -static int utf8_char_bytes(utf8) - ZCONST char *utf8; -{ - int t, r; - unsigned lead; - - if (!utf8) - return -1; /* no input */ - lead = (unsigned char) *utf8; - if (lead < 0x80) - r = 1; /* an ascii-7 character */ - else if (lead < 0xC0) - return -1; /* error: trailing byte without lead byte */ - else if (lead < 0xE0) - r = 2; /* an 11 bit character */ - else if (lead < 0xF0) - r = 3; /* a 16 bit character */ - else if (lead < 0xF8) - r = 4; /* a 21 bit character (the most currently used) */ - else if (lead < 0xFC) - r = 5; /* a 26 bit character (shouldn't happen) */ - else if (lead < 0xFE) - r = 6; /* a 31 bit character (shouldn't happen) */ - else - return -1; /* error: invalid lead byte */ - for (t = 1; t < r; t++) - if ((unsigned char) utf8[t] < 0x80 || (unsigned char) utf8[t] >= 0xC0) - return -1; /* error: not enough valid trailing bytes */ - return r; -} - - -/* ucs4_char_from_utf8 - * - * Given a reference to a pointer into a UTF-8 string, returns the next - * UCS-4 character and advances the pointer to the next character sequence. - * Returns ~0 (= -1 in twos-complement notation) and does not advance the - * pointer when input is ill-formed. - */ -static ulg ucs4_char_from_utf8(utf8) - ZCONST char **utf8; -{ - ulg ret; - int t, bytes; - - if (!utf8) - return ~0L; /* no input */ - bytes = utf8_char_bytes(*utf8); - if (bytes <= 0) - return ~0L; /* invalid input */ - if (bytes == 1) - ret = **utf8; /* ascii-7 */ - else - ret = **utf8 & (0x7F >> bytes); /* lead byte of a multibyte sequence */ - (*utf8)++; - for (t = 1; t < bytes; t++) /* consume trailing bytes */ - ret = (ret << 6) | (*((*utf8)++) & 0x3F); - return (zwchar) ret; -} - - -#if 0 /* currently unused */ -/* utf8_from_ucs4_char - Convert UCS char to UTF-8 - * - * Returns the number of bytes put into utf8buf to represent ch, from 1 to 6, - * or -1 if ch is too large to represent. utf8buf must have room for 6 bytes. - */ -static int utf8_from_ucs4_char(utf8buf, ch) - char *utf8buf; - ulg ch; -{ - int trailing = 0; - int leadmask = 0x80; - int leadbits = 0x3F; - int tch = ch; - int ret; - - if (ch > 0x7FFFFFFFL) - return -1; /* UTF-8 can represent 31 bits */ - if (ch < 0x7F) - { - *utf8buf++ = (char) ch; /* ascii-7 */ - return 1; - } - do { - trailing++; - leadmask = (leadmask >> 1) | 0x80; - leadbits >>= 1; - tch >>= 6; - } while (tch & ~leadbits); - ret = trailing + 1; - /* produce lead byte */ - *utf8buf++ = (char) (leadmask | (ch >> (6 * trailing))); - while (--trailing >= 0) - /* produce trailing bytes */ - *utf8buf++ = (char) (0x80 | ((ch >> (6 * trailing)) & 0x3F)); - return ret; -} -#endif /* unused */ - - -/*===================================================================*/ - -/* utf8_to_ucs4_string - convert UTF-8 string to UCS string - * - * Return UCS count. Now returns int so can return -1. - */ -static int utf8_to_ucs4_string(utf8, ucs4buf, buflen) - ZCONST char *utf8; - ulg *ucs4buf; - int buflen; -{ - int count = 0; - - for (;;) - { - ulg ch = ucs4_char_from_utf8(&utf8); - if (ch == ~0L) - return -1; - else - { - if (ucs4buf && count < buflen) - ucs4buf[count] = ch; - if (ch == 0) - return count; - count++; - } - } -} - - -#if 0 /* currently unused */ -/* ucs4_string_to_utf8 - * - * - */ -static int ucs4_string_to_utf8(ucs4, utf8buf, buflen) - ZCONST ulg *ucs4; - char *utf8buf; - int buflen; -{ - char mb[6]; - int count = 0; - - if (!ucs4) - return -1; - for (;;) - { - int mbl = utf8_from_ucs4_char(mb, *ucs4++); - int c; - if (mbl <= 0) - return -1; - /* We could optimize this a bit by passing utf8buf + count */ - /* directly to utf8_from_ucs4_char when buflen >= count + 6... */ - c = buflen - count; - if (mbl < c) - c = mbl; - if (utf8buf && count < buflen) - strncpy(utf8buf + count, mb, c); - if (mbl == 1 && !mb[0]) - return count; /* terminating nul */ - count += mbl; - } -} - - -/* utf8_chars - * - * Wrapper: counts the actual unicode characters in a UTF-8 string. - */ -static int utf8_chars(utf8) - ZCONST char *utf8; -{ - return utf8_to_ucs4_string(utf8, NULL, 0); -} -#endif /* unused */ - -/* --------------------------------------------------- */ -/* Unicode Support - * - * These functions common for all Unicode ports. - * - * These functions should allocate and return strings that can be - * freed with free(). - * - * 8/27/05 EG - * - * Use zwchar for wide char which is unsigned long - * in zip.h and 32 bits. This avoids problems with - * different sizes of wchar_t. - */ - -#if 0 /* currently unused */ -/* is_ascii_string - * Checks if a string is all ascii - */ -int is_ascii_string(mbstring) - ZCONST char *mbstring; -{ - char *p; - uch c; - - for (p = mbstring; c = (uch)*p; p++) { - if (c > 0x7F) { - return 0; - } - } - return 1; -} - -/* local to UTF-8 */ -char *local_to_utf8_string(local_string) - ZCONST char *local_string; -{ - return wide_to_utf8_string(local_to_wide_string(local_string)); -} -# endif /* unused */ - -/* wide_to_escape_string - provides a string that represents a wide char not in local char set - - An initial try at an algorithm. Suggestions welcome. - - According to the standard, Unicode character points are restricted to - the number range from 0 to 0x10FFFF, respective 21 bits. - For a hexadecimal notation, 2 octets are sufficient for the mostly - used characters from the "Basic Multilingual Plane", all other - Unicode characters can be represented by 3 octets (= 6 hex digits). - The Unicode standard suggests to write Unicode character points - as 4 resp. 6 hex digits, preprended by "U+". - (e.g.: U+10FFFF for the highest character point, or U+0030 for the ASCII - digit "0") - - However, for the purpose of escaping non-ASCII chars in an ASCII character - stream, the "U" is not a very good escape initializer. Therefore, we - use the following convention within our Info-ZIP code: - - If not an ASCII char probably need 2 bytes at least. So if - a 2-byte wide encode it as 4 hex digits with a leading #U. If - needs 3 bytes then prefix the string with #L. So - #U1234 - is a 2-byte wide character with bytes 0x12 and 0x34 while - #L123456 - is a 3-byte wide character with bytes 0x12, 0x34, 0x56. - On Windows, wide that need two wide characters need to be converted - to a single number. - */ - - /* set this to the max bytes an escape can be */ -#define MAX_ESCAPE_BYTES 8 - -char *wide_to_escape_string(wide_char) - zwchar wide_char; -{ - int i; - zwchar w = wide_char; - uch b[sizeof(zwchar)]; - char d[3]; - char e[11]; - int len; - char *r; - - /* fill byte array with zeros */ - memzero(b, sizeof(zwchar)); - /* get bytes in right to left order */ - for (len = 0; w; len++) { - b[len] = (char)(w % 0x100); - w /= 0x100; - } - strcpy(e, "#"); - /* either 2 bytes or 3 bytes */ - if (len <= 2) { - len = 2; - strcat(e, "U"); - } else { - strcat(e, "L"); - } - for (i = len - 1; i >= 0; i--) { - sprintf(d, "%02x", b[i]); - strcat(e, d); - } - if ((r = malloc(strlen(e) + 1)) == NULL) { - return NULL; - } - strcpy(r, e); - return r; -} - -#if 0 /* currently unused */ -/* returns the wide character represented by the escape string */ -zwchar escape_string_to_wide(escape_string) - ZCONST char *escape_string; -{ - int i; - zwchar w; - char c; - int len; - ZCONST char *e = escape_string; - - if (e == NULL) { - return 0; - } - if (e[0] != '#') { - /* no leading # */ - return 0; - } - len = strlen(e); - /* either #U1234 or #L123456 format */ - if (len != 6 && len != 8) { - return 0; - } - w = 0; - if (e[1] == 'L') { - if (len != 8) { - return 0; - } - /* 3 bytes */ - for (i = 2; i < 8; i++) { - c = e[i]; - if (c < '0' || c > '9') { - return 0; - } - w = w * 0x10 + (zwchar)(c - '0'); - } - } else if (e[1] == 'U') { - /* 2 bytes */ - for (i = 2; i < 6; i++) { - c = e[i]; - if (c < '0' || c > '9') { - return 0; - } - w = w * 0x10 + (zwchar)(c - '0'); - } - } - return w; -} -#endif /* unused */ - -#ifndef WIN32 /* WIN32 supplies a special variant of this function */ -/* convert wide character string to multi-byte character string */ -char *wide_to_local_string(wide_string, escape_all) - ZCONST zwchar *wide_string; - int escape_all; -{ - int i; - wchar_t wc; - int b; - int state_dependent; - int wsize = 0; - int max_bytes = MB_CUR_MAX; - char buf[9]; - char *buffer = NULL; - char *local_string = NULL; - - for (wsize = 0; wide_string[wsize]; wsize++) ; - - if (max_bytes < MAX_ESCAPE_BYTES) - max_bytes = MAX_ESCAPE_BYTES; - - if ((buffer = (char *)malloc(wsize * max_bytes + 1)) == NULL) { - return NULL; - } - - /* convert it */ - buffer[0] = '\0'; - /* set initial state if state-dependent encoding */ - wc = (wchar_t)'a'; - b = wctomb(NULL, wc); - if (b == 0) - state_dependent = 0; - else - state_dependent = 1; - for (i = 0; i < wsize; i++) { - if (sizeof(wchar_t) < 4 && wide_string[i] > 0xFFFF) { - /* wchar_t probably 2 bytes */ - /* could do surrogates if state_dependent and wctomb can do */ - wc = zwchar_to_wchar_t_default_char; - } else { - wc = (wchar_t)wide_string[i]; - } - b = wctomb(buf, wc); - if (escape_all) { - if (b == 1 && (uch)buf[0] <= 0x7f) { - /* ASCII */ - strncat(buffer, buf, b); - } else { - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } else if (b > 0) { - /* multi-byte char */ - strncat(buffer, buf, b); - } else { - /* no MB for this wide */ - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } - if ((local_string = (char *)malloc(strlen(buffer) + 1)) != NULL) { - strcpy(local_string, buffer); - } - free(buffer); - - return local_string; -} -#endif /* !WIN32 */ - -#if 0 /* currently unused */ -/* convert local string to display character set string */ -char *local_to_display_string(local_string) - ZCONST char *local_string; -{ - char *display_string; - - /* For Windows, OEM string should never be bigger than ANSI string, says - CharToOem description. - For all other ports, just make a copy of local_string. - */ - if ((display_string = (char *)malloc(strlen(local_string) + 1)) == NULL) { - return NULL; - } - - strcpy(display_string, local_string); - -#ifdef EBCDIC - { - char *ebc; - - if ((ebc = malloc(strlen(display_string) + 1)) == NULL) { - return NULL; - } - strtoebc(ebc, display_string); - free(display_string); - display_string = ebc; - } -#endif - - return display_string; -} -#endif /* unused */ - -/* UTF-8 to local */ -char *utf8_to_local_string(utf8_string, escape_all) - ZCONST char *utf8_string; - int escape_all; -{ - zwchar *wide = utf8_to_wide_string(utf8_string); - char *loc = wide_to_local_string(wide, escape_all); - free(wide); - return loc; -} - -#if 0 /* currently unused */ -/* convert multi-byte character string to wide character string */ -zwchar *local_to_wide_string(local_string) - ZCONST char *local_string; -{ - int wsize; - wchar_t *wc_string; - zwchar *wide_string; - - /* for now try to convert as string - fails if a bad char in string */ - wsize = mbstowcs(NULL, local_string, strlen(local_string) + 1); - if (wsize == (size_t)-1) { - /* could not convert */ - return NULL; - } - - /* convert it */ - if ((wc_string = (wchar_t *)malloc((wsize + 1) * sizeof(wchar_t))) == NULL) { - return NULL; - } - wsize = mbstowcs(wc_string, local_string, strlen(local_string) + 1); - wc_string[wsize] = (wchar_t) 0; - - /* in case wchar_t is not zwchar */ - if ((wide_string = (zwchar *)malloc((wsize + 1) * sizeof(zwchar))) == NULL) { - return NULL; - } - for (wsize = 0; wide_string[wsize] = (zwchar)wc_string[wsize]; wsize++) ; - wide_string[wsize] = (zwchar) 0; - free(wc_string); - - return wide_string; -} - - -/* convert wide string to UTF-8 */ -char *wide_to_utf8_string(wide_string) - ZCONST zwchar *wide_string; -{ - int mbcount; - char *utf8_string; - - /* get size of utf8 string */ - mbcount = ucs4_string_to_utf8(wide_string, NULL, 0); - if (mbcount == -1) - return NULL; - if ((utf8_string = (char *) malloc(mbcount + 1)) == NULL) { - return NULL; - } - mbcount = ucs4_string_to_utf8(wide_string, utf8_string, mbcount + 1); - if (mbcount == -1) - return NULL; - - return utf8_string; -} -#endif /* unused */ - -/* convert UTF-8 string to wide string */ -zwchar *utf8_to_wide_string(utf8_string) - ZCONST char *utf8_string; -{ - int wcount; - zwchar *wide_string; - - wcount = utf8_to_ucs4_string(utf8_string, NULL, 0); - if (wcount == -1) - return NULL; - if ((wide_string = (zwchar *) malloc((wcount + 1) * sizeof(zwchar))) - == NULL) { - return NULL; - } - wcount = utf8_to_ucs4_string(utf8_string, wide_string, wcount + 1); - - return wide_string; -} - -#endif /* UNICODE_WCHAR */ -#endif /* UNICODE_SUPPORT */ - - - - - -#ifdef USE_EF_UT_TIME - -#ifdef IZ_HAVE_UXUIDGID -static int read_ux3_value(dbuf, uidgid_sz, p_uidgid) - ZCONST uch *dbuf; /* buffer a uid or gid value */ - unsigned uidgid_sz; /* size of uid/gid value */ - ulg *p_uidgid; /* return storage: uid or gid value */ -{ - zusz_t uidgid64; - - switch (uidgid_sz) { - case 2: - *p_uidgid = (ulg)makeword(dbuf); - break; - case 4: - *p_uidgid = (ulg)makelong(dbuf); - break; - case 8: - uidgid64 = makeint64(dbuf); -#ifndef LARGE_FILE_SUPPORT - if (uidgid64 == (zusz_t)0xffffffffL) - return FALSE; -#endif - *p_uidgid = (ulg)uidgid64; - if ((zusz_t)(*p_uidgid) != uidgid64) - return FALSE; - break; - } - return TRUE; -} -#endif /* IZ_HAVE_UXUIDGID */ - - -/*******************************/ -/* Function ef_scan_for_izux() */ -/*******************************/ - -unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime, - z_utim, z_uidgid) - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ - int ef_is_c; /* flag indicating "is central extra field" */ - ulg dos_mdatetime; /* last_mod_file_date_time in DOS format */ - iztimes *z_utim; /* return storage: atime, mtime, ctime */ - ulg *z_uidgid; /* return storage: uid and gid */ -{ - unsigned flags = 0; - unsigned eb_id; - unsigned eb_len; - int have_new_type_eb = 0; - long i_time; /* buffer for Unix style 32-bit integer time value */ -#ifdef TIME_T_TYPE_DOUBLE - int ut_in_archive_sgn = 0; -#else - int ut_zip_unzip_compatible = FALSE; -#endif - -/*--------------------------------------------------------------------------- - This function scans the extra field for EF_TIME, EF_IZUNIX2, EF_IZUNIX, or - EF_PKUNIX blocks containing Unix-style time_t (GMT) values for the entry's - access, creation, and modification time. - If a valid block is found, the time stamps are copied to the iztimes - structure (provided the z_utim pointer is not NULL). - If a IZUNIX2 block is found or the IZUNIX block contains UID/GID fields, - and the z_uidgid array pointer is valid (!= NULL), the owner info is - transfered as well. - The presence of an EF_TIME or EF_IZUNIX2 block results in ignoring all - data from probably present obsolete EF_IZUNIX blocks. - If multiple blocks of the same type are found, only the information from - the last block is used. - The return value is a combination of the EF_TIME Flags field with an - additional flag bit indicating the presence of valid UID/GID info, - or 0 in case of failure. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL || (z_utim == 0 && z_uidgid == NULL)) - return 0; - - TTrace((stderr,"\nef_scan_for_izux: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - TTrace((stderr, - "ef_scan_for_izux: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_TIME: - flags &= ~0x0ff; /* ignore previous IZUNIX or EF_TIME fields */ - have_new_type_eb = 1; - if ( eb_len >= EB_UT_MINLEN && z_utim != NULL) { - unsigned eb_idx = EB_UT_TIME1; - TTrace((stderr,"ef_scan_for_izux: found TIME extra field\n")); - flags |= (ef_buf[EB_HEADSIZE+EB_UT_FLAGS] & 0x0ff); - if ((flags & EB_UT_FL_MTIME)) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - eb_idx += 4; - TTrace((stderr," UT e.f. modification time = %ld\n", - i_time)); - -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (dos_mdatetime == DOSTIME_MINIMUM) { - ut_in_archive_sgn = -1; - z_utim->mtime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (dos_mdatetime >= DOSTIME_2038_01_18) { - ut_in_archive_sgn = 1; - z_utim->mtime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - ut_in_archive_sgn = 0; - /* cannot determine sign of mtime; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UT modtime range error; ignore e.f.!\n")); - break; /* stop scanning this field */ - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_in_archive_sgn = 0; - z_utim->mtime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - ut_zip_unzip_compatible = - ((time_t)0x80000000L < (time_t)0L) - ? (dos_mdatetime == DOSTIME_MINIMUM) - : (dos_mdatetime >= DOSTIME_2038_01_18); - if (!ut_zip_unzip_compatible) { - /* UnZip interprets mtime differently than Zip; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UT modtime range error; ignore e.f.!\n")); - break; /* stop scanning this field */ - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_zip_unzip_compatible = FALSE; - } - z_utim->mtime = (time_t)i_time; -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_MTIME; - TTrace((stderr," UT e.f. truncated; no modtime\n")); - } - } - if (ef_is_c) { - break; /* central version of TIME field ends here */ - } - - if (flags & EB_UT_FL_ATIME) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - eb_idx += 4; - TTrace((stderr," UT e.f. access time = %ld\n", - i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->atime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->atime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UT access time range error: skip time!\n")); - } - } else { - z_utim->atime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible) { - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UT access time range error: skip time!\n")); - } else { - z_utim->atime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_ATIME; - } - } - if (flags & EB_UT_FL_CTIME) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - TTrace((stderr," UT e.f. creation time = %ld\n", - i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->ctime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->ctime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_CTIME; - TTrace((stderr, - " UT creation time range error: skip time!\n")); - } - } else { - z_utim->ctime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible) { - flags &= ~EB_UT_FL_CTIME; - TTrace((stderr, - " UT creation time range error: skip time!\n")); - } else { - z_utim->ctime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_CTIME; - } - } - } - break; - - case EF_IZUNIX2: - if (have_new_type_eb == 0) { - flags &= ~0x0ff; /* ignore any previous IZUNIX field */ - have_new_type_eb = 1; - } -#ifdef IZ_HAVE_UXUIDGID - if (have_new_type_eb > 1) - break; /* IZUNIX3 overrides IZUNIX2 e.f. block ! */ - if (eb_len == EB_UX2_MINLEN && z_uidgid != NULL) { - z_uidgid[0] = (ulg)makeword((EB_HEADSIZE+EB_UX2_UID) + ef_buf); - z_uidgid[1] = (ulg)makeword((EB_HEADSIZE+EB_UX2_GID) + ef_buf); - flags |= EB_UX2_VALID; /* signal success */ - } -#endif - break; - - case EF_IZUNIX3: - /* new 3rd generation Unix ef */ - have_new_type_eb = 2; - - /* - Version 1 byte version of this extra field, currently 1 - UIDSize 1 byte Size of UID field - UID Variable UID for this entry - GIDSize 1 byte Size of GID field - GID Variable GID for this entry - */ - -#ifdef IZ_HAVE_UXUIDGID - if (eb_len >= EB_UX3_MINLEN - && z_uidgid != NULL - && (*((EB_HEADSIZE + 0) + ef_buf) == 1) - /* only know about version 1 */ - { - uch uid_size; - uch gid_size; - - uid_size = *((EB_HEADSIZE + 1) + ef_buf); - gid_size = *((EB_HEADSIZE + uid_size + 2) + ef_buf); - - flags &= ~0x0ff; /* ignore any previous UNIX field */ - - if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf, - uid_size, z_uidgid[0]) - && - read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf, - gid_size, z_uidgid[1]) ) - { - flags |= EB_UX2_VALID; /* signal success */ - } - } -#endif /* IZ_HAVE_UXUIDGID */ - break; - - case EF_IZUNIX: - case EF_PKUNIX: /* PKUNIX e.f. layout is identical to IZUNIX */ - if (eb_len >= EB_UX_MINLEN) { - TTrace((stderr,"ef_scan_for_izux: found %s extra field\n", - (eb_id == EF_IZUNIX ? "IZUNIX" : "PKUNIX"))); - if (have_new_type_eb > 0) { - break; /* Ignore IZUNIX extra field block ! */ - } - if (z_utim != NULL) { - flags |= (EB_UT_FL_MTIME | EB_UT_FL_ATIME); - i_time = (long)makelong((EB_HEADSIZE+EB_UX_MTIME)+ef_buf); - TTrace((stderr," Unix EF modtime = %ld\n", i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (dos_mdatetime == DOSTIME_MINIMUM) { - ut_in_archive_sgn = -1; - z_utim->mtime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (dos_mdatetime >= DOSTIME_2038_01_18) { - ut_in_archive_sgn = 1; - z_utim->mtime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - ut_in_archive_sgn = 0; - /* cannot determine sign of mtime; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UX modtime range error: ignore e.f.!\n")); - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_in_archive_sgn = 0; - z_utim->mtime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - ut_zip_unzip_compatible = - ((time_t)0x80000000L < (time_t)0L) - ? (dos_mdatetime == DOSTIME_MINIMUM) - : (dos_mdatetime >= DOSTIME_2038_01_18); - if (!ut_zip_unzip_compatible) { - /* UnZip interpretes mtime differently than Zip; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UX modtime range error: ignore e.f.!\n")); - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_zip_unzip_compatible = FALSE; - } - z_utim->mtime = (time_t)i_time; -#endif /* ?TIME_T_TYPE_DOUBLE */ - i_time = (long)makelong((EB_HEADSIZE+EB_UX_ATIME)+ef_buf); - TTrace((stderr," Unix EF actime = %ld\n", i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->atime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->atime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else if (flags & 0x0ff) { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UX access time range error: skip time!\n")); - } - } else { - z_utim->atime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible && (flags & 0x0ff)) { - /* atime not in range of UnZip's time_t */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UX access time range error: skip time!\n")); - } else { - z_utim->atime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } -#ifdef IZ_HAVE_UXUIDGID - if (eb_len >= EB_UX_FULLSIZE && z_uidgid != NULL) { - z_uidgid[0] = makeword((EB_HEADSIZE+EB_UX_UID) + ef_buf); - z_uidgid[1] = makeword((EB_HEADSIZE+EB_UX_GID) + ef_buf); - flags |= EB_UX2_VALID; - } -#endif /* IZ_HAVE_UXUIDGID */ - } - break; - - default: - break; - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return flags; -} - -#endif /* USE_EF_UT_TIME */ - - -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - -#define SPARKID_2 0x30435241 /* = "ARC0" */ - -/*******************************/ -/* Function getRISCOSexfield() */ -/*******************************/ - -zvoid *getRISCOSexfield(ef_buf, ef_len) - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for a Acorn SPARK filetype ef-block. - If a valid block is found, the function returns a pointer to the start - of the SPARK_EF block in the extra field buffer. Otherwise, a NULL - pointer is returned. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL) - return NULL; - - Trace((stderr,"\ngetRISCOSexfield: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getRISCOSexfield: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - if (eb_id == EF_SPARK && (eb_len == 24 || eb_len == 20)) { - if (makelong(EB_HEADSIZE + ef_buf) == SPARKID_2) { - /* Return a pointer to the valid SPARK filetype ef block */ - return (zvoid *)ef_buf; - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return NULL; -} - -#endif /* (RISCOS || ACORN_FTYPE_NFS) */ diff --git a/data/windows/unzipfx-catarina/ttyio.c b/data/windows/unzipfx-catarina/ttyio.c deleted file mode 100644 index a1a13b1..0000000 --- a/data/windows/unzipfx-catarina/ttyio.c +++ /dev/null @@ -1,705 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ttyio.c - - This file contains routines for doing console input/output, including code - for non-echoing input. It is used by the encryption/decryption code but - does not contain any restricted code itself. This file is shared between - Info-ZIP's Zip and UnZip. - - Contains: echo() (VMS only) - Echon() (Unix only) - Echoff() (Unix only) - screensize() (Unix only) - zgetch() (Unix, VMS, and non-Unix/VMS versions) - getp() ("PC," Unix/Atari/Be, VMS/VMCMS/MVS) - - ---------------------------------------------------------------------------*/ - -#define __TTYIO_C /* identifies this source module */ - -#include "zip.h" -#include "crypt.h" - -#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) -/* Non-echo console/keyboard input is needed for (en/de)cryption's password - * entry, and for UnZip(SFX)'s MORE and Pause features. - * (The corresponding #endif is found at the end of this module.) - */ - -#include "ttyio.h" - -#ifndef PUTC -# define PUTC putc -#endif - -#ifdef ZIP -# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -# undef GLOBAL -# endif -# define GLOBAL(g) g -#else -# define GLOBAL(g) G.g -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__)) /* why yes, we do */ -# define HAVE_TERMIOS_H -#endif - -#ifdef _POSIX_VERSION -# ifndef USE_POSIX_TERMIOS -# define USE_POSIX_TERMIOS /* use POSIX style termio (termios) */ -# endif -# ifndef HAVE_TERMIOS_H -# define HAVE_TERMIOS_H /* POSIX termios.h */ -# endif -#endif /* _POSIX_VERSION */ - -#ifdef UNZIP /* Zip handles this with the unix/configure script */ -# ifndef _POSIX_VERSION -# if (defined(SYSV) || defined(CRAY)) && !defined(__MINT__) -# ifndef USE_SYSV_TERMIO -# define USE_SYSV_TERMIO -# endif -# ifdef COHERENT -# ifndef HAVE_TERMIO_H -# define HAVE_TERMIO_H -# endif -# ifdef HAVE_SYS_TERMIO_H -# undef HAVE_SYS_TERMIO_H -# endif -# else /* !COHERENT */ -# ifdef HAVE_TERMIO_H -# undef HAVE_TERMIO_H -# endif -# ifndef HAVE_SYS_TERMIO_H -# define HAVE_SYS_TERMIO_H -# endif -# endif /* ?COHERENT */ -# endif /* (SYSV || CRAY) && !__MINT__ */ -# endif /* !_POSIX_VERSION */ -# if !(defined(BSD4_4) || defined(SYSV) || defined(__convexc__)) -# ifndef NO_FCNTL_H -# define NO_FCNTL_H -# endif -# endif /* !(BSD4_4 || SYSV || __convexc__) */ -#endif /* UNZIP */ - -#ifdef HAVE_TERMIOS_H -# ifndef USE_POSIX_TERMIOS -# define USE_POSIX_TERMIOS -# endif -#endif - -#if (defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H)) -# ifndef USE_SYSV_TERMIO -# define USE_SYSV_TERMIO -# endif -#endif - -#if (defined(UNZIP) && !defined(FUNZIP) && defined(UNIX) && defined(MORE)) -# include -# define GOT_IOCTL_H - /* int ioctl OF((int, int, zvoid *)); GRR: may need for some systems */ -#endif - -#ifndef HAVE_WORKING_GETCH - /* include system support for switching of console echo */ -# ifdef VMS -# include -# include -# include - /* Workaround for broken header files of older DECC distributions - * that are incompatible with the /NAMES=AS_IS qualifier. */ -# define sys$assign SYS$ASSIGN -# define sys$dassgn SYS$DASSGN -# define sys$qiow SYS$QIOW -# include -# include -# else /* !VMS */ -# ifdef HAVE_TERMIOS_H -# include -# define sgttyb termios -# define sg_flags c_lflag -# define GTTY(f, s) tcgetattr(f, (zvoid *) s) -# define STTY(f, s) tcsetattr(f, TCSAFLUSH, (zvoid *) s) -# else /* !HAVE_TERMIOS_H */ -# ifdef USE_SYSV_TERMIO /* Amdahl, Cray, all SysV? */ -# ifdef HAVE_TERMIO_H -# include -# endif -# ifdef HAVE_SYS_TERMIO_H -# include -# endif -# ifdef NEED_PTEM -# include -# include -# endif -# define sgttyb termio -# define sg_flags c_lflag -# define GTTY(f,s) ioctl(f,TCGETA,(zvoid *)s) -# define STTY(f,s) ioctl(f,TCSETAW,(zvoid *)s) -# else /* !USE_SYSV_TERMIO */ -# ifndef CMS_MVS -# if (!defined(MINIX) && !defined(GOT_IOCTL_H)) -# include -# endif -# include -# define GTTY gtty -# define STTY stty -# ifdef UNZIP - /* - * XXX : Are these declarations needed at all ???? - */ - /* - * GRR: let's find out... Hmmm, appears not... - int gtty OF((int, struct sgttyb *)); - int stty OF((int, struct sgttyb *)); - */ -# endif -# endif /* !CMS_MVS */ -# endif /* ?USE_SYSV_TERMIO */ -# endif /* ?HAVE_TERMIOS_H */ -# ifndef NO_FCNTL_H -# ifndef UNZIP -# include -# endif -# else - char *ttyname OF((int)); -# endif -# endif /* ?VMS */ -#endif /* !HAVE_WORKING_GETCH */ - - - -#ifndef HAVE_WORKING_GETCH -#ifdef VMS - -static struct dsc$descriptor_s DevDesc = - {11, DSC$K_DTYPE_T, DSC$K_CLASS_S, "SYS$COMMAND"}; - /* {dsc$w_length, dsc$b_dtype, dsc$b_class, dsc$a_pointer}; */ - -/* - * Turn keyboard echoing on or off (VMS). Loosely based on VMSmunch.c - * and hence on Joe Meadows' file.c code. - */ -int echo(opt) - int opt; -{ - /* - * For VMS v5.x: - * IO$_SENSEMODE/SETMODE info: Programming, Vol. 7A, System Programming, - * I/O User's: Part I, sec. 8.4.1.1, 8.4.3, 8.4.5, 8.6 - * sys$assign(), sys$qio() info: Programming, Vol. 4B, System Services, - * System Services Reference Manual, pp. sys-23, sys-379 - * fixed-length descriptor info: Programming, Vol. 3, System Services, - * Intro to System Routines, sec. 2.9.2 - * Greg Roelofs, 15 Aug 91 - */ - - short DevChan, iosb[4]; - long status; - unsigned long ttmode[2]; /* space for 8 bytes */ - - - /* assign a channel to standard input */ - status = sys$assign(&DevDesc, &DevChan, 0, 0); - if (!(status & 1)) - return status; - - /* use sys$qio and the IO$_SENSEMODE function to determine the current - * tty status (for password reading, could use IO$_READVBLK function - * instead, but echo on/off will be more general) - */ - status = sys$qiow(0, DevChan, IO$_SENSEMODE, &iosb, 0, 0, - ttmode, 8, 0, 0, 0, 0); - if (!(status & 1)) - return status; - status = iosb[0]; - if (!(status & 1)) - return status; - - /* modify mode buffer to be either NOECHO or ECHO - * (depending on function argument opt) - */ - if (opt == 0) /* off */ - ttmode[1] |= TT$M_NOECHO; /* set NOECHO bit */ - else - ttmode[1] &= ~((unsigned long) TT$M_NOECHO); /* clear NOECHO bit */ - - /* use the IO$_SETMODE function to change the tty status */ - status = sys$qiow(0, DevChan, IO$_SETMODE, &iosb, 0, 0, - ttmode, 8, 0, 0, 0, 0); - if (!(status & 1)) - return status; - status = iosb[0]; - if (!(status & 1)) - return status; - - /* deassign the sys$input channel by way of clean-up */ - status = sys$dassgn(DevChan); - if (!(status & 1)) - return status; - - return SS$_NORMAL; /* we be happy */ - -} /* end function echo() */ - - -/* - * Read a single character from keyboard in non-echoing mode (VMS). - * (returns EOF in case of errors) - */ -int tt_getch() -{ - short DevChan, iosb[4]; - long status; - char kbbuf[16]; /* input buffer with - some - excess length */ - - /* assign a channel to standard input */ - status = sys$assign(&DevDesc, &DevChan, 0, 0); - if (!(status & 1)) - return EOF; - - /* read a single character from SYS$COMMAND (no-echo) and - * wait for completion - */ - status = sys$qiow(0,DevChan, - IO$_READVBLK|IO$M_NOECHO|IO$M_NOFILTR, - &iosb, 0, 0, - &kbbuf, 1, 0, 0, 0, 0); - if ((status&1) == 1) - status = iosb[0]; - - /* deassign the sys$input channel by way of clean-up - * (for this step, we do not need to check the completion status) - */ - sys$dassgn(DevChan); - - /* return the first char read, or EOF in case the read request failed */ - return (int)(((status&1) == 1) ? (uch)kbbuf[0] : EOF); - -} /* end function tt_getch() */ - - -#else /* !VMS: basically Unix */ - - -/* For VM/CMS and MVS, non-echo terminal input is not (yet?) supported. */ -#ifndef CMS_MVS - -#ifdef ZIP /* moved to globals.h for UnZip */ - static int echofd=(-1); /* file descriptor whose echo is off */ -#endif - -/* - * Turn echo off for file descriptor f. Assumes that f is a tty device. - */ -void Echoff(__G__ f) - __GDEF - int f; /* file descriptor for which to turn echo off */ -{ - struct sgttyb sg; /* tty device structure */ - - GLOBAL(echofd) = f; - GTTY(f, &sg); /* get settings */ - sg.sg_flags &= ~ECHO; /* turn echo off */ - STTY(f, &sg); -} - -/* - * Turn echo back on for file descriptor echofd. - */ -void Echon(__G) - __GDEF -{ - struct sgttyb sg; /* tty device structure */ - - if (GLOBAL(echofd) != -1) { - GTTY(GLOBAL(echofd), &sg); /* get settings */ - sg.sg_flags |= ECHO; /* turn echo on */ - STTY(GLOBAL(echofd), &sg); - GLOBAL(echofd) = -1; - } -} - -#endif /* !CMS_MVS */ -#endif /* ?VMS */ - - -#if (defined(UNZIP) && !defined(FUNZIP)) - -#ifdef ATH_BEO_UNX -#ifdef MORE - -/* - * Get the number of lines on the output terminal. SCO Unix apparently - * defines TIOCGWINSZ but doesn't support it (!M_UNIX). - * - * GRR: will need to know width of terminal someday, too, to account for - * line-wrapping. - */ - -#if (defined(TIOCGWINSZ) && !defined(M_UNIX)) - -int screensize(tt_rows, tt_cols) - int *tt_rows; - int *tt_cols; -{ - struct winsize wsz; -#ifdef DEBUG_WINSZ - static int firsttime = TRUE; -#endif - - /* see termio(4) under, e.g., SunOS */ - if (ioctl(1, TIOCGWINSZ, &wsz) == 0) { -#ifdef DEBUG_WINSZ - if (firsttime) { - firsttime = FALSE; - fprintf(stderr, "ttyio.c screensize(): ws_row = %d\n", - wsz.ws_row); - fprintf(stderr, "ttyio.c screensize(): ws_col = %d\n", - wsz.ws_col); - } -#endif - /* number of rows */ - if (tt_rows != NULL) - *tt_rows = (int)((wsz.ws_row > 0) ? wsz.ws_row : 24); - /* number of columns */ - if (tt_cols != NULL) - *tt_cols = (int)((wsz.ws_col > 0) ? wsz.ws_col : 80); - return 0; /* signal success */ - } else { /* this happens when piping to more(1), for example */ -#ifdef DEBUG_WINSZ - if (firsttime) { - firsttime = FALSE; - fprintf(stderr, - "ttyio.c screensize(): ioctl(TIOCGWINSZ) failed\n")); - } -#endif - /* VT-100 assumed to be minimal hardware */ - if (tt_rows != NULL) - *tt_rows = 24; - if (tt_cols != NULL) - *tt_cols = 80; - return 1; /* signal failure */ - } -} - -#else /* !TIOCGWINSZ: service not available, fall back to semi-bogus method */ - -int screensize(tt_rows, tt_cols) - int *tt_rows; - int *tt_cols; -{ - char *envptr, *getenv(); - int n; - int errstat = 0; - - /* GRR: this is overly simplistic, but don't have access to stty/gtty - * system anymore - */ - if (tt_rows != NULL) { - envptr = getenv("LINES"); - if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { - /* VT-100 assumed to be minimal hardware */ - *tt_rows = 24; - errstat = 1; /* signal failure */ - } else { - *tt_rows = n; - } - } - if (tt_cols != NULL) { - envptr = getenv("COLUMNS"); - if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { - *tt_cols = 80; - errstat = 1; /* signal failure */ - } else { - *tt_cols = n; - } - } - return errstat; -} - -#endif /* ?(TIOCGWINSZ && !M_UNIX) */ -#endif /* MORE */ - - -/* - * Get a character from the given file descriptor without echo or newline. - */ -int zgetch(__G__ f) - __GDEF - int f; /* file descriptor from which to read */ -{ -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - char oldmin, oldtim; -#endif - char c; - struct sgttyb sg; /* tty device structure */ - - GTTY(f, &sg); /* get settings */ -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - oldmin = sg.c_cc[VMIN]; /* save old values */ - oldtim = sg.c_cc[VTIME]; - sg.c_cc[VMIN] = 1; /* need only one char to return read() */ - sg.c_cc[VTIME] = 0; /* no timeout */ - sg.sg_flags &= ~ICANON; /* canonical mode off */ -#else - sg.sg_flags |= CBREAK; /* cbreak mode on */ -#endif - sg.sg_flags &= ~ECHO; /* turn echo off, too */ - STTY(f, &sg); /* set cbreak mode */ - GLOBAL(echofd) = f; /* in case ^C hit (not perfect: still CBREAK) */ - - read(f, &c, 1); /* read our character */ - -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - sg.c_cc[VMIN] = oldmin; /* restore old values */ - sg.c_cc[VTIME] = oldtim; - sg.sg_flags |= ICANON; /* canonical mode on */ -#else - sg.sg_flags &= ~CBREAK; /* cbreak mode off */ -#endif - sg.sg_flags |= ECHO; /* turn echo on */ - STTY(f, &sg); /* restore canonical mode */ - GLOBAL(echofd) = -1; - - return (int)(uch)c; -} - - -#else /* !ATH_BEO_UNX */ -#ifndef VMS /* VMS supplies its own variant of getch() */ - - -int zgetch(__G__ f) - __GDEF - int f; /* file descriptor from which to read (must be open already) */ -{ - char c, c2; - -/*--------------------------------------------------------------------------- - Get a character from the given file descriptor without echo; can't fake - CBREAK mode (i.e., newline required), but can get rid of all chars up to - and including newline. - ---------------------------------------------------------------------------*/ - - echoff(f); - read(f, &c, 1); - if (c != '\n') - do { - read(f, &c2, 1); /* throw away all other chars up thru newline */ - } while (c2 != '\n'); - echon(); - return (int)c; -} - -#endif /* !VMS */ -#endif /* ?ATH_BEO_UNX */ - -#endif /* UNZIP && !FUNZIP */ -#endif /* !HAVE_WORKING_GETCH */ - - -#if CRYPT /* getp() is only used with full encryption */ - -/* - * Simple compile-time check for source compatibility between - * zcrypt and ttyio: - */ -#if (!defined(CR_MAJORVER) || (CR_MAJORVER < 2) || (CR_MINORVER < 7)) - error: This Info-ZIP tool requires zcrypt 2.7 or later. -#endif - -/* - * Get a password of length n-1 or less into *p using the prompt *m. - * The entered password is not echoed. - */ - -#ifdef HAVE_WORKING_GETCH -/* - * For the AMIGA, getch() is defined as Agetch(), which is in - * amiga/filedate.c; SAS/C 6.x provides a getch(), but since Agetch() - * uses the infrastructure that is already in place in filedate.c, it is - * smaller. With this function, echoff() and echon() are not needed. - * - * For the MAC, a non-echo macgetch() function is defined in the MacOS - * specific sources which uses the event handling mechanism of the - * desktop window manager to get a character from the keyboard. - * - * For the other systems in this section, a non-echo getch() function - * is either contained the C runtime library (conio package), or getch() - * is defined as an alias for a similar system specific RTL function. - */ - -#ifndef WINDLL /* WINDLL does not support a console interface */ -#ifndef QDOS /* QDOS supplies a variant of this function */ - -/* This is the getp() function for all systems (with TTY type user interface) - * that supply a working `non-echo' getch() function for "raw" console input. - */ -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - - /* get password */ - w = ""; - do { - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* display prompt and flush */ - fflush(stderr); - i = 0; - do { /* read line, keeping first n characters */ - if ((c = (char)getch()) == '\r') - c = '\n'; /* until user hits CR */ - if (c == 8 || c == 127) { - if (i > 0) i--; /* the `backspace' and `del' keys works */ - } - else if (i < n) - p[i++] = c; /* truncate past n */ - } while (c != '\n'); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* !QDOS */ -#endif /* !WINDLL */ - - -#else /* !HAVE_WORKING_GETCH */ - - -#if (defined(ATH_BEO_UNX) || defined(__MINT__)) - -#ifndef _PATH_TTY -# ifdef __MINT__ -# define _PATH_TTY ttyname(2) -# else -# define _PATH_TTY "/dev/tty" -# endif -#endif - -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - int f; /* file descriptor for tty device */ - -#ifdef PASSWD_FROM_STDIN - /* Read from stdin. This is unsafe if the password is stored on disk. */ - f = 0; -#else - /* turn off echo on tty */ - - if ((f = open(_PATH_TTY, 0)) == -1) - return NULL; -#endif - /* get password */ - w = ""; - do { - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* prompt */ - fflush(stderr); - i = 0; - echoff(f); - do { /* read line, keeping n */ - read(f, &c, 1); - if (i < n) - p[i++] = c; - } while (c != '\n'); - echon(); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ - -#ifndef PASSWD_FROM_STDIN - close(f); -#endif - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* ATH_BEO_UNX || __MINT__ */ - - - -#if (defined(VMS) || defined(CMS_MVS)) - -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - FILE *f; /* file structure for SYS$COMMAND device */ - -#ifdef PASSWD_FROM_STDIN - f = stdin; -#else - if ((f = fopen(ctermid(NULL), "r")) == NULL) - return NULL; -#endif - - /* get password */ - fflush(stdout); - w = ""; - do { - if (*w) /* bug: VMS apparently adds \n to NULL fputs */ - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* prompt */ - fflush(stderr); - i = 0; - echoff(f); - do { /* read line, keeping n */ - if ((c = (char)getc(f)) == '\r') - c = '\n'; - if (i < n) - p[i++] = c; - } while (c != '\n'); - echon(); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ -#ifndef PASSWD_FROM_STDIN - fclose(f); -#endif - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* VMS || CMS_MVS */ -#endif /* ?HAVE_WORKING_GETCH */ -#endif /* CRYPT */ -#endif /* CRYPT || (UNZIP && !FUNZIP) */ diff --git a/data/windows/unzipfx-catarina/ttyio.h b/data/windows/unzipfx-catarina/ttyio.h deleted file mode 100644 index 43f004f..0000000 --- a/data/windows/unzipfx-catarina/ttyio.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - Copyright (c) 1990-2004 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - ttyio.h - */ - -#ifndef __ttyio_h /* don't include more than once */ -#define __ttyio_h - -#ifndef __crypt_h -# include "crypt.h" /* ensure that encryption header file has been seen */ -#endif - -#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) -/* - * Non-echo keyboard/console input support is needed and enabled. - */ - -#ifndef __G /* UnZip only, for now (DLL stuff) */ -# define __G -# define __G__ -# define __GDEF -# define __GPRO void -# define __GPRO__ -#endif - -#ifndef ZCONST /* UnZip only (until have configure script like Zip) */ -# define ZCONST const -#endif - -#if (defined(MSDOS) || defined(OS2) || defined(WIN32)) -# ifndef DOS_OS2_W32 -# define DOS_OS2_W32 -# endif -#endif - -#if (defined(DOS_OS2_W32) || defined(__human68k__)) -# ifndef DOS_H68_OS2_W32 -# define DOS_H68_OS2_W32 -# endif -#endif - -#if (defined(DOS_OS2_W32) || defined(FLEXOS)) -# ifndef DOS_FLX_OS2_W32 -# define DOS_FLX_OS2_W32 -# endif -#endif - -#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) -# ifndef DOS_FLX_H68_OS2_W32 -# define DOS_FLX_H68_OS2_W32 -# endif -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) -# ifndef ATH_BEO_UNX -# define ATH_BEO_UNX -# endif -#endif - -#if (defined(VM_CMS) || defined(MVS)) -# ifndef CMS_MVS -# define CMS_MVS -# endif -#endif - - -/* Function prototypes */ - -/* The following systems supply a `non-echo' character input function "getch()" - * (or an alias) and do not need the echoff() / echon() function pair. - */ -#ifdef AMIGA -# define echoff(f) -# define echon() -# define getch() Agetch() -# define HAVE_WORKING_GETCH -#endif /* AMIGA */ - -#ifdef ATARI -# define echoff(f) -# define echon() -# include -# define getch() (Cnecin() & 0x000000ff) -# define HAVE_WORKING_GETCH -#endif - -#ifdef MACOS -# define echoff(f) -# define echon() -# define getch() macgetch() -# define HAVE_WORKING_GETCH -#endif - -#ifdef NLM -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -#ifdef QDOS -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -#ifdef RISCOS -# define echoff(f) -# define echon() -# define getch() SWI_OS_ReadC() -# define HAVE_WORKING_GETCH -#endif - -#ifdef DOS_H68_OS2_W32 -# define echoff(f) -# define echon() -# ifdef WIN32 -# ifndef getch -# define getch() getch_win32() -# endif -# else /* !WIN32 */ -# ifdef __EMX__ -# ifndef getch -# define getch() _read_kbd(0, 1, 0) -# endif -# else /* !__EMX__ */ -# ifdef __GO32__ -# include -# define getch() getkey() -# else /* !__GO32__ */ -# include -# endif /* ?__GO32__ */ -# endif /* ?__EMX__ */ -# endif /* ?WIN32 */ -# define HAVE_WORKING_GETCH -#endif /* DOS_H68_OS2_W32 */ - -#ifdef FLEXOS -# define echoff(f) -# define echon() -# define getch() getchar() /* not correct, but may not be on a console */ -# define HAVE_WORKING_GETCH -#endif - -/* For VM/CMS and MVS, we do not (yet) have any support to switch terminal - * input echo on and off. The following "fake" definitions allow inclusion - * of crypt support and UnZip's "pause prompting" features, but without - * any echo suppression. - */ -#ifdef CMS_MVS -# define echoff(f) -# define echon() -#endif - -#ifdef TANDEM -# define echoff(f) -# define echon() -# define getch() zgetch() /* defined in TANDEMC */ -# define HAVE_WORKING_GETCH -#endif - -/* The THEOS C runtime library supplies the function conmask() to toggle - * terminal input echo on (conmask("e")) and off (conmask("n")). But, - * since THEOS C RTL also contains a working non-echo getch() function, - * the echo toggles are not needed. - */ -#ifdef THEOS -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -/* VMS has a single echo() function in ttyio.c to toggle terminal - * input echo on and off. - */ -#ifdef VMS -# define echoff(f) echo(0) -# define echon() echo(1) -# define getch() tt_getch() -# define FGETCH(f) tt_getch() - int echo OF((int)); - int tt_getch OF((void)); -#endif - -/* For all other systems, ttyio.c supplies the two functions Echoff() and - * Echon() for suppressing and (re)enabling console input echo. - */ -#ifndef echoff -# define echoff(f) Echoff(__G__ f) -# define echon() Echon(__G) - void Echoff OF((__GPRO__ int f)); - void Echon OF((__GPRO)); -#endif - -/* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */ -#if (defined(UNZIP) && !defined(FUNZIP)) -# ifdef HAVE_WORKING_GETCH -# define FGETCH(f) getch() -# endif -# ifndef FGETCH - /* default for all systems where no getch()-like function is available */ - int zgetch OF((__GPRO__ int f)); -# define FGETCH(f) zgetch(__G__ f) -# endif -#endif /* UNZIP && !FUNZIP */ - -#if (CRYPT && !defined(WINDLL)) - char *getp OF((__GPRO__ ZCONST char *m, char *p, int n)); -#endif - -#else /* !(CRYPT || (UNZIP && !FUNZIP)) */ - -/* - * No need for non-echo keyboard/console input; provide dummy definitions. - */ -#define echoff(f) -#define echon() - -#endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */ - -#endif /* !__ttyio_h */ diff --git a/data/windows/unzipfx-catarina/ubz2err.c b/data/windows/unzipfx-catarina/ubz2err.c deleted file mode 100644 index f384489..0000000 --- a/data/windows/unzipfx-catarina/ubz2err.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ubz2err.c - - This file contains the "fatal error" callback routine required by the - "minimal" (silent, non-stdio) setup of the bzip2 compression library. - - The fatal bzip2 error bail-out routine is provided in a separate code - module, so that it can be easily overridden when the UnZip package is - used as a static link library. One example is the WinDLL static library - usage for building a monolythic binary of the Windows application "WiZ" - that supports bzip2 both in compression and decompression operations. - - Contains: bz_internal_error() (USE_BZIP2 only) - - ---------------------------------------------------------------------------*/ - - -#define __UBZ2ERR_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif - -#ifdef USE_BZIP2 - -/**********************************/ -/* Function bz_internal_error() */ -/**********************************/ - -/* Call-back function for the bzip2 decompression code (compiled with - * BZ_NO_STDIO), required to handle fatal internal bug-type errors of - * the bzip2 library. - */ -void bz_internal_error(bzerrcode) - int bzerrcode; -{ - GETGLOBALS(); - - Info(slide, 0x421, ((char *)slide, - "error: internal fatal libbzip2 error number %d\n", bzerrcode)); -#ifdef WINDLL - longjmp(dll_error_return, 1); -#else - DESTROYGLOBALS(); - EXIT(PK_BADERR); -#endif -} /* end function bz_internal_error() */ - -#endif /* USE_BZIP2 */ diff --git a/data/windows/unzipfx-catarina/unix/unix.c b/data/windows/unzipfx-catarina/unix/unix.c deleted file mode 100644 index efa97fc..0000000 --- a/data/windows/unzipfx-catarina/unix/unix.c +++ /dev/null @@ -1,1876 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unix.c - - Unix-specific routines for use with Info-ZIP's UnZip 5.41 and later. - - Contains: readdir() - do_wild() <-- generic enough to put in fileio.c? - mapattr() - mapname() - checkdir() - mkdir() - close_outfile() - defer_dir_attribs() - set_direc_attribs() - stamp_file() - version() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifdef SCO_XENIX -# define SYSNDIR -#else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */ -# if defined(__convexc__) || defined(SYSV) || defined(CRAY) || defined(BSD4_4) -# define DIRENT -# endif -#endif -#if defined(_AIX) || defined(__mpexl) -# define DIRENT -#endif -#ifdef COHERENT -# if defined(_I386) || (defined(__COHERENT__) && (__COHERENT__ >= 0x420)) -# define DIRENT -# endif -#endif - -#ifdef _POSIX_VERSION -# ifndef DIRENT -# define DIRENT -# endif -#endif - -#ifdef DIRENT -# include -#else -# ifdef SYSV -# ifdef SYSNDIR -# include -# else -# include -# endif -# else /* !SYSV */ -# ifndef NO_SYSDIR -# include -# endif -# endif /* ?SYSV */ -# ifndef dirent -# define dirent direct -# endif -#endif /* ?DIRENT */ - -#ifdef SET_DIR_ATTRIB -typedef struct uxdirattr { /* struct for holding unix style directory */ - struct uxdirattr *next; /* info until can be sorted and set at end */ - char *fn; /* filename of directory */ - union { - iztimes t3; /* mtime, atime, ctime */ - ztimbuf t2; /* modtime, actime */ - } u; - unsigned perms; /* same as min_info.file_attr */ - int have_uidgid; /* flag */ - ulg uidgid[2]; - char fnbuf[1]; /* buffer stub for directory name */ -} uxdirattr; -#define UxAtt(d) ((uxdirattr *)d) /* typecast shortcut */ -#endif /* SET_DIR_ATTRIB */ - -#ifdef ACORN_FTYPE_NFS -/* Acorn bits for NFS filetyping */ -typedef struct { - uch ID[2]; - uch size[2]; - uch ID_2[4]; - uch loadaddr[4]; - uch execaddr[4]; - uch attr[4]; -} RO_extra_block; - -#endif /* ACORN_FTYPE_NFS */ - -/* static int created_dir; */ /* used in mapname(), checkdir() */ -/* static int renamed_fullpath; */ /* ditto */ - -static unsigned filtattr OF((__GPRO__ unsigned perms)); - - -/*****************************/ -/* Strings used multiple */ -/* times in unix.c */ -/*****************************/ - -#ifndef MTS -/* messages of code for setting file/directory attributes */ -static ZCONST char CannotSetItemUidGid[] = - "warning: cannot set UID %lu and/or GID %lu for %s\n %s\n"; -static ZCONST char CannotSetUidGid[] = - " (warning) cannot set UID %lu and/or GID %lu\n %s"; -static ZCONST char CannotSetItemTimestamps[] = - "warning: cannot set modif./access times for %s\n %s\n"; -static ZCONST char CannotSetTimestamps[] = - " (warning) cannot set modif./access times\n %s"; -#endif /* !MTS */ - - -#ifndef SFX -#ifdef NO_DIR /* for AT&T 3B1 */ - -#define opendir(path) fopen(path,"r") -#define closedir(dir) fclose(dir) -typedef FILE DIR; -typedef struct zdir { - FILE *dirhandle; - struct dirent *entry; -} DIR -DIR *opendir OF((ZCONST char *dirspec)); -void closedir OF((DIR *dirp)); -struct dirent *readdir OF((DIR *dirp)); - -DIR *opendir(dirspec) - ZCONST char *dirspec; -{ - DIR *dirp; - - if ((dirp = malloc(sizeof(DIR)) != NULL) { - if ((dirp->dirhandle = fopen(dirspec, "r")) == NULL) { - free(dirp); - dirp = NULL; - } - } - return dirp; -} - -void closedir(dirp) - DIR *dirp; -{ - fclose(dirp->dirhandle); - free(dirp); -} - -/* - * Apparently originally by Rich Salz. - * Cleaned up and modified by James W. Birdsall. - */ -struct dirent *readdir(dirp) - DIR *dirp; -{ - - if (dirp == NULL) - return NULL; - - for (;;) - if (fread(&(dirp->entry), sizeof (struct dirent), 1, - dirp->dirhandle) == 0) - return (struct dirent *)NULL; - else if ((dirp->entry).d_ino) - return &(dirp->entry); - -} /* end function readdir() */ - -#endif /* NO_DIR */ - - -/**********************/ -/* Function do_wild() */ /* for porting: dir separator; match(ignore_case) */ -/**********************/ - -char *do_wild(__G__ wildspec) - __GDEF - ZCONST char *wildspec; /* only used first time on a given dir */ -{ -/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in unxcfg.h: - static DIR *wild_dir = (DIR *)NULL; - static ZCONST char *wildname; - static char *dirname, matchname[FILNAMSIZ]; - static int notfirstcall=FALSE, have_dirname, dirnamelen; -*/ - struct dirent *file; - - /* Even when we're just returning wildspec, we *always* do so in - * matchname[]--calling routine is allowed to append four characters - * to the returned string, and wildspec may be a pointer to argv[]. - */ - if (!G.notfirstcall) { /* first call: must initialize everything */ - G.notfirstcall = TRUE; - - if (!iswild(wildspec)) { - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - G.have_dirname = FALSE; - G.wild_dir = NULL; - return G.matchname; - } - - /* break the wildspec into a directory part and a wildcard filename */ - if ((G.wildname = (ZCONST char *)strrchr(wildspec, '/')) == NULL) { - G.dirname = "."; - G.dirnamelen = 1; - G.have_dirname = FALSE; - G.wildname = wildspec; - } else { - ++G.wildname; /* point at character after '/' */ - G.dirnamelen = G.wildname - wildspec; - if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == (char *)NULL) { - Info(slide, 0x201, ((char *)slide, - "warning: cannot allocate wildcard buffers\n")); - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; /* but maybe filespec was not a wildcard */ - } - strncpy(G.dirname, wildspec, G.dirnamelen); - G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ - G.have_dirname = TRUE; - } - - if ((G.wild_dir = (zvoid *)opendir(G.dirname)) != (zvoid *)NULL) { - while ((file = readdir((DIR *)G.wild_dir)) != - (struct dirent *)NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - if (file->d_name[0] == '.' && G.wildname[0] != '.') - continue; /* Unix: '*' and '?' do not match leading dot */ - if (match(file->d_name, G.wildname, 0 WISEP) &&/*0=case sens.*/ - /* skip "." and ".." directory entries */ - strcmp(file->d_name, ".") && strcmp(file->d_name, "..")) { - Trace((stderr, "do_wild: match() succeeds\n")); - if (G.have_dirname) { - strcpy(G.matchname, G.dirname); - strcpy(G.matchname+G.dirnamelen, file->d_name); - } else - strcpy(G.matchname, file->d_name); - return G.matchname; - } - } - /* if we get to here directory is exhausted, so close it */ - closedir((DIR *)G.wild_dir); - G.wild_dir = (zvoid *)NULL; - } - Trace((stderr, "do_wild: opendir(%s) returns NULL\n", - FnFilter1(G.dirname))); - - /* return the raw wildspec in case that works (e.g., directory not - * searchable, but filespec was not wild and file is readable) */ - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; - } - - /* last time through, might have failed opendir but returned raw wildspec */ - if ((DIR *)G.wild_dir == (DIR *)NULL) { - G.notfirstcall = FALSE; /* nothing left--reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - } - - /* If we've gotten this far, we've read and matched at least one entry - * successfully (in a previous call), so dirname has been copied into - * matchname already. - */ - while ((file = readdir((DIR *)G.wild_dir)) != (struct dirent *)NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - if (file->d_name[0] == '.' && G.wildname[0] != '.') - continue; /* Unix: '*' and '?' do not match leading dot */ - if (match(file->d_name, G.wildname, 0 WISEP)) { /* 0 == case sens. */ - Trace((stderr, "do_wild: match() succeeds\n")); - if (G.have_dirname) { - /* strcpy(G.matchname, G.dirname); */ - strcpy(G.matchname+G.dirnamelen, file->d_name); - } else - strcpy(G.matchname, file->d_name); - return G.matchname; - } - } - - closedir((DIR *)G.wild_dir); /* at least one entry read; nothing left */ - G.wild_dir = (zvoid *)NULL; - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - -} /* end function do_wild() */ - -#endif /* !SFX */ - - - - -#ifndef S_ISUID -# define S_ISUID 0004000 /* set user id on execution */ -#endif -#ifndef S_ISGID -# define S_ISGID 0002000 /* set group id on execution */ -#endif -#ifndef S_ISVTX -# define S_ISVTX 0001000 /* save swapped text even after use */ -#endif - -/************************/ -/* Function filtattr() */ -/************************/ -/* This is used to clear or keep the SUID and SGID bits on file permissions. - * It's possible that a file in an archive could have one of these bits set - * and, unknown to the person unzipping, could allow others to execute the - * file as the user or group. The new option -K bypasses this check. - */ - -static unsigned filtattr(__G__ perms) - __GDEF - unsigned perms; -{ - /* keep setuid/setgid/tacky perms? */ - if (!uO.K_flag) - perms &= ~(S_ISUID | S_ISGID | S_ISVTX); - - return (0xffff & perms); -} /* end function filtattr() */ - - - - - -/**********************/ -/* Function mapattr() */ -/**********************/ - -int mapattr(__G) - __GDEF -{ - int r; - ulg tmp = G.crec.external_file_attributes; - - G.pInfo->file_attr = 0; - /* initialized to 0 for check in "default" branch below... */ - - switch (G.pInfo->hostnum) { - case AMIGA_: - tmp = (unsigned)(tmp>>17 & 7); /* Amiga RWE bits */ - G.pInfo->file_attr = (unsigned)(tmp<<6 | tmp<<3 | tmp); - break; - case THEOS_: - tmp &= 0xF1FFFFFFL; - if ((tmp & 0xF0000000L) != 0x40000000L) - tmp &= 0x01FFFFFFL; /* not a dir, mask all ftype bits */ - else - tmp &= 0x41FFFFFFL; /* leave directory bit as set */ - /* fall through! */ - case UNIX_: - case VMS_: - case ACORN_: - case ATARI_: - case ATHEOS_: - case BEOS_: - case QDOS_: - case TANDEM_: - r = FALSE; - G.pInfo->file_attr = (unsigned)(tmp >> 16); - if (G.pInfo->file_attr == 0 && G.extra_field) { - /* Some (non-Info-ZIP) implementations of Zip for Unix and - * VMS (and probably others ??) leave 0 in the upper 16-bit - * part of the external_file_attributes field. Instead, they - * store file permission attributes in some extra field. - * As a work-around, we search for the presence of one of - * these extra fields and fall back to the MSDOS compatible - * part of external_file_attributes if one of the known - * e.f. types has been detected. - * Later, we might implement extraction of the permission - * bits from the VMS extra field. But for now, the work-around - * should be sufficient to provide "readable" extracted files. - * (For ASI Unix e.f., an experimental remap of the e.f. - * mode value IS already provided!) - */ - ush ebID; - unsigned ebLen; - uch *ef = G.extra_field; - unsigned ef_len = G.crec.extra_field_length; - - while (!r && ef_len >= EB_HEADSIZE) { - ebID = makeword(ef); - ebLen = (unsigned)makeword(ef+EB_LEN); - if (ebLen > (ef_len - EB_HEADSIZE)) - /* discoverd some e.f. inconsistency! */ - break; - switch (ebID) { - case EF_ASIUNIX: - if (ebLen >= (EB_ASI_MODE+2)) { - G.pInfo->file_attr = - (unsigned)makeword(ef+(EB_HEADSIZE+EB_ASI_MODE)); - /* force stop of loop: */ - ef_len = (ebLen + EB_HEADSIZE); - break; - } - /* else: fall through! */ - case EF_PKVMS: - /* "found nondecypherable e.f. with perm. attr" */ - r = TRUE; - default: - break; - } - ef_len -= (ebLen + EB_HEADSIZE); - ef += (ebLen + EB_HEADSIZE); - } - } - if (!r) { -#ifdef SYMLINKS - /* Check if the file is a (POSIX-compatible) symbolic link. - * We restrict symlink support to those "made-by" hosts that - * are known to support symbolic links. - */ - G.pInfo->symlink = S_ISLNK(G.pInfo->file_attr) && - SYMLINK_HOST(G.pInfo->hostnum); -#endif - return 0; - } - /* fall through! */ - /* all remaining cases: expand MSDOS read-only bit into write perms */ - case FS_FAT_: - /* PKWARE's PKZip for Unix marks entries as FS_FAT_, but stores the - * Unix attributes in the upper 16 bits of the external attributes - * field, just like Info-ZIP's Zip for Unix. We try to use that - * value, after a check for consistency with the MSDOS attribute - * bits (see below). - */ - G.pInfo->file_attr = (unsigned)(tmp >> 16); - /* fall through! */ - case FS_HPFS_: - case FS_NTFS_: - case MAC_: - case TOPS20_: - default: - /* Ensure that DOS subdir bit is set when the entry's name ends - * in a '/'. Some third-party Zip programs fail to set the subdir - * bit for directory entries. - */ - if ((tmp & 0x10) == 0) { - extent fnlen = strlen(G.filename); - if (fnlen > 0 && G.filename[fnlen-1] == '/') - tmp |= 0x10; - } - /* read-only bit --> write perms; subdir bit --> dir exec bit */ - tmp = !(tmp & 1) << 1 | (tmp & 0x10) >> 4; - if ((G.pInfo->file_attr & 0700) == (unsigned)(0400 | tmp<<6)) { - /* keep previous G.pInfo->file_attr setting, when its "owner" - * part appears to be consistent with DOS attribute flags! - */ -#ifdef SYMLINKS - /* Entries "made by FS_FAT_" could have been zipped on a - * system that supports POSIX-style symbolic links. - */ - G.pInfo->symlink = S_ISLNK(G.pInfo->file_attr) && - (G.pInfo->hostnum == FS_FAT_); -#endif - return 0; - } - G.pInfo->file_attr = (unsigned)(0444 | tmp<<6 | tmp<<3 | tmp); - break; - } /* end switch (host-OS-created-by) */ - - /* for originating systems with no concept of "group," "other," "system": */ - umask( (int)(tmp=umask(0)) ); /* apply mask to expanded r/w(/x) perms */ - G.pInfo->file_attr &= ~tmp; - - return 0; - -} /* end function mapattr() */ - - - - - -/************************/ -/* Function mapname() */ -/************************/ - -int mapname(__G__ renamed) - __GDEF - int renamed; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - caution (truncated filename) - * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) - * MPN_ERR_SKIP - error -> skip entry - * MPN_ERR_TOOLONG - error -> path is too long - * MPN_NOMEM - error (memory allocation failed) -> skip entry - * [also MPN_VOL_LABEL, MPN_CREATED_DIR] - */ -{ - char pathcomp[FILNAMSIZ]; /* path-component buffer */ - char *pp, *cp=(char *)NULL; /* character pointers */ - char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ -#ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ - RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ -#endif - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ - int error = MPN_OK; - register unsigned workch; /* hold the character being tested */ - - -/*--------------------------------------------------------------------------- - Initialize various pointers and counters and stuff. - ---------------------------------------------------------------------------*/ - - if (G.pInfo->vollabel) - return MPN_VOL_LABEL; /* can't set disk volume labels in Unix */ - - /* can create path as long as not just freshening, or if user told us */ - G.create_dirs = (!uO.fflag || renamed); - - G.created_dir = FALSE; /* not yet */ - - /* user gave full pathname: don't prepend rootpath */ - G.renamed_fullpath = (renamed && (*G.filename == '/')); - - if (checkdir(__G__ (char *)NULL, INIT) == MPN_NOMEM) - return MPN_NOMEM; /* initialize path buffer, unless no memory */ - - *pathcomp = '\0'; /* initialize translation buffer */ - pp = pathcomp; /* point to translation buffer */ - if (uO.jflag) /* junking directories */ - cp = (char *)strrchr(G.filename, '/'); - if (cp == (char *)NULL) /* no '/' or not junking dirs */ - cp = G.filename; /* point to internal zipfile-member pathname */ - else - ++cp; /* point to start of last component of path */ - -/*--------------------------------------------------------------------------- - Begin main loop through characters in filename. - ---------------------------------------------------------------------------*/ - - while ((workch = (uch)*cp++) != 0) { - - switch (workch) { - case '/': /* can assume -j flag not given */ - *pp = '\0'; - if (strcmp(pathcomp, ".") == 0) { - /* don't bother appending "./" to the path */ - *pathcomp = '\0'; - } else if (!uO.ddotflag && strcmp(pathcomp, "..") == 0) { - /* "../" dir traversal detected, skip over it */ - *pathcomp = '\0'; - killed_ddot = TRUE; /* set "show message" flag */ - } - /* when path component is not empty, append it now */ - if (*pathcomp != '\0' && - ((error = checkdir(__G__ pathcomp, APPEND_DIR)) - & MPN_MASK) > MPN_INF_TRUNC) - return error; - pp = pathcomp; /* reset conversion buffer for next piece */ - lastsemi = (char *)NULL; /* leave direct. semi-colons alone */ - break; - -#ifdef __CYGWIN__ /* Cygwin runs on Win32, apply FAT/NTFS filename rules */ - case ':': /* drive spec not stored, so no colon allowed */ - case '\\': /* '\\' may come as normal filename char (not */ - case '<': /* dir sep char!) from unix-like file system */ - case '>': /* no redirection symbols allowed either */ - case '|': /* no pipe signs allowed */ - case '"': /* no double quotes allowed */ - case '?': /* no wildcards allowed */ - case '*': - *pp++ = '_'; /* these rules apply equally to FAT and NTFS */ - break; -#endif - - case ';': /* VMS version (or DEC-20 attrib?) */ - lastsemi = pp; - *pp++ = ';'; /* keep for now; remove VMS ";##" */ - break; /* later, if requested */ - -#ifdef ACORN_FTYPE_NFS - case ',': /* NFS filetype extension */ - lastcomma = pp; - *pp++ = ','; /* keep for now; may need to remove */ - break; /* later, if requested */ -#endif - -#ifdef MTS - case ' ': /* change spaces to underscore under */ - *pp++ = '_'; /* MTS; leave as spaces under Unix */ - break; -#endif - - default: - /* disable control character filter when requested, - * else allow 8-bit characters (e.g. UTF-8) in filenames: - */ - if (uO.cflxflag || - (isprint(workch) || (128 <= workch && workch <= 254))) - *pp++ = (char)workch; - } /* end switch */ - - } /* end while loop */ - - /* Show warning when stripping insecure "parent dir" path components */ - if (killed_ddot && QCOND2) { - Info(slide, 0, ((char *)slide, - "warning: skipped \"../\" path component(s) in %s\n", - FnFilter1(G.filename))); - if (!(error & ~MPN_MASK)) - error = (error & MPN_MASK) | PK_WARN; - } - -/*--------------------------------------------------------------------------- - Report if directory was created (and no file to create: filename ended - in '/'), check name to be sure it exists, and combine path and name be- - fore exiting. - ---------------------------------------------------------------------------*/ - - if (G.filename[strlen(G.filename) - 1] == '/') { - checkdir(__G__ G.filename, GETPATH); - if (G.created_dir) { - if (QCOND2) { - Info(slide, 0, ((char *)slide, " creating: %s\n", - FnFilter1(G.filename))); - } -#ifndef NO_CHMOD - /* Filter out security-relevant attributes bits. */ - G.pInfo->file_attr = filtattr(__G__ G.pInfo->file_attr); - /* When extracting non-UNIX directories or when extracting - * without UID/GID restoration or SGID preservation, any - * SGID flag inherited from the parent directory should be - * maintained to allow files extracted into this new folder - * to inherit the GID setting from the parent directory. - */ - if (G.pInfo->hostnum != UNIX_ || !(uO.X_flag || uO.K_flag)) { - /* preserve SGID bit when inherited from parent dir */ - if (!SSTAT(G.filename, &G.statbuf)) { - G.pInfo->file_attr |= G.statbuf.st_mode & S_ISGID; - } else { - perror("Could not read directory attributes"); - } - } - - /* set approx. dir perms (make sure can still read/write in dir) */ - if (chmod(G.filename, G.pInfo->file_attr | 0700)) - perror("chmod (directory attributes) error"); -#endif - /* set dir time (note trailing '/') */ - return (error & ~MPN_MASK) | MPN_CREATED_DIR; - } - /* dir existed already; don't look for data to extract */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; - } - - *pp = '\0'; /* done with pathcomp: terminate it */ - - /* if not saving them, remove VMS version numbers (appended ";###") */ - if (!uO.V_flag && lastsemi) { - pp = lastsemi + 1; - while (isdigit((uch)(*pp))) - ++pp; - if (*pp == '\0') /* only digits between ';' and end: nuke */ - *lastsemi = '\0'; - } - - /* On UNIX (and compatible systems), "." and ".." are reserved for - * directory navigation and cannot be used as regular file names. - * These reserved one-dot and two-dot names are mapped to "_" and "__". - */ - if (strcmp(pathcomp, ".") == 0) - *pathcomp = '_'; - else if (strcmp(pathcomp, "..") == 0) - strcpy(pathcomp, "__"); - -#ifdef ACORN_FTYPE_NFS - /* translate Acorn filetype information if asked to do so */ - if (uO.acorn_nfs_ext && - (ef_spark = (RO_extra_block *) - getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) - != (RO_extra_block *)NULL) - { - /* file *must* have a RISC OS extra field */ - long ft = (long)makelong(ef_spark->loadaddr); - /*32-bit*/ - if (lastcomma) { - pp = lastcomma + 1; - while (isxdigit((uch)(*pp))) ++pp; - if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ - } - if ((ft & 1<<31)==0) ft=0x000FFD00; - sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); - } -#endif /* ACORN_FTYPE_NFS */ - - if (*pathcomp == '\0') { - Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", - FnFilter1(G.filename))); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - - checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ - checkdir(__G__ G.filename, GETPATH); - - return error; - -} /* end function mapname() */ - - - - -#if 0 /*========== NOTES ==========*/ - - extract-to dir: a:path/ - buildpath: path1/path2/ ... (NULL-terminated) - pathcomp: filename - - mapname(): - loop over chars in zipfile member name - checkdir(path component, COMPONENT | CREATEDIR) --> map as required? - (d:/tmp/unzip/) (disk:[tmp.unzip.) - (d:/tmp/unzip/jj/) (disk:[tmp.unzip.jj.) - (d:/tmp/unzip/jj/temp/) (disk:[tmp.unzip.jj.temp.) - finally add filename itself and check for existence? (could use with rename) - (d:/tmp/unzip/jj/temp/msg.outdir) (disk:[tmp.unzip.jj.temp]msg.outdir) - checkdir(name, GETPATH) --> copy path to name and free space - -#endif /* 0 */ - - - - -/***********************/ -/* Function checkdir() */ -/***********************/ - -int checkdir(__G__ pathcomp, flag) - __GDEF - char *pathcomp; - int flag; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename - * MPN_INF_SKIP - path doesn't exist, not allowed to create - * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path - * exists and is not a directory, but is supposed to be - * MPN_ERR_TOOLONG - path is too long - * MPN_NOMEM - can't allocate memory for filename buffers - */ -{ - /* static int rootlen = 0; */ /* length of rootpath */ - /* static char *rootpath; */ /* user's "extract-to" directory */ - /* static char *buildpath; */ /* full path (so far) to extracted file */ - /* static char *end; */ /* pointer to end of buildpath ('\0') */ - -# define FN_MASK 7 -# define FUNCTION (flag & FN_MASK) - - - -/*--------------------------------------------------------------------------- - APPEND_DIR: append the path component to the path being built and check - for its existence. If doesn't exist and we are creating directories, do - so for this one; else signal success or error as appropriate. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_DIR) { - int too_long = FALSE; -#ifdef SHORT_NAMES - char *old_end = end; -#endif - - Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); - while ((*G.end = *pathcomp++) != '\0') - ++G.end; -#ifdef SHORT_NAMES /* path components restricted to 14 chars, typically */ - if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ - *(G.end = old_end + FILENAME_MAX) = '\0'; -#endif - - /* GRR: could do better check, see if overrunning buffer as we go: - * check end-buildpath after each append, set warning variable if - * within 20 of FILNAMSIZ; then if var set, do careful check when - * appending. Clear variable when begin new path. */ - - /* next check: need to append '/', at least one-char name, '\0' */ - if ((G.end-G.buildpath) > FILNAMSIZ-3) - too_long = TRUE; /* check if extracting dir? */ - if (SSTAT(G.buildpath, &G.statbuf)) { /* path doesn't exist */ - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpath); - return MPN_INF_SKIP; /* path doesn't exist: nothing to do */ - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpath))); - free(G.buildpath); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (mkdir(G.buildpath, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpath), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpath); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } else if (!S_ISDIR(G.statbuf.st_mode)) { - Info(slide, 1, ((char *)slide, - "checkdir error: %s exists but is not directory\n\ - unable to process %s.\n", - FnFilter2(G.buildpath), FnFilter1(G.filename))); - free(G.buildpath); - /* path existed but wasn't dir */ - return MPN_ERR_SKIP; - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", FnFilter1(G.buildpath))); - free(G.buildpath); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - *G.end++ = '/'; - *G.end = '\0'; - Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); - return MPN_OK; - - } /* end if (FUNCTION == APPEND_DIR) */ - -/*--------------------------------------------------------------------------- - GETPATH: copy full path to the string pointed at by pathcomp, and free - G.buildpath. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == GETPATH) { - strcpy(pathcomp, G.buildpath); - Trace((stderr, "getting and freeing path [%s]\n", - FnFilter1(pathcomp))); - free(G.buildpath); - G.buildpath = G.end = (char *)NULL; - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - APPEND_NAME: assume the path component is the filename; append it and - return without checking for existence. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_NAME) { -#ifdef SHORT_NAMES - char *old_end = end; -#endif - - Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); - while ((*G.end = *pathcomp++) != '\0') { - ++G.end; -#ifdef SHORT_NAMES /* truncate name at 14 characters, typically */ - if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ - *(G.end = old_end + FILENAME_MAX) = '\0'; -#endif - if ((G.end-G.buildpath) >= FILNAMSIZ) { - *--G.end = '\0'; - Info(slide, 0x201, ((char *)slide, - "checkdir warning: path too long; truncating\n\ - %s\n -> %s\n", - FnFilter1(G.filename), FnFilter2(G.buildpath))); - return MPN_INF_TRUNC; /* filename truncated */ - } - } - Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); - /* could check for existence here, prompt for new name... */ - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - INIT: allocate and initialize buffer space for the file currently being - extracted. If file was renamed with an absolute path, don't prepend the - extract-to path. - ---------------------------------------------------------------------------*/ - -/* GRR: for VMS and TOPS-20, add up to 13 to strlen */ - - if (FUNCTION == INIT) { - Trace((stderr, "initializing buildpath to ")); -#ifdef ACORN_FTYPE_NFS - if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+1)) -#endif - == (char *)NULL) - return MPN_NOMEM; - if ((G.rootlen > 0) && !G.renamed_fullpath) { - strcpy(G.buildpath, G.rootpath); - G.end = G.buildpath + G.rootlen; - } else { - *G.buildpath = '\0'; - G.end = G.buildpath; - } - Trace((stderr, "[%s]\n", FnFilter1(G.buildpath))); - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - ROOT: if appropriate, store the path in rootpath and create it if - necessary; else assume it's a zipfile member and return. This path - segment gets used in extracting all members from every zipfile specified - on the command line. - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) || defined(SFX_EXDIR)) - if (FUNCTION == ROOT) { - Trace((stderr, "initializing root path to [%s]\n", - FnFilter1(pathcomp))); - if (pathcomp == (char *)NULL) { - G.rootlen = 0; - return MPN_OK; - } - if (G.rootlen > 0) /* rootpath was already set, nothing to do */ - return MPN_OK; - if ((G.rootlen = strlen(pathcomp)) > 0) { - char *tmproot; - - if ((tmproot = (char *)malloc(G.rootlen+2)) == (char *)NULL) { - G.rootlen = 0; - return MPN_NOMEM; - } - strcpy(tmproot, pathcomp); - if (tmproot[G.rootlen-1] == '/') { - tmproot[--G.rootlen] = '\0'; - } - if (G.rootlen > 0 && (SSTAT(tmproot, &G.statbuf) || - !S_ISDIR(G.statbuf.st_mode))) - { /* path does not exist */ - if (!G.create_dirs /* || iswild(tmproot) */ ) { - free(tmproot); - G.rootlen = 0; - /* skip (or treat as stored file) */ - return MPN_INF_SKIP; - } - /* create the directory (could add loop here scanning tmproot - * to create more than one level, but why really necessary?) */ - if (mkdir(tmproot, 0777) == -1) { - Info(slide, 1, ((char *)slide, - "checkdir: cannot create extraction directory: %s\n\ - %s\n", - FnFilter1(tmproot), strerror(errno))); - free(tmproot); - G.rootlen = 0; - /* path didn't exist, tried to create, and failed: */ - /* file exists, or 2+ subdir levels required */ - return MPN_ERR_SKIP; - } - } - tmproot[G.rootlen++] = '/'; - tmproot[G.rootlen] = '\0'; - if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { - free(tmproot); - G.rootlen = 0; - return MPN_NOMEM; - } - Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); - } - return MPN_OK; - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - END: free rootpath, immediately prior to program exit. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == END) { - Trace((stderr, "freeing rootpath\n")); - if (G.rootlen > 0) { - free(G.rootpath); - G.rootlen = 0; - } - return MPN_OK; - } - - return MPN_INVALID; /* should never reach */ - -} /* end function checkdir() */ - - - - - -#ifdef NO_MKDIR - -/********************/ -/* Function mkdir() */ -/********************/ - -int mkdir(path, mode) - ZCONST char *path; - int mode; /* ignored */ -/* - * returns: 0 - successful - * -1 - failed (errno not set, however) - */ -{ - char command[FILNAMSIZ+40]; /* buffer for system() call */ - - /* GRR 930416: added single quotes around path to avoid bug with - * creating directories with ampersands in name; not yet tested */ - sprintf(command, "IFS=\" \t\n\" /bin/mkdir '%s' 2>/dev/null", path); - if (system(command)) - return -1; - return 0; -} - -#endif /* NO_MKDIR */ - - - - -#if (!defined(MTS) || defined(SET_DIR_ATTRIB)) -static int get_extattribs OF((__GPRO__ iztimes *pzt, ulg z_uidgid[2])); - -static int get_extattribs(__G__ pzt, z_uidgid) - __GDEF - iztimes *pzt; - ulg z_uidgid[2]; -{ -/*--------------------------------------------------------------------------- - Convert from MSDOS-format local time and date to Unix-format 32-bit GMT - time: adjust base year from 1980 to 1970, do usual conversions from - yy/mm/dd hh:mm:ss to elapsed seconds, and account for timezone and day- - light savings time differences. If we have a Unix extra field, however, - we're laughing: both mtime and atime are ours. On the other hand, we - then have to check for restoration of UID/GID. - ---------------------------------------------------------------------------*/ - int have_uidgid_flg; - unsigned eb_izux_flg; - - eb_izux_flg = (G.extra_field ? ef_scan_for_izux(G.extra_field, - G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, -#ifdef IZ_CHECK_TZ - (G.tz_is_valid ? pzt : NULL), -#else - pzt, -#endif - z_uidgid) : 0); - if (eb_izux_flg & EB_UT_FL_MTIME) { - TTrace((stderr, "\nget_extattribs: Unix e.f. modif. time = %ld\n", - pzt->mtime)); - } else { - pzt->mtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - } - if (eb_izux_flg & EB_UT_FL_ATIME) { - TTrace((stderr, "get_extattribs: Unix e.f. access time = %ld\n", - pzt->atime)); - } else { - pzt->atime = pzt->mtime; - TTrace((stderr, "\nget_extattribs: modification/access times = %ld\n", - pzt->mtime)); - } - - /* if -X option was specified and we have UID/GID info, restore it */ - have_uidgid_flg = -#ifdef RESTORE_UIDGID - (uO.X_flag && (eb_izux_flg & EB_UX2_VALID)); -#else - 0; -#endif - return have_uidgid_flg; -} -#endif /* !MTS || SET_DIR_ATTRIB */ - - - -#ifndef MTS - -/****************************/ -/* Function close_outfile() */ -/****************************/ - -void close_outfile(__G) /* GRR: change to return PK-style warning level */ - __GDEF -{ - union { - iztimes t3; /* mtime, atime, ctime */ - ztimbuf t2; /* modtime, actime */ - } zt; - ulg z_uidgid[2]; - int have_uidgid_flg; - - have_uidgid_flg = get_extattribs(__G__ &(zt.t3), z_uidgid); - -/*--------------------------------------------------------------------------- - If symbolic links are supported, allocate storage for a symlink control - structure, put the uncompressed "data" and other required info in it, and - add the structure to the "deferred symlinks" chain. Since we know it's a - symbolic link to start with, we shouldn't have to worry about overflowing - unsigned ints with unsigned longs. - ---------------------------------------------------------------------------*/ - -#ifdef SYMLINKS - if (G.symlnk) { - extent ucsize = (extent)G.lrec.ucsize; -# ifdef SET_SYMLINK_ATTRIBS - extent attribsize = sizeof(unsigned) + - (have_uidgid_flg ? sizeof(z_uidgid) : 0); -# else - extent attribsize = 0; -# endif - /* size of the symlink entry is the sum of - * (struct size (includes 1st '\0') + 1 additional trailing '\0'), - * system specific attribute data size (might be 0), - * and the lengths of name and link target. - */ - extent slnk_entrysize = (sizeof(slinkentry) + 1) + attribsize + - ucsize + strlen(G.filename); - slinkentry *slnk_entry; - - if (slnk_entrysize < ucsize) { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed: mem alloc overflow\n", - FnFilter1(G.filename))); - fclose(G.outfile); - return; - } - - if ((slnk_entry = (slinkentry *)malloc(slnk_entrysize)) == NULL) { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed: no mem\n", - FnFilter1(G.filename))); - fclose(G.outfile); - return; - } - slnk_entry->next = NULL; - slnk_entry->targetlen = ucsize; - slnk_entry->attriblen = attribsize; -# ifdef SET_SYMLINK_ATTRIBS - memcpy(slnk_entry->buf, &(G.pInfo->file_attr), - sizeof(unsigned)); - if (have_uidgid_flg) - memcpy(slnk_entry->buf + 4, z_uidgid, sizeof(z_uidgid)); -# endif - slnk_entry->target = slnk_entry->buf + slnk_entry->attriblen; - slnk_entry->fname = slnk_entry->target + ucsize + 1; - strcpy(slnk_entry->fname, G.filename); - - /* move back to the start of the file to re-read the "link data" */ - rewind(G.outfile); - - if (fread(slnk_entry->target, 1, ucsize, G.outfile) != ucsize) - { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed\n", - FnFilter1(G.filename))); - free(slnk_entry); - fclose(G.outfile); - return; - } - fclose(G.outfile); /* close "link" file for good... */ - slnk_entry->target[ucsize] = '\0'; - if (QCOND2) - Info(slide, 0, ((char *)slide, "-> %s ", - FnFilter1(slnk_entry->target))); - /* add this symlink record to the list of deferred symlinks */ - if (G.slink_last != NULL) - G.slink_last->next = slnk_entry; - else - G.slink_head = slnk_entry; - G.slink_last = slnk_entry; - return; - } -#endif /* SYMLINKS */ - -#ifdef QLZIP - if (G.extra_field) { - static void qlfix OF((__GPRO__ uch *ef_ptr, unsigned ef_len)); - - qlfix(__G__ G.extra_field, G.lrec.extra_field_length); - } -#endif - -#if (defined(NO_FCHOWN)) - fclose(G.outfile); -#endif - - /* if -X option was specified and we have UID/GID info, restore it */ - if (have_uidgid_flg - /* check that both uid and gid values fit into their data sizes */ - && ((ulg)(uid_t)(z_uidgid[0]) == z_uidgid[0]) - && ((ulg)(gid_t)(z_uidgid[1]) == z_uidgid[1])) { - TTrace((stderr, "close_outfile: restoring Unix UID/GID info\n")); -#if (defined(NO_FCHOWN)) - if (chown(G.filename, (uid_t)z_uidgid[0], (gid_t)z_uidgid[1])) -#else - if (fchown(fileno(G.outfile), (uid_t)z_uidgid[0], (gid_t)z_uidgid[1])) -#endif - { - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - z_uidgid[0], z_uidgid[1], FnFilter1(G.filename), - strerror(errno))); - else - Info(slide, 0x201, ((char *)slide, CannotSetUidGid, - z_uidgid[0], z_uidgid[1], strerror(errno))); - } - } - -#if (!defined(NO_FCHOWN) && defined(NO_FCHMOD)) - fclose(G.outfile); -#endif - -#if (!defined(NO_FCHOWN) && !defined(NO_FCHMOD)) -/*--------------------------------------------------------------------------- - Change the file permissions from default ones to those stored in the - zipfile. - ---------------------------------------------------------------------------*/ - - if (fchmod(fileno(G.outfile), filtattr(__G__ G.pInfo->file_attr))) - perror("fchmod (file attributes) error"); - - fclose(G.outfile); -#endif /* !NO_FCHOWN && !NO_FCHMOD */ - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - /* set the file's access and modification times */ - if (utime(G.filename, &(zt.t2))) { - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, CannotSetItemTimestamps, - FnFilter1(G.filename), strerror(errno))); - else - Info(slide, 0x201, ((char *)slide, CannotSetTimestamps, - strerror(errno))); - } - } - -#if (defined(NO_FCHOWN) || defined(NO_FCHMOD)) -/*--------------------------------------------------------------------------- - Change the file permissions from default ones to those stored in the - zipfile. - ---------------------------------------------------------------------------*/ - -#ifndef NO_CHMOD - if (chmod(G.filename, filtattr(__G__ G.pInfo->file_attr))) - perror("chmod (file attributes) error"); -#endif -#endif /* NO_FCHOWN || NO_FCHMOD */ - -} /* end function close_outfile() */ - -#endif /* !MTS */ - - -#if (defined(SYMLINKS) && defined(SET_SYMLINK_ATTRIBS)) -int set_symlnk_attribs(__G__ slnk_entry) - __GDEF - slinkentry *slnk_entry; -{ - if (slnk_entry->attriblen > 0) { -# if (!defined(NO_LCHOWN)) - if (slnk_entry->attriblen > sizeof(unsigned)) { - ulg *z_uidgid_p = (zvoid *)(slnk_entry->buf + sizeof(unsigned)); - /* check that both uid and gid values fit into their data sizes */ - if (((ulg)(uid_t)(z_uidgid_p[0]) == z_uidgid_p[0]) && - ((ulg)(gid_t)(z_uidgid_p[1]) == z_uidgid_p[1])) { - TTrace((stderr, - "set_symlnk_attribs: restoring Unix UID/GID info for\n\ - %s\n", - FnFilter1(slnk_entry->fname))); - if (lchown(slnk_entry->fname, - (uid_t)z_uidgid_p[0], (gid_t)z_uidgid_p[1])) - { - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - z_uidgid_p[0], z_uidgid_p[1], FnFilter1(slnk_entry->fname), - strerror(errno))); - } - } - } -# endif /* !NO_LCHOWN */ -# if (!defined(NO_LCHMOD)) - TTrace((stderr, - "set_symlnk_attribs: restoring Unix attributes for\n %s\n", - FnFilter1(slnk_entry->fname))); - if (lchmod(slnk_entry->fname, - filtattr(__G__ *(unsigned *)(zvoid *)slnk_entry->buf))) - perror("lchmod (file attributes) error"); -# endif /* !NO_LCHMOD */ - } - /* currently, no error propagation... */ - return PK_OK; -} /* end function set_symlnk_attribs() */ -#endif /* SYMLINKS && SET_SYMLINK_ATTRIBS */ - - -#ifdef SET_DIR_ATTRIB -/* messages of code for setting directory attributes */ -# ifndef NO_CHMOD - static ZCONST char DirlistChmodFailed[] = - "warning: cannot set permissions for %s\n %s\n"; -# endif - - -int defer_dir_attribs(__G__ pd) - __GDEF - direntry **pd; -{ - uxdirattr *d_entry; - - d_entry = (uxdirattr *)malloc(sizeof(uxdirattr) + strlen(G.filename)); - *pd = (direntry *)d_entry; - if (d_entry == (uxdirattr *)NULL) { - return PK_MEM; - } - d_entry->fn = d_entry->fnbuf; - strcpy(d_entry->fn, G.filename); - - d_entry->perms = G.pInfo->file_attr; - - d_entry->have_uidgid = get_extattribs(__G__ &(d_entry->u.t3), - d_entry->uidgid); - return PK_OK; -} /* end function defer_dir_attribs() */ - - -int set_direc_attribs(__G__ d) - __GDEF - direntry *d; -{ - int errval = PK_OK; - - if (UxAtt(d)->have_uidgid && - /* check that both uid and gid values fit into their data sizes */ - ((ulg)(uid_t)(UxAtt(d)->uidgid[0]) == UxAtt(d)->uidgid[0]) && - ((ulg)(gid_t)(UxAtt(d)->uidgid[1]) == UxAtt(d)->uidgid[1]) && - chown(UxAtt(d)->fn, (uid_t)UxAtt(d)->uidgid[0], - (gid_t)UxAtt(d)->uidgid[1])) - { - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - UxAtt(d)->uidgid[0], UxAtt(d)->uidgid[1], FnFilter1(d->fn), - strerror(errno))); - if (!errval) - errval = PK_WARN; - } - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - /* restore directory timestamps */ - if (utime(d->fn, &UxAtt(d)->u.t2)) { - Info(slide, 0x201, ((char *)slide, CannotSetItemTimestamps, - FnFilter1(d->fn), strerror(errno))); - if (!errval) - errval = PK_WARN; - } - } -#ifndef NO_CHMOD - if (chmod(d->fn, UxAtt(d)->perms)) { - Info(slide, 0x201, ((char *)slide, DirlistChmodFailed, - FnFilter1(d->fn), strerror(errno))); - if (!errval) - errval = PK_WARN; - } -#endif /* !NO_CHMOD */ - return errval; -} /* end function set_direc_attribs() */ - -#endif /* SET_DIR_ATTRIB */ - - - - -#ifdef TIMESTAMP - -/***************************/ -/* Function stamp_file() */ -/***************************/ - -int stamp_file(fname, modtime) - ZCONST char *fname; - time_t modtime; -{ - ztimbuf tp; - - tp.modtime = tp.actime = modtime; - return (utime(fname, &tp)); - -} /* end function stamp_file() */ - -#endif /* TIMESTAMP */ - - - - -#ifndef SFX - -/************************/ -/* Function version() */ -/************************/ - -void version(__G) - __GDEF -{ -#if (defined(__GNUC__) && defined(NX_CURRENT_COMPILER_RELEASE)) - char cc_namebuf[40]; - char cc_versbuf[40]; -#else -#if (defined(__SUNPRO_C)) - char cc_versbuf[17]; -#else -#if (defined(__HP_cc) || defined(__IBMC__)) - char cc_versbuf[25]; -#else -#if (defined(__DECC_VER)) - char cc_versbuf[17]; - int cc_verstyp; -#else -#if (defined(CRAY) && defined(_RELEASE)) - char cc_versbuf[40]; -#endif /* (CRAY && _RELEASE) */ -#endif /* __DECC_VER */ -#endif /* __HP_cc || __IBMC__ */ -#endif /* __SUNPRO_C */ -#endif /* (__GNUC__ && NX_CURRENT_COMPILER_RELEASE) */ - -#if ((defined(CRAY) || defined(cray)) && defined(_UNICOS)) - char os_namebuf[40]; -#else -#if defined(__NetBSD__) - char os_namebuf[40]; -#endif -#endif - - /* Pyramid, NeXT have problems with huge macro expansion, too: no Info() */ - sprintf((char *)slide, LoadFarString(CompiledWith), - -#ifdef __GNUC__ -# ifdef NX_CURRENT_COMPILER_RELEASE - (sprintf(cc_namebuf, "NeXT DevKit %d.%02d ", - NX_CURRENT_COMPILER_RELEASE/100, NX_CURRENT_COMPILER_RELEASE%100), - cc_namebuf), - (strlen(__VERSION__) > 8)? "(gcc)" : - (sprintf(cc_versbuf, "(gcc %s)", __VERSION__), cc_versbuf), -# else - "gcc ", __VERSION__, -# endif -#else -#if defined(__SUNPRO_C) - "Sun C ", (sprintf(cc_versbuf, "version %x", __SUNPRO_C), cc_versbuf), -#else -#if (defined(__HP_cc)) - "HP C ", - (((__HP_cc% 100) == 0) ? - (sprintf(cc_versbuf, "version A.%02d.%02d", - (__HP_cc/ 10000), ((__HP_cc% 10000)/ 100))) : - (sprintf(cc_versbuf, "version A.%02d.%02d.%02d", - (__HP_cc/ 10000), ((__HP_cc% 10000)/ 100), (__HP_cc% 100))), - cc_versbuf), -#else -#if (defined(__DECC_VER)) - "DEC C ", - (sprintf(cc_versbuf, "%c%d.%d-%03d", - ((cc_verstyp = (__DECC_VER / 10000) % 10) == 6 ? 'T' : - (cc_verstyp == 8 ? 'S' : 'V')), - __DECC_VER / 10000000, - (__DECC_VER % 10000000) / 100000, __DECC_VER % 1000), - cc_versbuf), -#else -#if defined(CRAY) && defined(_RELEASE) - "cc ", (sprintf(cc_versbuf, "version %d", _RELEASE), cc_versbuf), -#else -#ifdef __IBMC__ - "IBM C ", - (sprintf(cc_versbuf, "version %d.%d.%d", - (__IBMC__ / 100), ((__IBMC__ / 10) % 10), (__IBMC__ % 10)), - cc_versbuf), -#else -#ifdef __VERSION__ -# ifndef IZ_CC_NAME -# define IZ_CC_NAME "cc " -# endif - IZ_CC_NAME, __VERSION__ -#else -# ifndef IZ_CC_NAME -# define IZ_CC_NAME "cc" -# endif - IZ_CC_NAME, "", -#endif /* ?__VERSION__ */ -#endif /* ?__IBMC__ */ -#endif /* ?(CRAY && _RELEASE) */ -#endif /* ?__DECC_VER */ -#endif /* ?__HP_cc */ -#endif /* ?__SUNPRO_C */ -#endif /* ?__GNUC__ */ - -#ifndef IZ_OS_NAME -# define IZ_OS_NAME "Unix" -#endif - IZ_OS_NAME, - -#if defined(sgi) || defined(__sgi) - " (Silicon Graphics IRIX)", -#else -#ifdef sun -# ifdef sparc -# ifdef __SVR4 - " (Sun SPARC/Solaris)", -# else /* may or may not be SunOS */ - " (Sun SPARC)", -# endif -# else -# if defined(sun386) || defined(i386) - " (Sun 386i)", -# else -# if defined(mc68020) || defined(__mc68020__) - " (Sun 3)", -# else /* mc68010 or mc68000: Sun 2 or earlier */ - " (Sun 2)", -# endif -# endif -# endif -#else -#ifdef __hpux - " (HP-UX)", -#else -#ifdef __osf__ - " (DEC OSF/1)", -#else -#ifdef _AIX - " (IBM AIX)", -#else -#ifdef aiws - " (IBM RT/AIX)", -#else -#if defined(CRAY) || defined(cray) -# ifdef _UNICOS - (sprintf(os_namebuf, " (Cray UNICOS release %d)", _UNICOS), os_namebuf), -# else - " (Cray UNICOS)", -# endif -#else -#if defined(uts) || defined(UTS) - " (Amdahl UTS)", -#else -#ifdef NeXT -# ifdef mc68000 - " (NeXTStep/black)", -# else - " (NeXTStep for Intel)", -# endif -#else /* the next dozen or so are somewhat order-dependent */ -#ifdef LINUX -# ifdef __ELF__ - " (Linux ELF)", -# else - " (Linux a.out)", -# endif -#else -#ifdef MINIX - " (Minix)", -#else -#ifdef M_UNIX - " (SCO Unix)", -#else -#ifdef M_XENIX - " (SCO Xenix)", -#else -#ifdef __NetBSD__ -# ifdef NetBSD0_8 - (sprintf(os_namebuf, " (NetBSD 0.8%c)", (char)(NetBSD0_8 - 1 + 'A')), - os_namebuf), -# else -# ifdef NetBSD0_9 - (sprintf(os_namebuf, " (NetBSD 0.9%c)", (char)(NetBSD0_9 - 1 + 'A')), - os_namebuf), -# else -# ifdef NetBSD1_0 - (sprintf(os_namebuf, " (NetBSD 1.0%c)", (char)(NetBSD1_0 - 1 + 'A')), - os_namebuf), -# else - (BSD4_4 == 0.5)? " (NetBSD before 0.9)" : " (NetBSD 1.1 or later)", -# endif -# endif -# endif -#else -#ifdef __FreeBSD__ - (BSD4_4 == 0.5)? " (FreeBSD 1.x)" : " (FreeBSD 2.0 or later)", -#else -#ifdef __bsdi__ - (BSD4_4 == 0.5)? " (BSD/386 1.0)" : " (BSD/386 1.1 or later)", -#else -#ifdef __386BSD__ - (BSD4_4 == 1)? " (386BSD, post-4.4 release)" : " (386BSD)", -#else -#ifdef __CYGWIN__ - " (Cygwin)", -#else -#if defined(i686) || defined(__i686) || defined(__i686__) - " (Intel 686)", -#else -#if defined(i586) || defined(__i586) || defined(__i586__) - " (Intel 586)", -#else -#if defined(i486) || defined(__i486) || defined(__i486__) - " (Intel 486)", -#else -#if defined(i386) || defined(__i386) || defined(__i386__) - " (Intel 386)", -#else -#ifdef pyr - " (Pyramid)", -#else -#ifdef ultrix -# ifdef mips - " (DEC/MIPS)", -# else -# ifdef vax - " (DEC/VAX)", -# else /* __alpha? */ - " (DEC/Alpha)", -# endif -# endif -#else -#ifdef gould - " (Gould)", -#else -#ifdef MTS - " (MTS)", -#else -#ifdef __convexc__ - " (Convex)", -#else -#ifdef __QNX__ - " (QNX 4)", -#else -#ifdef __QNXNTO__ - " (QNX Neutrino)", -#else -#ifdef Lynx - " (LynxOS)", -#else -#ifdef __APPLE__ -# ifdef __i386__ - " Mac OS X Intel i32", -# else -# ifdef __ppc__ - " Mac OS X PowerPC", -# else -# ifdef __ppc64__ - " Mac OS X PowerPC64", -# else - " Mac OS X", -# endif /* __ppc64__ */ -# endif /* __ppc__ */ -# endif /* __i386__ */ -#else - "", -#endif /* Apple */ -#endif /* Lynx */ -#endif /* QNX Neutrino */ -#endif /* QNX 4 */ -#endif /* Convex */ -#endif /* MTS */ -#endif /* Gould */ -#endif /* DEC */ -#endif /* Pyramid */ -#endif /* 386 */ -#endif /* 486 */ -#endif /* 586 */ -#endif /* 686 */ -#endif /* Cygwin */ -#endif /* 386BSD */ -#endif /* BSDI BSD/386 */ -#endif /* NetBSD */ -#endif /* FreeBSD */ -#endif /* SCO Xenix */ -#endif /* SCO Unix */ -#endif /* Minix */ -#endif /* Linux */ -#endif /* NeXT */ -#endif /* Amdahl */ -#endif /* Cray */ -#endif /* RT/AIX */ -#endif /* AIX */ -#endif /* OSF/1 */ -#endif /* HP-UX */ -#endif /* Sun */ -#endif /* SGI */ - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - - (*G.message)((zvoid *)&G, slide, (ulg)strlen((char *)slide), 0); - -} /* end function version() */ - -#endif /* !SFX */ - - - - -#ifdef QLZIP - -struct qdirect { - long d_length __attribute__ ((packed)); /* file length */ - unsigned char d_access __attribute__ ((packed)); /* file access type */ - unsigned char d_type __attribute__ ((packed)); /* file type */ - long d_datalen __attribute__ ((packed)); /* data length */ - long d_reserved __attribute__ ((packed));/* Unused */ - short d_szname __attribute__ ((packed)); /* size of name */ - char d_name[36] __attribute__ ((packed));/* name area */ - long d_update __attribute__ ((packed)); /* last update */ - long d_refdate __attribute__ ((packed)); - long d_backup __attribute__ ((packed)); /* EOD */ -}; - -#define LONGID "QDOS02" -#define EXTRALEN (sizeof(struct qdirect) + 8) -#define JBLONGID "QZHD" -#define JBEXTRALEN (sizeof(jbextra) - 4 * sizeof(char)) - -typedef struct { - char eb_header[4] __attribute__ ((packed)); /* place_holder */ - char longid[8] __attribute__ ((packed)); - struct qdirect header __attribute__ ((packed)); -} qdosextra; - -typedef struct { - char eb_header[4]; /* place_holder */ - char longid[4]; - struct qdirect header; -} jbextra; - - - -/* The following two functions SH() and LG() convert big-endian short - * and long numbers into native byte order. They are some kind of - * counterpart to the generic UnZip's makeword() and makelong() functions. - */ -static ush SH(ush val) -{ - uch swapbuf[2]; - - swapbuf[1] = (uch)(val & 0xff); - swapbuf[0] = (uch)(val >> 8); - return (*(ush *)swapbuf); -} - - - -static ulg LG(ulg val) -{ - /* convert the big-endian unsigned long number `val' to the machine - * dependent representation - */ - ush swapbuf[2]; - - swapbuf[1] = SH((ush)(val & 0xffff)); - swapbuf[0] = SH((ush)(val >> 16)); - return (*(ulg *)swapbuf); -} - - - -static void qlfix(__G__ ef_ptr, ef_len) - __GDEF - uch *ef_ptr; - unsigned ef_len; -{ - while (ef_len >= EB_HEADSIZE) - { - unsigned eb_id = makeword(EB_ID + ef_ptr); - unsigned eb_len = makeword(EB_LEN + ef_ptr); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "qlfix: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_QDOS: - { - struct _ntc_ - { - long id; - long dlen; - } ntc; - long dlen = 0; - - qdosextra *extra = (qdosextra *)ef_ptr; - jbextra *jbp = (jbextra *)ef_ptr; - - if (!strncmp(extra->longid, LONGID, strlen(LONGID))) - { - if (eb_len != EXTRALEN) - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in Qdos field for %s\n", - FnFilter1(G.filename))); - else - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in Qdos field")); - - if (extra->header.d_type) - { - dlen = extra->header.d_datalen; - } - } - - if (!strncmp(jbp->longid, JBLONGID, strlen(JBLONGID))) - { - if (eb_len != JBEXTRALEN) - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in QZ field for %s\n", - FnFilter1(G.filename))); - else - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in QZ field")); - if (jbp->header.d_type) - { - dlen = jbp->header.d_datalen; - } - } - - if ((long)LG(dlen) > 0) - { - zfseeko(G.outfile, -8, SEEK_END); - fread(&ntc, 8, 1, G.outfile); - if (ntc.id != *(long *)"XTcc") - { - ntc.id = *(long *)"XTcc"; - ntc.dlen = dlen; - fwrite (&ntc, 8, 1, G.outfile); - } - Info(slide, 0x201, ((char *)slide, "QData = %d", LG(dlen))); - } - return; /* finished, cancel further extra field scanning */ - } - - default: - Trace((stderr,"qlfix: unknown extra field block, ID=%d\n", - eb_id)); - } - - /* Skip this extra field block */ - ef_ptr += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } -} -#endif /* QLZIP */ diff --git a/data/windows/unzipfx-catarina/unix/unxcfg.h b/data/windows/unzipfx-catarina/unix/unxcfg.h deleted file mode 100644 index e39b283..0000000 --- a/data/windows/unzipfx-catarina/unix/unxcfg.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - Unix specific configuration section: - ---------------------------------------------------------------------------*/ - -#ifndef __unxcfg_h -#define __unxcfg_h - - -/* LARGE FILE SUPPORT - 10/6/04 EG */ -/* This needs to be set before the includes so they set the right sizes */ - -#if (defined(NO_LARGE_FILE_SUPPORT) && defined(LARGE_FILE_SUPPORT)) -# undef LARGE_FILE_SUPPORT -#endif - -/* Automatically set ZIP64_SUPPORT if LFS */ -#ifdef LARGE_FILE_SUPPORT -# if (!defined(NO_ZIP64_SUPPORT) && !defined(ZIP64_SUPPORT)) -# define ZIP64_SUPPORT -# endif -#endif - -/* NO_ZIP64_SUPPORT takes preceedence over ZIP64_SUPPORT */ -#if defined(NO_ZIP64_SUPPORT) && defined(ZIP64_SUPPORT) -# undef ZIP64_SUPPORT -#endif - -#ifdef LARGE_FILE_SUPPORT - /* 64-bit Large File Support */ - - /* The following Large File Summit (LFS) defines turn on large file support - on Linux (probably 2.4 or later kernel) and many other unixen */ - - /* These have to be before any include that sets types so the large file - versions of the types are set in the includes */ - -# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */ -# define _LARGEFILE64_SOURCE -# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */ -# define _LARGE_FILES /* some OSes need this for 64-bit off_t */ -# define __USE_LARGEFILE64 -#endif /* LARGE_FILE_SUPPORT */ - - -#include /* off_t, time_t, dev_t, ... */ -#include - -#ifdef NO_OFF_T - typedef long zoff_t; -#else - typedef off_t zoff_t; -#endif -#define ZOFF_T_DEFINED -typedef struct stat z_stat; -#define Z_STAT_DEFINED - -#ifndef COHERENT -# include /* O_BINARY for open() w/o CR/LF translation */ -#else /* COHERENT */ -# ifdef _I386 -# include /* Coherent 4.0.x, Mark Williams C */ -# else -# include /* Coherent 3.10, Mark Williams C */ -# endif -# define SHORT_SYMS -# ifndef __COHERENT__ /* Coherent 4.2 has tzset() */ -# define tzset settz -# endif -#endif /* ?COHERENT */ - -#ifndef NO_PARAM_H -# ifdef NGROUPS_MAX -# undef NGROUPS_MAX /* SCO bug: defined again in */ -# endif -# ifdef BSD -# define TEMP_BSD /* may be defined again in */ -# undef BSD -# endif -# include /* conflict with , some systems? */ -# ifdef TEMP_BSD -# undef TEMP_BSD -# ifndef BSD -# define BSD -# endif -# endif -#endif /* !NO_PARAM_H */ - -#ifdef __osf__ -# define DIRENT -# ifdef BSD -# undef BSD -# endif -#endif /* __osf__ */ - -#ifdef __CYGWIN__ -# include -# define DIRENT -# define HAVE_TERMIOS_H -# ifndef timezone -# define timezone _timezone -# endif -#endif - -#ifdef BSD -# include -# include -# if (defined(_AIX) || defined(__GLIBC__) || defined(__GNU__)) -# include -# endif -#else -# include - struct tm *gmtime(), *localtime(); -#endif - -#if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN))) -# include /* this includes utime.h on SGIs */ -# if (defined(BSD4_4) || defined(linux) || defined(__GLIBC__)) -# include -# define GOT_UTIMBUF -# endif -# if (!defined(GOT_UTIMBUF) && (defined(__hpux) || defined(__SUNPRO_C))) -# include -# define GOT_UTIMBUF -# endif -# if (!defined(GOT_UTIMBUF) && defined(__GNU__)) -# include -# define GOT_UTIMBUF -# endif -#endif -#if (defined(__DGUX__) && !defined(GOT_UTIMBUF)) - /* DG/UX requires this because of a non-standard struct utimebuf */ -# include -# define GOT_UTIMBUF -#endif - -#if (defined(V7) || defined(pyr_bsd)) -# define strchr index -# define strrchr rindex -#endif -#ifdef V7 -# define O_RDONLY 0 -# define O_WRONLY 1 -# define O_RDWR 2 -#endif - -#if defined(NO_UNICODE_SUPPORT) && defined(UNICODE_SUPPORT) - /* disable Unicode (UTF-8) support when requested */ -# undef UNICODE_SUPPORT -#endif - -#if (defined(_MBCS) && defined(NO_MBCS)) - /* disable MBCS support when requested */ -# undef _MBCS -#endif - -#if (!defined(NO_SETLOCALE) && !defined(_MBCS)) -# if (!defined(UNICODE_SUPPORT) || !defined(UTF8_MAYBE_NATIVE)) - /* enable setlocale here, unless this happens later for UTF-8 and/or - * MBCS support */ -# include -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -# endif -#endif -#ifndef NO_SETLOCALE -# if (!defined(NO_WORKING_ISPRINT) && !defined(HAVE_WORKING_ISPRINT)) - /* enable "enhanced" unprintable chars detection in fnfilter() */ -# define HAVE_WORKING_ISPRINT -# endif -#endif - -#ifdef MINIX -# include -#endif -#if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP)) -# define NO_STRNICMP -#endif -#ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */ -#endif -#define lenEOL 1 -#ifdef EBCDIC -# define PutNativeEOL *q++ = '\n'; -#else -# define PutNativeEOL *q++ = native(LF); -#endif -#define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) -#define SCREENWIDTH 80 -#define SCREENLWRAP 1 -#define USE_EF_UT_TIME -#if (!defined(NO_LCHOWN) || !defined(NO_LCHMOD)) -# define SET_SYMLINK_ATTRIBS -#endif -#ifdef MTS -# ifdef SET_DIR_ATTRIB -# undef SET_DIR_ATTRIB -# endif -#else /* !MTS */ -# define SET_DIR_ATTRIB -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) /* GRR 970513 */ -# define TIMESTAMP -# endif -# define RESTORE_UIDGID -#endif /* ?MTS */ - -/* Static variables that we have to add to Uz_Globs: */ -#define SYSTEM_SPECIFIC_GLOBALS \ - int created_dir, renamed_fullpath;\ - char *rootpath, *buildpath, *end;\ - ZCONST char *wildname;\ - char *dirname, matchname[FILNAMSIZ];\ - int rootlen, have_dirname, dirnamelen, notfirstcall;\ - zvoid *wild_dir; - -/* created_dir, and renamed_fullpath are used by both mapname() and */ -/* checkdir(). */ -/* rootlen, rootpath, buildpath and end are used by checkdir(). */ -/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ -/* and notfirstcall are used by do_wild(). */ - -#endif /* !__unxcfg_h */ diff --git a/data/windows/unzipfx-catarina/unzip.c b/data/windows/unzipfx-catarina/unzip.c deleted file mode 100644 index bc75c73..0000000 --- a/data/windows/unzipfx-catarina/unzip.c +++ /dev/null @@ -1,2666 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unzip.c - - UnZip - a zipfile extraction utility. See below for make instructions, or - read the comments in Makefile and the various Contents files for more de- - tailed explanations. To report a bug, submit a *complete* description via - //www.info-zip.org/zip-bug.html; include machine type, operating system and - version, compiler and version, and reasonably detailed error messages or - problem report. To join Info-ZIP, see the instructions in README. - - UnZip 5.x is a greatly expanded and partially rewritten successor to 4.x, - which in turn was almost a complete rewrite of version 3.x. For a detailed - revision history, see UnzpHist.zip at quest.jpl.nasa.gov. For a list of - the many (near infinite) contributors, see "CONTRIBS" in the UnZip source - distribution. - - UnZip 6.0 adds support for archives larger than 4 GiB using the Zip64 - extensions as well as support for Unicode information embedded per the - latest zip standard additions. - - --------------------------------------------------------------------------- - - [from original zipinfo.c] - - This program reads great gobs of totally nifty information, including the - central directory stuff, from ZIP archives ("zipfiles" for short). It - started as just a testbed for fooling with zipfiles, but at this point it - is actually a useful utility. It also became the basis for the rewrite of - UnZip (3.16 -> 4.0), using the central directory for processing rather than - the individual (local) file headers. - - As of ZipInfo v2.0 and UnZip v5.1, the two programs are combined into one. - If the executable is named "unzip" (or "unzip.exe", depending), it behaves - like UnZip by default; if it is named "zipinfo" or "ii", it behaves like - ZipInfo. The ZipInfo behavior may also be triggered by use of unzip's -Z - option; for example, "unzip -Z [zipinfo_options] archive.zip". - - Another dandy product from your buddies at Newtware! - - Author: Greg Roelofs, newt@pobox.com, http://pobox.com/~newt/ - 23 August 1990 -> April 1997 - - --------------------------------------------------------------------------- - - Version: unzip5??.{tar.Z | tar.gz | zip} for Unix, VMS, OS/2, MS-DOS, Amiga, - Atari, Windows 3.x/95/NT/CE, Macintosh, Human68K, Acorn RISC OS, - AtheOS, BeOS, SMS/QDOS, VM/CMS, MVS, AOS/VS, Tandem NSK, Theos - and TOPS-20. - - Copyrights: see accompanying file "LICENSE" in UnZip source distribution. - (This software is free but NOT IN THE PUBLIC DOMAIN.) - - ---------------------------------------------------------------------------*/ - - - -#define __UNZIP_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" /* includes, typedefs, macros, prototypes, etc. */ -#include "crypt.h" -#include "unzvers.h" - -#include "unzipfx/appDetails.h" - -#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */ - -/***************************/ -/* Local type declarations */ -/***************************/ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -typedef struct _sign_info - { - struct _sign_info *previous; - void (*sighandler)(int); - int sigtype; - } savsigs_info; -#endif - -/*******************/ -/* Local Functions */ -/*******************/ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -static int setsignalhandler OF((__GPRO__ savsigs_info **p_savedhandler_chain, - int signal_type, void (*newhandler)(int))); -#endif -#ifndef SFX -static void help_extended OF((__GPRO)); -static void show_version_info OF((__GPRO)); -#endif - - -/*************/ -/* Constants */ -/*************/ - -#include "consts.h" /* all constant global variables are in here */ - /* (non-constant globals were moved to globals.c) */ - -/* constant local variables: */ - -#ifndef SFX -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - static ZCONST char Far EnvUnZip[] = ENV_UNZIP; - static ZCONST char Far EnvUnZip2[] = ENV_UNZIP2; - static ZCONST char Far EnvZipInfo[] = ENV_ZIPINFO; - static ZCONST char Far EnvZipInfo2[] = ENV_ZIPINFO2; -#ifdef RISCOS - static ZCONST char Far EnvUnZipExts[] = ENV_UNZIPEXTS; -#endif /* RISCOS */ - static ZCONST char Far NoMemEnvArguments[] = - "envargs: cannot get memory for arguments"; -#endif /* !_WIN32_WCE */ - static ZCONST char Far CmdLineParamTooLong[] = - "error: command line parameter #%d exceeds internal size limit\n"; -#endif /* !SFX */ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) - static ZCONST char Far CantSaveSigHandler[] = - "error: cannot save signal handler settings\n"; -#endif - -#if (!defined(SFX) || defined(SFX_EXDIR)) - static ZCONST char Far NotExtracting[] = - "caution: not extracting; -d ignored\n"; - static ZCONST char Far MustGiveExdir[] = - "error: must specify directory to which to extract with -d option\n"; - static ZCONST char Far OnlyOneExdir[] = - "error: -d option used more than once (only one exdir allowed)\n"; -#endif -#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR)) - static ZCONST char Far UTF8EscapeUnSupp[] = - "warning: -U \"escape all non-ASCII UTF-8 chars\" is not supported\n"; -#endif - -#if CRYPT - static ZCONST char Far MustGivePasswd[] = - "error: must give decryption password with -P option\n"; -#endif - -#ifndef SFX - static ZCONST char Far Zfirst[] = - "error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n"; -#endif -static ZCONST char Far InvalidOptionsMsg[] = "error:\ - -fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n"; -static ZCONST char Far IgnoreOOptionMsg[] = - "caution: both -n and -o specified; ignoring -o\n"; - -/* usage() strings */ -#ifndef SFX -#ifdef VMS - static ZCONST char Far Example3[] = "vms.c"; - static ZCONST char Far Example2[] = " unzip \"-V\" foo \"Bar\"\ - (Quote names to preserve case, unless SET PROC/PARS=EXT)\n"; -#else /* !VMS */ - static ZCONST char Far Example3[] = "ReadMe"; -#ifdef RISCOS - static ZCONST char Far Example2[] = -" unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n"; -#else /* !RISCOS */ -#if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE))) - static ZCONST char Far Example2[] = - ""; /* no room: too many local3[] items */ -#else /* !OS2 */ -#ifdef MACOS - static ZCONST char Far Example2[] = ""; /* not needed */ -#else /* !MACOS */ - static ZCONST char Far Example2[] = " \ - unzip -p foo | more => send contents of foo.zip via pipe into program more\n"; -#endif /* ?MACOS */ -#endif /* ?OS2 */ -#endif /* ?RISCOS */ -#endif /* ?VMS */ - -/* local1[]: command options */ -#if defined(TIMESTAMP) - static ZCONST char Far local1[] = - " -T timestamp archive to latest"; -#else /* !TIMESTAMP */ - static ZCONST char Far local1[] = ""; -#endif /* ?TIMESTAMP */ - -/* local2[] and local3[]: modifier options */ -#ifdef DOS_FLX_H68_OS2_W32 -#ifdef FLEXOS - static ZCONST char Far local2[] = ""; -#else - static ZCONST char Far local2[] = - " -$ label removables (-$$ => fixed disks)"; -#endif -#ifdef OS2 -#ifdef MORE - static ZCONST char Far local3[] = "\ - -X restore ACLs if supported -s spaces in filenames => '_'\n\ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = " \ - -X restore ACLs if supported -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#else /* !OS2 */ -#ifdef WIN32 -#ifdef NTSD_EAS -#ifdef MORE - static ZCONST char Far local3[] = "\ - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = " \ - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#else /* !NTSD_EAS */ -#ifdef MORE - static ZCONST char Far local3[] = "\ - -M pipe through \"more\" pager \ - -s spaces in filenames => '_'\n\n"; -#else - static ZCONST char Far local3[] = " \ - -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#endif /* ?NTSD_EAS */ -#else /* !WIN32 */ -#ifdef MORE - static ZCONST char Far local3[] = " -\ -M pipe through \"more\" pager -s spaces in filenames => '_'\n\n"; -#else - static ZCONST char Far local3[] = "\ - -s spaces in filenames => '_'\n"; -#endif -#endif /* ?WIN32 */ -#endif /* ?OS2 || ?WIN32 */ -#else /* !DOS_FLX_OS2_W32 */ -#ifdef VMS - static ZCONST char Far local2[] = " -X restore owner/ACL protection info"; -#ifdef MORE - static ZCONST char Far local3[] = "\ - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ - --D restore dir (-D: no) timestamps -M pipe through \"more\" pager\n\ - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ -\n\n"; -#else - static ZCONST char Far local3[] = "\n\ - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ - --D restore dir (-D: no) timestamps\n\ - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ -\n\n"; -#endif -#else /* !VMS */ -#ifdef ATH_BEO_UNX - static ZCONST char Far local2[] = " -X restore UID/GID info"; -#ifdef MORE - static ZCONST char Far local3[] = "\ - -K keep setuid/setgid/tacky permissions -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\ - -K keep setuid/setgid/tacky permissions\n"; -#endif -#else /* !ATH_BEO_UNX */ -#ifdef TANDEM - static ZCONST char Far local2[] = "\ - -X restore Tandem User ID -r remove file extensions\n\ - -b create 'C' (180) text files "; -#ifdef MORE - static ZCONST char Far local3[] = " \ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\n"; -#endif -#else /* !TANDEM */ -#ifdef AMIGA - static ZCONST char Far local2[] = " -N restore comments as filenotes"; -#ifdef MORE - static ZCONST char Far local3[] = " \ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\n"; -#endif -#else /* !AMIGA */ -#ifdef MACOS - static ZCONST char Far local2[] = " -E show Mac info during extraction"; - static ZCONST char Far local3[] = " \ - -i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\ -\n"; -#else /* !MACOS */ -#ifdef MORE - static ZCONST char Far local2[] = " -M pipe through \"more\" pager"; - static ZCONST char Far local3[] = "\n"; -#else - static ZCONST char Far local2[] = ""; /* Atari, Mac, CMS/MVS etc. */ - static ZCONST char Far local3[] = ""; -#endif -#endif /* ?MACOS */ -#endif /* ?AMIGA */ -#endif /* ?TANDEM */ -#endif /* ?ATH_BEO_UNX */ -#endif /* ?VMS */ -#endif /* ?DOS_FLX_OS2_W32 */ -#endif /* !SFX */ - -#ifndef NO_ZIPINFO -#ifdef VMS - static ZCONST char Far ZipInfoExample[] = "* or % (e.g., \"*font-%.zip\")"; -#else - static ZCONST char Far ZipInfoExample[] = "*, ?, [] (e.g., \"[a-j]*.zip\")"; -#endif - -static ZCONST char Far ZipInfoUsageLine1[] = "\ -ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\ -\n\ -List name, date/time, attribute, size, compression method, etc., about files\n\ -in list (excluding those in xlist) contained in the specified .zip archive(s).\ -\n\"file[.zip]\" may be a wildcard name containing %s.\n\n\ - usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\ - or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n"; - -static ZCONST char Far ZipInfoUsageLine2[] = "\nmain\ - listing-format options: -s short Unix \"ls -l\" format (def.)\n\ - -1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\ - -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ - -v verbose, multi-page format\n"; - -static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ - -h print header line -t print totals for listed files or for all\n\ - -z print zipfile comment -T print file times in sortable decimal format\ -\n -C be case-insensitive %s\ - -x exclude filenames that follow from listing\n"; -#ifdef MORE - static ZCONST char Far ZipInfoUsageLine4[] = - " -M page output through built-in \"more\"\n"; -#else /* !MORE */ - static ZCONST char Far ZipInfoUsageLine4[] = ""; -#endif /* ?MORE */ -#endif /* !NO_ZIPINFO */ - -#ifdef BETA -# ifdef VMSCLI - /* BetaVersion[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far BetaVersion[] = "%s\ - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; -# else - static ZCONST char Far BetaVersion[] = "%s\ - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; -# endif -#endif - -#ifdef SFX -# ifdef VMSCLI - /* UnzipSFXBanner[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far UnzipSFXBanner[] = -# else - static ZCONST char Far UnzipSFXBanner[] = -# endif - SFX_APP_BANNER "\n"; -# ifdef SFX_EXDIR - static ZCONST char Far UnzipSFXOpts[] = - "Valid options are -tfupcz and -d ; modifiers are -abjnoqCL%sV%s.\n"; -# else - static ZCONST char Far UnzipSFXOpts[] = - "Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n"; -# endif -#else /* !SFX */ - static ZCONST char Far CompileOptions[] = - "UnZip special compilation options:\n"; - static ZCONST char Far CompileOptFormat[] = " %s\n"; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - static ZCONST char Far EnvOptions[] = - "\nUnZip and ZipInfo environment options:\n"; - static ZCONST char Far EnvOptFormat[] = "%16s: %.1024s\n"; -#endif - static ZCONST char Far None[] = "[none]"; -# ifdef ACORN_FTYPE_NFS - static ZCONST char Far AcornFtypeNFS[] = "ACORN_FTYPE_NFS"; -# endif -# ifdef ASM_CRC - static ZCONST char Far AsmCRC[] = "ASM_CRC"; -# endif -# ifdef ASM_INFLATECODES - static ZCONST char Far AsmInflateCodes[] = "ASM_INFLATECODES"; -# endif -# ifdef CHECK_VERSIONS - static ZCONST char Far Check_Versions[] = "CHECK_VERSIONS"; -# endif -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far Copyright_Clean[] = - "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)"; -# endif -# ifdef DEBUG - static ZCONST char Far UDebug[] = "DEBUG"; -# endif -# ifdef DEBUG_TIME - static ZCONST char Far DebugTime[] = "DEBUG_TIME"; -# endif -# ifdef DLL - static ZCONST char Far Dll[] = "DLL"; -# endif -# ifdef DOSWILD - static ZCONST char Far DosWild[] = "DOSWILD"; -# endif -# ifdef LZW_CLEAN - static ZCONST char Far LZW_Clean[] = - "LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)"; -# endif -# ifndef MORE - static ZCONST char Far No_More[] = "NO_MORE"; -# endif -# ifdef NO_ZIPINFO - static ZCONST char Far No_ZipInfo[] = "NO_ZIPINFO"; -# endif -# ifdef NTSD_EAS - static ZCONST char Far NTSDExtAttrib[] = "NTSD_EAS"; -# endif -# if defined(WIN32) && defined(NO_W32TIMES_IZFIX) - static ZCONST char Far W32NoIZTimeFix[] = "NO_W32TIMES_IZFIX"; -# endif -# ifdef OLD_THEOS_EXTRA - static ZCONST char Far OldTheosExtra[] = - "OLD_THEOS_EXTRA (handle also old Theos port extra field)"; -# endif -# ifdef OS2_EAS - static ZCONST char Far OS2ExtAttrib[] = "OS2_EAS"; -# endif -# ifdef QLZIP - static ZCONST char Far SMSExFldOnUnix[] = "QLZIP"; -# endif -# ifdef REENTRANT - static ZCONST char Far Reentrant[] = "REENTRANT"; -# endif -# ifdef REGARGS - static ZCONST char Far RegArgs[] = "REGARGS"; -# endif -# ifdef RETURN_CODES - static ZCONST char Far Return_Codes[] = "RETURN_CODES"; -# endif -# ifdef SET_DIR_ATTRIB - static ZCONST char Far SetDirAttrib[] = "SET_DIR_ATTRIB"; -# endif -# ifdef SYMLINKS - static ZCONST char Far SymLinkSupport[] = - "SYMLINKS (symbolic links supported, if RTL and file system permit)"; -# endif -# ifdef TIMESTAMP - static ZCONST char Far TimeStamp[] = "TIMESTAMP"; -# endif -# ifdef UNIXBACKUP - static ZCONST char Far UnixBackup[] = "UNIXBACKUP"; -# endif -# ifdef USE_EF_UT_TIME - static ZCONST char Far Use_EF_UT_time[] = "USE_EF_UT_TIME"; -# endif -# ifndef LZW_CLEAN - static ZCONST char Far Use_Unshrink[] = - "USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)"; -# endif -# ifndef COPYRIGHT_CLEAN - static ZCONST char Far Use_Smith_Code[] = - "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)"; -# endif -# ifdef USE_DEFLATE64 - static ZCONST char Far Use_Deflate64[] = - "USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)"; -# endif -# ifdef UNICODE_SUPPORT -# ifdef UTF8_MAYBE_NATIVE -# ifdef UNICODE_WCHAR - /* direct native UTF-8 check AND charset transform via wchar_t */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [wide-chars, char coding: %s] (handle UTF-8 paths)"; -# else - /* direct native UTF-8 check, only */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [char coding: %s] (handle UTF-8 paths)"; -# endif - static ZCONST char Far SysChUTF8[] = "UTF-8"; - static ZCONST char Far SysChOther[] = "other"; -# else /* !UTF8_MAYBE_NATIVE */ - /* charset transform via wchar_t, no native UTF-8 support */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [wide-chars] (handle UTF-8 paths)"; -# endif /* ?UTF8_MAYBE_NATIVE */ -# endif /* UNICODE_SUPPORT */ -# ifdef _MBCS - static ZCONST char Far Have_MBCS_Support[] = - "MBCS-support (multibyte character support, MB_CUR_MAX = %u)"; -# endif -# ifdef MULT_VOLUME - static ZCONST char Far Use_MultiVol[] = - "MULT_VOLUME (multi-volume archives supported)"; -# endif -# ifdef LARGE_FILE_SUPPORT - static ZCONST char Far Use_LFS[] = - "LARGE_FILE_SUPPORT (large files over 2 GiB supported)"; -# endif -# ifdef ZIP64_SUPPORT - static ZCONST char Far Use_Zip64[] = - "ZIP64_SUPPORT (archives using Zip64 for large files supported)"; -# endif -# if (defined(__DJGPP__) && (__DJGPP__ >= 2)) -# ifdef USE_DJGPP_ENV - static ZCONST char Far Use_DJGPP_Env[] = "USE_DJGPP_ENV"; -# endif -# ifdef USE_DJGPP_GLOB - static ZCONST char Far Use_DJGPP_Glob[] = "USE_DJGPP_GLOB"; -# endif -# endif /* __DJGPP__ && (__DJGPP__ >= 2) */ -# ifdef USE_VFAT - static ZCONST char Far Use_VFAT_support[] = "USE_VFAT"; -# endif -# ifdef USE_ZLIB - static ZCONST char Far UseZlib[] = - "USE_ZLIB (compiled with version %s; using version %s)"; -# endif -# ifdef USE_BZIP2 - static ZCONST char Far UseBZip2[] = - "USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version %s)"; -# endif -# ifdef VMS_TEXT_CONV - static ZCONST char Far VmsTextConv[] = "VMS_TEXT_CONV"; -# endif -# ifdef VMSCLI - static ZCONST char Far VmsCLI[] = "VMSCLI"; -# endif -# ifdef VMSWILD - static ZCONST char Far VmsWild[] = "VMSWILD"; -# endif -# ifdef WILD_STOP_AT_DIR - static ZCONST char Far WildStopAtDir[] = "WILD_STOP_AT_DIR"; -# endif -# if CRYPT -# ifdef PASSWD_FROM_STDIN - static ZCONST char Far PasswdStdin[] = "PASSWD_FROM_STDIN"; -# endif - static ZCONST char Far Decryption[] = - " [decryption, version %d.%d%s of %s]\n"; - static ZCONST char Far CryptDate[] = CR_VERSION_DATE; -# endif -# ifndef __RSXNT__ -# ifdef __EMX__ - static ZCONST char Far EnvEMX[] = "EMX"; - static ZCONST char Far EnvEMXOPT[] = "EMXOPT"; -# endif -# if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) - static ZCONST char Far EnvGO32[] = "GO32"; - static ZCONST char Far EnvGO32TMP[] = "GO32TMP"; -# endif -# endif /* !__RSXNT__ */ - -#ifdef VMS -/* UnzipUsageLine1[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n"; -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far UnzipUsageLine1v[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# else - static ZCONST char Far UnzipUsageLine1v[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# endif /* ?COPYRIGHT_CLEAN */ -#else /* !VMS */ -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# else - static ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# endif /* ?COPYRIGHT_CLEAN */ -# define UnzipUsageLine1v UnzipUsageLine1 -#endif /* ?VMS */ - -static ZCONST char Far UnzipUsageLine2v[] = "\ -Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;\ -\nsee ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.\ -\n\n"; - -#ifdef MACOS -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \ - Default action is to extract files in list, to exdir;\n\ - file[.zip] may be a wildcard. %s\n"; -#else /* !MACOS */ -#ifdef VM_CMS -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \ - Default action is to extract files in list, except those in xlist, to disk fm;\ -\n file[.zip] may be a wildcard. %s\n"; -#else /* !VM_CMS */ -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \ - Default action is to extract files in list, except those in xlist, to exdir;\n\ - file[.zip] may be a wildcard. %s\n"; -#endif /* ?VM_CMS */ -#endif /* ?MACOS */ - -#ifdef NO_ZIPINFO -# define ZIPINFO_MODE_OPTION "" - static ZCONST char Far ZipInfoMode[] = - "(ZipInfo mode is disabled in this version.)"; -#else -# define ZIPINFO_MODE_OPTION "[-Z] " - static ZCONST char Far ZipInfoMode[] = - "-Z => ZipInfo mode (\"unzip -Z\" for usage)."; -#endif /* ?NO_ZIPINFO */ - -#ifdef VMS - static ZCONST char Far VMSusageLine2b[] = "\ -=> define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\ -\n"; -#endif - -#ifdef MACOS -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -d extract files into exdir -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n"; -#else /* !MACOS */ -#ifdef VM_CMS -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -p extract files to pipe, no messages -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n\ - -x exclude files that follow (in xlist) -d extract files onto disk fm\n"; -#else /* !VM_CMS */ -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -p extract files to pipe, no messages -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n\ - -x exclude files that follow (in xlist) -d extract files into exdir\n"; -#endif /* ?VM_CMS */ -#endif /* ?MACOS */ - -/* There is not enough space on a standard 80x25 Windows console screen for - * the additional line advertising the UTF-8 debugging options. This may - * eventually also be the case for other ports. Probably, the -U option need - * not be shown on the introductory screen at all. [Chr. Spieler, 2008-02-09] - * - * Likely, other advanced options should be moved to an extended help page and - * the option to list that page put here. [E. Gordon, 2008-3-16] - */ -#if (defined(UNICODE_SUPPORT) && !defined(WIN32)) -#ifdef VMS -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite or make a new version of an existing file\n\ - -o always make a new version (-oo: overwrite original) of an existing file\n\ - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#else /* !VMS */ -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#endif /* ?VMS */ -#else /* !UNICODE_SUPPORT */ -#ifdef VMS -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite or make a new version of an existing file\n\ - -o always make a new version (-oo: overwrite original) of an existing file\n\ - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#else /* !VMS */ -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#endif /* ?VMS */ -#endif /* ?UNICODE_SUPPORT */ - -static ZCONST char Far UnzipUsageLine5[] = "\ -See \"unzip -hh\" or unzip.txt for more help. Examples:\n\ - unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\ -%s\ - unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n"; -#endif /* ?SFX */ - - - - - -/*****************************/ -/* main() / UzpMain() stub */ -/*****************************/ - -int MAIN(argc, argv) /* return PK-type error code (except under VMS) */ - int argc; - char *argv[]; -{ - int r; - - CONSTRUCTGLOBALS(); - r = unzip(__G__ argc, argv); - DESTROYGLOBALS(); - RETURN(r); -} - - - - -/*******************************/ -/* Primary UnZip entry point */ -/*******************************/ - -int unzip(__G__ argc, argv) - __GDEF - int argc; - char *argv[]; -{ -#ifndef NO_ZIPINFO - char *p; -#endif -#if (defined(DOS_FLX_H68_NLM_OS2_W32) || !defined(SFX)) - int i; -#endif - int retcode, error=FALSE; -#ifndef NO_EXCEPT_SIGNALS -#ifdef REENTRANT - savsigs_info *oldsighandlers = NULL; -# define SET_SIGHANDLER(sigtype, newsighandler) \ - if ((retcode = setsignalhandler(__G__ &oldsighandlers, (sigtype), \ - (newsighandler))) > PK_WARN) \ - goto cleanup_and_exit -#else -# define SET_SIGHANDLER(sigtype, newsighandler) \ - signal((sigtype), (newsighandler)) -#endif -#endif /* NO_EXCEPT_SIGNALS */ - - /* initialize international char support to the current environment */ - SETLOCALE(LC_CTYPE, ""); - -#ifdef UNICODE_SUPPORT - /* see if can use UTF-8 Unicode locale */ -# ifdef UTF8_MAYBE_NATIVE - { - char *codeset; -# if !(defined(NO_NL_LANGINFO) || defined(NO_LANGINFO_H)) - /* get the codeset (character set encoding) currently used */ -# include - - codeset = nl_langinfo(CODESET); -# else /* NO_NL_LANGINFO || NO_LANGINFO_H */ - /* query the current locale setting for character classification */ - codeset = setlocale(LC_CTYPE, NULL); - if (codeset != NULL) { - /* extract the codeset portion of the locale name */ - codeset = strchr(codeset, '.'); - if (codeset != NULL) ++codeset; - } -# endif /* ?(NO_NL_LANGINFO || NO_LANGINFO_H) */ - /* is the current codeset UTF-8 ? */ - if ((codeset != NULL) && (strcmp(codeset, "UTF-8") == 0)) { - /* successfully found UTF-8 char coding */ - G.native_is_utf8 = TRUE; - } else { - /* Current codeset is not UTF-8 or cannot be determined. */ - G.native_is_utf8 = FALSE; - } - /* Note: At least for UnZip, trying to change the process codeset to - * UTF-8 does not work. For the example Linux setup of the - * UnZip maintainer, a successful switch to "en-US.UTF-8" - * resulted in garbage display of all non-basic ASCII characters. - */ - } -# endif /* UTF8_MAYBE_NATIVE */ - - /* initialize Unicode */ - G.unicode_escape_all = 0; - G.unicode_mismatch = 0; - - G.unipath_version = 0; - G.unipath_checksum = 0; - G.unipath_filename = NULL; -#endif /* UNICODE_SUPPORT */ - - -#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) - extern void DebugMalloc(void); - - atexit(DebugMalloc); -#endif - -#ifdef MALLOC_WORK - /* The following (rather complex) expression determines the allocation - size of the decompression work area. It simulates what the - combined "union" and "struct" declaration of the "static" work - area reservation achieves automatically at compile time. - Any decent compiler should evaluate this expression completely at - compile time and provide constants to the zcalloc() call. - (For better readability, some subexpressions are encapsulated - in temporarly defined macros.) - */ -# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch)) -# define UZ_NUMOF_CHUNKS \ - (unsigned)(((WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK > HSIZE) ? \ - (WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK : HSIZE) - G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK); -# undef UZ_SLIDE_CHUNK -# undef UZ_NUMOF_CHUNKS - G.area.shrink.Parent = (shrint *)G.area.Slide; - G.area.shrink.value = G.area.Slide + (sizeof(shrint)*(HSIZE)); - G.area.shrink.Stack = G.area.Slide + - (sizeof(shrint) + sizeof(uch))*(HSIZE); -#endif - -/*--------------------------------------------------------------------------- - Set signal handler for restoring echo, warn of zipfile corruption, etc. - ---------------------------------------------------------------------------*/ -#ifndef NO_EXCEPT_SIGNALS -#ifdef SIGINT - SET_SIGHANDLER(SIGINT, handler); -#endif -#ifdef SIGTERM /* some systems really have no SIGTERM */ - SET_SIGHANDLER(SIGTERM, handler); -#endif -#if defined(SIGABRT) && !(defined(AMIGA) && defined(__SASC)) - SET_SIGHANDLER(SIGABRT, handler); -#endif -#ifdef SIGBREAK - SET_SIGHANDLER(SIGBREAK, handler); -#endif -#ifdef SIGBUS - SET_SIGHANDLER(SIGBUS, handler); -#endif -#ifdef SIGILL - SET_SIGHANDLER(SIGILL, handler); -#endif -#ifdef SIGSEGV - SET_SIGHANDLER(SIGSEGV, handler); -#endif -#endif /* NO_EXCEPT_SIGNALS */ - -#if (defined(WIN32) && defined(__RSXNT__)) - for (i = 0 ; i < argc; i++) { - _ISO_INTERN(argv[i]); - } -#endif - -/*--------------------------------------------------------------------------- - Macintosh initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef MACOS - { - int a; - - for (a = 0; a < 4; ++a) - G.rghCursor[a] = GetCursor(a+128); - G.giCursor = 0; - } -#endif - -/*--------------------------------------------------------------------------- - NetWare initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef NLM - InitUnZipConsole(); -#endif - -/*--------------------------------------------------------------------------- - Acorn RISC OS initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef RISCOS - set_prefix(); -#endif - -/*--------------------------------------------------------------------------- - Theos initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef THEOS - /* The easiest way found to force creation of libraries when selected - * members are to be unzipped. Explicitly add libraries names to the - * arguments list before the first member of the library. - */ - if (! _setargv(&argc, &argv)) { - Info(slide, 0x401, ((char *)slide, "cannot process argv\n")); - retcode = PK_MEM; - goto cleanup_and_exit; - } -#endif - -/*--------------------------------------------------------------------------- - Sanity checks. Commentary by Otis B. Driftwood and Fiorello: - - D: It's all right. That's in every contract. That's what they - call a sanity clause. - - F: Ha-ha-ha-ha-ha. You can't fool me. There ain't no Sanity - Claus. - ---------------------------------------------------------------------------*/ - -#ifdef DEBUG -# ifdef LARGE_FILE_SUPPORT - /* test if we can support large files - 10/6/04 EG */ - if (sizeof(zoff_t) < 8) { - Info(slide, 0x401, ((char *)slide, "LARGE_FILE_SUPPORT set but not supported\n")); - retcode = PK_BADERR; - goto cleanup_and_exit; - } - /* test if we can show 64-bit values */ - { - zoff_t z = ~(zoff_t)0; /* z should be all 1s now */ - char *sz; - - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); - if ((sz[0] != 'F') || (strlen(sz) != 16)) - { - z = 0; - } - - /* shift z so only MSB is set */ - z <<= 63; - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); - if ((sz[0] != '8') || (strlen(sz) != 16)) - { - Info(slide, 0x401, ((char *)slide, - "Can't show 64-bit values correctly\n")); - retcode = PK_BADERR; - goto cleanup_and_exit; - } - } -# endif /* LARGE_FILE_SUPPORT */ - - /* 2004-11-30 SMS. - Test the NEXTBYTE macro for proper operation. - */ - { - int test_char; - static uch test_buf[2] = { 'a', 'b' }; - - G.inptr = test_buf; - G.incnt = 1; - - test_char = NEXTBYTE; /* Should get 'a'. */ - if (test_char == 'a') - { - test_char = NEXTBYTE; /* Should get EOF, not 'b'. */ - } - if (test_char != EOF) - { - Info(slide, 0x401, ((char *)slide, - "NEXTBYTE macro failed. Try compiling with ALT_NEXTBYTE defined?")); - - retcode = PK_BADERR; - goto cleanup_and_exit; - } - } -#endif /* DEBUG */ - -/*--------------------------------------------------------------------------- - First figure out if we're running in UnZip mode or ZipInfo mode, and put - the appropriate environment-variable options into the queue. Then rip - through any command-line options lurking about... - ---------------------------------------------------------------------------*/ - -#ifdef SFX - G.argv0 = argv[0]; -#if (defined(OS2) || defined(WIN32)) - G.zipfn = GetLoadPath(__G);/* non-MSC NT puts path into G.filename[] */ -#else - G.zipfn = G.argv0; -#endif - -#ifdef VMSCLI - { - ulg status = vms_unzip_cmdline(&argc, &argv); - if (!(status & 1)) { - retcode = (int)status; - goto cleanup_and_exit; - } - } -#endif /* VMSCLI */ - - uO.zipinfo_mode = FALSE; - error = uz_opts(__G__ &argc, &argv); /* UnZipSFX call only */ - -#else /* !SFX */ - -#ifdef RISCOS - /* get the extensions to swap from environment */ - getRISCOSexts(ENV_UNZIPEXTS); -#endif - -#ifdef MSDOS - /* extract MKS extended argument list from environment (before envargs!) */ - mksargs(&argc, &argv); -#endif - -#ifdef VMSCLI - { - ulg status = vms_unzip_cmdline(&argc, &argv); - if (!(status & 1)) { - retcode = (int)status; - goto cleanup_and_exit; - } - } -#endif /* VMSCLI */ - - G.noargs = (argc == 1); /* no options, no zipfile, no anything */ - -#ifndef NO_ZIPINFO - for (p = argv[0] + strlen(argv[0]); p >= argv[0]; --p) { - if (*p == DIR_END -#ifdef DIR_END2 - || *p == DIR_END2 -#endif - ) - break; - } - ++p; - -#ifdef THEOS - if (strncmp(p, "ZIPINFO.",8) == 0 || strstr(p, ".ZIPINFO:") != NULL || - strncmp(p, "II.",3) == 0 || strstr(p, ".II:") != NULL || -#else - if (STRNICMP(p, LoadFarStringSmall(Zipnfo), 7) == 0 || - STRNICMP(p, "ii", 2) == 0 || -#endif - (argc > 1 && strncmp(argv[1], "-Z", 2) == 0)) - { - uO.zipinfo_mode = TRUE; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvZipInfo), - LoadFarStringSmall2(EnvZipInfo2))) != PK_OK) - perror(LoadFarString(NoMemEnvArguments)); -#endif - } else -#endif /* !NO_ZIPINFO */ - { - uO.zipinfo_mode = FALSE; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvUnZip), - LoadFarStringSmall2(EnvUnZip2))) != PK_OK) - perror(LoadFarString(NoMemEnvArguments)); -#endif - } - - if (!error) { - /* Check the length of all passed command line parameters. - * Command arguments might get sent through the Info() message - * system, which uses the sliding window area as string buffer. - * As arguments may additionally get fed through one of the FnFilter - * macros, we require all command line arguments to be shorter than - * WSIZE/4 (and ca. 2 standard line widths for fixed message text). - */ - for (i = 1 ; i < argc; i++) { - if (strlen(argv[i]) > ((WSIZE>>2) - 160)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CmdLineParamTooLong), i)); - retcode = PK_PARAM; - goto cleanup_and_exit; - } - } -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) - error = zi_opts(__G__ &argc, &argv); - else -#endif /* !NO_ZIPINFO */ - error = uz_opts(__G__ &argc, &argv); - } - -#endif /* ?SFX */ - - if ((argc < 0) || error) { - retcode = error; - goto cleanup_and_exit; - } - -/*--------------------------------------------------------------------------- - Now get the zipfile name from the command line and then process any re- - maining options and file specifications. - ---------------------------------------------------------------------------*/ - -#ifdef DOS_FLX_H68_NLM_OS2_W32 - /* convert MSDOS-style 'backward slash' directory separators to Unix-style - * 'forward slashes' for user's convenience (include zipfile name itself) - */ -#ifdef SFX - for (G.pfnames = argv, i = argc; i > 0; --i) { -#else - /* argc does not include the zipfile specification */ - for (G.pfnames = argv, i = argc+1; i > 0; --i) { -#endif -#ifdef __human68k__ - extern char *_toslash(char *); - _toslash(*G.pfnames); -#else /* !__human68k__ */ - char *q = *G.pfnames; - - while (*q != '\0') { - if (*q == '\\') - *q = '/'; - INCSTR(q); - } -#endif /* ?__human68k__ */ - ++G.pfnames; - } -#endif /* DOS_FLX_H68_NLM_OS2_W32 */ - -#ifndef SFX - G.wildzipfn = *argv++; -#endif - -#if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */ - - G.filespecs = argc; - G.xfilespecs = 0; - - if (argc > 0) { - char **pp = argv-1; - - G.pfnames = argv; - while (*++pp) - if (strcmp(*pp, "-x") == 0) { - if (pp > argv) { - *pp = 0; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; - } else { - G.pfnames = (char **)fnames; /* defaults */ - G.filespecs = 0; - } - G.pxnames = pp + 1; /* excluded-names ptr: _after_ -x */ - G.xfilespecs = argc - G.filespecs - 1; - break; /* skip rest of args */ - } - G.process_all_files = FALSE; - } else - G.process_all_files = TRUE; /* for speed */ - -#else /* !SFX || SFX_EXDIR */ /* check for -x or -d */ - - G.filespecs = argc; - G.xfilespecs = 0; - - if (argc > 0) { - int in_files=FALSE, in_xfiles=FALSE; - char **pp = argv-1; - - G.process_all_files = FALSE; - G.pfnames = argv; - while (*++pp) { - Trace((stderr, "pp - argv = %d\n", pp-argv)); -#ifdef CMS_MVS - if (!uO.exdir && STRNICMP(*pp, "-d", 2) == 0) { -#else - if (!uO.exdir && strncmp(*pp, "-d", 2) == 0) { -#endif - int firstarg = (pp == argv); - - uO.exdir = (*pp) + 2; - if (in_files) { /* ... zipfile ... -d exdir ... */ - *pp = (char *)NULL; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; - in_files = FALSE; - } else if (in_xfiles) { - *pp = (char *)NULL; /* terminate G.pxnames */ - G.xfilespecs = pp - G.pxnames; - /* "... -x xlist -d exdir": nothing left */ - } - /* first check for "-dexdir", then for "-d exdir" */ - if (*uO.exdir == '\0') { - if (*++pp) - uO.exdir = *pp; - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - /* don't extract here by accident */ - retcode = PK_PARAM; - goto cleanup_and_exit; - } - } - if (firstarg) { /* ... zipfile -d exdir ... */ - if (pp[1]) { - G.pfnames = pp + 1; /* argv+2 */ - G.filespecs = argc - (G.pfnames-argv); /* for now... */ - } else { - G.process_all_files = TRUE; - G.pfnames = (char **)fnames; /* GRR: necessary? */ - G.filespecs = 0; /* GRR: necessary? */ - break; - } - } - } else if (!in_xfiles) { - if (strcmp(*pp, "-x") == 0) { - in_xfiles = TRUE; - if (pp == G.pfnames) { - G.pfnames = (char **)fnames; /* defaults */ - G.filespecs = 0; - } else if (in_files) { - *pp = 0; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; /* adjust count */ - in_files = FALSE; - } - G.pxnames = pp + 1; /* excluded-names ptr starts after -x */ - G.xfilespecs = argc - (G.pxnames-argv); /* anything left */ - } else - in_files = TRUE; - } - } - } else - G.process_all_files = TRUE; /* for speed */ - - if (uO.exdir != (char *)NULL && !G.extract_flag) /* -d ignored */ - Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting))); -#endif /* ?(SFX && !SFX_EXDIR) */ - -#ifdef UNICODE_SUPPORT - /* set Unicode-escape-all if option -U used */ - if (uO.U_flag == 1) -# ifdef UNICODE_WCHAR - G.unicode_escape_all = TRUE; -# else - Info(slide, 0x401, ((char *)slide, LoadFarString(UTF8EscapeUnSupp))); -# endif -#endif - - -/*--------------------------------------------------------------------------- - Okey dokey, we have everything we need to get started. Let's roll. - ---------------------------------------------------------------------------*/ - - retcode = process_zipfiles(__G); - -cleanup_and_exit: -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) - /* restore all signal handlers back to their state at function entry */ - while (oldsighandlers != NULL) { - savsigs_info *thissigsav = oldsighandlers; - - signal(thissigsav->sigtype, thissigsav->sighandler); - oldsighandlers = thissigsav->previous; - free(thissigsav); - } -#endif -#if (defined(MALLOC_WORK) && !defined(REENTRANT)) - if (G.area.Slide != (uch *)NULL) { - free(G.area.Slide); - G.area.Slide = (uch *)NULL; - } -#endif -#if (defined(MSDOS) && !defined(SFX) && !defined(WINDLL)) - if (retcode != PK_OK) - check_for_windows("UnZip"); -#endif - return(retcode); - -} /* end main()/unzip() */ - - - - - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -/*******************************/ -/* Function setsignalhandler() */ -/*******************************/ - -static int setsignalhandler(__G__ p_savedhandler_chain, signal_type, - newhandler) - __GDEF - savsigs_info **p_savedhandler_chain; - int signal_type; - void (*newhandler)(int); -{ - savsigs_info *savsig; - - savsig = malloc(sizeof(savsigs_info)); - if (savsig == NULL) { - /* error message and break */ - Info(slide, 0x401, ((char *)slide, LoadFarString(CantSaveSigHandler))); - return PK_MEM; - } - savsig->sigtype = signal_type; - savsig->sighandler = signal(SIGINT, newhandler); - if (savsig->sighandler == SIG_ERR) { - free(savsig); - } else { - savsig->previous = *p_savedhandler_chain; - *p_savedhandler_chain = savsig; - } - return PK_OK; - -} /* end function setsignalhandler() */ - -#endif /* REENTRANT && !NO_EXCEPT_SIGNALS */ - - - - - -/**********************/ -/* Function uz_opts() */ -/**********************/ - -int uz_opts(__G__ pargc, pargv) - __GDEF - int *pargc; - char ***pargv; -{ - char **argv, *s; - int argc, c, error=FALSE, negative=0, showhelp=0; - - - argc = *pargc; - argv = *pargv; - - uO.exdir = sfx_get_tmp_path(0); - uO.overwrite_all = 1; - - sfx_app_set_args(argc-1, argv+1); - - while (++argv, (--argc > 0 && *argv != NULL /*&& **argv == '-'*/)) { -#if 0 - s = *argv + 1; - while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ -#ifdef CMS_MVS - switch (tolower(c)) -#else - switch (c) -#endif - { - case ('-'): - ++negative; - break; -#ifdef RISCOS - case ('/'): - if (negative) { /* negative not allowed with -/ swap */ - Info(slide, 0x401, ((char *)slide, - "error: must give extensions list")); - return(PK_PARAM); /* don't extract here by accident */ - } - exts2swap = s; /* override Unzip$Exts */ - s += strlen(s); - break; -#endif - case ('a'): - if (negative) { - uO.aflag = MAX(uO.aflag-negative,0); - negative = 0; - } else - ++uO.aflag; - break; -#if (defined(DLL) && defined(API_DOC)) - case ('A'): /* extended help for API */ - APIhelp(__G__ argc, argv); - *pargc = -1; /* signal to exit successfully */ - return 0; -#endif - case ('b'): - if (negative) { -#if (defined(TANDEM) || defined(VMS)) - uO.bflag = MAX(uO.bflag-negative,0); -#endif - negative = 0; /* do nothing: "-b" is default */ - } else { -#ifdef VMS - if (uO.aflag == 0) - ++uO.bflag; -#endif -#ifdef TANDEM - ++uO.bflag; -#endif - uO.aflag = 0; - } - break; -#ifdef UNIXBACKUP - case ('B'): /* -B: back up existing files */ - if (negative) - uO.B_flag = FALSE, negative = 0; - else - uO.B_flag = TRUE; - break; -#endif - case ('c'): - if (negative) { - uO.cflag = FALSE, negative = 0; -#ifdef NATIVE - uO.aflag = 0; -#endif - } else { - uO.cflag = TRUE; -#ifdef NATIVE - uO.aflag = 2; /* so you can read it on the screen */ -#endif -#ifdef DLL - if (G.redirect_text) - G.redirect_data = 2; -#endif - } - break; -#ifndef CMS_MVS - case ('C'): /* -C: match filenames case-insensitively */ - if (negative) - uO.C_flag = FALSE, negative = 0; - else - uO.C_flag = TRUE; - break; -#endif /* !CMS_MVS */ -#if (!defined(SFX) || defined(SFX_EXDIR)) - case ('d'): - if (negative) { /* negative not allowed with -d exdir */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); /* don't extract here by accident */ - } - if (uO.exdir != (char *)NULL) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(OnlyOneExdir))); - return(PK_PARAM); /* GRR: stupid restriction? */ - } else { - /* first check for "-dexdir", then for "-d exdir" */ - uO.exdir = s; - if (*uO.exdir == '\0') { - if (argc > 1) { - --argc; - uO.exdir = *++argv; - if (*uO.exdir == '-') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); - } - /* else uO.exdir points at extraction dir */ - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); - } - } - /* uO.exdir now points at extraction dir (-dexdir or - * -d exdir); point s at end of exdir to avoid mis- - * interpretation of exdir characters as more options - */ - if (*s != 0) - while (*++s != 0) - ; - } - break; -#endif /* !SFX || SFX_EXDIR */ -#if (!defined(NO_TIMESTAMPS)) - case ('D'): /* -D: Skip restoring dir (or any) timestamp. */ - if (negative) { - uO.D_flag = MAX(uO.D_flag-negative,0); - negative = 0; - } else - uO.D_flag++; - break; -#endif /* (!NO_TIMESTAMPS) */ - case ('e'): /* just ignore -e, -x options (extract) */ - break; -#ifdef MACOS - case ('E'): /* -E [MacOS] display Mac e.f. when restoring */ - if( negative ) { - uO.E_flag = FALSE, negative = 0; - } else { - uO.E_flag = TRUE; - } - break; -#endif /* MACOS */ - case ('f'): /* "freshen" (extract only newer files) */ - if (negative) - uO.fflag = uO.uflag = FALSE, negative = 0; - else - uO.fflag = uO.uflag = TRUE; - break; -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - case ('F'): /* Acorn filetype & NFS extension handling */ - if (negative) - uO.acorn_nfs_ext = FALSE, negative = 0; - else - uO.acorn_nfs_ext = TRUE; - break; -#endif /* RISCOS || ACORN_FTYPE_NFS */ - case ('h'): /* just print help message and quit */ - if (showhelp == 0) { -#ifndef SFX - if (*s == 'h') - showhelp = 2; - else -#endif /* !SFX */ - { - showhelp = 1; - } - } - break; -#ifdef MACOS - case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */ - if( negative ) { - uO.i_flag = FALSE, negative = 0; - } else { - uO.i_flag = TRUE; - } - break; -#endif /* MACOS */ - case ('j'): /* junk pathnames/directory structure */ - if (negative) - uO.jflag = FALSE, negative = 0; - else - uO.jflag = TRUE; - break; -#if (defined(ATH_BEO) || defined(MACOS)) - case ('J'): /* Junk AtheOS, BeOS or MacOS file attributes */ - if( negative ) { - uO.J_flag = FALSE, negative = 0; - } else { - uO.J_flag = TRUE; - } - break; -#endif /* ATH_BEO || MACOS */ -#ifdef ATH_BEO_UNX - case ('K'): - if (negative) { - uO.K_flag = FALSE, negative = 0; - } else { - uO.K_flag = TRUE; - } - break; -#endif /* ATH_BEO_UNX */ -#ifndef SFX - case ('l'): - if (negative) { - uO.vflag = MAX(uO.vflag-negative,0); - negative = 0; - } else - ++uO.vflag; - break; -#endif /* !SFX */ -#ifndef CMS_MVS - case ('L'): /* convert (some) filenames to lowercase */ - if (negative) { - uO.L_flag = MAX(uO.L_flag-negative,0); - negative = 0; - } else - ++uO.L_flag; - break; -#endif /* !CMS_MVS */ -#ifdef MORE -#ifdef CMS_MVS - case ('m'): -#endif - case ('M'): /* send all screen output through "more" fn. */ -/* GRR: eventually check for numerical argument => height */ - if (negative) - G.M_flag = FALSE, negative = 0; - else - G.M_flag = TRUE; - break; -#endif /* MORE */ - case ('n'): /* don't overwrite any files */ - if (negative) - uO.overwrite_none = FALSE, negative = 0; - else - uO.overwrite_none = TRUE; - break; -#ifdef AMIGA - case ('N'): /* restore comments as filenotes */ - if (negative) - uO.N_flag = FALSE, negative = 0; - else - uO.N_flag = TRUE; - break; -#endif /* AMIGA */ - case ('o'): /* OK to overwrite files without prompting */ - if (negative) { - uO.overwrite_all = MAX(uO.overwrite_all-negative,0); - negative = 0; - } else - ++uO.overwrite_all; - break; - case ('p'): /* pipes: extract to stdout, no messages */ - if (negative) { - uO.cflag = FALSE; - uO.qflag = MAX(uO.qflag-999,0); - negative = 0; - } else { - uO.cflag = TRUE; - uO.qflag += 999; - } - break; -#if CRYPT - /* GRR: yes, this is highly insecure, but dozens of people - * have pestered us for this, so here we go... */ - case ('P'): - if (negative) { /* negative not allowed with -P passwd */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); /* don't extract here by accident */ - } - if (uO.pwdarg != (char *)NULL) { -/* - GRR: eventually support multiple passwords? - Info(slide, 0x401, ((char *)slide, - LoadFarString(OnlyOnePasswd))); - return(PK_PARAM); - */ - } else { - /* first check for "-Ppasswd", then for "-P passwd" */ - uO.pwdarg = s; - if (*uO.pwdarg == '\0') { - if (argc > 1) { - --argc; - uO.pwdarg = *++argv; - if (*uO.pwdarg == '-') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); - } - /* else pwdarg points at decryption password */ - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); - } - } - /* pwdarg now points at decryption password (-Ppasswd or - * -P passwd); point s at end of passwd to avoid mis- - * interpretation of passwd characters as more options - */ - if (*s != 0) - while (*++s != 0) - ; - } - break; -#endif /* CRYPT */ - case ('q'): /* quiet: fewer comments/messages */ - if (negative) { - uO.qflag = MAX(uO.qflag-negative,0); - negative = 0; - } else - ++uO.qflag; - break; -#ifdef QDOS - case ('Q'): /* QDOS flags */ - qlflag ^= strtol(s, &s, 10); - break; /* we XOR this as we can config qlflags */ -#endif -#ifdef TANDEM - case ('r'): /* remove file extensions */ - if (negative) - uO.rflag = FALSE, negative = 0; - else - uO.rflag = TRUE; - break; -#endif /* TANDEM */ -#ifdef DOS_FLX_NLM_OS2_W32 - case ('s'): /* spaces in filenames: allow by default */ - if (negative) - uO.sflag = FALSE, negative = 0; - else - uO.sflag = TRUE; - break; -#endif /* DOS_FLX_NLM_OS2_W32 */ -#ifdef VMS - /* VMS: extract "text" files in Stream_LF format (-a[a]) */ - case ('S'): - if (negative) - uO.S_flag = FALSE, negative = 0; - else - uO.S_flag = TRUE; - break; -#endif /* VMS */ - case ('t'): - if (negative) - uO.tflag = FALSE, negative = 0; - else - uO.tflag = TRUE; - break; -#ifdef TIMESTAMP - case ('T'): - if (negative) - uO.T_flag = FALSE, negative = 0; - else - uO.T_flag = TRUE; - break; -#endif - case ('u'): /* update (extract only new and newer files) */ - if (negative) - uO.uflag = FALSE, negative = 0; - else - uO.uflag = TRUE; - break; -#ifdef UNICODE_SUPPORT - case ('U'): /* escape UTF-8, or disable UTF-8 support */ - if (negative) { - uO.U_flag = MAX(uO.U_flag-negative,0); - negative = 0; - } else - uO.U_flag++; - break; -#else /* !UNICODE_SUPPORT */ -#ifndef CMS_MVS - case ('U'): /* obsolete; to be removed in version 6.0 */ - if (negative) - uO.L_flag = TRUE, negative = 0; - else - uO.L_flag = FALSE; - break; -#endif /* !CMS_MVS */ -#endif /* ?UNICODE_SUPPORT */ -#ifndef SFX - case ('v'): /* verbose */ - if (negative) { - uO.vflag = MAX(uO.vflag-negative,0); - negative = 0; - } else if (uO.vflag) - ++uO.vflag; - else - uO.vflag = 2; - break; -#endif /* !SFX */ -#ifndef CMS_MVS - case ('V'): /* Version (retain VMS/DEC-20 file versions) */ - if (negative) - uO.V_flag = FALSE, negative = 0; - else - uO.V_flag = TRUE; - break; -#endif /* !CMS_MVS */ -#ifdef WILD_STOP_AT_DIR - case ('W'): /* Wildcard interpretation (stop at '/'?) */ - if (negative) - uO.W_flag = FALSE, negative = 0; - else - uO.W_flag = TRUE; - break; -#endif /* WILD_STOP_AT_DIR */ - case ('x'): /* extract: default */ -#ifdef SFX - /* when 'x' is the only option in this argument, and the - * next arg is not an option, assume this initiates an - * exclusion list (-x xlist): terminate option-scanning - * and leave uz_opts with argv still pointing to "-x"; - * the xlist is processed later - */ - if (s - argv[0] == 2 && *s == '\0' && - argc > 1 && argv[1][0] != '-') { - /* break out of nested loops without "++argv;--argc" */ - goto opts_done; - } -#endif /* SFX */ - break; -#if (defined(RESTORE_UIDGID) || defined(RESTORE_ACL)) - case ('X'): /* restore owner/protection info (need privs?) */ - if (negative) { - uO.X_flag = MAX(uO.X_flag-negative,0); - negative = 0; - } else - ++uO.X_flag; - break; -#endif /* RESTORE_UIDGID || RESTORE_ACL */ -#ifdef VMS - case ('Y'): /* Treat ".nnn" as ";nnn" version. */ - if (negative) - uO.Y_flag = FALSE, negative = 0; - else - uO.Y_flag = TRUE; - break; -#endif /* VMS */ - case ('z'): /* display only the archive comment */ - if (negative) { - uO.zflag = MAX(uO.zflag-negative,0); - negative = 0; - } else - ++uO.zflag; - break; -#ifndef SFX - case ('Z'): /* should have been first option (ZipInfo) */ - Info(slide, 0x401, ((char *)slide, LoadFarString(Zfirst))); - error = TRUE; - break; -#endif /* !SFX */ -#ifdef VMS - case ('2'): /* Force ODS2-compliant names. */ - if (negative) - uO.ods2_flag = FALSE, negative = 0; - else - uO.ods2_flag = TRUE; - break; -#endif /* VMS */ -#ifdef DOS_H68_OS2_W32 - case ('$'): - if (negative) { - uO.volflag = MAX(uO.volflag-negative,0); - negative = 0; - } else - ++uO.volflag; - break; -#endif /* DOS_H68_OS2_W32 */ -#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) - case (':'): /* allow "parent dir" path components */ - if (negative) { - uO.ddotflag = MAX(uO.ddotflag-negative,0); - negative = 0; - } else - ++uO.ddotflag; - break; -#endif /* !RISCOS && !CMS_MVS && !TANDEM */ -#ifdef UNIX - case ('^'): /* allow control chars in filenames */ - if (negative) { - uO.cflxflag = MAX(uO.cflxflag-negative,0); - negative = 0; - } else - ++uO.cflxflag; - break; -#endif /* UNIX */ - default: - error = TRUE; - break; - - } /* end switch */ - } /* end while (not end of argument string) */ -#endif - } /* end while (not done with switches) */ - -/*--------------------------------------------------------------------------- - Check for nonsensical combinations of options. - ---------------------------------------------------------------------------*/ - -#if 0 -#ifdef SFX -opts_done: /* yes, very ugly...but only used by UnZipSFX with -x xlist */ -#endif - - if (showhelp > 0) { /* just print help message and quit */ - *pargc = -1; -#ifndef SFX - if (showhelp == 2) { - help_extended(__G); - return PK_OK; - } else -#endif /* !SFX */ - { - return USAGE(PK_OK); - } - } - - if ((uO.cflag && (uO.tflag || uO.uflag)) || - (uO.tflag && uO.uflag) || (uO.fflag && uO.overwrite_none)) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(InvalidOptionsMsg))); - error = TRUE; - } - if (uO.aflag > 2) - uO.aflag = 2; -#ifdef VMS - if (uO.bflag > 2) - uO.bflag = 2; - /* Clear -s flag when converting text files. */ - if (uO.aflag <= 0) - uO.S_flag = 0; -#endif /* VMS */ - if (uO.overwrite_all && uO.overwrite_none) { - Info(slide, 0x401, ((char *)slide, LoadFarString(IgnoreOOptionMsg))); - uO.overwrite_all = FALSE; - } -#ifdef MORE - if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func. useless */ - G.M_flag = 0; -#endif - -#ifdef SFX - if (error) -#else - if ((argc-- == 0) || error) -#endif - { - *pargc = argc; - *pargv = argv; -#ifndef SFX - if (uO.vflag >= 2 && argc == -1) { /* "unzip -v" */ - show_version_info(__G); - return PK_OK; - } - if (!G.noargs && !error) - error = TRUE; /* had options (not -h or -v) but no zipfile */ -#endif /* !SFX */ - return USAGE(error); - } -#endif - -#ifdef SFX - /* print our banner unless we're being fairly quiet */ - if (uO.qflag < 2) - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); -#ifdef BETA - /* always print the beta warning: no unauthorized distribution!! */ - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", - "SFX")); -#endif -#endif /* SFX */ - - if (uO.cflag || uO.tflag || uO.vflag || uO.zflag -#ifdef TIMESTAMP - || uO.T_flag -#endif - ) - G.extract_flag = FALSE; - else - G.extract_flag = TRUE; - - *pargc = argc; - *pargv = argv; - return PK_OK; - -} /* end function uz_opts() */ - - - - -/********************/ -/* Function usage() */ -/********************/ - -#ifdef SFX -# ifdef VMS -# define LOCAL "X.\n\ -(Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)" -# endif -# ifdef UNIX -# define LOCAL "X" -# endif -# ifdef DOS_OS2_W32 -# define LOCAL "s$" -# endif -# if (defined(FLEXOS) || defined(NLM)) -# define LOCAL "s" -# endif -# ifdef AMIGA -# define LOCAL "N" -# endif - /* Default for all other systems: */ -# ifndef LOCAL -# define LOCAL "" -# endif - -# ifndef NO_TIMESTAMP -# ifdef MORE -# define SFXOPT1 "DM" -# else -# define SFXOPT1 "D" -# endif -# else -# ifdef MORE -# define SFXOPT1 "M" -# else -# define SFXOPT1 "" -# endif -# endif - -int usage(__G__ error) /* return PK-type error code */ - __GDEF - int error; -{ - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXOpts), - SFXOPT1, LOCAL)); -#ifdef BETA - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", - "SFX")); -#endif - - if (error) - return PK_PARAM; - else - return PK_COOL; /* just wanted usage screen: no error */ - -} /* end function usage() */ - - - - - -#else /* !SFX */ -# ifdef VMS -# define QUOT '\"' -# define QUOTS "\"" -# else -# define QUOT ' ' -# define QUOTS "" -# endif - -int usage(__G__ error) /* return PK-type error code */ - __GDEF - int error; -{ - int flag = (error? 1 : 0); - - -/*--------------------------------------------------------------------------- - Print either ZipInfo usage or UnZip usage, depending on incantation. - (Strings must be no longer than 512 bytes for Turbo C, apparently.) - ---------------------------------------------------------------------------*/ - - if (uO.zipinfo_mode) { - -#ifndef NO_ZIPINFO - - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine1), - ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate), - LoadFarStringSmall2(ZipInfoExample), QUOTS,QUOTS)); - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine2))); - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine3), - LoadFarStringSmall(ZipInfoUsageLine4))); -#ifdef VMS - Info(slide, flag, ((char *)slide, "\n\ -You must quote non-lowercase options and filespecs, unless SET PROC/PARSE=EXT.\ -\n")); -#endif - -#endif /* !NO_ZIPINFO */ - - } else { /* UnZip mode */ - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine1), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); -#ifdef BETA - Info(slide, flag, ((char *)slide, LoadFarString(BetaVersion), "", "")); -#endif - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine2), - ZIPINFO_MODE_OPTION, LoadFarStringSmall(ZipInfoMode))); -#ifdef VMS - if (!error) /* maybe no command-line tail found; show extra help */ - Info(slide, flag, ((char *)slide, LoadFarString(VMSusageLine2b))); -#endif - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine3), - LoadFarStringSmall(local1))); - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine4), - LoadFarStringSmall(local2), LoadFarStringSmall2(local3))); - - /* This is extra work for SMALL_MEM, but it will work since - * LoadFarStringSmall2 uses the same buffer. Remember, this - * is a hack. */ - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5), - LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3), - LoadFarStringSmall2(Example3))); - - } /* end if (uO.zipinfo_mode) */ - - if (error) - return PK_PARAM; - else - return PK_COOL; /* just wanted usage screen: no error */ - -} /* end function usage() */ - -#endif /* ?SFX */ - - - - -#ifndef SFX - -/* Print extended help to stdout. */ -static void help_extended(__G) - __GDEF -{ - extent i; /* counter for help array */ - - /* help array */ - static ZCONST char *text[] = { - "", - "Extended Help for UnZip", - "", - "See the UnZip Manual for more detailed help", - "", - "", - "UnZip lists and extracts files in zip archives. The default action is to", - "extract zipfile entries to the current directory, creating directories as", - "needed. With appropriate options, UnZip lists the contents of archives", - "instead.", - "", - "Basic unzip command line:", - " unzip [-Z] options archive[.zip] [file ...] [-x xfile ...] [-d exdir]", - "", - "Some examples:", - " unzip -l foo.zip - list files in short format in archive foo.zip", - "", - " unzip -t foo - test the files in archive foo", - "", - " unzip -Z foo - list files using more detailed zipinfo format", - "", - " unzip foo - unzip the contents of foo in current dir", - "", - " unzip -a foo - unzip foo and convert text files to local OS", - "", - "If unzip is run in zipinfo mode, a more detailed list of archive contents", - "is provided. The -Z option sets zipinfo mode and changes the available", - "options.", - "", - "Basic zipinfo command line:", - " zipinfo options archive[.zip] [file ...] [-x xfile ...]", - " unzip -Z options archive[.zip] [file ...] [-x xfile ...]", - "", - "Below, Mac OS refers to Mac OS before Mac OS X. Mac OS X is a Unix based", - "port and is referred to as Unix Apple.", - "", - "", - "unzip options:", - " -Z Switch to zipinfo mode. Must be first option.", - " -hh Display extended help.", - " -A [OS/2, Unix DLL] Print extended help for DLL.", - " -c Extract files to stdout/screen. As -p but include names. Also,", - " -a allowed and EBCDIC conversions done if needed.", - " -f Freshen by extracting only if older file on disk.", - " -l List files using short form.", - " -p Extract files to pipe (stdout). Only file data is output and all", - " files extracted in binary mode (as stored).", - " -t Test archive files.", - " -T Set timestamp on archive(s) to that of newest file. Similar to", - " zip -o but faster.", - " -u Update existing older files on disk as -f and extract new files.", - " -v Use verbose list format. If given alone as unzip -v show version", - " information. Also can be added to other list commands for more", - " verbose output.", - " -z Display only archive comment.", - "", - "unzip modifiers:", - " -a Convert text files to local OS format. Convert line ends, EOF", - " marker, and from or to EBCDIC character set as needed.", - " -b Treat all files as binary. [Tandem] Force filecode 180 ('C').", - " [VMS] Autoconvert binary files. -bb forces convert of all files.", - " -B [UNIXBACKUP compile option enabled] Save a backup copy of each", - " overwritten file in foo~ or foo~99999 format.", - " -C Use case-insensitive matching.", - " -D Skip restoration of timestamps for extracted directories. On VMS this", - " is on by default and -D essentially becames -DD.", - " -DD Skip restoration of timestamps for all entries.", - " -E [MacOS (not Unix Apple)] Display contents of MacOS extra field during", - " restore.", - " -F [Acorn] Suppress removal of NFS filetype extension. [Non-Acorn if", - " ACORN_FTYPE_NFS] Translate filetype and append to name.", - " -i [MacOS] Ignore filenames in MacOS extra field. Instead, use name in", - " standard header.", - " -j Junk paths and deposit all files in extraction directory.", - " -J [BeOS] Junk file attributes. [MacOS] Ignore MacOS specific info.", - " -K [AtheOS, BeOS, Unix] Restore SUID/SGID/Tacky file attributes.", - " -L Convert to lowercase any names from uppercase only file system.", - " -LL Convert all files to lowercase.", - " -M Pipe all output through internal pager similar to Unix more(1).", - " -n Never overwrite existing files. Skip extracting that file, no prompt.", - " -N [Amiga] Extract file comments as Amiga filenotes.", - " -o Overwrite existing files without prompting. Useful with -f. Use with", - " care.", - " -P p Use password p to decrypt files. THIS IS INSECURE! Some OS show", - " command line to other users.", - " -q Perform operations quietly. The more q (as in -qq) the quieter.", - " -s [OS/2, NT, MS-DOS] Convert spaces in filenames to underscores.", - " -S [VMS] Convert text files (-a, -aa) into Stream_LF format.", - " -U [UNICODE enabled] Show non-local characters as #Uxxxx or #Lxxxxxx ASCII", - " text escapes where x is hex digit. [Old] -U used to leave names", - " uppercase if created on MS-DOS, VMS, etc. See -L.", - " -UU [UNICODE enabled] Disable use of stored UTF-8 paths. Note that UTF-8", - " paths stored as native local paths are still processed as Unicode.", - " -V Retain VMS file version numbers.", - " -W [Only if WILD_STOP_AT_DIR] Modify pattern matching so ? and * do not", - " match directory separator /, but ** does. Allows matching at specific", - " directory levels.", - " -X [VMS, Unix, OS/2, NT, Tandem] Restore UICs and ACL entries under VMS,", - " or UIDs/GIDs under Unix, or ACLs under certain network-enabled", - " versions of OS/2, or security ACLs under Windows NT. Can require", - " user privileges.", - " -XX [NT] Extract NT security ACLs after trying to enable additional", - " system privileges.", - " -Y [VMS] Treat archived name endings of .nnn as VMS version numbers.", - " -$ [MS-DOS, OS/2, NT] Restore volume label if extraction medium is", - " removable. -$$ allows fixed media (hard drives) to be labeled.", - " -/ e [Acorn] Use e as extension list.", - " -: [All but Acorn, VM/CMS, MVS, Tandem] Allow extract archive members into", - " locations outside of current extraction root folder. This allows", - " paths such as ../foo to be extracted above the current extraction", - " directory, which can be a security problem.", - " -^ [Unix] Allow control characters in names of extracted entries. Usually", - " this is not a good thing and should be avoided.", - " -2 [VMS] Force unconditional conversion of names to ODS-compatible names.", - " Default is to exploit destination file system, preserving cases and", - " extended name characters on ODS5 and applying ODS2 filtering on ODS2.", - "", - "", - "Wildcards:", - " Internally unzip supports the following wildcards:", - " ? (or %% or #, depending on OS) matches any single character", - " * matches any number of characters, including zero", - " [list] matches char in list (regex), can do range [ac-f], all but [!bf]", - " If port supports [], must escape [ as [[]", - " For shells that expand wildcards, escape (\\* or \"*\") so unzip can recurse.", - "", - "Include and Exclude:", - " -i pattern pattern ... include files that match a pattern", - " -x pattern pattern ... exclude files that match a pattern", - " Patterns are paths with optional wildcards and match paths as stored in", - " archive. Exclude and include lists end at next option or end of line.", - " unzip archive -x pattern pattern ...", - "", - "Multi-part (split) archives (archives created as a set of split files):", - " Currently split archives are not readable by unzip. A workaround is", - " to use zip to convert the split archive to a single-file archive and", - " use unzip on that. See the manual page for Zip 3.0 or later.", - "", - "Streaming (piping into unzip):", - " Currently unzip does not support streaming. The funzip utility can be", - " used to process the first entry in a stream.", - " cat archive | funzip", - "", - "Testing archives:", - " -t test contents of archive", - " This can be modified using -q for quieter operation, and -qq for even", - " quieter operation.", - "", - "Unicode:", - " If compiled with Unicode support, unzip automatically handles archives", - " with Unicode entries. Currently Unicode on Win32 systems is limited.", - " Characters not in the current character set are shown as ASCII escapes", - " in the form #Uxxxx where the Unicode character number fits in 16 bits,", - " or #Lxxxxxx where it doesn't, where x is the ASCII character for a hex", - " digit.", - "", - "", - "zipinfo options (these are used in zipinfo mode (unzip -Z ...)):", - " -1 List names only, one per line. No headers/trailers. Good for scripts.", - " -2 List names only as -1, but include headers, trailers, and comments.", - " -s List archive entries in short Unix ls -l format. Default list format.", - " -m List in long Unix ls -l format. As -s, but includes compression %.", - " -l List in long Unix ls -l format. As -m, but compression in bytes.", - " -v List zipfile information in verbose, multi-page format.", - " -h List header line. Includes archive name, actual size, total files.", - " -M Pipe all output through internal pager similar to Unix more(1) command.", - " -t List totals for files listed or for all files. Includes uncompressed", - " and compressed sizes, and compression factors.", - " -T Print file dates and times in a sortable decimal format (yymmdd.hhmmss)", - " Default date and time format is a more human-readable version.", - " -U [UNICODE] If entry has a UTF-8 Unicode path, display any characters", - " not in current character set as text #Uxxxx and #Lxxxxxx escapes", - " representing the Unicode character number of the character in hex.", - " -UU [UNICODE] Disable use of any UTF-8 path information.", - " -z Include archive comment if any in listing.", - "", - "", - "funzip stream extractor:", - " funzip extracts the first member in an archive to stdout. Typically", - " used to unzip the first member of a stream or pipe. If a file argument", - " is given, read from that file instead of stdin.", - "", - "funzip command line:", - " funzip [-password] [input[.zip|.gz]]", - "", - "", - "unzipsfx self extractor:", - " Self-extracting archives made with unzipsfx are no more (or less)", - " portable across different operating systems than unzip executables.", - " In general, a self-extracting archive made on a particular Unix system,", - " for example, will only self-extract under the same flavor of Unix.", - " Regular unzip may still be used to extract embedded archive however.", - "", - "unzipsfx command line:", - " [-options] [file(s) ... [-x xfile(s) ...]]", - "", - "unzipsfx options:", - " -c, -p - Output to pipe. (See above for unzip.)", - " -f, -u - Freshen and Update, as for unzip.", - " -t - Test embedded archive. (Can be used to list contents.)", - " -z - Print archive comment. (See unzip above.)", - "", - "unzipsfx modifiers:", - " Most unzip modifiers are supported. These include", - " -a - Convert text files.", - " -n - Never overwrite.", - " -o - Overwrite without prompting.", - " -q - Quiet operation.", - " -C - Match names case-insensitively.", - " -j - Junk paths.", - " -V - Keep version numbers.", - " -s - Convert spaces to underscores.", - " -$ - Restore volume label.", - "", - "If unzipsfx compiled with SFX_EXDIR defined, -d option also available:", - " -d exd - Extract to directory exd.", - "By default, all files extracted to current directory. This option", - "forces extraction to specified directory.", - "", - "See unzipsfx manual page for more information.", - "" - }; - - for (i = 0; i < sizeof(text)/sizeof(char *); i++) - { - Info(slide, 0, ((char *)slide, "%s\n", text[i])); - } -} /* end function help_extended() */ - - - - -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ -#if (!defined(MODERN) || defined(NO_STDLIB_H)) -/* Declare getenv() to be sure (might be missing in some environments) */ -extern char *getenv(); -#endif -#endif - -/********************************/ -/* Function show_version_info() */ -/********************************/ - -static void show_version_info(__G) - __GDEF -{ - if (uO.qflag > 3) /* "unzip -vqqqq" */ - Info(slide, 0, ((char *)slide, "%d\n", - (UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL))); - else { -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - char *envptr; -#endif - int numopts = 0; - - Info(slide, 0, ((char *)slide, LoadFarString(UnzipUsageLine1v), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); - Info(slide, 0, ((char *)slide, - LoadFarString(UnzipUsageLine2v))); - version(__G); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptions))); -#ifdef ACORN_FTYPE_NFS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AcornFtypeNFS))); - ++numopts; -#endif -#ifdef ASM_CRC - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AsmCRC))); - ++numopts; -#endif -#ifdef ASM_INFLATECODES - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AsmInflateCodes))); - ++numopts; -#endif -#ifdef CHECK_VERSIONS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Check_Versions))); - ++numopts; -#endif -#ifdef COPYRIGHT_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Copyright_Clean))); - ++numopts; -#endif -#ifdef DEBUG - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(UDebug))); - ++numopts; -#endif -#ifdef DEBUG_TIME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(DebugTime))); - ++numopts; -#endif -#ifdef DLL - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Dll))); - ++numopts; -#endif -#ifdef DOSWILD - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(DosWild))); - ++numopts; -#endif -#ifdef LZW_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(LZW_Clean))); - ++numopts; -#endif -#ifndef MORE - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(No_More))); - ++numopts; -#endif -#ifdef NO_ZIPINFO - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(No_ZipInfo))); - ++numopts; -#endif -#ifdef NTSD_EAS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(NTSDExtAttrib))); - ++numopts; -#endif -#if defined(WIN32) && defined(NO_W32TIMES_IZFIX) - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(W32NoIZTimeFix))); - ++numopts; -#endif -#ifdef OLD_THEOS_EXTRA - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(OldTheosExtra))); - ++numopts; -#endif -#ifdef OS2_EAS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(OS2ExtAttrib))); - ++numopts; -#endif -#ifdef QLZIP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SMSExFldOnUnix))); - ++numopts; -#endif -#ifdef REENTRANT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Reentrant))); - ++numopts; -#endif -#ifdef REGARGS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(RegArgs))); - ++numopts; -#endif -#ifdef RETURN_CODES - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Return_Codes))); - ++numopts; -#endif -#ifdef SET_DIR_ATTRIB - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SetDirAttrib))); - ++numopts; -#endif -#ifdef SYMLINKS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SymLinkSupport))); - ++numopts; -#endif -#ifdef TIMESTAMP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(TimeStamp))); - ++numopts; -#endif -#ifdef UNIXBACKUP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(UnixBackup))); - ++numopts; -#endif -#ifdef USE_EF_UT_TIME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_EF_UT_time))); - ++numopts; -#endif -#ifndef COPYRIGHT_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Smith_Code))); - ++numopts; -#endif -#ifndef LZW_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Unshrink))); - ++numopts; -#endif -#ifdef USE_DEFLATE64 - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Deflate64))); - ++numopts; -#endif -#ifdef UNICODE_SUPPORT -# ifdef UTF8_MAYBE_NATIVE - sprintf((char *)(slide+256), LoadFarStringSmall(Use_Unicode), - LoadFarStringSmall2(G.native_is_utf8 ? SysChUTF8 : SysChOther)); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); -# else - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Unicode))); -# endif - ++numopts; -#endif -#ifdef _MBCS - sprintf((char *)(slide+256), LoadFarStringSmall(Have_MBCS_Support), - (unsigned int)MB_CUR_MAX); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef MULT_VOLUME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_MultiVol))); - ++numopts; -#endif -#ifdef LARGE_FILE_SUPPORT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_LFS))); - ++numopts; -#endif -#ifdef ZIP64_SUPPORT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Zip64))); - ++numopts; -#endif -#if (defined(__DJGPP__) && (__DJGPP__ >= 2)) -# ifdef USE_DJGPP_ENV - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_DJGPP_Env))); - ++numopts; -# endif -# ifdef USE_DJGPP_GLOB - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_DJGPP_Glob))); - ++numopts; -# endif -#endif /* __DJGPP__ && (__DJGPP__ >= 2) */ -#ifdef USE_VFAT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_VFAT_support))); - ++numopts; -#endif -#ifdef USE_ZLIB - sprintf((char *)(slide+256), LoadFarStringSmall(UseZlib), - ZLIB_VERSION, zlibVersion()); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef USE_BZIP2 - sprintf((char *)(slide+256), LoadFarStringSmall(UseBZip2), - BZ2_bzlibVersion()); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef VMS_TEXT_CONV - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsTextConv))); - ++numopts; -#endif -#ifdef VMSCLI - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsCLI))); - ++numopts; -#endif -#ifdef VMSWILD - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsWild))); - ++numopts; -#endif -#ifdef WILD_STOP_AT_DIR - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(WildStopAtDir))); - ++numopts; -#endif -#if CRYPT -# ifdef PASSWD_FROM_STDIN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(PasswdStdin))); -# endif - Info(slide, 0, ((char *)slide, LoadFarString(Decryption), - CR_MAJORVER, CR_MINORVER, CR_BETA_VER, - LoadFarStringSmall(CryptDate))); - ++numopts; -#endif /* CRYPT */ - if (numopts == 0) - Info(slide, 0, ((char *)slide, - LoadFarString(CompileOptFormat), - LoadFarStringSmall(None))); - -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptions))); - envptr = getenv(LoadFarStringSmall(EnvUnZip)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZip), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvUnZip2)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZip2), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvZipInfo)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvZipInfo), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvZipInfo2)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvZipInfo2), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#ifndef __RSXNT__ -#ifdef __EMX__ - envptr = getenv(LoadFarStringSmall(EnvEMX)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvEMX), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvEMXOPT)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvEMXOPT), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* __EMX__ */ -#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) - envptr = getenv(LoadFarStringSmall(EnvGO32)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvGO32), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvGO32TMP)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvGO32TMP), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* __GO32__ && !(__DJGPP__ >= 2) */ -#endif /* !__RSXNT__ */ -#ifdef RISCOS - envptr = getenv(LoadFarStringSmall(EnvUnZipExts)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZipExts), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* RISCOS */ -#endif /* !_WIN32_WCE */ - } -} /* end function show_version() */ - -#endif /* !SFX */ -#endif /* !WINDLL */ diff --git a/data/windows/unzipfx-catarina/unzip.h b/data/windows/unzipfx-catarina/unzip.h deleted file mode 100644 index 5b2a326..0000000 --- a/data/windows/unzipfx-catarina/unzip.h +++ /dev/null @@ -1,722 +0,0 @@ -/*--------------------------------------------------------------------------- - - unzip.h (new) - - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - This header file contains the public macros and typedefs required by - both the UnZip sources and by any application using the UnZip API. If - UNZIP_INTERNAL is defined, it includes unzpriv.h (containing includes, - prototypes and extern variables used by the actual UnZip sources). - - ---------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------- -This is version 2009-Jan-02 of the Info-ZIP license. -The definitive version of this document should be available at -ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and -a copy at http://www.info-zip.org/pub/infozip/license.html. - - -Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - -For the purposes of this copyright and license, "Info-ZIP" is defined as -the following set of individuals: - - Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, - Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth, - Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, - David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, - Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, - Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda, - Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren, - Rich Wales, Mike White. - -This software is provided "as is," without warranty of any kind, express -or implied. In no event shall Info-ZIP or its contributors be held liable -for any direct, indirect, incidental, special or consequential damages -arising out of the use of or inability to use this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the above disclaimer and the following restrictions: - - 1. Redistributions of source code (in whole or in part) must retain - the above copyright notice, definition, disclaimer, and this list - of conditions. - - 2. Redistributions in binary form (compiled executables and libraries) - must reproduce the above copyright notice, definition, disclaimer, - and this list of conditions in documentation and/or other materials - provided with the distribution. Additional documentation is not needed - for executables where a command line license option provides these and - a note regarding this option is in the executable's startup banner. The - sole exception to this condition is redistribution of a standard - UnZipSFX binary (including SFXWiz) as part of a self-extracting archive; - that is permitted without inclusion of this license, as long as the - normal SFX banner has not been removed from the binary or disabled. - - 3. Altered versions--including, but not limited to, ports to new operating - systems, existing ports with new graphical interfaces, versions with - modified or added functionality, and dynamic, shared, or static library - versions not from Info-ZIP--must be plainly marked as such and must not - be misrepresented as being the original source or, if binaries, - compiled from the original source. Such altered versions also must not - be misrepresented as being Info-ZIP releases--including, but not - limited to, labeling of the altered versions with the names "Info-ZIP" - (or any variation thereof, including, but not limited to, different - capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the - explicit permission of Info-ZIP. Such altered versions are further - prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP - e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP - will provide support for the altered versions. - - 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," - "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its - own source and binary releases. - ---------------------------------------------------------------------------*/ - -#ifndef __unzip_h /* prevent multiple inclusions */ -#define __unzip_h - -/*--------------------------------------------------------------------------- - Predefined, machine-specific macros. - ---------------------------------------------------------------------------*/ - -#ifdef __GO32__ /* MS-DOS extender: NOT Unix */ -# ifdef unix -# undef unix -# endif -# ifdef _unix -# undef _unix -# endif -# ifdef __unix -# undef __unix -# endif -# ifdef __unix__ -# undef __unix__ -# endif -#endif - -#if ((defined(__convex__) || defined(__convexc__)) && !defined(CONVEX)) -# define CONVEX -#endif - -#if (defined(unix) || defined(_unix) || defined(__unix) || defined(__unix__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* unix || _unix || __unix || __unix__ */ -#if (defined(M_XENIX) || defined(COHERENT) || defined(__hpux)) -# ifndef UNIX -# define UNIX -# endif -#endif /* M_XENIX || COHERENT || __hpux */ -#if (defined(__NetBSD__) || defined(__FreeBSD__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* __NetBSD__ || __FreeBSD__ */ -#if (defined(CONVEX) || defined(MINIX) || defined(_AIX) || defined(__QNX__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* CONVEX || MINIX || _AIX || __QNX__ */ - -#if (defined(VM_CMS) || defined(MVS)) -# define CMS_MVS -#endif - -#if (defined(__OS2__) && !defined(OS2)) -# define OS2 -#endif - -#if (defined(__TANDEM) && !defined(TANDEM)) -# define TANDEM -#endif - -#if (defined(__VMS) && !defined(VMS)) -# define VMS -#endif - -#if ((defined(__WIN32__) || defined(_WIN32)) && !defined(WIN32)) -# define WIN32 -#endif -#if ((defined(__WINNT__) || defined(__WINNT)) && !defined(WIN32)) -# define WIN32 -#endif - -#if defined(_WIN32_WCE) -# ifndef WIN32 /* WinCE is treated as a variant of the Win32 API */ -# define WIN32 -# endif -# ifndef UNICODE /* WinCE requires UNICODE wide character support */ -# define UNICODE -# endif -#endif - -#ifdef __COMPILER_KCC__ -# include -# ifdef SYS_T20 -# define TOPS20 -# endif -#endif /* __COMPILER_KCC__ */ - -/* Borland C does not define __TURBOC__ if compiling for a 32-bit platform */ -#ifdef __BORLANDC__ -# ifndef __TURBOC__ -# define __TURBOC__ -# endif -# if (!defined(__MSDOS__) && !defined(OS2) && !defined(WIN32)) -# define __MSDOS__ -# endif -#endif - -/* define MSDOS for Turbo C (unless OS/2) and Power C as well as Microsoft C */ -#ifdef __POWERC -# define __TURBOC__ -# define MSDOS -#endif /* __POWERC */ - -#if (defined(__MSDOS__) && !defined(MSDOS)) /* just to make sure */ -# define MSDOS -#endif - -/* RSXNTDJ (at least up to v1.3) compiles for WIN32 (RSXNT) using a derivate - of the EMX environment, but defines MSDOS and __GO32__. ARG !!! */ -#if (defined(MSDOS) && defined(WIN32)) -# undef MSDOS /* WIN32 is >>>not<<< MSDOS */ -#endif -#if (defined(__GO32__) && defined(__EMX__) && defined(__RSXNT__)) -# undef __GO32__ -#endif - -#if (defined(linux) && !defined(LINUX)) -# define LINUX -#endif - -#ifdef __riscos -# define RISCOS -#endif - -#if (defined(THINK_C) || defined(MPW)) -# define MACOS -#endif -#if (defined(__MWERKS__) && defined(macintosh)) -# define MACOS -#endif - -/* use prototypes and ANSI libraries if __STDC__, or MS-DOS, or OS/2, or Win32, - * or IBM C Set/2, or Borland C, or Watcom C, or GNU gcc (emx or Cygwin), - * or Macintosh, or Sequent, or Atari, or IBM RS/6000, or Silicon Graphics, - * or Convex?, or AtheOS, or BeOS. - */ -#if (defined(__STDC__) || defined(MSDOS) || defined(OS2) || defined(WIN32)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(__EMX__) || defined(__CYGWIN__)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(MACOS) || defined(ATARI_ST) || defined(RISCOS) || defined(THEOS)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -/* Sequent running Dynix/ptx: non-modern compiler */ -#if (defined(_AIX) || defined(sgi) || (defined(_SEQUENT_) && !defined(PTX))) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(CMS_MVS) || defined(__ATHEOS__) || defined(__BEOS__)) -/* || defined(CONVEX) ? */ -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -/* Bundled C compiler on HP-UX needs this. Others shouldn't care. */ -#if (defined(__hpux)) -# ifndef MODERN -# define MODERN -# endif -#endif - -/* turn off prototypes if requested */ -#if (defined(NOPROTO) && defined(PROTO)) -# undef PROTO -#endif - -/* used to remove arguments in function prototypes for non-ANSI C */ -#ifdef PROTO -# define OF(a) a -#else -# define OF(a) () -#endif - -/* enable the "const" keyword only if MODERN and if not otherwise instructed */ -#ifdef MODERN -# if (!defined(ZCONST) && (defined(USE_CONST) || !defined(NO_CONST))) -# define ZCONST const -# endif -#endif - -#ifndef ZCONST -# define ZCONST -#endif - -/* Tell Microsoft Visual C++ 2005 (and newer) to leave us alone - * and let us use standard C functions the way we're supposed to. - * (These preprocessor symbols must appear before the first system - * header include. They are located here, because for WINDLL the - * first system header includes follow just below.) - */ -#if defined(_MSC_VER) && (_MSC_VER >= 1400) -# ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -# endif -# ifndef _CRT_NONSTDC_NO_WARNINGS -# define _CRT_NONSTDC_NO_WARNINGS -# endif -# if defined(POCKET_UNZIP) && !defined(_CRT_NON_CONFORMING_SWPRINTFS) -# define _CRT_NON_CONFORMING_SWPRINTFS -# endif -#endif - -/* NO_UNIXBACKUP overrides UNIXBACKUP */ -#if defined(NO_UNIXBACKUP) && defined(UNIXBACKUP) -# undef UNIXBACKUP -#endif - -/*--------------------------------------------------------------------------- - Grab system-specific public include headers. - ---------------------------------------------------------------------------*/ - -#ifdef POCKET_UNZIP /* WinCE port */ -# include "wince/punzip.h" /* must appear before windows.h */ -#endif - -#ifdef WINDLL - /* for UnZip, the "basic" part of the win32 api is sufficient */ -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# define IZ_HASDEFINED_WIN32LEAN -# endif -# include -# include "windll/structs.h" -# ifdef IZ_HASDEFINED_WIN32LEAN -# undef WIN32_LEAN_AND_MEAN -# undef IZ_HASDEFINED_WIN32LEAN -# endif -#endif - -/*--------------------------------------------------------------------------- - Grab system-dependent definition of EXPENTRY for prototypes below. - ---------------------------------------------------------------------------*/ - -#if 0 -#if (defined(OS2) && !defined(FUNZIP)) -# ifdef UNZIP_INTERNAL -# define INCL_NOPM -# define INCL_DOSNLS -# define INCL_DOSPROCESS -# define INCL_DOSDEVICES -# define INCL_DOSDEVIOCTL -# define INCL_DOSERRORS -# define INCL_DOSMISC -# ifdef OS2DLL -# define INCL_REXXSAA -# include -# endif -# endif /* UNZIP_INTERNAL */ -# include -# define UZ_EXP EXPENTRY -#endif /* OS2 && !FUNZIP */ -#endif /* 0 */ - -#if (defined(OS2) && !defined(FUNZIP)) -# if (defined(__IBMC__) || defined(__WATCOMC__)) -# define UZ_EXP _System /* compiler keyword */ -# else -# define UZ_EXP -# endif -#endif /* OS2 && !FUNZIP */ - -#if (defined(WINDLL) || defined(USE_UNZIP_LIB)) -# ifndef EXPENTRY -# define UZ_EXP WINAPI -# else -# define UZ_EXP EXPENTRY -# endif -#endif - -#ifndef UZ_EXP -# define UZ_EXP -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - Public typedefs. - ---------------------------------------------------------------------------*/ - -#ifndef _IZ_TYPES_DEFINED -#ifdef MODERN - typedef void zvoid; -#else /* !MODERN */ -# ifndef AOS_VS /* mostly modern? */ -# ifndef VAXC /* not fully modern, but has knows 'void' */ -# define void int -# endif /* !VAXC */ -# endif /* !AOS_VS */ - typedef char zvoid; -#endif /* ?MODERN */ -typedef unsigned char uch; /* code assumes unsigned bytes; these type- */ -typedef unsigned short ush; /* defs replace byte/UWORD/ULONG (which are */ -typedef unsigned long ulg; /* predefined on some systems) & match zip */ -#define _IZ_TYPES_DEFINED -#endif /* !_IZ_TYPES_DEFINED */ - -/* InputFn is not yet used and is likely to change: */ -#ifdef PROTO - typedef int (UZ_EXP MsgFn) (zvoid *pG, uch *buf, ulg size, int flag); - typedef int (UZ_EXP InputFn) (zvoid *pG, uch *buf, int *size, int flag); - typedef void (UZ_EXP PauseFn) (zvoid *pG, ZCONST char *prompt, int flag); - typedef int (UZ_EXP PasswdFn) (zvoid *pG, int *rcnt, char *pwbuf, - int size, ZCONST char *zfn, - ZCONST char *efn); - typedef int (UZ_EXP StatCBFn) (zvoid *pG, int fnflag, ZCONST char *zfn, - ZCONST char *efn, ZCONST zvoid *details); - typedef void (UZ_EXP UsrIniFn) (void); -#else /* !PROTO */ - typedef int (UZ_EXP MsgFn) (); - typedef int (UZ_EXP InputFn) (); - typedef void (UZ_EXP PauseFn) (); - typedef int (UZ_EXP PasswdFn) (); - typedef int (UZ_EXP StatCBFn) (); - typedef void (UZ_EXP UsrIniFn) (); -#endif /* ?PROTO */ - -typedef struct _UzpBuffer { /* rxstr */ - ulg strlength; /* length of string */ - char *strptr; /* pointer to string */ -} UzpBuffer; - -typedef struct _UzpInit { - ulg structlen; /* length of the struct being passed */ - - /* GRR: can we assume that each of these is a 32-bit pointer? if not, - * does it matter? add "far" keyword to make sure? */ - MsgFn *msgfn; - InputFn *inputfn; - PauseFn *pausefn; - UsrIniFn *userfn; /* user init function to be called after */ - /* globals constructed and initialized */ - - /* pointer to program's environment area or something? */ - /* hooks for performance testing? */ - /* hooks for extra unzip -v output? (detect CPU or other hardware?) */ - /* anything else? let me (Greg) know... */ -} UzpInit; - -typedef struct _UzpCB { - ulg structlen; /* length of the struct being passed */ - /* GRR: can we assume that each of these is a 32-bit pointer? if not, - * does it matter? add "far" keyword to make sure? */ - MsgFn *msgfn; - InputFn *inputfn; - PauseFn *pausefn; - PasswdFn *passwdfn; - StatCBFn *statrepfn; -} UzpCB; - -/* the collection of general UnZip option flags and option arguments */ -typedef struct _UzpOpts { -#ifndef FUNZIP - char *exdir; /* pointer to extraction root directory (-d option) */ - char *pwdarg; /* pointer to command-line password (-P option) */ - int zipinfo_mode; /* behave like ZipInfo or like normal UnZip? */ - int aflag; /* -a: do ASCII-EBCDIC and/or end-of-line translation */ -#ifdef VMS - int bflag; /* -b: force fixed record format for binary files */ -#endif -#ifdef TANDEM - int bflag; /* -b: create text files in 'C' format (180)*/ -#endif -#if defined(UNIX) || defined(OS2) || defined(WIN32) - int B_flag; /* -B: back up existing files by renaming to *~##### */ -#else -#ifdef UNIXBACKUP - int B_flag; /* -B: back up existing files by renaming to *~##### */ -#endif -#endif - int cflag; /* -c: output to stdout */ - int C_flag; /* -C: match filenames case-insensitively */ - int D_flag; /* -D: don't restore directory (-DD: any) timestamps */ -#ifdef MACOS - int E_flag; /* -E: [MacOS] show Mac extra field during restoring */ -#endif - int fflag; /* -f: "freshen" (extract only newer files) */ -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - int acorn_nfs_ext; /* -F: RISC OS types & NFS filetype extensions */ -#endif - int hflag; /* -h: header line (zipinfo) */ -#ifdef MACOS - int i_flag; /* -i: [MacOS] ignore filenames stored in Mac e.f. */ -#endif -#ifdef RISCOS - int scanimage; /* -I: scan image files */ -#endif - int jflag; /* -j: junk pathnames (unzip) */ -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(MACOS)) - int J_flag; /* -J: ignore AtheOS/BeOS/MacOS e. f. info (unzip) */ -#endif -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) - int K_flag; /* -K: keep setuid/setgid/tacky permissions */ -#endif - int lflag; /* -12slmv: listing format (zipinfo) */ - int L_flag; /* -L: convert filenames from some OSes to lowercase */ - int overwrite_none; /* -n: never overwrite files (no prompting) */ -#ifdef AMIGA - int N_flag; /* -N: restore comments as AmigaDOS filenotes */ -#endif - int overwrite_all; /* -o: OK to overwrite files without prompting */ -#endif /* !FUNZIP */ - int qflag; /* -q: produce a lot less output */ -#ifdef TANDEM - int rflag; /* -r: remove file extensions */ -#endif -#ifndef FUNZIP -#if (defined(MSDOS) || defined(FLEXOS) || defined(OS2) || defined(WIN32)) - int sflag; /* -s: convert spaces in filenames to underscores */ -#endif -#if (defined(NLM)) - int sflag; /* -s: convert spaces in filenames to underscores */ -#endif -#ifdef VMS - int S_flag; /* -S: use Stream_LF for text files (-a[a]) */ -#endif -#if (defined(MSDOS) || defined(__human68k__) || defined(OS2) || defined(WIN32)) - int volflag; /* -$: extract volume labels */ -#endif - int tflag; /* -t: test (unzip) or totals line (zipinfo) */ - int T_flag; /* -T: timestamps (unzip) or dec. time fmt (zipinfo) */ - int uflag; /* -u: "update" (extract only newer/brand-new files) */ -#if defined(UNIX) || defined(VMS) || defined(WIN32) - int U_flag; /* -U: escape non-ASCII, -UU No Unicode paths */ -#endif - int vflag; /* -v: (verbosely) list directory */ - int V_flag; /* -V: don't strip VMS version numbers */ - int W_flag; /* -W: wildcard '*' won't match '/' dir separator */ -#if (defined (__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#else -#if (defined(TANDEM) || defined(THEOS)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#else -#if (defined(OS2) || defined(VMS) || defined(WIN32)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#endif -#endif -#endif -#ifdef VMS - int Y_flag; /* -Y: treat ".nnn" as ";nnn" version */ -#endif - int zflag; /* -z: display the zipfile comment (only, for unzip) */ -#ifdef VMS - int ods2_flag; /* -2: force names to conform to ODS2 */ -#endif -#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) - int ddotflag; /* -:: don't skip over "../" path elements */ -#endif -#ifdef UNIX - int cflxflag; /* -^: allow control chars in extracted filenames */ -#endif -#endif /* !FUNZIP */ -} UzpOpts; - -/* intended to be a private struct: */ -typedef struct _ver { - uch major; /* e.g., integer 5 */ - uch minor; /* e.g., 2 */ - uch patchlevel; /* e.g., 0 */ - uch not_used; -} _version_type; - -typedef struct _UzpVer { - ulg structlen; /* length of the struct being passed */ - ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ - ZCONST char *betalevel; /* e.g. "g BETA" or "" */ - ZCONST char *date; /* e.g. "9 Oct 08" (beta) or "9 October 2008" */ - ZCONST char *zlib_version;/* e.g. "1.2.3" or NULL */ - _version_type unzip; /* current UnZip version */ - _version_type zipinfo; /* current ZipInfo version */ - _version_type os2dll; /* OS2DLL version (retained for compatibility */ - _version_type windll; /* WinDLL version (retained for compatibility */ - _version_type dllapimin; /* last incompatible change of library API */ -} UzpVer; - -/* for Visual BASIC access to Windows DLLs: */ -typedef struct _UzpVer2 { - ulg structlen; /* length of the struct being passed */ - ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ - char betalevel[10]; /* e.g. "g BETA" or "" */ - char date[20]; /* e.g. "9 Oct 08" (beta) or "9 October 2008" */ - char zlib_version[10]; /* e.g. "1.2.3" or NULL */ - _version_type unzip; /* current UnZip version */ - _version_type zipinfo; /* current ZipInfo version */ - _version_type os2dll; /* OS2DLL version (retained for compatibility */ - _version_type windll; /* WinDLL version (retained for compatibility */ - _version_type dllapimin; /* last incompatible change of library API */ -} UzpVer2; - - -typedef struct _Uzp_Siz64 { - unsigned long lo32; - unsigned long hi32; -} Uzp_Siz64; - -typedef struct _Uzp_cdir_Rec { - uch version_made_by[2]; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ulg last_mod_dos_datetime; - ulg crc32; - Uzp_Siz64 csize; - Uzp_Siz64 ucsize; - ush filename_length; - ush extra_field_length; - ush file_comment_length; - ush disk_number_start; - ush internal_file_attributes; - ulg external_file_attributes; - Uzp_Siz64 relative_offset_local_header; -} Uzp_cdir_Rec; - - -#define UZPINIT_LEN sizeof(UzpInit) -#define UZPVER_LEN sizeof(UzpVer) -#define cbList(func) int (* UZ_EXP func)(char *filename, Uzp_cdir_Rec *crec) - - -/*--------------------------------------------------------------------------- - Return (and exit) values of the public UnZip API functions. - ---------------------------------------------------------------------------*/ - -/* external return codes */ -#define PK_OK 0 /* no error */ -#define PK_COOL 0 /* no error */ -#define PK_WARN 1 /* warning error */ -#define PK_ERR 2 /* error in zipfile */ -#define PK_BADERR 3 /* severe error in zipfile */ -#define PK_MEM 4 /* insufficient memory (during initialization) */ -#define PK_MEM2 5 /* insufficient memory (password failure) */ -#define PK_MEM3 6 /* insufficient memory (file decompression) */ -#define PK_MEM4 7 /* insufficient memory (memory decompression) */ -#define PK_MEM5 8 /* insufficient memory (not yet used) */ -#define PK_NOZIP 9 /* zipfile not found */ -#define PK_PARAM 10 /* bad or illegal parameters specified */ -#define PK_FIND 11 /* no files found */ -#define PK_DISK 50 /* disk full */ -#define PK_EOF 51 /* unexpected EOF */ - -#define IZ_CTRLC 80 /* user hit ^C to terminate */ -#define IZ_UNSUP 81 /* no files found: all unsup. compr/encrypt. */ -#define IZ_BADPWD 82 /* no files found: all had bad password */ -#define IZ_ERRBF 83 /* big-file archive, small-file program */ - -/* return codes of password fetches (negative = user abort; positive = error) */ -#define IZ_PW_ENTERED 0 /* got some password string; use/try it */ -#define IZ_PW_CANCEL -1 /* no password available (for this entry) */ -#define IZ_PW_CANCELALL -2 /* no password, skip any further pwd. request */ -#define IZ_PW_ERROR 5 /* = PK_MEM2 : failure (no mem, no tty, ...) */ - -/* flag values for status callback function */ -#define UZ_ST_START_EXTRACT 1 /* no details */ -#define UZ_ST_IN_PROGRESS 2 /* no details */ -#define UZ_ST_FINISH_MEMBER 3 /* 'details': extracted size */ - -/* return values of status callback function */ -#define UZ_ST_CONTINUE 0 -#define UZ_ST_BREAK 1 - - -/*--------------------------------------------------------------------------- - Prototypes for public UnZip API (DLL) functions. - ---------------------------------------------------------------------------*/ - -#define UzpMatch match - -int UZ_EXP UzpMain OF((int argc, char **argv)); -int UZ_EXP UzpAltMain OF((int argc, char **argv, UzpInit *init)); -ZCONST UzpVer * UZ_EXP UzpVersion OF((void)); -void UZ_EXP UzpFreeMemBuffer OF((UzpBuffer *retstr)); -#ifndef WINDLL -int UZ_EXP UzpUnzipToMemory OF((char *zip, char *file, UzpOpts *optflgs, - UzpCB *UsrFunc, UzpBuffer *retstr)); -int UZ_EXP UzpGrep OF((char *archive, char *file, - char *pattern, int cmd, int SkipBin, - UzpCB *UsrFunc)); -#endif -#ifdef OS2 -int UZ_EXP UzpFileTree OF((char *name, cbList(callBack), - char *cpInclude[], char *cpExclude[])); -#endif - -unsigned UZ_EXP UzpVersion2 OF((UzpVer2 *version)); -int UZ_EXP UzpValidate OF((char *archive, int AllCodes)); - - -/* default I/O functions (can be swapped out via UzpAltMain() entry point): */ - -int UZ_EXP UzpMessagePrnt OF((zvoid *pG, uch *buf, ulg size, int flag)); -int UZ_EXP UzpMessageNull OF((zvoid *pG, uch *buf, ulg size, int flag)); -int UZ_EXP UzpInput OF((zvoid *pG, uch *buf, int *size, int flag)); -void UZ_EXP UzpMorePause OF((zvoid *pG, ZCONST char *prompt, int flag)); -int UZ_EXP UzpPassword OF((zvoid *pG, int *rcnt, char *pwbuf, - int size, ZCONST char *zfn, - ZCONST char *efn)); - -#ifdef __cplusplus -} -#endif - - -/*--------------------------------------------------------------------------- - Remaining private stuff for UnZip compilation. - ---------------------------------------------------------------------------*/ - -#ifdef UNZIP_INTERNAL -# include "unzpriv.h" -#endif - - -#endif /* !__unzip_h */ diff --git a/data/windows/unzipfx-catarina/unzipfx/appDetails.c b/data/windows/unzipfx-catarina/unzipfx/appDetails.c deleted file mode 100644 index 7f53dcb..0000000 --- a/data/windows/unzipfx-catarina/unzipfx/appDetails.c +++ /dev/null @@ -1,80 +0,0 @@ - -#include -#include - -#ifdef WIN32 -# include -#endif - -#include "appDetails.h" - -#define CMD_BUF_LEN 1024 - -static int sfx_app_argc = 0; -static char** sfx_app_argv = NULL; -static char sfx_tmp_path[512] = { 0 }; - -void sfx_app_set_args(int argc, char** argv) -{ - sfx_app_argc = argc; - sfx_app_argv = argv; -} - -int sfx_app_autorun_now() -{ - int i, cmdBufLen = 0; - char cmdBuf[CMD_BUF_LEN]; - -#ifdef WIN32 - strcpy(cmdBuf, sfx_get_tmp_path(1)); - strcat(cmdBuf, SFX_AUTORUN_CMD); -#else - strcpy(cmdBuf, "cd "); - strcat(cmdBuf, sfx_get_tmp_path(1)); - strcat(cmdBuf, "; "); - strcat(cmdBuf, SFX_AUTORUN_CMD); -#endif - - cmdBufLen = strlen(cmdBuf); - - for (i=0; i < sfx_app_argc; i++) - { - if (! sfx_app_argv[i]) - continue; - - cmdBufLen += strlen(sfx_app_argv[i]) + 1; - if (cmdBufLen >= CMD_BUF_LEN-1) - break; - - strcat(cmdBuf, " "); - strcat(cmdBuf, sfx_app_argv[i]); - } - - return system(cmdBuf); -} - -char* sfx_get_tmp_path(int withAppName) -{ -#ifdef WIN32 - { - GetTempPathA(512 - strlen(SFX_APP_MININAME), sfx_tmp_path); - - if (withAppName == 1) - strcat(sfx_tmp_path, SFX_APP_MININAME); - } -#else - { - char* tmp = getenv("TMP"); - - if (tmp) - strcpy(sfx_tmp_path, tmp); - else - strcpy(sfx_tmp_path, "/tmp"); - - if (withAppName == 1) - strcat(sfx_tmp_path, "/" SFX_APP_MININAME); - } -#endif - - return sfx_tmp_path; -} diff --git a/data/windows/unzipfx-catarina/unzipfx/appDetails.h b/data/windows/unzipfx-catarina/unzipfx/appDetails.h deleted file mode 100644 index 1bb3637..0000000 --- a/data/windows/unzipfx-catarina/unzipfx/appDetails.h +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef __APP_DETAILS_H__ -#define __APP_DETAILS_H__ - -#define SFX_APP_VERSION "0.8.1" -#define SFX_APP_BANNER "Catarina self-contained executable " SFX_APP_VERSION ", based on UnZipSFX." - -#ifndef SFX_APP_MININAME -# define SFX_APP_MININAME "Catarina" -#endif - -#ifdef WIN32 -# define SFX_AUTORUN_CMD "\\" SFX_APP_MININAME ".exe" -#else -# define SFX_AUTORUN_CMD "./" SFX_APP_MININAME -#endif - -void sfx_app_set_args(int argc, char** argv); -int sfx_app_autorun_now(); -char* sfx_get_tmp_path(int withAppName); - -#endif // __APP_DETAILS_H__ diff --git a/data/windows/unzipfx-catarina/unzpriv.h b/data/windows/unzipfx-catarina/unzpriv.h deleted file mode 100644 index 92967e7..0000000 --- a/data/windows/unzipfx-catarina/unzpriv.h +++ /dev/null @@ -1,3123 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unzpriv.h - - This header file contains private (internal) macros, typedefs, prototypes - and global-variable declarations used by all of the UnZip source files. - In a prior life it was part of the main unzip.h header, but now it is only - included by that header if UNZIP_INTERNAL is defined. - - ---------------------------------------------------------------------------*/ - - - -#ifndef __unzpriv_h /* prevent multiple inclusions */ -#define __unzpriv_h - -/* First thing: Signal all following code that we compile UnZip utilities! */ -#ifndef UNZIP -# define UNZIP -#endif - -/* GRR 960204: MORE defined here in preparation for removal altogether */ -#ifndef MORE -# ifndef RISCOS -# define MORE -# endif -#endif - -/* fUnZip should never need to be reentrant */ -#ifdef FUNZIP -# ifdef REENTRANT -# undef REENTRANT -# endif -# ifdef DLL -# undef DLL -# endif -# ifdef SFX /* fUnZip is NOT the sfx stub! */ -# undef SFX -# endif -# ifdef USE_BZIP2 /* fUnZip does not support bzip2 decompression */ -# undef USE_BZIP2 -# endif -#endif - -#if (defined(USE_ZLIB) && !defined(HAVE_ZL_INFLAT64) && !defined(NO_DEFLATE64)) - /* zlib does not (yet?) provide Deflate64(tm) support */ -# define NO_DEFLATE64 -#endif - -#ifdef NO_DEFLATE64 - /* disable support for Deflate64(tm) */ -# ifdef USE_DEFLATE64 -# undef USE_DEFLATE64 -# endif -#else - /* enable Deflate64(tm) support unless compiling for SFX stub */ -# if (!defined(USE_DEFLATE64) && !defined(SFX)) -# define USE_DEFLATE64 -# endif -#endif - -/* disable bzip2 support for SFX stub, unless explicitly requested */ -#if (defined(SFX) && !defined(BZIP2_SFX) && defined(USE_BZIP2)) -# undef USE_BZIP2 -#endif - -#if (defined(NO_VMS_TEXT_CONV) || defined(VMS)) -# ifdef VMS_TEXT_CONV -# undef VMS_TEXT_CONV -# endif -#else -# if (!defined(VMS_TEXT_CONV) && !defined(SFX)) -# define VMS_TEXT_CONV -# endif -#endif - -/* Enable -B option per default on specific systems, to allow backing up - * files that would be overwritten. - * (This list of systems must be kept in sync with the list of systems - * that add the B_flag to the UzpOpts structure, see unzip.h.) - */ -#if (!defined(NO_UNIXBACKUP) && !defined(UNIXBACKUP)) -# if defined(UNIX) || defined(OS2) || defined(WIN32) -# define UNIXBACKUP -# endif -#endif - -#if (defined(DLL) && !defined(REENTRANT)) -# define REENTRANT -#endif - -#if (!defined(DYNAMIC_CRC_TABLE) && !defined(FUNZIP)) -# define DYNAMIC_CRC_TABLE -#endif - -#if (defined(DYNAMIC_CRC_TABLE) && !defined(REENTRANT)) -# ifndef DYNALLOC_CRCTAB -# define DYNALLOC_CRCTAB -# endif -#endif - -/*--------------------------------------------------------------------------- - OS-dependent configuration for UnZip internals - ---------------------------------------------------------------------------*/ - -/* Some compiler distributions for Win32/i386 systems try to emulate - * a Unix (POSIX-compatible) environment. - */ -#if (defined(WIN32) && defined(UNIX)) - /* UnZip does not support merging both ports in a single executable. */ -# if (defined(FORCE_WIN32_OVER_UNIX) && defined(FORCE_UNIX_OVER_WIN32)) - /* conflicting choice requests -> we prefer the Win32 environment */ -# undef FORCE_UNIX_OVER_WIN32 -# endif -# ifdef FORCE_WIN32_OVER_UNIX - /* native Win32 support was explicitly requested... */ -# undef UNIX -# else - /* use the POSIX (Unix) emulation features by default... */ -# undef WIN32 -# endif -#endif - -/* bad or (occasionally?) missing stddef.h: */ -#if (defined(M_XENIX) || defined(DNIX)) -# define NO_STDDEF_H -#endif - -#if (defined(M_XENIX) && !defined(M_UNIX)) /* SCO Xenix only, not SCO Unix */ -# define SCO_XENIX -# define NO_LIMITS_H /* no limits.h, but MODERN defined */ -# define NO_UID_GID /* no uid_t/gid_t */ -# define size_t int -#endif - -#ifdef realix /* Modcomp Real/IX, real-time SysV.3 variant */ -# define SYSV -# define NO_UID_GID /* no uid_t/gid_t */ -#endif - -#if (defined(_AIX) && !defined(_ALL_SOURCE)) -# define _ALL_SOURCE -#endif - -#if defined(apollo) /* defines __STDC__ */ -# define NO_STDLIB_H -#endif - -#ifdef DNIX -# define SYSV -# define SHORT_NAMES /* 14-char limitation on path components */ -/* # define FILENAME_MAX 14 */ -# define FILENAME_MAX NAME_MAX /* GRR: experiment */ -#endif - -#if (defined(SYSTEM_FIVE) || defined(__SYSTEM_FIVE)) -# ifndef SYSV -# define SYSV -# endif -#endif /* SYSTEM_FIVE || __SYSTEM_FIVE */ -#if (defined(M_SYSV) || defined(M_SYS5)) -# ifndef SYSV -# define SYSV -# endif -#endif /* M_SYSV || M_SYS5 */ -/* __SVR4 and __svr4__ catch Solaris on at least some combos of compiler+OS */ -#if (defined(__SVR4) || defined(__svr4__) || defined(sgi) || defined(__hpux)) -# ifndef SYSV -# define SYSV -# endif -#endif /* __SVR4 || __svr4__ || sgi || __hpux */ -#if (defined(LINUX) || defined(__QNX__)) -# ifndef SYSV -# define SYSV -# endif -#endif /* LINUX || __QNX__ */ - -#if (defined(ultrix) || defined(__ultrix) || defined(bsd4_2)) -# if (!defined(BSD) && !defined(SYSV)) -# define BSD -# endif -#endif /* ultrix || __ultrix || bsd4_2 */ -#if (defined(sun) || defined(pyr) || defined(CONVEX)) -# if (!defined(BSD) && !defined(SYSV)) -# define BSD -# endif -#endif /* sun || pyr || CONVEX */ - -#ifdef pyr /* Pyramid: has BSD and AT&T "universes" */ -# ifdef BSD -# define pyr_bsd -# define USE_STRINGS_H /* instead of more common string.h */ -# define ZMEM /* ZMEM now uses bcopy/bzero: not in AT&T universe */ -# endif /* (AT&T memcpy claimed to be very slow, though) */ -# define DECLARE_ERRNO -#endif /* pyr */ - -/* stat() bug for Borland, VAX C RTL, and Atari ST MiNT on TOS - * filesystems: returns 0 for wildcards! (returns 0xffffffff on Minix - * filesystem or `U:' drive under Atari MiNT.) Watcom C was previously - * included on this list; it would be good to know what version the problem - * was fixed at, if it did exist. */ -#if (defined(__TURBOC__) && !defined(WIN32)) -/*# define WILD_STAT_BUG*/ -#endif -#if (defined(VMS) || defined(__MINT__)) -# define WILD_STAT_BUG -#endif - -/*--------------------------------------------------------------------------- - OS-dependent includes - ---------------------------------------------------------------------------*/ - - -/*--------------------------------------------------------------------------- - API (DLL) section: - ---------------------------------------------------------------------------*/ - -#ifdef DLL -# define MAIN UZ_EXP UzpMain /* was UzpUnzip */ -# ifdef OS2DLL -# undef Info -# define REDIRECTC(c) varputchar(__G__ c) -# define REDIRECTPRINT(buf,size) varmessage(__G__ buf, size) -# define FINISH_REDIRECT() finish_REXX_redirect(__G) -# else -# define REDIRECTC(c) -# define REDIRECTPRINT(buf,size) 0 -# define FINISH_REDIRECT() close_redirect(__G) -# endif -#endif - -/*--------------------------------------------------------------------------- - Acorn RISCOS section: - ---------------------------------------------------------------------------*/ - -#ifdef RISCOS -# include "acorn/riscos.h" -#endif - -/*--------------------------------------------------------------------------- - Amiga section: - ---------------------------------------------------------------------------*/ - -#ifdef AMIGA -# include "amiga/amiga.h" -#endif - -/*--------------------------------------------------------------------------- - AOS/VS section (somewhat similar to Unix, apparently): - ---------------------------------------------------------------------------*/ - -#ifdef AOS_VS -# ifdef __FILEIO_C -# include "aosvs/aosvs.h" -# endif -#endif - -/*--------------------------------------------------------------------------- - Atari ST section: - ---------------------------------------------------------------------------*/ - -#ifdef ATARI -# include -# include -# include -# include -# define SYMLINKS -# define EXE_EXTENSION ".tos" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_DMY -# endif -# define DIR_END '/' -# define INT_SPRINTF -# define timezone _timezone -# define lenEOL 2 -# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} -# undef SHORT_NAMES -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -# endif -#endif - -/*--------------------------------------------------------------------------- - AtheOS section: - ---------------------------------------------------------------------------*/ - -#ifdef __ATHEOS__ -# include "atheos/athcfg.h" -#endif - -/*--------------------------------------------------------------------------- - BeOS section: - ---------------------------------------------------------------------------*/ - -#ifdef __BEOS__ -# include "beos/beocfg.h" -#endif - -/*--------------------------------------------------------------------------- - Human68k/X680x0 section: - ---------------------------------------------------------------------------*/ - -#ifdef __human68k__ - /* DO NOT DEFINE DOS_OS2 HERE! If Human68k is so much */ - /* like MS-DOS and/or OS/2, create DOS_H68_OS2 macro. */ -# if (!defined(_MBCS) && !defined(NO_MBCS)) - /* enable MBCS support by default for this system */ -# define _MBCS -# endif -# if (defined(_MBCS) && defined(NO_MBCS)) - /* disable MBCS support when explicitely requested */ -# undef _MBCS -# endif -# include -# include -# include -# include -# include -# ifdef HAVE_MBSTRING_H -# include -# endif -# ifdef HAVE_MBCTYPE_H -# include -# else -# ifndef _ismbblead -# define _ismbblead(c) (0x80 <= (c) && ((c) < 0xa0 || 0xe0 <= (c))) -# endif -# endif -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_YMD /* Japanese standard */ -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -# define INT_SPRINTF -# define SYMLINKS -# ifdef SFX -# define MAIN main_sfx -# endif -#endif - -/*--------------------------------------------------------------------------- - Mac section: - ---------------------------------------------------------------------------*/ - -#ifdef MACOS -# include "maccfg.h" -#endif /* MACOS */ - -/*--------------------------------------------------------------------------- - MS-DOS, OS/2, FLEXOS section: - ---------------------------------------------------------------------------*/ - -#ifdef WINDLL -# ifdef MORE -# undef MORE -# endif -# ifdef OS2_EAS -# undef OS2_EAS -# endif -#endif - -#if (defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__))) -# ifndef MSC -# define MSC /* This should work for older MSC, too! */ -# endif -#endif - -#if (defined(MSDOS) || defined(OS2) || defined(FLEXOS)) -# include /* off_t, time_t, dev_t, ... */ -# include -# include /* lseek(), open(), setftime(), dup(), creat() */ -# include /* localtime() */ -# include /* O_BINARY for open() w/o CR/LF translation */ - -# ifdef OS2 /* defined for all OS/2 compilers */ -# include "os2/os2cfg.h" -# else -# ifdef FLEXOS -# include "flexos/flxcfg.h" -# else -# include "msdos/doscfg.h" -# endif -# endif - -# if (defined(_MSC_VER) && (_MSC_VER == 700) && !defined(GRR)) - /* - * ARGH. MSC 7.0 libraries think times are based on 1899 Dec 31 00:00, not - * 1970 Jan 1 00:00. So we have to diddle time_t's appropriately: add or - * subtract 70 years' worth of seconds; i.e., number of days times 86400; - * i.e., (70*365 regular days + 17 leap days + 1 1899 day) * 86400 == - * (25550 + 17 + 1) * 86400 == 2209075200 seconds. We know time_t is an - * unsigned long (ulg) on the only system with this bug. - */ -# define TIMET_TO_NATIVE(x) (x) += (ulg)2209075200L; -# define NATIVE_TO_TIMET(x) (x) -= (ulg)2209075200L; -# endif -# if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0450)) -# define timezone _timezone -# endif -# if (defined(__GO32__) || defined(FLEXOS)) -# define DIR_END '/' -# else -# define DIR_END '\\' /* OS uses '\\' as directory separator */ -# define DIR_END2 '/' /* also check for '/' (RTL may convert) */ -# endif -# ifdef DATE_FORMAT -# undef DATE_FORMAT -# endif -# define DATE_FORMAT dateformat() -# define lenEOL 2 -# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} -# if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -# endif -#endif /* MSDOS || OS2 || FLEXOS */ - -/*--------------------------------------------------------------------------- - MTS section (piggybacks UNIX, I think): - ---------------------------------------------------------------------------*/ - -#ifdef MTS -# include /* off_t, time_t, dev_t, ... */ -# include -# include /* MTS uses this instead of fcntl.h */ -# include -# include -# include /* some important non-ANSI routines */ -# define mkdir(s,n) (-1) /* no "make directory" capability */ -# define EBCDIC /* set EBCDIC conversion on */ -# define NO_STRNICMP /* unzip's is as good the one in MTS */ -# define USE_FWRITE -# define close_outfile() fclose(G.outfile) /* can't set time on files */ -# define umask(n) /* don't have umask() on MTS */ -# define FOPWT "w" /* open file for writing in TEXT mode */ -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -#endif /* MTS */ - - /*--------------------------------------------------------------------------- - Novell Netware NLM section - ---------------------------------------------------------------------------*/ - -#ifdef NLM -# include "netware/nlmcfg.h" -#endif - - /*--------------------------------------------------------------------------- - QDOS section - ---------------------------------------------------------------------------*/ - -#ifdef QDOS -# define DIRENT -# include -# include -# include -# include -# include "qdos/izqdos.h" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -# define DIR_END '_' -# define RETURN QReturn -# undef PATH_MAX -# define PATH_MAX 36 -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -# endif -# define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) -# define SCREENWIDTH 80 -#endif - -/*--------------------------------------------------------------------------- - Tandem NSK section: - ---------------------------------------------------------------------------*/ - -#ifdef TANDEM -# include "tandem.h" -# include -# ifndef __INT32 - /* We are compiling with non-WIDE memory model, int = 16 bits */ -# ifndef INT_16BIT -# define INT_16BIT /* report "int" size is 16-bit to inflate setup */ -# endif -# ifdef USE_DEFLATE64 - /* Following required for 64k WSIZE of Deflate64 support */ -# define MED_MEM /* else OUTBUFSIZ is 64K and fails in do_string */ -# define INBUFSIZ 8192 /* but larger buffer for real OSes */ -# endif -# endif - /* use a single LF delimiter so that writes to 101 text files work */ -# define PutNativeEOL *q++ = native(LF); -# define lenEOL 1 -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_DMY -# endif -# define SCREENLINES 25 - /* USE_EF_UT_TIME is set in tandem.h */ -# define RESTORE_UIDGID -# define NO_STRNICMP -#endif - -/*--------------------------------------------------------------------------- - THEOS section: - ---------------------------------------------------------------------------*/ - -#ifdef THEOS -# include "theos/thscfg.h" -#endif - -/*--------------------------------------------------------------------------- - TOPS-20 section: - ---------------------------------------------------------------------------*/ - -#ifdef TOPS20 -# include /* off_t, time_t, dev_t, ... */ -# include -# include -# include -# include -# include -# include -# include /* get amazing monsym() macro */ - extern int open(), close(), read(); - extern int stat(), unlink(), jsys(), fcntl(); - extern long lseek(), dup(), creat(); -# define strchr index /* GRR: necessary? */ -# define strrchr rindex -# define REALLY_SHORT_SYMS -# define NO_MKDIR -# ifndef HAVE_STRNICMP -# define NO_STRNICMP /* probably not provided by TOPS20 C RTL */ -# endif -# define DIR_BEG '<' -# define DIR_END '>' -# define DIR_EXT ".directory" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define EXE_EXTENSION ".exe" /* just a guess... */ -#endif /* TOPS20 */ - -/*--------------------------------------------------------------------------- - Unix section: - ---------------------------------------------------------------------------*/ - -#ifdef UNIX -# include "unix/unxcfg.h" -#endif /* UNIX */ - -/*--------------------------------------------------------------------------- - VM/CMS and MVS section: - ---------------------------------------------------------------------------*/ - -#ifdef CMS_MVS -# include "vmmvs.h" -# define CLOSE_INFILE() close_infile(__G) -#endif - -/*--------------------------------------------------------------------------- - VMS section: - ---------------------------------------------------------------------------*/ - -#ifdef VMS -# include "vms/vmscfg.h" -#endif /* VMS */ - -/*--------------------------------------------------------------------------- - Win32 (Windows 95/NT) section: - ---------------------------------------------------------------------------*/ - -#if (defined(WIN32) && !defined(POCKET_UNZIP) && !defined(_WIN32_WCE)) -# include "win32/w32cfg.h" -#endif - -/*--------------------------------------------------------------------------- - Win32 Windows CE section (also POCKET_UNZIP) - ---------------------------------------------------------------------------*/ - -#if (defined(_WIN32_WCE) || defined(POCKET_UNZIP)) -# include "wince/wcecfg.h" -#endif - - - -/* ---------------------------------------------------------------------------- - MUST BE AFTER LARGE FILE INCLUDES - ---------------------------------------------------------------------------- */ -/* This stuff calls in types and messes up large file includes. It needs to - go after large file defines in local includes. - I am guessing that moving them here probably broke some ports, but hey. - 10/31/2004 EG */ -/* ---------------------------------------------------------------------------- - Common includes - ---------------------------------------------------------------------------- */ - -/* Some ports apply specific adjustments which must be in effect before - reading the "standard" include headers. - */ - -#ifdef EFT -# define Z_OFF_T off_t /* Amdahl UTS nonsense ("extended file types") */ -#else -#if (defined(UNIX) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) -# define Z_OFF_T off_t /* 64bit offsets to support 2GB < zipfile size < 4GB */ -#else -# define Z_OFF_T long long -#endif -#endif - -#ifndef ZOFF_T_DEFINED - typedef Z_OFF_T zoff_t; -# define ZOFF_T_DEFINED -#endif -#ifndef Z_STAT_DEFINED - typedef struct stat z_stat; -# define Z_STAT_DEFINED -#endif - -#ifndef MINIX /* Minix needs it after all the other includes (?) */ -# include -#endif - -#include /* skip for VMS, to use tolower() function? */ -#include /* used in mapname() */ -#ifdef USE_STRINGS_H -# include /* strcpy, strcmp, memcpy, index/rindex, etc. */ -#else -# include /* strcpy, strcmp, memcpy, strchr/strrchr, etc. */ -#endif -#if (defined(MODERN) && !defined(NO_LIMITS_H)) -# include /* MAX/MIN constant symbols for system types... */ -#endif - -/* this include must be down here for SysV.4, for some reason... */ -#include /* used in unzip.c, fileio.c */ - - -#ifdef MODERN -# ifndef NO_STDDEF_H -# include -# endif -# ifndef NO_STDLIB_H -# include /* standard library prototypes, malloc(), etc. */ -# endif - typedef size_t extent; -#else /* !MODERN */ -# ifndef AOS_VS /* mostly modern? */ - Z_OFF_T lseek(); -# ifdef VAXC /* not fully modern, but has stdlib.h and void */ -# include -# else - char *malloc(); -# endif /* ?VAXC */ -# endif /* !AOS_VS */ - typedef unsigned int extent; -#endif /* ?MODERN */ - - - - -/*************/ -/* Defines */ -/*************/ - -#define UNZIP_BZ2VERS 46 -#ifdef ZIP64_SUPPORT -# ifdef USE_BZIP2 -# define UNZIP_VERSION UNZIP_BZ2VERS -# else -# define UNZIP_VERSION 45 -# endif -#else -#ifdef USE_DEFLATE64 -# define UNZIP_VERSION 21 /* compatible with PKUNZIP 4.0 */ -#else -# define UNZIP_VERSION 20 /* compatible with PKUNZIP 2.0 */ -#endif -#endif -#define VMS_UNZIP_VERSION 42 /* if OS-needed-to-extract is VMS: can do */ - -#if (defined(MSDOS) || defined(OS2)) -# define DOS_OS2 -#endif - -#if (defined(OS2) || defined(WIN32)) -# define OS2_W32 -#endif - -#if (defined(DOS_OS2) || defined(WIN32)) -# define DOS_OS2_W32 -# define DOS_W32_OS2 /* historical: don't use */ -#endif - -#if (defined(DOS_OS2_W32) || defined(__human68k__)) -# define DOS_H68_OS2_W32 -#endif - -#if (defined(DOS_OS2) || defined(FLEXOS)) -# define DOS_FLX_OS2 -#endif - -#if (defined(DOS_OS2_W32) || defined(FLEXOS)) -# define DOS_FLX_OS2_W32 -#endif - -#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) -# define DOS_FLX_H68_OS2_W32 -#endif - -#if (defined(DOS_FLX_OS2) || defined(NLM)) -# define DOS_FLX_NLM_OS2 -#endif - -#if (defined(DOS_FLX_OS2_W32) || defined(NLM)) -# define DOS_FLX_NLM_OS2_W32 -#endif - -#if (defined(DOS_FLX_H68_OS2_W32) || defined(NLM)) -# define DOS_FLX_H68_NLM_OS2_W32 -#endif - -#if (defined(TOPS20) || defined(VMS)) -# define T20_VMS -#endif - -#if (defined(MSDOS) || defined(T20_VMS)) -# define DOS_T20_VMS -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__)) -# define ATH_BEO -#endif - -#if (defined(ATH_BEO) || defined(UNIX)) -# define ATH_BEO_UNX -#endif - -#if (defined(ATH_BEO_UNX) || defined(THEOS)) -# define ATH_BEO_THS_UNX -#endif - -/* clean up with a few defaults */ -#ifndef DIR_END -# define DIR_END '/' /* last char before program name or filename */ -#endif -#ifndef DATE_FORMAT -# ifdef DATEFMT_ISO_DEFAULT -# define DATE_FORMAT DF_YMD /* defaults to invariant ISO-style */ -# else -# define DATE_FORMAT DF_MDY /* defaults to US convention */ -# endif -#endif -#ifndef DATE_SEPCHAR -# define DATE_SEPCHAR '-' -#endif -#ifndef CLOSE_INFILE -# define CLOSE_INFILE() close(G.zipfd) -#endif -#ifndef RETURN -# define RETURN return /* only used in main() */ -#endif -#ifndef EXIT -# define EXIT exit -#endif -#ifndef USAGE -# define USAGE(ret) usage(__G__ (ret)) /* used in unzip.c, zipinfo.c */ -#endif -#ifndef TIMET_TO_NATIVE /* everybody but MSC 7.0 and Macintosh */ -# define TIMET_TO_NATIVE(x) -# define NATIVE_TO_TIMET(x) -#endif -#ifndef STRNICMP -# ifdef NO_STRNICMP -# define STRNICMP zstrnicmp -# else -# define STRNICMP strnicmp -# endif -#endif - - -#if (defined(DOS_FLX_NLM_OS2_W32) || defined(ATH_BEO_UNX) || defined(RISCOS)) -# ifndef HAVE_UNLINK -# define HAVE_UNLINK -# endif -#endif -#if (defined(AOS_VS) || defined(ATARI)) /* GRR: others? */ -# ifndef HAVE_UNLINK -# define HAVE_UNLINK -# endif -#endif - -/* OS-specific exceptions to the "ANSI <--> INT_SPRINTF" rule */ - -#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) -# if (defined(SYSV) || defined(CONVEX) || defined(NeXT) || defined(BSD4_4)) -# define INT_SPRINTF /* sprintf() returns int: SysVish/Posix */ -# endif -# if (defined(DOS_FLX_NLM_OS2_W32) || defined(VMS) || defined(AMIGA)) -# define INT_SPRINTF /* sprintf() returns int: ANSI */ -# endif -# if (defined(ultrix) || defined(__ultrix)) /* Ultrix 4.3 and newer */ -# if (defined(POSIX) || defined(__POSIX)) -# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ -# endif -# ifdef __GNUC__ -# define PCHAR_SPRINTF /* undetermined actual return value */ -# endif -# endif -# if (defined(__osf__) || defined(_AIX) || defined(CMS_MVS) || defined(THEOS)) -# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ -# endif -# if defined(sun) -# define PCHAR_SPRINTF /* sprintf() returns char *: SunOS cc *and* gcc */ -# endif -#endif - -/* defaults that we hope will take care of most machines in the future */ - -#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) -# ifdef __STDC__ -# define INT_SPRINTF /* sprintf() returns int: ANSI */ -# endif -# ifndef INT_SPRINTF -# define PCHAR_SPRINTF /* sprintf() returns char *: BSDish */ -# endif -#endif - -#define MSG_STDERR(f) (f & 1) /* bit 0: 0 = stdout, 1 = stderr */ -#define MSG_INFO(f) ((f & 6) == 0) /* bits 1 and 2: 0 = info */ -#define MSG_WARN(f) ((f & 6) == 2) /* bits 1 and 2: 1 = warning */ -#define MSG_ERROR(f) ((f & 6) == 4) /* bits 1 and 2: 2 = error */ -#define MSG_FATAL(f) ((f & 6) == 6) /* bits 1 and 2: (3 = fatal error) */ -#define MSG_ZFN(f) (f & 0x0008) /* bit 3: 1 = print zipfile name */ -#define MSG_FN(f) (f & 0x0010) /* bit 4: 1 = print filename */ -#define MSG_LNEWLN(f) (f & 0x0020) /* bit 5: 1 = leading newline if !SOL */ -#define MSG_TNEWLN(f) (f & 0x0040) /* bit 6: 1 = trailing newline if !SOL */ -#define MSG_MNEWLN(f) (f & 0x0080) /* bit 7: 1 = trailing NL for prompts */ -/* the following are subject to change */ -#define MSG_NO_WGUI(f) (f & 0x0100) /* bit 8: 1 = skip if Windows GUI */ -#define MSG_NO_AGUI(f) (f & 0x0200) /* bit 9: 1 = skip if Acorn GUI */ -#define MSG_NO_DLL2(f) (f & 0x0400) /* bit 10: 1 = skip if OS/2 DLL */ -#define MSG_NO_NDLL(f) (f & 0x0800) /* bit 11: 1 = skip if WIN32 DLL */ -#define MSG_NO_WDLL(f) (f & 0x1000) /* bit 12: 1 = skip if Windows DLL */ - -#if (defined(MORE) && !defined(SCREENLINES)) -# ifdef DOS_FLX_NLM_OS2_W32 -# define SCREENLINES 25 /* can be (should be) a function instead */ -# else -# define SCREENLINES 24 /* VT-100s are assumed to be minimal hardware */ -# endif -#endif -#if (defined(MORE) && !defined(SCREENSIZE)) -# ifndef SCREENWIDTH -# define SCREENSIZE(scrrows, scrcols) { \ - if ((scrrows) != NULL) *(scrrows) = SCREENLINES; } -# else -# define SCREENSIZE(scrrows, scrcols) { \ - if ((scrrows) != NULL) *(scrrows) = SCREENLINES; \ - if ((scrcols) != NULL) *(scrcols) = SCREENWIDTH; } -# endif -#endif - -#if (defined(__16BIT__) || defined(MED_MEM) || defined(SMALL_MEM)) -# define DIR_BLKSIZ 64 /* number of directory entries per block - * (should fit in 4096 bytes, usually) */ -#else -# define DIR_BLKSIZ 16384 /* use more memory, to reduce long-range seeks */ -#endif - -#ifndef WSIZE -# ifdef USE_DEFLATE64 -# define WSIZE 65536L /* window size--must be a power of two, and */ -# else /* at least 64K for PKZip's deflate64 method */ -# define WSIZE 0x8000 /* window size--must be a power of two, and */ -# endif /* at least 32K for zip's deflate method */ -#endif - -#ifdef __16BIT__ -# ifndef INT_16BIT -# define INT_16BIT /* on 16-bit systems int size is 16 bits */ -# endif -#else -# define nearmalloc malloc -# define nearfree free -# if (!defined(__IBMC__) || !defined(OS2)) -# ifndef near -# define near -# endif -# ifndef far -# define far -# endif -# endif -#endif - -#if (defined(DYNALLOC_CRCTAB) && !defined(DYNAMIC_CRC_TABLE)) -# undef DYNALLOC_CRCTAB -#endif - -#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) -# undef DYNALLOC_CRCTAB /* not safe with reentrant code */ -#endif - -#if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB)) -# ifdef DYNALLOC_CRCTAB -# undef DYNALLOC_CRCTAB -# endif -#endif - -#if (defined(USE_ZLIB) && defined(ASM_CRC)) -# undef ASM_CRC -#endif - -#ifdef USE_ZLIB -# ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -# endif -# ifdef IZ_CRC_LE_OPTIMIZ -# undef IZ_CRC_LE_OPTIMIZ -# endif -#endif -#if (!defined(IZ_CRC_BE_OPTIMIZ) && !defined(IZ_CRC_LE_OPTIMIZ)) -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# undef IZ_CRCOPTIM_UNFOLDTBL -# endif -#endif - -#ifndef INBUFSIZ -# if (defined(MED_MEM) || defined(SMALL_MEM)) -# define INBUFSIZ 2048 /* works for MS-DOS small model */ -# else -# define INBUFSIZ 8192 /* larger buffers for real OSes */ -# endif -#endif - -#if (defined(INT_16BIT) && (defined(USE_DEFLATE64) || lenEOL > 1)) - /* For environments using 16-bit integers OUTBUFSIZ must be limited to - * less than 64k (do_string() uses "unsigned" in calculations involving - * OUTBUFSIZ). This is achieved by defining MED_MEM when WSIZE = 64k (aka - * Deflate64 support enabled) or EOL markers contain multiple characters. - * (The rule gets applied AFTER the default rule for INBUFSIZ because it - * is not neccessary to reduce INBUFSIZE in this case.) - */ -# if (!defined(SMALL_MEM) && !defined(MED_MEM)) -# define MED_MEM -# endif -#endif - -/* Logic for case of small memory, length of EOL > 1: if OUTBUFSIZ == 2048, - * OUTBUFSIZ>>1 == 1024 and OUTBUFSIZ>>7 == 16; therefore rawbuf is 1008 bytes - * and transbuf 1040 bytes. Have room for 32 extra EOL chars; 1008/32 == 31.5 - * chars/line, smaller than estimated 35-70 characters per line for C source - * and normal text. Hence difference is sufficient for most "average" files. - * (Argument scales for larger OUTBUFSIZ.) - */ -#ifdef SMALL_MEM /* i.e., 16-bit OSes: MS-DOS, OS/2 1.x, etc. */ -# define LoadFarString(x) fLoadFarString(__G__ (x)) -# define LoadFarStringSmall(x) fLoadFarStringSmall(__G__ (x)) -# define LoadFarStringSmall2(x) fLoadFarStringSmall2(__G__ (x)) -# if (defined(_MSC_VER) && (_MSC_VER >= 600)) -# define zfstrcpy(dest, src) _fstrcpy((dest), (src)) -# define zfstrcmp(s1, s2) _fstrcmp((s1), (s2)) -# endif -# if !(defined(SFX) || defined(FUNZIP)) -# if (defined(_MSC_VER)) -# define zfmalloc(sz) _fmalloc((sz)) -# define zffree(x) _ffree(x) -# endif -# if (defined(__TURBOC__)) -# include -# define zfmalloc(sz) farmalloc((unsigned long)(sz)) -# define zffree(x) farfree(x) -# endif -# endif /* !(SFX || FUNZIP) */ -# ifndef Far -# define Far far /* __far only works for MSC 6.00, not 6.0a or Borland */ -# endif -# define OUTBUFSIZ INBUFSIZ -# if (lenEOL == 1) -# define RAWBUFSIZ (OUTBUFSIZ>>1) -# else -# define RAWBUFSIZ ((OUTBUFSIZ>>1) - (OUTBUFSIZ>>7)) -# endif -# define TRANSBUFSIZ (OUTBUFSIZ-RAWBUFSIZ) - typedef short shrint; /* short/int or "shrink int" (unshrink) */ -#else -# define zfstrcpy(dest, src) strcpy((dest), (src)) -# define zfstrcmp(s1, s2) strcmp((s1), (s2)) -# define zfmalloc malloc -# define zffree(x) free(x) -# ifdef QDOS -# define LoadFarString(x) Qstrfix(x) /* fix up _ for '.' */ -# define LoadFarStringSmall(x) Qstrfix(x) -# define LoadFarStringSmall2(x) Qstrfix(x) -# else -# define LoadFarString(x) (char *)(x) -# define LoadFarStringSmall(x) (char *)(x) -# define LoadFarStringSmall2(x) (char *)(x) -# endif -# ifdef MED_MEM -# define OUTBUFSIZ 0xFF80 /* can't malloc arrays of 0xFFE8 or more */ -# define TRANSBUFSIZ 0xFF80 - typedef short shrint; -# else -# define OUTBUFSIZ (lenEOL*WSIZE) /* more efficient text conversion */ -# define TRANSBUFSIZ (lenEOL*OUTBUFSIZ) -# ifdef AMIGA - typedef short shrint; -# else - typedef int shrint; /* for efficiency/speed, we hope... */ -# endif -# endif /* ?MED_MEM */ -# define RAWBUFSIZ OUTBUFSIZ -#endif /* ?SMALL_MEM */ - -#ifndef Far -# define Far -#endif - -#ifndef Cdecl -# define Cdecl -#endif - -#ifndef MAIN -# define MAIN main -#endif - -#ifdef SFX /* disable some unused features for SFX executables */ -# ifndef NO_ZIPINFO -# define NO_ZIPINFO -# endif -# ifdef TIMESTAMP -# undef TIMESTAMP -# endif -#endif - -#ifdef SFX -# ifdef CHEAP_SFX_AUTORUN -# ifndef NO_SFX_EXDIR -# define NO_SFX_EXDIR -# endif -# endif -# ifndef NO_SFX_EXDIR -# ifndef SFX_EXDIR -# define SFX_EXDIR -# endif -# else -# ifdef SFX_EXDIR -# undef SFX_EXDIR -# endif -# endif -#endif - -/* user may have defined both by accident... NOTIMESTAMP takes precedence */ -#if (defined(TIMESTAMP) && defined(NOTIMESTAMP)) -# undef TIMESTAMP -#endif - -#if (!defined(COPYRIGHT_CLEAN) && !defined(USE_SMITH_CODE)) -# define COPYRIGHT_CLEAN -#endif - -/* The LZW patent is expired worldwide since 2004-Jul-07, so USE_UNSHRINK - * is now enabled by default. See unshrink.c. - */ -#if (!defined(LZW_CLEAN) && !defined(USE_UNSHRINK)) -# define USE_UNSHRINK -#endif - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -#ifndef PIPE_ERROR -# ifndef EPIPE -# define EPIPE -1 -# endif -# define PIPE_ERROR (errno == EPIPE) -#endif - -/* File operations--use "b" for binary if allowed or fixed length 512 on VMS */ -#ifdef VMS -# define FOPR "r","ctx=stm" -# define FOPM "r+","ctx=stm","rfm=fix","mrs=512" -# define FOPW "w","ctx=stm","rfm=fix","mrs=512" -# define FOPWR "w+","ctx=stm","rfm=fix","mrs=512" -#endif /* VMS */ - -#ifdef CMS_MVS -/* Binary files must be RECFM=F,LRECL=1 for ftell() to get correct pos */ -/* ...unless byteseek is used. Let's try that for a while. */ -# define FOPR "rb,byteseek" -# define FOPM "r+b,byteseek" -# ifdef MVS -# define FOPW "wb,recfm=u,lrecl=32760,byteseek" /* New binary files */ -# define FOPWE "wb" /* Existing binary files */ -# define FOPWT "w,lrecl=133" /* New text files */ -# define FOPWTE "w" /* Existing text files */ -# else -# define FOPW "wb,recfm=v,lrecl=32760" -# define FOPWT "w" -# endif -#endif /* CMS_MVS */ - -#ifdef TOPS20 /* TOPS-20 MODERN? You kidding? */ -# define FOPW "w8" -#endif /* TOPS20 */ - -/* Defaults when nothing special has been defined previously. */ -#ifdef MODERN -# ifndef FOPR -# define FOPR "rb" -# endif -# ifndef FOPM -# define FOPM "r+b" -# endif -# ifndef FOPW -# define FOPW "wb" -# endif -# ifndef FOPWT -# define FOPWT "wt" -# endif -# ifndef FOPWR -# define FOPWR "w+b" -# endif -#else /* !MODERN */ -# ifndef FOPR -# define FOPR "r" -# endif -# ifndef FOPM -# define FOPM "r+" -# endif -# ifndef FOPW -# define FOPW "w" -# endif -# ifndef FOPWT -# define FOPWT "w" -# endif -# ifndef FOPWR -# define FOPWR "w+" -# endif -#endif /* ?MODERN */ - -/* - * If exists on most systems, should include that, since it may - * define some or all of the following: NAME_MAX, PATH_MAX, _POSIX_NAME_MAX, - * _POSIX_PATH_MAX. - */ -#ifdef DOS_FLX_NLM_OS2_W32 -# include -#endif - -/* 2008-07-22 SMS. - * Unfortunately, on VMS, exists, and is included by - * (so it's pretty much unavoidable), and it defines PATH_MAX to a fixed - * short value (256, correct only for older systems without ODS-5 support), - * rather than one based on the real RMS NAM[L] situation. So, we - * artificially undefine it here, to allow our better-defined _MAX_PATH - * (see vms/vmscfg.h) to be used. - */ -#ifdef VMS -# undef PATH_MAX -#endif - -#ifndef PATH_MAX -# ifdef MAXPATHLEN -# define PATH_MAX MAXPATHLEN /* in on some systems */ -# else -# ifdef _MAX_PATH -# define PATH_MAX _MAX_PATH -# else -# if FILENAME_MAX > 255 -# define PATH_MAX FILENAME_MAX /* used like PATH_MAX on some systems */ -# else -# define PATH_MAX 1024 -# endif -# endif /* ?_MAX_PATH */ -# endif /* ?MAXPATHLEN */ -#endif /* !PATH_MAX */ - -/* - * buffer size required to hold the longest legal local filepath - * (including the trailing '\0') - */ -#define FILNAMSIZ PATH_MAX - -#ifdef UNICODE_SUPPORT -# if !(defined(UTF8_MAYBE_NATIVE) || defined(UNICODE_WCHAR)) -# undef UNICODE_SUPPORT -# endif -#endif -/* 2007-09-18 SMS. - * Include here if it will be needed later for Unicode. - * Otherwise, SETLOCALE may be defined here, and then defined again - * (differently) when is read later. - */ -#ifdef UNICODE_SUPPORT -# ifdef UNICODE_WCHAR -# if !(defined(_WIN32_WCE) || defined(POCKET_UNZIP)) -# include -# endif -# endif -# ifndef _MBCS /* no need to include twice, see below */ -# include -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -# endif -#endif /* UNICODE_SUPPORT */ - -/* DBCS support for Info-ZIP (mainly for japanese (-: ) - * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) - */ -#ifdef _MBCS -# include - /* Multi Byte Character Set */ -# define ___MBS_TMP_DEF char *___tmp_ptr; -# define ___TMP_PTR ___tmp_ptr -# ifndef CLEN -# define NEED_UZMBCLEN -# define CLEN(ptr) (int)uzmbclen((ZCONST unsigned char *)(ptr)) -# endif -# ifndef PREINCSTR -# define PREINCSTR(ptr) (ptr += CLEN(ptr)) -# endif -# define POSTINCSTR(ptr) (___TMP_PTR=(char *)(ptr), PREINCSTR(ptr),___TMP_PTR) - char *plastchar OF((ZCONST char *ptr, extent len)); -# define lastchar(ptr, len) ((int)(unsigned)*plastchar(ptr, len)) -# ifndef MBSCHR -# define NEED_UZMBSCHR -# define MBSCHR(str,c) (char *)uzmbschr((ZCONST unsigned char *)(str), c) -# endif -# ifndef MBSRCHR -# define NEED_UZMBSRCHR -# define MBSRCHR(str,c) (char *)uzmbsrchr((ZCONST unsigned char *)(str), c) -# endif -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -#else /* !_MBCS */ -# define ___MBS_TMP_DEF -# define ___TMP_PTR -# define CLEN(ptr) 1 -# define PREINCSTR(ptr) (++(ptr)) -# define POSTINCSTR(ptr) ((ptr)++) -# define plastchar(ptr, len) (&ptr[(len)-1]) -# define lastchar(ptr, len) (ptr[(len)-1]) -# define MBSCHR(str, c) strchr(str, c) -# define MBSRCHR(str, c) strrchr(str, c) -# ifndef SETLOCALE -# define SETLOCALE(category, locale) -# endif -#endif /* ?_MBCS */ -#define INCSTR(ptr) PREINCSTR(ptr) - - -#if (defined(MALLOC_WORK) && !defined(MY_ZCALLOC)) - /* Any system without a special calloc function */ -# ifndef zcalloc -# define zcalloc(items, size) \ - (zvoid far *)calloc((unsigned)(items), (unsigned)(size)) -# endif -# ifndef zcfree -# define zcfree free -# endif -#endif /* MALLOC_WORK && !MY_ZCALLOC */ - -#if (defined(CRAY) && defined(ZMEM)) -# undef ZMEM -#endif - -#ifdef ZMEM -# undef ZMEM -# define memcmp(b1,b2,len) bcmp(b2,b1,len) -# define memcpy(dest,src,len) bcopy(src,dest,len) -# define memzero bzero -#else -# define memzero(dest,len) memset(dest,0,len) -#endif - -#ifndef TRUE -# define TRUE 1 /* sort of obvious */ -#endif -#ifndef FALSE -# define FALSE 0 -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 -#endif - -#if (!defined(S_IEXEC) && defined(S_IXUSR)) -# define S_IEXEC S_IXUSR -#endif - -#if (defined(UNIX) && defined(S_IFLNK) && !defined(MTS)) -# define SYMLINKS -# ifndef S_ISLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -# endif -#endif /* UNIX && S_IFLNK && !MTS */ - -#ifndef S_ISDIR -# ifdef CMS_MVS -# define S_ISDIR(m) (FALSE) -# else -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# endif -#endif - -#ifndef IS_VOLID -# define IS_VOLID(m) ((m) & 0x08) -#endif - -/***********************************/ -/* LARGE_FILE_SUPPORT */ -/***********************************/ -/* This whole section lifted from Zip 3b tailor.h - - * Types are in OS dependent headers (eg, w32cfg.h) - * - * LARGE_FILE_SUPPORT and ZIP64_SUPPORT are automatically - * set in OS dependent headers (for some ports) based on the port and compiler. - * - * Function prototypes are below as OF is defined earlier in this file - * but after OS dependent header is included. - * - * E. Gordon 9/21/2003 - * Updated 1/28/2004 - * Lifted and placed here 6/7/2004 - Myles Bennett - */ -#ifdef LARGE_FILE_SUPPORT - /* 64-bit Large File Support */ - -/* ---------------------------- */ - -# if defined(UNIX) || defined(VMS) - - /* 64-bit stat functions */ -# define zstat stat -# define zfstat fstat - - /* 64-bit fseeko */ -# define zlseek lseek -# define zfseeko fseeko - - /* 64-bit ftello */ -# define zftello ftello - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif /* UNIX || VMS */ - -/* ---------------------------- */ - -# ifdef WIN32 - -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__LCC__) - /* MS C (VC), MinGW GCC port and LCC-32 use the MS C Runtime lib */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - - /* 64-bit lseek */ -# define zlseek _lseeki64 - -# if defined(_MSC_VER) && (_MSC_VER >= 1400) - /* Beginning with VS 8.0 (Visual Studio 2005, MSC 14), the Microsoft - C rtl publishes its (previously internal) implmentations of - "fseeko" and "ftello" for 64-bit file offsets. */ - /* 64-bit fseeko */ -# define zfseeko _fseeki64 - /* 64-bit ftello */ -# define zftello _ftelli64 - -# else /* not (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ - -# if defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ >= 0x800) - /* Up-to-date versions of MinGW define the macro __MSVCRT_VERSION__ - to denote the version of the MS C rtl dll used for linking. When - configured to link against the runtime of MS Visual Studio 8 (or - newer), the built-in 64-bit fseek/ftell functions are available. */ - /* 64-bit fseeko */ -# define zfseeko _fseeki64 - /* 64-bit ftello */ -# define zftello _ftelli64 - -# else /* !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__>=0x800)) */ - /* The version of the C runtime is lower than MSC 14 or unknown. */ - - /* The newest MinGW port contains built-in extensions to the MSC rtl - that provide fseeko and ftello, but our implementations will do - for now. */ - /* 64-bit fseeko */ - int zfseeko OF((FILE *, zoff_t, int)); - - /* 64-bit ftello */ - zoff_t zftello OF((FILE *)); - -# endif /* ? (__MSVCRT_VERSION__ >= 0x800) */ -# endif /* ? (_MSC_VER >= 1400) */ - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif /* _MSC_VER || __MINGW__ || __LCC__ */ - -# ifdef __CYGWIN__ - /* CYGWIN GCC Posix emulator on Windows - (configuration not yet finished/tested) */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - - /* 64-bit lseek */ -# define zlseek _lseeki64 - - /* 64-bit fseeko */ -# define zfseeko fseeko - - /* 64-bit ftello */ -# define zftello ftello - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif -# if defined(__WATCOMC__) || defined(__BORLANDC__) - /* WATCOM C and Borland C provide their own C runtime libraries, - but they are sufficiently compatible with MS CRTL. */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - -# ifdef __WATCOMC__ - /* 64-bit lseek */ -# define zlseek _lseeki64 -# endif - - /* 64-bit fseeko */ - int zfseeko OF((FILE *, zoff_t, int)); - - /* 64-bit ftello */ - zoff_t zftello OF((FILE *)); - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif -# ifdef __IBMC__ - /* IBM C */ - - /* 64-bit stat functions */ - - /* 64-bit fseeko */ - - /* 64-bit ftello */ - - /* 64-bit fopen */ - -# endif - -# endif /* WIN32 */ - -#else - /* No Large File Support */ - -# ifndef REGULUS /* returns the inode number on success(!)...argh argh argh */ -# define zstat stat -# endif -# define zfstat fstat -# define zlseek lseek -# define zfseeko fseek -# define zftello ftell -# define zfopen fopen -# define zfdopen fdopen - -# if defined(UNIX) || defined(VMS) || defined(WIN32) - /* For these systems, implement "64bit file vs. 32bit prog" check */ -# ifndef DO_SAFECHECK_2GB -# define DO_SAFECHECK_2GB -# endif -# endif - -#endif - -/* No "64bit file vs. 32bit prog" check for SFX stub, to save space */ -#if (defined(DO_SAFECHECK_2GB) && defined(SFX)) -# undef DO_SAFECHECK_2GB -#endif - -#ifndef SSTAT -# ifdef WILD_STAT_BUG -# define SSTAT(path,pbuf) (iswild(path) || zstat(path,pbuf)) -# else -# define SSTAT zstat -# endif -#endif - - -/* Default fzofft() format selection. */ - -#ifndef FZOFFT_FMT - -# ifdef LARGE_FILE_SUPPORT -# define FZOFFT_FMT "ll" -# define FZOFFT_HEX_WID_VALUE "16" -# else /* def LARGE_FILE_SUPPORT */ -# define FZOFFT_FMT "l" -# define FZOFFT_HEX_WID_VALUE "8" -# endif /* def LARGE_FILE_SUPPORT */ - -#endif /* ndef FZOFFT_FMT */ - -#define FZOFFT_HEX_WID ((char *) -1) -#define FZOFFT_HEX_DOT_WID ((char *) -2) - -#define FZOFFT_NUM 4 /* Number of chambers. */ -#define FZOFFT_LEN 24 /* Number of characters/chamber. */ - - -#ifdef SHORT_SYMS /* Mark Williams C, ...? */ -# define extract_or_test_files xtr_or_tst_files -# define extract_or_test_member xtr_or_tst_member -#endif - -#ifdef REALLY_SHORT_SYMS /* TOPS-20 linker: first 6 chars */ -# define process_cdir_file_hdr XXpcdfh -# define process_local_file_hdr XXplfh -# define extract_or_test_files XXxotf /* necessary? */ -# define extract_or_test_member XXxotm /* necessary? */ -# define check_for_newer XXcfn -# define overwrite_all XXoa -# define process_all_files XXpaf -# define extra_field XXef -# define explode_lit8 XXel8 -# define explode_lit4 XXel4 -# define explode_nolit8 XXnl8 -# define explode_nolit4 XXnl4 -# define cpdist8 XXcpdist8 -# define inflate_codes XXic -# define inflate_stored XXis -# define inflate_fixed XXif -# define inflate_dynamic XXid -# define inflate_block XXib -# define maxcodemax XXmax -#endif - -#ifndef S_TIME_T_MAX /* max value of signed (>= 32-bit) time_t */ -# define S_TIME_T_MAX ((time_t)(ulg)0x7fffffffL) -#endif -#ifndef U_TIME_T_MAX /* max value of unsigned (>= 32-bit) time_t */ -# define U_TIME_T_MAX ((time_t)(ulg)0xffffffffL) -#endif -#ifdef DOSTIME_MINIMUM /* min DOSTIME value (1980-01-01) */ -# undef DOSTIME_MINIMUM -#endif -#define DOSTIME_MINIMUM ((ulg)0x00210000L) -#ifdef DOSTIME_2038_01_18 /* approximate DOSTIME equivalent of */ -# undef DOSTIME_2038_01_18 /* the signed-32-bit time_t limit */ -#endif -#define DOSTIME_2038_01_18 ((ulg)0x74320000L) - -#ifdef QDOS -# define ZSUFX "_zip" -# define ALT_ZSUFX ".zip" -#else -# ifdef RISCOS -# define ZSUFX "/zip" -# else -# define ZSUFX ".zip" -# endif -# define ALT_ZSUFX ".ZIP" /* Unix-only so far (only case-sensitive fs) */ -#endif - -#define CENTRAL_HDR_SIG "\001\002" /* the infamous "PK" signature bytes, */ -#define LOCAL_HDR_SIG "\003\004" /* w/o "PK" (so unzip executable not */ -#define END_CENTRAL_SIG "\005\006" /* mistaken for zipfile itself) */ -#define EXTD_LOCAL_SIG "\007\010" /* [ASCII "\113" == EBCDIC "\080" ??] */ - -/** internal-only return codes **/ -#define IZ_DIR 76 /* potential zipfile is a directory */ -/* special return codes for mapname() */ -#define MPN_OK 0 /* mapname successful */ -#define MPN_INF_TRUNC (1<<8) /* caution - filename truncated */ -#define MPN_INF_SKIP (2<<8) /* info - skipped because nothing to do */ -#define MPN_ERR_SKIP (3<<8) /* error - entry skipped */ -#define MPN_ERR_TOOLONG (4<<8) /* error - path too long */ -#define MPN_NOMEM (10<<8) /* error - out of memory, file skipped */ -#define MPN_CREATED_DIR (16<<8) /* directory created: set time & permission */ -#define MPN_VOL_LABEL (17<<8) /* volume label, but can't set on hard disk */ -#define MPN_INVALID (99<<8) /* internal logic error, should never reach */ -/* mask for internal mapname&checkdir return codes */ -#define MPN_MASK 0x7F00 -/* error code for extracting/testing extra field blocks */ -#define IZ_EF_TRUNC 79 /* local extra field truncated (PKZIP'd) */ - -/* choice of activities for do_string() */ -#define SKIP 0 /* skip header block */ -#define DISPLAY 1 /* display archive comment (ASCII) */ -#define DISPL_8 5 /* display file comment (ext. ASCII) */ -#define DS_FN 2 /* read filename (ext. ASCII, chead) */ -#define DS_FN_C 2 /* read filename from central header */ -#define DS_FN_L 6 /* read filename from local header */ -#define EXTRA_FIELD 3 /* copy extra field into buffer */ -#define DS_EF 3 -#ifdef AMIGA -# define FILENOTE 4 /* convert file comment to filenote */ -#endif -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) -# define CHECK_AUTORUN 7 /* copy command, display remainder */ -# define CHECK_AUTORUN_Q 8 /* copy command, skip remainder */ -#endif - -#define DOES_NOT_EXIST -1 /* return values for check_for_newer() */ -#define EXISTS_AND_OLDER 0 -#define EXISTS_AND_NEWER 1 - -#define OVERWRT_QUERY 0 /* status values for G.overwrite_mode */ -#define OVERWRT_ALWAYS 1 -#define OVERWRT_NEVER 2 - -#define IS_OVERWRT_ALL (G.overwrite_mode == OVERWRT_ALWAYS) -#define IS_OVERWRT_NONE (G.overwrite_mode == OVERWRT_NEVER) - -#ifdef VMS - /* return codes for VMS-specific open_outfile() function */ -# define OPENOUT_OK 0 /* file openend normally */ -# define OPENOUT_FAILED 1 /* file open failed */ -# define OPENOUT_SKIPOK 2 /* file not opened, skip at error level OK */ -# define OPENOUT_SKIPWARN 3 /* file not opened, skip at error level WARN */ -#endif /* VMS */ - -#define ROOT 0 /* checkdir() extract-to path: called once */ -#define INIT 1 /* allocate buildpath: called once per member */ -#define APPEND_DIR 2 /* append a dir comp.: many times per member */ -#define APPEND_NAME 3 /* append actual filename: once per member */ -#define GETPATH 4 /* retrieve the complete path and free it */ -#define END 5 /* free root path prior to exiting program */ - -/* version_made_by codes (central dir): make sure these */ -/* are not defined on their respective systems!! */ -#define FS_FAT_ 0 /* filesystem used by MS-DOS, OS/2, Win32 */ -#define AMIGA_ 1 -#define VMS_ 2 -#define UNIX_ 3 -#define VM_CMS_ 4 -#define ATARI_ 5 /* what if it's a minix filesystem? [cjh] */ -#define FS_HPFS_ 6 /* filesystem used by OS/2 (and NT 3.x) */ -#define MAC_ 7 /* HFS filesystem used by MacOS */ -#define Z_SYSTEM_ 8 -#define CPM_ 9 -#define TOPS20_ 10 -#define FS_NTFS_ 11 /* filesystem used by Windows NT */ -#define QDOS_ 12 -#define ACORN_ 13 /* Archimedes Acorn RISC OS */ -#define FS_VFAT_ 14 /* filesystem used by Windows 95, NT */ -#define MVS_ 15 -#define BEOS_ 16 /* hybrid POSIX/database filesystem */ -#define TANDEM_ 17 /* Tandem NSK */ -#define THEOS_ 18 /* THEOS */ -#define MAC_OSX_ 19 /* Mac OS/X (Darwin) */ -#define ATHEOS_ 30 /* AtheOS */ -#define NUM_HOSTS 31 /* index of last system + 1 */ -/* don't forget to update zipinfo.c appropiately if NUM_HOSTS changes! */ - -#define STORED 0 /* compression methods */ -#define SHRUNK 1 -#define REDUCED1 2 -#define REDUCED2 3 -#define REDUCED3 4 -#define REDUCED4 5 -#define IMPLODED 6 -#define TOKENIZED 7 -#define DEFLATED 8 -#define ENHDEFLATED 9 -#define DCLIMPLODED 10 -#define BZIPPED 12 -#define LZMAED 14 -#define IBMTERSED 18 -#define IBMLZ77ED 19 -#define WAVPACKED 97 -#define PPMDED 98 -#define NUM_METHODS 17 /* number of known method IDs */ -/* don't forget to update list.c (list_files()), extract.c and zipinfo.c - * appropriately if NUM_METHODS changes */ - -/* (the PK-class error codes are public and have been moved into unzip.h) */ - -#define DF_MDY 0 /* date format 10/26/91 (USA only) */ -#define DF_DMY 1 /* date format 26/10/91 (most of the world) */ -#define DF_YMD 2 /* date format 91/10/26 (a few countries) */ - -/*--------------------------------------------------------------------------- - Extra-field block ID values and offset info. - ---------------------------------------------------------------------------*/ -/* extra-field ID values, all little-endian: */ -#define EF_PKSZ64 0x0001 /* PKWARE's 64-bit filesize extensions */ -#define EF_AV 0x0007 /* PKWARE's authenticity verification */ -#define EF_EFS 0x0008 /* PKWARE's extended language encoding */ -#define EF_OS2 0x0009 /* OS/2 extended attributes */ -#define EF_PKW32 0x000a /* PKWARE's Win95/98/WinNT filetimes */ -#define EF_PKVMS 0x000c /* PKWARE's VMS */ -#define EF_PKUNIX 0x000d /* PKWARE's Unix */ -#define EF_PKFORK 0x000e /* PKWARE's future stream/fork descriptors */ -#define EF_PKPATCH 0x000f /* PKWARE's patch descriptor */ -#define EF_PKPKCS7 0x0014 /* PKWARE's PKCS#7 store for X.509 Certs */ -#define EF_PKFX509 0x0015 /* PKWARE's file X.509 Cert&Signature ID */ -#define EF_PKCX509 0x0016 /* PKWARE's central dir X.509 Cert ID */ -#define EF_PKENCRHD 0x0017 /* PKWARE's Strong Encryption header */ -#define EF_PKRMCTL 0x0018 /* PKWARE's Record Management Controls*/ -#define EF_PKLSTCS7 0x0019 /* PKWARE's PKCS#7 Encr. Recipient Cert List */ -#define EF_PKIBM 0x0065 /* PKWARE's IBM S/390 & AS/400 attributes */ -#define EF_PKIBM2 0x0066 /* PKWARE's IBM S/390 & AS/400 compr. attribs */ -#define EF_IZVMS 0x4d49 /* Info-ZIP's VMS ("IM") */ -#define EF_IZUNIX 0x5855 /* Info-ZIP's first Unix[1] ("UX") */ -#define EF_IZUNIX2 0x7855 /* Info-ZIP's second Unix[2] ("Ux") */ -#define EF_IZUNIX3 0x7875 /* Info-ZIP's newest Unix[3] ("ux") */ -#define EF_TIME 0x5455 /* universal timestamp ("UT") */ -#define EF_UNIPATH 0x7075 /* Info-ZIP Unicode Path ("up") */ -#define EF_UNICOMNT 0x6375 /* Info-ZIP Unicode Comment ("uc") */ -#define EF_MAC3 0x334d /* Info-ZIP's new Macintosh (= "M3") */ -#define EF_JLMAC 0x07c8 /* Johnny Lee's old Macintosh (= 1992) */ -#define EF_ZIPIT 0x2605 /* Thomas Brown's Macintosh (ZipIt) */ -#define EF_ZIPIT2 0x2705 /* T. Brown's Mac (ZipIt) v 1.3.8 and newer ? */ -#define EF_SMARTZIP 0x4d63 /* Mac SmartZip by Marco Bambini */ -#define EF_VMCMS 0x4704 /* Info-ZIP's VM/CMS ("\004G") */ -#define EF_MVS 0x470f /* Info-ZIP's MVS ("\017G") */ -#define EF_ACL 0x4c41 /* (OS/2) access control list ("AL") */ -#define EF_NTSD 0x4453 /* NT security descriptor ("SD") */ -#define EF_ATHEOS 0x7441 /* AtheOS ("At") */ -#define EF_BEOS 0x6542 /* BeOS ("Be") */ -#define EF_QDOS 0xfb4a /* SMS/QDOS ("J\373") */ -#define EF_AOSVS 0x5356 /* AOS/VS ("VS") */ -#define EF_SPARK 0x4341 /* David Pilling's Acorn/SparkFS ("AC") */ -#define EF_TANDEM 0x4154 /* Tandem NSK ("TA") */ -#define EF_THEOS 0x6854 /* Jean-Michel Dubois' Theos "Th" */ -#define EF_THEOSO 0x4854 /* old Theos port */ -#define EF_MD5 0x4b46 /* Fred Kantor's MD5 ("FK") */ -#define EF_ASIUNIX 0x756e /* ASi's Unix ("nu") */ - -#define EB_HEADSIZE 4 /* length of extra field block header */ -#define EB_ID 0 /* offset of block ID in header */ -#define EB_LEN 2 /* offset of data length field in header */ -#define EB_UCSIZE_P 0 /* offset of ucsize field in compr. data */ -#define EB_CMPRHEADLEN 6 /* lenght of compression header */ - -#define EB_UX_MINLEN 8 /* minimal "UX" field contains atime, mtime */ -#define EB_UX_FULLSIZE 12 /* full "UX" field (atime, mtime, uid, gid) */ -#define EB_UX_ATIME 0 /* offset of atime in "UX" extra field data */ -#define EB_UX_MTIME 4 /* offset of mtime in "UX" extra field data */ -#define EB_UX_UID 8 /* byte offset of UID in "UX" field data */ -#define EB_UX_GID 10 /* byte offset of GID in "UX" field data */ - -#define EB_UX2_MINLEN 4 /* minimal "Ux" field contains UID/GID */ -#define EB_UX2_UID 0 /* byte offset of UID in "Ux" field data */ -#define EB_UX2_GID 2 /* byte offset of GID in "Ux" field data */ -#define EB_UX2_VALID (1 << 8) /* UID/GID present */ - -#define EB_UX3_MINLEN 7 /* minimal "ux" field size (2-byte UID/GID) */ - -#define EB_UT_MINLEN 1 /* minimal UT field contains Flags byte */ -#define EB_UT_FLAGS 0 /* byte offset of Flags field */ -#define EB_UT_TIME1 1 /* byte offset of 1st time value */ -#define EB_UT_FL_MTIME (1 << 0) /* mtime present */ -#define EB_UT_FL_ATIME (1 << 1) /* atime present */ -#define EB_UT_FL_CTIME (1 << 2) /* ctime present */ - -#define EB_FLGS_OFFS 4 /* offset of flags area in generic compressed - extra field blocks (BEOS, MAC, and others) */ -#define EB_OS2_HLEN 4 /* size of OS2/ACL compressed data header */ -#define EB_BEOS_HLEN 5 /* length of BeOS&AtheOS e.f attribute header */ -#define EB_BE_FL_UNCMPR 0x01 /* "BeOS&AtheOS attribs uncompr." bit flag */ -#define EB_MAC3_HLEN 14 /* length of Mac3 attribute block header */ -#define EB_SMARTZIP_HLEN 64 /* fixed length of the SmartZip extra field */ -#define EB_M3_FL_DATFRK 0x01 /* "this entry is data fork" flag */ -#define EB_M3_FL_UNCMPR 0x04 /* "Mac3 attributes uncompressed" bit flag */ -#define EB_M3_FL_TIME64 0x08 /* "Mac3 time fields are 64 bit wide" flag */ -#define EB_M3_FL_NOUTC 0x10 /* "Mac3 timezone offset fields missing" flag */ - -#define EB_NTSD_C_LEN 4 /* length of central NT security data */ -#define EB_NTSD_L_LEN 5 /* length of minimal local NT security data */ -#define EB_NTSD_VERSION 4 /* offset of NTSD version byte */ -#define EB_NTSD_MAX_VER (0) /* maximum version # we know how to handle */ - -#define EB_ASI_CRC32 0 /* offset of ASI Unix field's crc32 checksum */ -#define EB_ASI_MODE 4 /* offset of ASI Unix permission mode field */ - -#define EB_IZVMS_HLEN 12 /* length of IZVMS attribute block header */ -#define EB_IZVMS_FLGS 4 /* offset of compression type flag */ -#define EB_IZVMS_UCSIZ 6 /* offset of ucsize field in IZVMS header */ -#define EB_IZVMS_BCMASK 07 /* 3 bits for compression type */ -#define EB_IZVMS_BCSTOR 0 /* Stored */ -#define EB_IZVMS_BC00 1 /* 0byte -> 0bit compression */ -#define EB_IZVMS_BCDEFL 2 /* Deflated */ - - -/*--------------------------------------------------------------------------- - True sizes of the various headers (excluding their 4-byte signatures), - as defined by PKWARE--so it is not likely that these will ever change. - But if they do, make sure both these defines AND the typedefs below get - updated accordingly. - - 12/27/2006 - The Zip64 End Of Central Directory record is variable size and now - comes in two flavors, version 1 and the new version 2 that supports - central directory encryption. We only use the old fields at the - top of the Zip64 EOCDR, and this block is a fixed size still, but - need to be aware of the stuff following. - ---------------------------------------------------------------------------*/ -#define LREC_SIZE 26 /* lengths of local file headers, central */ -#define CREC_SIZE 42 /* directory headers, end-of-central-dir */ -#define ECREC_SIZE 18 /* record, zip64 end-of-cent-dir locator */ -#define ECLOC64_SIZE 16 /* and zip64 end-of-central-dir record, */ -#define ECREC64_SIZE 52 /* respectively */ - -#define MAX_BITS 13 /* used in unshrink() */ -#define HSIZE (1 << MAX_BITS) /* size of global work area */ - -#define LF 10 /* '\n' on ASCII machines; must be 10 due to EBCDIC */ -#define CR 13 /* '\r' on ASCII machines; must be 13 due to EBCDIC */ -#define CTRLZ 26 /* DOS & OS/2 EOF marker (used in fileio.c, vms.c) */ - -#ifdef EBCDIC -# define foreign(c) ascii[(uch)(c)] -# define native(c) ebcdic[(uch)(c)] -# define NATIVE "EBCDIC" -# define NOANSIFILT -#endif - -#ifdef VMS -# define ENV_UNZIP "UNZIP_OPTS" /* names of environment variables */ -# define ENV_ZIPINFO "ZIPINFO_OPTS" -#endif /* VMS */ -#ifdef RISCOS -# define ENV_UNZIP "Unzip$Options" -# define ENV_ZIPINFO "Zipinfo$Options" -# define ENV_UNZIPEXTS "Unzip$Exts" -#endif /* RISCOS */ -#ifndef ENV_UNZIP -# define ENV_UNZIP "UNZIP" /* the standard names */ -# define ENV_ZIPINFO "ZIPINFO" -#endif -#define ENV_UNZIP2 "UNZIPOPT" /* alternate names, for zip compat. */ -#define ENV_ZIPINFO2 "ZIPINFOOPT" - -#if (!defined(QQ) && !defined(NOQQ)) -# define QQ -#endif - -#ifdef QQ /* Newtware version: no file */ -# define QCOND (!uO.qflag) /* comments with -vq or -vqq */ -#else /* Bill Davidsen version: no way to */ -# define QCOND (longhdr) /* kill file comments when listing */ -#endif - -#ifdef OLD_QQ -# define QCOND2 (uO.qflag < 2) -#else -# define QCOND2 (!uO.qflag) -#endif - -#ifdef WILD_STOP_AT_DIR -# define __WDLPRO , int sepc -# define __WDL , sepc -# define __WDLDEF int sepc; -# define WISEP , (uO.W_flag ? '/' : '\0') -#else -# define __WDLPRO -# define __WDL -# define __WDLDEF -# define WISEP -#endif - - - - -/**************/ -/* Typedefs */ -/**************/ - -#ifdef ZIP64_SUPPORT -# ifndef Z_UINT8_DEFINED -# if (defined(__GNUC__) || defined(__hpux) || defined(__SUNPRO_C)) - typedef unsigned long long z_uint8; -# else - typedef unsigned __int64 z_uint8; -# endif -# define Z_UINT8_DEFINED -# endif -#endif -#ifndef Z_UINT4_DEFINED -# if (defined(MODERN) && !defined(NO_LIMITS_H)) -# if (defined(UINT_MAX) && (UINT_MAX == 0xffffffffUL)) - typedef unsigned int z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(ULONG_MAX) && (ULONG_MAX == 0xffffffffUL)) - typedef unsigned long z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(USHRT_MAX) && (USHRT_MAX == 0xffffffffUL)) - typedef unsigned short z_uint4; -# define Z_UINT4_DEFINED -# endif -# endif -# endif -# endif /* MODERN && !NO_LIMITS_H */ -#endif /* !Z_UINT4_DEFINED */ -#ifndef Z_UINT4_DEFINED - typedef ulg z_uint4; -# define Z_UINT4_DEFINED -#endif - -/* The following three user-defined unsigned integer types are used for - holding zipfile entities (required widths without / with Zip64 support): - a) sizes and offset of zipfile entries - (4 bytes / 8 bytes) - b) enumeration and counts of zipfile entries - (2 bytes / 8 bytes) - Remark: internally, we use 4 bytes for archive member counting in the - No-Zip64 case, because UnZip supports more than 64k entries for - classic Zip archives without Zip64 extensions. - c) enumeration and counts of zipfile volumes of multivolume archives - (2 bytes / 4 bytes) - */ -#ifdef ZIP64_SUPPORT - typedef z_uint8 zusz_t; /* zipentry sizes & offsets */ - typedef z_uint8 zucn_t; /* archive entry counts */ - typedef z_uint4 zuvl_t; /* multivolume numbers */ -# define MASK_ZUCN64 (~(zucn_t)0) -/* In case we ever get to support an environment where z_uint8 may be WIDER - than 64 bit wide, we will have to apply a construct similar to - #define MASK_ZUCN64 (~(zucn_t)0 & (zucn_t)0xffffffffffffffffULL) - for the 64-bit mask. - */ -#else - typedef ulg zusz_t; /* zipentry sizes & offsets */ - typedef unsigned int zucn_t; /* archive entry counts */ - typedef unsigned short zuvl_t; /* multivolume numbers */ -# define MASK_ZUCN64 (~(zucn_t)0) -#endif -#define MASK_ZUCN16 ((zucn_t)0xFFFF) - -#ifdef NO_UID_GID -# ifdef UID_USHORT - typedef unsigned short uid_t; /* TI SysV.3 */ - typedef unsigned short gid_t; -# else - typedef unsigned int uid_t; /* SCO Xenix */ - typedef unsigned int gid_t; -# endif -#endif - -#if (defined(GOT_UTIMBUF) || defined(sgi) || defined(ATARI)) - typedef struct utimbuf ztimbuf; -#else - typedef struct ztimbuf { - time_t actime; /* new access time */ - time_t modtime; /* new modification time */ - } ztimbuf; -#endif - -typedef struct iztimes { - time_t atime; /* new access time */ - time_t mtime; /* new modification time */ - time_t ctime; /* used for creation time; NOT same as st_ctime */ -} iztimes; - -#ifdef SET_DIR_ATTRIB - typedef struct direntry { /* head of system-specific struct holding */ - struct direntry *next; /* defered directory attributes info */ - char *fn; /* filename of directory */ - char buf[1]; /* start of system-specific internal data */ - } direntry; -#endif /* SET_DIR_ATTRIB */ - -#ifdef SYMLINKS - typedef struct slinkentry { /* info for deferred symlink creation */ - struct slinkentry *next; /* pointer to next entry in chain */ - extent targetlen; /* length of target filespec */ - extent attriblen; /* length of system-specific attrib data */ - char *target; /* pointer to target filespec */ - char *fname; /* pointer to name of link */ - char buf[1]; /* data/name/link buffer */ - } slinkentry; -#endif /* SYMLINKS */ - -typedef struct min_info { - zoff_t offset; - zusz_t compr_size; /* compressed size (needed if extended header) */ - zusz_t uncompr_size; /* uncompressed size (needed if extended header) */ - ulg crc; /* crc (needed if extended header) */ - zuvl_t diskstart; /* no of volume where this entry starts */ - uch hostver; - uch hostnum; - unsigned file_attr; /* local flavor, as used by creat(), chmod()... */ - unsigned encrypted : 1; /* file encrypted: decrypt before uncompressing */ - unsigned ExtLocHdr : 1; /* use time instead of CRC for decrypt check */ - unsigned textfile : 1; /* file is text (according to zip) */ - unsigned textmode : 1; /* file is to be extracted as text */ - unsigned lcflag : 1; /* convert filename to lowercase */ - unsigned vollabel : 1; /* "file" is an MS-DOS volume (disk) label */ -#ifdef SYMLINKS - unsigned symlink : 1; /* file is a symbolic link */ -#endif - unsigned HasUxAtt : 1; /* crec ext_file_attr has Unix style mode bits */ -#ifdef UNICODE_SUPPORT - unsigned GPFIsUTF8: 1; /* crec gen_purpose_flag UTF-8 bit 11 is set */ -#endif -#ifndef SFX - char Far *cfilname; /* central header version of filename */ -#endif -} min_info; - -typedef struct VMStimbuf { - char *revdate; /* (both roughly correspond to Unix modtime/st_mtime) */ - char *credate; -} VMStimbuf; - -/*--------------------------------------------------------------------------- - Zipfile work area declarations. - ---------------------------------------------------------------------------*/ - -#ifdef MALLOC_WORK - union work { - struct { /* unshrink(): */ - shrint *Parent; /* pointer to (8192 * sizeof(shrint)) */ - uch *value; /* pointer to 8KB char buffer */ - uch *Stack; /* pointer to another 8KB char buffer */ - } shrink; - uch *Slide; /* explode(), inflate(), unreduce() */ - }; -#else /* !MALLOC_WORK */ - union work { - struct { /* unshrink(): */ - shrint Parent[HSIZE]; /* (8192 * sizeof(shrint)) == 16KB minimum */ - uch value[HSIZE]; /* 8KB */ - uch Stack[HSIZE]; /* 8KB */ - } shrink; /* total = 32KB minimum; 80KB on Cray/Alpha */ - uch Slide[WSIZE]; /* explode(), inflate(), unreduce() */ - }; -#endif /* ?MALLOC_WORK */ - -#define slide G.area.Slide - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define redirSlide G.redirect_sldptr -#else -# define redirSlide G.area.Slide -#endif - -/*--------------------------------------------------------------------------- - Zipfile layout declarations. If these headers ever change, make sure the - xxREC_SIZE defines (above) change with them! - ---------------------------------------------------------------------------*/ - - typedef uch local_byte_hdr[ LREC_SIZE ]; -# define L_VERSION_NEEDED_TO_EXTRACT_0 0 -# define L_VERSION_NEEDED_TO_EXTRACT_1 1 -# define L_GENERAL_PURPOSE_BIT_FLAG 2 -# define L_COMPRESSION_METHOD 4 -# define L_LAST_MOD_DOS_DATETIME 6 -# define L_CRC32 10 -# define L_COMPRESSED_SIZE 14 -# define L_UNCOMPRESSED_SIZE 18 -# define L_FILENAME_LENGTH 22 -# define L_EXTRA_FIELD_LENGTH 24 - - typedef uch cdir_byte_hdr[ CREC_SIZE ]; -# define C_VERSION_MADE_BY_0 0 -# define C_VERSION_MADE_BY_1 1 -# define C_VERSION_NEEDED_TO_EXTRACT_0 2 -# define C_VERSION_NEEDED_TO_EXTRACT_1 3 -# define C_GENERAL_PURPOSE_BIT_FLAG 4 -# define C_COMPRESSION_METHOD 6 -# define C_LAST_MOD_DOS_DATETIME 8 -# define C_CRC32 12 -# define C_COMPRESSED_SIZE 16 -# define C_UNCOMPRESSED_SIZE 20 -# define C_FILENAME_LENGTH 24 -# define C_EXTRA_FIELD_LENGTH 26 -# define C_FILE_COMMENT_LENGTH 28 -# define C_DISK_NUMBER_START 30 -# define C_INTERNAL_FILE_ATTRIBUTES 32 -# define C_EXTERNAL_FILE_ATTRIBUTES 34 -# define C_RELATIVE_OFFSET_LOCAL_HEADER 38 - - typedef uch ec_byte_rec[ ECREC_SIZE+4 ]; -/* define SIGNATURE 0 space-holder only */ -# define NUMBER_THIS_DISK 4 -# define NUM_DISK_WITH_START_CEN_DIR 6 -# define NUM_ENTRIES_CEN_DIR_THS_DISK 8 -# define TOTAL_ENTRIES_CENTRAL_DIR 10 -# define SIZE_CENTRAL_DIRECTORY 12 -# define OFFSET_START_CENTRAL_DIRECTORY 16 -# define ZIPFILE_COMMENT_LENGTH 20 - - typedef uch ec_byte_loc64[ ECLOC64_SIZE+4 ]; -# define NUM_DISK_START_EOCDR64 4 -# define OFFSET_START_EOCDR64 8 -# define NUM_THIS_DISK_LOC64 16 - - typedef uch ec_byte_rec64[ ECREC64_SIZE+4 ]; -# define ECREC64_LENGTH 4 -# define EC_VERSION_MADE_BY_0 12 -# define EC_VERSION_NEEDED_0 14 -# define NUMBER_THIS_DSK_REC64 16 -# define NUM_DISK_START_CEN_DIR64 20 -# define NUM_ENTRIES_CEN_DIR_THS_DISK64 24 -# define TOTAL_ENTRIES_CENTRAL_DIR64 32 -# define SIZE_CENTRAL_DIRECTORY64 40 -# define OFFSET_START_CENTRAL_DIRECT64 48 - - -/* The following structs are used to hold all header data of a zip entry. - Traditionally, the structs' layouts followed the data layout of the - corresponding zipfile header structures. However, the zipfile header - layouts were designed in the old ages of 16-bit CPUs, they are subject - to structure padding and/or alignment issues on newer systems with a - "natural word width" of more than 2 bytes. - Please note that the structure members are now reordered by size - (top-down), to prevent internal padding and optimize memory usage! - */ - typedef struct local_file_header { /* LOCAL */ - zusz_t csize; - zusz_t ucsize; - ulg last_mod_dos_datetime; - ulg crc32; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ush filename_length; - ush extra_field_length; - } local_file_hdr; - - typedef struct central_directory_file_header { /* CENTRAL */ - zusz_t csize; - zusz_t ucsize; - zusz_t relative_offset_local_header; - ulg last_mod_dos_datetime; - ulg crc32; - ulg external_file_attributes; - zuvl_t disk_number_start; - ush internal_file_attributes; - uch version_made_by[2]; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ush filename_length; - ush extra_field_length; - ush file_comment_length; - } cdir_file_hdr; - - typedef struct end_central_dir_record { /* END CENTRAL */ - zusz_t size_central_directory; - zusz_t offset_start_central_directory; - zucn_t num_entries_centrl_dir_ths_disk; - zucn_t total_entries_central_dir; - zuvl_t number_this_disk; - zuvl_t num_disk_start_cdir; - int have_ecr64; /* valid Zip64 ecdir-record exists */ - int is_zip64_archive; /* Zip64 ecdir-record is mandatory */ - ush zipfile_comment_length; - } ecdir_rec; - - -/* Huffman code lookup table entry--this entry is four bytes for machines - that have 16-bit pointers (e.g. PC's in the small or medium model). - Valid extra bits are 0..16. e == 31 is EOB (end of block), e == 32 - means that v is a literal, 32 < e < 64 means that v is a pointer to - the next table, which codes (e & 31) bits, and lastly e == 99 indicates - an unused code. If a code with e == 99 is looked up, this implies an - error in the data. */ - -struct huft { - uch e; /* number of extra bits or operation */ - uch b; /* number of bits in this code or subcode */ - union { - ush n; /* literal, length base, or distance base */ - struct huft *t; /* pointer to next level of table */ - } v; -}; - - -typedef struct _APIDocStruct { - char *compare; - char *function; - char *syntax; - char *purpose; -} APIDocStruct; - - - - -/*************/ -/* Globals */ -/*************/ - -#if (defined(OS2) && !defined(FUNZIP)) -# include "os2/os2data.h" -#endif - -#include "globals.h" - - - -/*************************/ -/* Function Prototypes */ -/*************************/ - -/*--------------------------------------------------------------------------- - Functions in unzip.c (initialization routines): - ---------------------------------------------------------------------------*/ - -#ifndef WINDLL - int MAIN OF((int argc, char **argv)); - int unzip OF((__GPRO__ int argc, char **argv)); - int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); - int usage OF((__GPRO__ int error)); -#endif /* !WINDLL */ - -/*--------------------------------------------------------------------------- - Functions in process.c (main driver routines): - ---------------------------------------------------------------------------*/ - -int process_zipfiles OF((__GPRO)); -void free_G_buffers OF((__GPRO)); -/* static int do_seekable OF((__GPRO__ int lastchance)); */ -/* static int find_ecrec OF((__GPRO__ long searchlen)); */ -/* static int process_central_comment OF((__GPRO)); */ -int process_cdir_file_hdr OF((__GPRO)); -int process_local_file_hdr OF((__GPRO)); -int getZip64Data OF((__GPRO__ ZCONST uch *ef_buf, - unsigned ef_len)); -#ifdef UNICODE_SUPPORT - int getUnicodeData OF((__GPRO__ ZCONST uch *ef_buf, - unsigned ef_len)); -#endif -unsigned ef_scan_for_izux OF((ZCONST uch *ef_buf, unsigned ef_len, - int ef_is_c, ulg dos_mdatetime, - iztimes *z_utim, ulg *z_uidgid)); -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - zvoid *getRISCOSexfield OF((ZCONST uch *ef_buf, unsigned ef_len)); -#endif - -#ifndef SFX - -/*--------------------------------------------------------------------------- - Functions in zipinfo.c (`zipinfo-style' listing routines): - ---------------------------------------------------------------------------*/ - -#ifndef NO_ZIPINFO -#ifndef WINDLL - int zi_opts OF((__GPRO__ int *pargc, char ***pargv)); -#endif -void zi_end_central OF((__GPRO)); -int zipinfo OF((__GPRO)); -/* static int zi_long OF((__GPRO__ zusz_t *pEndprev)); */ -/* static int zi_short OF((__GPRO)); */ -/* static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, - ZCONST time_t *modtimez, char *d_t_str));*/ -#endif /* !NO_ZIPINFO */ - -/*--------------------------------------------------------------------------- - Functions in list.c (generic zipfile-listing routines): - ---------------------------------------------------------------------------*/ - -int list_files OF((__GPRO)); -#ifdef TIMESTAMP - int get_time_stamp OF((__GPRO__ time_t *last_modtime, - ulg *nmember)); -#endif -int ratio OF((zusz_t uc, zusz_t c)); -void fnprint OF((__GPRO)); - -#endif /* !SFX */ - -/*--------------------------------------------------------------------------- - Functions in fileio.c: - ---------------------------------------------------------------------------*/ - -int open_input_file OF((__GPRO)); -int open_outfile OF((__GPRO)); /* also vms.c */ -void undefer_input OF((__GPRO)); -void defer_leftover_input OF((__GPRO)); -unsigned readbuf OF((__GPRO__ char *buf, register unsigned len)); -int readbyte OF((__GPRO)); -int fillinbuf OF((__GPRO)); -int seek_zipf OF((__GPRO__ zoff_t abs_offset)); -#ifdef FUNZIP - int flush OF((__GPRO__ ulg size)); /* actually funzip.c */ -#else - int flush OF((__GPRO__ uch *buf, ulg size, int unshrink)); -#endif -/* static int disk_error OF((__GPRO)); */ -void handler OF((int signal)); -time_t dos_to_unix_time OF((ulg dos_datetime)); -int check_for_newer OF((__GPRO__ char *filename)); /* os2,vmcms,vms */ -int do_string OF((__GPRO__ unsigned int length, int option)); -ush makeword OF((ZCONST uch *b)); -ulg makelong OF((ZCONST uch *sig)); -zusz_t makeint64 OF((ZCONST uch *sig)); -char *fzofft OF((__GPRO__ zoff_t val, - ZCONST char *pre, ZCONST char *post)); -#if (!defined(STR_TO_ISO) || defined(NEED_STR2ISO)) - char *str2iso OF((char *dst, ZCONST char *src)); -#endif -#if (!defined(STR_TO_OEM) || defined(NEED_STR2OEM)) - char *str2oem OF((char *dst, ZCONST char *src)); -#endif -#ifdef NO_STRNICMP - int zstrnicmp OF((register ZCONST char *s1, - register ZCONST char *s2, - register unsigned n)); -#endif -#ifdef REGULUS - int zstat OF((ZCONST char *p, struct stat *s)); -#endif -#ifdef ZMEM /* MUST be ifdef'd because of conflicts with the standard def. */ - zvoid *memset OF((register zvoid *, register int, register unsigned int)); - int memcmp OF((register ZCONST zvoid*, register ZCONST zvoid *, - register unsigned int)); - zvoid *memcpy OF((register zvoid *, register ZCONST zvoid *, - register unsigned int)); -#endif -#ifdef NEED_UZMBCLEN - extent uzmbclen OF((ZCONST unsigned char *ptr)); -#endif -#ifdef NEED_UZMBSCHR - unsigned char *uzmbschr OF((ZCONST unsigned char *str, unsigned int c)); -#endif -#ifdef NEED_UZMBSRCHR - unsigned char *uzmbsrchr OF((ZCONST unsigned char *str, unsigned int c)); -#endif -#ifdef SMALL_MEM - char *fLoadFarString OF((__GPRO__ const char Far *sz)); - char *fLoadFarStringSmall OF((__GPRO__ const char Far *sz)); - char *fLoadFarStringSmall2 OF((__GPRO__ const char Far *sz)); - #ifndef zfstrcpy - char Far * Far zfstrcpy OF((char Far *s1, const char Far *s2)); - #endif - #if (!defined(SFX) && !defined(zfstrcmp)) - int Far zfstrcmp OF((const char Far *s1, const char Far *s2)); - #endif -#endif - - -/*--------------------------------------------------------------------------- - Functions in extract.c: - ---------------------------------------------------------------------------*/ - -int extract_or_test_files OF((__GPRO)); -/* static int store_info OF((void)); */ -/* static int extract_or_test_member OF((__GPRO)); */ -/* static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); */ -/* static int test_OS2 OF((__GPRO__ uch *eb, unsigned eb_size)); */ -/* static int test_NT OF((__GPRO__ uch *eb, unsigned eb_size)); */ -#ifndef SFX - unsigned find_compr_idx OF((unsigned compr_methodnum)); -#endif -int memextract OF((__GPRO__ uch *tgt, ulg tgtsize, - ZCONST uch *src, ulg srcsize)); -int memflush OF((__GPRO__ ZCONST uch *rawbuf, ulg size)); -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - uch *extract_izvms_block OF((__GPRO__ ZCONST uch *ebdata, - unsigned size, unsigned *retlen, - ZCONST uch *init, unsigned needlen)); -#endif -char *fnfilter OF((ZCONST char *raw, uch *space, - extent size)); - -/*--------------------------------------------------------------------------- - Decompression functions: - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) && !defined(FUNZIP)) -int explode OF((__GPRO)); /* explode.c */ -#endif -int huft_free OF((struct huft *t)); /* inflate.c */ -int huft_build OF((__GPRO__ ZCONST unsigned *b, unsigned n, - unsigned s, ZCONST ush *d, ZCONST uch *e, - struct huft **t, unsigned *m)); -#ifdef USE_ZLIB - int UZinflate OF((__GPRO__ int is_defl64)); /* inflate.c */ -# define inflate_free(x) inflateEnd(&((Uz_Globs *)(&G))->dstrm) -#else - int inflate OF((__GPRO__ int is_defl64)); /* inflate.c */ - int inflate_free OF((__GPRO)); /* inflate.c */ -#endif /* ?USE_ZLIB */ -#if (!defined(SFX) && !defined(FUNZIP)) -#ifndef COPYRIGHT_CLEAN - int unreduce OF((__GPRO)); /* unreduce.c */ -/* static void LoadFollowers OF((__GPRO__ f_array *follower, uch *Slen)); - * unreduce.c */ -#endif /* !COPYRIGHT_CLEAN */ -#ifndef LZW_CLEAN - int unshrink OF((__GPRO)); /* unshrink.c */ -/* static void partial_clear OF((__GPRO)); * unshrink.c */ -#endif /* !LZW_CLEAN */ -#endif /* !SFX && !FUNZIP */ -#ifdef USE_BZIP2 - int UZbunzip2 OF((__GPRO)); /* extract.c */ - void bz_internal_error OF((int bzerrcode)); /* ubz2err.c */ -#endif - -/*--------------------------------------------------------------------------- - Internal API functions (only included in DLL versions): - ---------------------------------------------------------------------------*/ - -#ifdef DLL - void setFileNotFound OF((__GPRO)); /* api.c */ - int unzipToMemory OF((__GPRO__ char *zip, char *file, - UzpBuffer *retstr)); /* api.c */ - int redirect_outfile OF((__GPRO)); /* api.c */ - int writeToMemory OF((__GPRO__ ZCONST uch *rawbuf, - extent size)); /* api.c */ - int close_redirect OF((__GPRO)); /* api.c */ - /* this obsolescent entry point kept for compatibility: */ - int UzpUnzip OF((int argc, char **argv));/* use UzpMain */ -#ifdef OS2DLL - int varmessage OF((__GPRO__ ZCONST uch *buf, ulg size)); - int varputchar OF((__GPRO__ int c)); /* rexxapi.c */ - int finish_REXX_redirect OF((__GPRO)); /* rexxapi.c */ -#endif -#ifdef API_DOC - void APIhelp OF((__GPRO__ int argc, char **argv)); -#endif /* apihelp.c */ -#endif /* DLL */ - -/*--------------------------------------------------------------------------- - MSDOS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef MSDOS -#if (!defined(FUNZIP) && !defined(SFX) && !defined(WINDLL)) - void check_for_windows OF((ZCONST char *app)); /* msdos.c */ -#endif -#if (defined(__GO32__) || defined(__EMX__)) - unsigned _dos_getcountryinfo(void *); /* msdos.c */ -#if (!defined(__DJGPP__) || (__DJGPP__ < 2)) - unsigned _dos_setftime(int, unsigned, unsigned); /* msdos.c */ - unsigned _dos_setfileattr(const char *, unsigned); /* msdos.c */ - unsigned _dos_creat(const char *, unsigned, int *); /* msdos.c */ - void _dos_getdrive(unsigned *); /* msdos.c */ - unsigned _dos_close(int); /* msdos.c */ -#endif /* !__DJGPP__ || (__DJGPP__ < 2) */ -#endif /* __GO32__ || __EMX__ */ -#endif - -/*--------------------------------------------------------------------------- - OS/2-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef OS2 /* GetFileTime conflicts with something in Win32 header files */ -#if (defined(REENTRANT) && defined(USETHREADID)) - ulg GetThreadId OF((void)); -#endif - int GetCountryInfo OF((void)); /* os2.c */ - long GetFileTime OF((ZCONST char *name)); /* os2.c */ -/* static void SetPathAttrTimes OF((__GPRO__ int flags, int dir)); os2.c */ -/* static int SetEAs OF((__GPRO__ const char *path, - void *eablock)); os2.c */ -/* static int SetACL OF((__GPRO__ const char *path, - void *eablock)); os2.c */ -/* static int IsFileNameValid OF((const char *name)); os2.c */ -/* static void map2fat OF((char *pathcomp, char **pEndFAT)); os2.c */ -/* static int SetLongNameEA OF((char *name, char *longname)); os2.c */ -/* static void InitNLS OF((void)); os2.c */ - int IsUpperNLS OF((int nChr)); /* os2.c */ - int ToLowerNLS OF((int nChr)); /* os2.c */ - void DebugMalloc OF((void)); /* os2.c */ -#endif - -/*--------------------------------------------------------------------------- - QDOS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef QDOS - int QMatch (uch, uch); - void QFilename (__GPRO__ char *); - char *Qstrfix (char *); - int QReturn (int zip_error); -#endif - -/*--------------------------------------------------------------------------- - TOPS20-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef TOPS20 - int upper OF((char *s)); /* tops20.c */ - int enquote OF((char *s)); /* tops20.c */ - int dequote OF((char *s)); /* tops20.c */ - int fnlegal OF(()); /* error if prototyped? */ /* tops20.c */ -#endif - -/*--------------------------------------------------------------------------- - VM/CMS- and MVS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef CMS_MVS - extent getVMMVSexfield OF((char *type, uch *ef_block, unsigned datalen)); - FILE *vmmvs_open_infile OF((__GPRO)); /* vmmvs.c */ - void close_infile OF((__GPRO)); /* vmmvs.c */ -#endif - -/*--------------------------------------------------------------------------- - VMS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef VMS - int check_format OF((__GPRO)); /* vms.c */ -/* int open_outfile OF((__GPRO)); * (see fileio.c) vms.c */ -/* int flush OF((__GPRO__ uch *rawbuf, unsigned size, - int final_flag)); * (see fileio.c) vms.c */ - char *vms_msg_text OF((void)); /* vms.c */ -#ifdef RETURN_CODES - void return_VMS OF((__GPRO__ int zip_error)); /* vms.c */ -#else - void return_VMS OF((int zip_error)); /* vms.c */ -#endif -#ifdef VMSCLI - ulg vms_unzip_cmdline OF((int *, char ***)); /* cmdline.c */ - int VMSCLI_usage OF((__GPRO__ int error)); /* cmdline.c */ -#endif -#endif - -/*--------------------------------------------------------------------------- - WIN32-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef WIN32 - int IsWinNT OF((void)); /* win32.c */ -#ifdef NTSD_EAS - void process_defer_NT OF((__GPRO)); /* win32.c */ - int test_NTSD OF((__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize)); /* win32.c */ -# define TEST_NTSD test_NTSD -#endif -#ifdef W32_STAT_BANDAID - int zstat_win32 OF((__W32STAT_GLOBALS__ - const char *path, z_stat *buf)); /* win32.c */ -#endif -#endif - -/*--------------------------------------------------------------------------- - Miscellaneous/shared functions: - ---------------------------------------------------------------------------*/ - -Uz_Globs *globalsCtor OF((void)); /* globals.c */ - -int envargs OF((int *Pargc, char ***Pargv, - ZCONST char *envstr, ZCONST char *envstr2)); - /* envargs.c */ -void mksargs OF((int *argcp, char ***argvp)); /* envargs.c */ - -int match OF((ZCONST char *s, ZCONST char *p, - int ic __WDLPRO)); /* match.c */ -int iswild OF((ZCONST char *p)); /* match.c */ - -/* declarations of public CRC-32 functions have been moved into crc32.h - (free_crc_table(), get_crc_table(), crc32()) crc32.c */ - -int dateformat OF((void)); /* local */ -char dateseparator OF((void)); /* local */ -#ifndef WINDLL - void version OF((__GPRO)); /* local */ -#endif -int mapattr OF((__GPRO)); /* local */ -int mapname OF((__GPRO__ int renamed)); /* local */ -int checkdir OF((__GPRO__ char *pathcomp, int flag)); /* local */ -char *do_wild OF((__GPRO__ ZCONST char *wildzipfn)); /* local */ -char *GetLoadPath OF((__GPRO)); /* local */ -#if (defined(MORE) && (defined(ATH_BEO_UNX) || defined(QDOS) || defined(VMS))) - int screensize OF((int *tt_rows, int *tt_cols)); /* local */ -# if defined(VMS) - int screenlinewrap OF((void)); /* local */ -# endif -#endif /* MORE && (ATH_BEO_UNX || QDOS || VMS) */ -#ifdef OS2_W32 - int SetFileSize OF((FILE *file, zusz_t filesize)); /* local */ -#endif -#ifndef MTS /* macro in MTS */ - void close_outfile OF((__GPRO)); /* local */ -#endif -#ifdef SET_SYMLINK_ATTRIBS - int set_symlnk_attribs OF((__GPRO__ slinkentry *slnk_entry)); /* local */ -#endif -#ifdef SET_DIR_ATTRIB - int defer_dir_attribs OF((__GPRO__ direntry **pd)); /* local */ - int set_direc_attribs OF((__GPRO__ direntry *d)); /* local */ -#endif -#ifdef TIMESTAMP -# ifdef WIN32 - int stamp_file OF((__GPRO__ - ZCONST char *fname, time_t modtime)); /* local */ -# else - int stamp_file OF((ZCONST char *fname, time_t modtime)); /* local */ -# endif -#endif -#ifdef NEED_ISO_OEM_INIT - void prepare_ISO_OEM_translat OF((__GPRO)); /* local */ -#endif -#if (defined(MALLOC_WORK) && defined(MY_ZCALLOC)) - zvoid far *zcalloc OF((unsigned int, unsigned int)); - zvoid zcfree OF((zvoid far *)); -#endif /* MALLOC_WORK && MY_ZCALLOC */ -#ifdef SYSTEM_SPECIFIC_CTOR - void SYSTEM_SPECIFIC_CTOR OF((__GPRO)); /* local */ -#endif -#ifdef SYSTEM_SPECIFIC_DTOR - void SYSTEM_SPECIFIC_DTOR OF((__GPRO)); /* local */ -#endif - - - - - -/************/ -/* Macros */ -/************/ - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifdef DEBUG -# if (defined(THEOS) && defined(NO_BOGUS_SPC)) -# define NO_DEBUG_IN_MACROS -# define Trace(x) _fprintf x -# else -# define Trace(x) fprintf x -# endif -#else -# define Trace(x) -#endif - -#ifdef DEBUG_TIME -# define TTrace(x) fprintf x -#else -# define TTrace(x) -#endif - -#ifdef NO_DEBUG_IN_MACROS -# define MTrace(x) -#else -# define MTrace(x) Trace(x) -#endif - -#if (defined(UNIX) || defined(T20_VMS)) /* generally old systems */ -# define ToLower(x) ((char)(isupper((int)x)? tolower((int)x) : x)) -#else -# define ToLower tolower /* assumed "smart"; used in match() */ -#endif - -#ifdef USE_STRM_INPUT - /* ``Replace'' the unbuffered UNIX style I/O function with similar - * standard C functions from . - */ -# define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd)) -# ifdef zlseek -# undef zlseek -# endif -# define zlseek(fd,o,w) zfseeko((FILE *)(fd),(o),(w)) -# define close(fd) fclose((FILE *)(fd)) -#endif /* USE_STRM_INPUT */ - -/* The return value of the Info() "macro function" is never checked in - * UnZip. Otherwise, to get the same behaviour as for (*G.message)(), the - * Info() definition for "FUNZIP" would have to be corrected: - * #define Info(buf,flag,sprf_arg) \ - * (fputs((char *)(sprintf sprf_arg, (buf)), \ - * (flag)&1? stderr : stdout) < 0) - */ -#ifndef Info /* may already have been defined for redirection */ -# ifdef FUNZIP -# define Info(buf,flag,sprf_arg) \ - fputs((char *)(sprintf sprf_arg, (buf)), (flag)&1? stderr : stdout) -# else -# ifdef INT_SPRINTF /* optimized version for "int sprintf()" flavour */ -# define Info(buf,flag,sprf_arg) \ - (*G.message)((zvoid *)&G, (uch *)(buf), (ulg)sprintf sprf_arg, (flag)) -# else /* generic version, does not use sprintf() return value */ -# define Info(buf,flag,sprf_arg) \ - (*G.message)((zvoid *)&G, (uch *)(buf), \ - (ulg)(sprintf sprf_arg, strlen((char *)(buf))), (flag)) -# endif -# endif -#endif /* !Info */ - -/* This wrapper macro around fzofft() is just defined to "hide" the - * argument needed to reference the global storage buffers. - */ -#define FmZofft(val, pre, post) fzofft(__G__ val, pre, post) - -/* The following macro wrappers around the fnfilter function are used many - * times to prepare archive entry names or name components for displaying - * listings and (warning/error) messages. They use sections in the upper half - * of 'slide' as buffer, since their output is normally fed through the - * Info() macro with 'slide' (the start of this area) as message buffer. - */ -#define FnFilter1(fname) \ - fnfilter((fname), slide + (extent)(WSIZE>>1), (extent)(WSIZE>>2)) -#define FnFilter2(fname) \ - fnfilter((fname), slide + (extent)((WSIZE>>1) + (WSIZE>>2)),\ - (extent)(WSIZE>>2)) - -#ifndef FUNZIP /* used only in inflate.c */ -# define MESSAGE(str,len,flag) (*G.message)((zvoid *)&G,(str),(len),(flag)) -#endif - -#if 0 /* Optimization: use the (const) result of crc32(0L,NULL,0) */ -# define CRCVAL_INITIAL crc32(0L, NULL, 0) -#else -# define CRCVAL_INITIAL 0L -#endif - -#ifdef SYMLINKS - /* This macro defines the Zip "made by" hosts that are considered - to support storing symbolic link entries. */ -# define SYMLINK_HOST(hn) ((hn) == UNIX_ || (hn) == ATARI_ || \ - (hn) == ATHEOS_ || (hn) == BEOS_ || (hn) == VMS_) -#endif - -#ifndef TEST_NTSD /* "NTSD valid?" checking function */ -# define TEST_NTSD NULL /* ... is not available */ -#endif - -#define SKIP_(length) if(length&&((error=do_string(__G__ length,SKIP))!=0))\ - {error_in_archive=error; if(error>1) return error;} - -/* - * Skip a variable-length field, and report any errors. Used in zipinfo.c - * and unzip.c in several functions. - * - * macro SKIP_(length) - * ush length; - * { - * if (length && ((error = do_string(length, SKIP)) != 0)) { - * error_in_archive = error; /-* might be warning *-/ - * if (error > 1) /-* fatal *-/ - * return (error); - * } - * } - * - */ - - -#ifdef FUNZIP -# define FLUSH(w) flush(__G__ (ulg)(w)) -# define NEXTBYTE getc(G.in) /* redefined in crypt.h if full version */ -#else -# define FLUSH(w) ((G.mem_mode) ? memflush(__G__ redirSlide,(ulg)(w)) \ - : flush(__G__ redirSlide,(ulg)(w),0)) -# define NEXTBYTE (G.incnt-- > 0 ? (int)(*G.inptr++) : readbyte(__G)) -#endif - - -#define READBITS(nbits,zdest) {if(nbits>G.bits_left) {int temp; G.zipeof=1;\ - while (G.bits_left<=8*(int)(sizeof(G.bitbuf)-1) && (temp=NEXTBYTE)!=EOF) {\ - G.bitbuf|=(ulg)temp<>=nbits;\ - G.bits_left-=nbits;} - -/* - * macro READBITS(nbits,zdest) * only used by unreduce and unshrink * - * { - * if (nbits > G.bits_left) { * fill G.bitbuf, 8*sizeof(ulg) bits * - * int temp; - * - * G.zipeof = 1; - * while (G.bits_left <= 8*(int)(sizeof(G.bitbuf)-1) && - * (temp = NEXTBYTE) != EOF) { - * G.bitbuf |= (ulg)temp << G.bits_left; - * G.bits_left += 8; - * G.zipeof = 0; - * } - * } - * zdest = (shrint)((unsigned)G.bitbuf & mask_bits[nbits]); - * G.bitbuf >>= nbits; - * G.bits_left -= nbits; - * } - * - */ - - -/* GRR: should use StringLower for STRLOWER macro if possible */ - -/* - * Copy the zero-terminated string in str1 into str2, converting any - * uppercase letters to lowercase as we go. str2 gets zero-terminated - * as well, of course. str1 and str2 may be the same character array. - */ -#ifdef _MBCS -# define STRLOWER(str1, str2) \ - { \ - char *p, *q, c; unsigned i; \ - p = (char *)(str1); \ - q = (char *)(str2); \ - while ((c = *p) != '\0') { \ - if ((i = CLEN(p)) > 1) { \ - while (i--) *q++ = *p++; \ - } else { \ - *q++ = (char)(isupper((int)(c))? tolower((int)(c)) : c); \ - p++; \ - } \ - } \ - *q = '\0'; \ - } -#else -# define STRLOWER(str1, str2) \ - { \ - char *p, *q; \ - p = (char *)(str1) - 1; \ - q = (char *)(str2); \ - while (*++p) \ - *q++ = (char)(isupper((int)(*p))? tolower((int)(*p)) : *p); \ - *q = '\0'; \ - } -#endif -/* - * NOTES: This macro makes no assumptions about the characteristics of - * the tolower() function or macro (beyond its existence), nor does it - * make assumptions about the structure of the character set (i.e., it - * should work on EBCDIC machines, too). The fact that either or both - * of isupper() and tolower() may be macros has been taken into account; - * watch out for "side effects" (in the C sense) when modifying this - * macro. - */ - -#ifndef foreign -# define foreign(c) (c) -#endif - -#ifndef native -# define native(c) (c) -# define A_TO_N(str1) -#else -# ifndef NATIVE -# define NATIVE "native chars" -# endif -# define A_TO_N(str1) {register uch *p;\ - for (p=(uch *)(str1); *p; p++) *p=native(*p);} -#endif -/* - * Translate the zero-terminated string in str1 from ASCII to the native - * character set. The translation is performed in-place and uses the - * "native" macro to translate each character. - * - * NOTE: Using the "native" macro means that is it the only part of unzip - * which knows which translation table (if any) is actually in use to - * produce the native character set. This makes adding new character set - * translation tables easy, insofar as all that is needed is an appropriate - * "native" macro definition and the translation table itself. Currently, - * the only non-ASCII native character set implemented is EBCDIC, but this - * may not always be so. - */ - - -/* default setup for internal codepage: assume ISO 8859-1 compatibility!! */ -#if (!defined(NATIVE) && !defined(CRTL_CP_IS_ISO) && !defined(CRTL_CP_IS_OEM)) -# define CRTL_CP_IS_ISO -#endif - - -/* Translate "extended ASCII" chars (OEM coding for DOS and OS/2; else - * ISO-8859-1 [ISO Latin 1, Win Ansi,...]) into the internal "native" - * code page. As with A_TO_N(), conversion is done in place. - */ -#ifndef _ISO_INTERN -# ifdef CRTL_CP_IS_OEM -# ifndef IZ_ISO2OEM_ARRAY -# define IZ_ISO2OEM_ARRAY -# endif -# define _ISO_INTERN(str1) if (iso2oem) {register uch *p;\ - for (p=(uch *)(str1); *p; p++)\ - *p = native((*p & 0x80) ? iso2oem[*p & 0x7f] : *p);} -# else -# define _ISO_INTERN(str1) A_TO_N(str1) -# endif -#endif - -#ifndef _OEM_INTERN -# ifdef CRTL_CP_IS_OEM -# define _OEM_INTERN(str1) A_TO_N(str1) -# else -# ifndef IZ_OEM2ISO_ARRAY -# define IZ_OEM2ISO_ARRAY -# endif -# define _OEM_INTERN(str1) if (oem2iso) {register uch *p;\ - for (p=(uch *)(str1); *p; p++)\ - *p = native((*p & 0x80) ? oem2iso[*p & 0x7f] : *p);} -# endif -#endif - -#ifndef STR_TO_ISO -# ifdef CRTL_CP_IS_ISO -# define STR_TO_ISO strcpy -# else -# define STR_TO_ISO str2iso -# define NEED_STR2ISO -# endif -#endif - -#ifndef STR_TO_OEM -# ifdef CRTL_CP_IS_OEM -# define STR_TO_OEM strcpy -# else -# define STR_TO_OEM str2oem -# define NEED_STR2OEM -# endif -#endif - -#if (!defined(INTERN_TO_ISO) && !defined(ASCII2ISO)) -# ifdef CRTL_CP_IS_OEM - /* know: "ASCII" is "OEM" */ -# define ASCII2ISO(c) \ - ((((c) & 0x80) && oem2iso) ? oem2iso[(c) & 0x7f] : (c)) -# if (defined(NEED_STR2ISO) && !defined(CRYP_USES_OEM2ISO)) -# define CRYP_USES_OEM2ISO -# endif -# else - /* assume: "ASCII" is "ISO-ANSI" */ -# define ASCII2ISO(c) (c) -# endif -#endif - -#if (!defined(INTERN_TO_OEM) && !defined(ASCII2OEM)) -# ifdef CRTL_CP_IS_OEM - /* know: "ASCII" is "OEM" */ -# define ASCII2OEM(c) (c) -# else - /* assume: "ASCII" is "ISO-ANSI" */ -# define ASCII2OEM(c) \ - ((((c) & 0x80) && iso2oem) ? iso2oem[(c) & 0x7f] : (c)) -# if (defined(NEED_STR2OEM) && !defined(CRYP_USES_ISO2OEM)) -# define CRYP_USES_ISO2OEM -# endif -# endif -#endif - -/* codepage conversion setup for testp() in crypt.c */ -#ifdef CRTL_CP_IS_ISO -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_OEM -# endif -#else -# ifdef CRTL_CP_IS_OEM -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_ISO -# endif -# else /* native internal CP is neither ISO nor OEM */ -# ifndef STR_TO_CP1 -# define STR_TO_CP1 STR_TO_ISO -# endif -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_OEM -# endif -# endif -#endif - - -/* Convert filename (and file comment string) into "internal" charset. - * This macro assumes that Zip entry filenames are coded in OEM (IBM DOS) - * codepage when made on - * -> DOS (this includes 16-bit Windows 3.1) (FS_FAT_) - * -> OS/2 (FS_HPFS_) - * -> Win95/WinNT with Nico Mak's WinZip (FS_NTFS_ && hostver == "5.0") - * EXCEPTIONS: - * PKZIP for Windows 2.5, 2.6, and 4.0 flag their entries as "FS_FAT_", but - * the filename stored in the local header is coded in Windows ANSI (CP 1252 - * resp. ISO 8859-1 on US and western Europe locale settings). - * Likewise, PKZIP for UNIX 2.51 flags its entries as "FS_FAT_", but the - * filenames stored in BOTH the local and the central header are coded - * in the local system's codepage (usually ANSI codings like ISO 8859-1). - * - * All other ports are assumed to code zip entry filenames in ISO 8859-1. - */ -#ifndef Ext_ASCII_TO_Native -# define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \ - if (((hostnum) == FS_FAT_ && \ - !(((islochdr) || (isuxatt)) && \ - ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \ - (hostnum) == FS_HPFS_ || \ - ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \ - _OEM_INTERN((string)); \ - } else { \ - _ISO_INTERN((string)); \ - } -#endif - - - -/**********************/ -/* Global constants */ -/**********************/ - - extern ZCONST unsigned near mask_bits[17]; - extern ZCONST char *fnames[2]; - -#ifdef EBCDIC - extern ZCONST uch ebcdic[]; -#endif -#ifdef IZ_ISO2OEM_ARRAY - extern ZCONST uch Far *iso2oem; - extern ZCONST uch Far iso2oem_850[]; -#endif -#ifdef IZ_OEM2ISO_ARRAY - extern ZCONST uch Far *oem2iso; - extern ZCONST uch Far oem2iso_850[]; -#endif - - extern ZCONST char Far VersionDate[]; - extern ZCONST char Far CentSigMsg[]; -#ifndef SFX - extern ZCONST char Far EndSigMsg[]; -#endif - extern ZCONST char Far SeekMsg[]; - extern ZCONST char Far FilenameNotMatched[]; - extern ZCONST char Far ExclFilenameNotMatched[]; - extern ZCONST char Far ReportMsg[]; - -#ifndef SFX - extern ZCONST char Far Zipnfo[]; - extern ZCONST char Far CompiledWith[]; -#endif /* !SFX */ - - - -/***********************************/ -/* Global (shared?) RTL variables */ -/***********************************/ - -#ifdef DECLARE_ERRNO - extern int errno; -#endif - -/*--------------------------------------------------------------------- - Unicode Support - 28 August 2005 - ---------------------------------------------------------------------*/ -#if (defined(UNICODE_SUPPORT) && defined(UNICODE_WCHAR)) - - /* Default character when a zwchar too big for wchar_t */ -# define zwchar_to_wchar_t_default_char '_' - - /* Default character string when wchar_t does not convert to mb */ -# define wide_to_mb_default_string "_" - - /* wide character type */ - typedef unsigned long zwchar; - - /* UTF-8 related conversion functions, currently found in process.c */ - -# if 0 /* currently unused */ - /* check if string is all ASCII */ - int is_ascii_string OF((ZCONST char *mbstring)); -# endif /* unused */ - - /* convert UTF-8 string to multi-byte string */ - char *utf8_to_local_string OF((ZCONST char *utf8_string, int escape_all)); - - /* convert UTF-8 string to wide string */ - zwchar *utf8_to_wide_string OF((ZCONST char *utf8_string)); - - /* convert wide string to multi-byte string */ - char *wide_to_local_string OF((ZCONST zwchar *wide_string, int escape_all)); - -# if 0 /* currently unused */ - /* convert local string to multi-byte display string */ - char *local_to_display_string OF((ZCONST char *local_string)); -# endif /* unused */ - - /* convert wide character to escape string */ - char *wide_to_escape_string OF((unsigned long)); - -# define utf8_to_escaped_string(utf8_string) \ - utf8_to_local_string(utf8_string, TRUE) - -# if 0 /* currently unused */ - /* convert escape string to wide character */ - unsigned long escape_string_to_wide OF((ZCONST char *escape_string)); - - /* convert local to UTF-8 */ - char *local_to_utf8_string OF ((ZCONST char *local_string)); - - /* convert local to wide string */ - zwchar *local_to_wide_string OF ((ZCONST char *local_string)); - - /* convert wide string to UTF-8 */ - char *wide_to_utf8_string OF((ZCONST zwchar *wide_string)); -# endif /* unused */ - -#endif /* UNICODE_SUPPORT && UNICODE_WCHAR */ - - -#endif /* !__unzpriv_h */ diff --git a/data/windows/unzipfx-catarina/unzvers.h b/data/windows/unzipfx-catarina/unzvers.h deleted file mode 100644 index 828f537..0000000 --- a/data/windows/unzipfx-catarina/unzvers.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - unzvers.h (for UnZip) by Info-ZIP. - */ - -#ifndef __unzvers_h /* don't include more than once */ -#define __unzvers_h - -#ifdef BETA -# undef BETA /* undefine BETA for public releases */ -#endif - -#ifdef BETA -# define UZ_BETALEVEL "h03 BETA" -# define UZ_VERSION_DATE "17 Apr 09" /* internal beta version */ -#else -# define UZ_BETALEVEL "" -# define UZ_VERSION_DATE "20 April 2009" /* official release version */ -# define RELEASE -#endif - -#define UZ_MAJORVER 6 /* UnZip */ -#define UZ_MINORVER 0 - -#define ZI_MAJORVER 3 /* ZipInfo */ -#define ZI_MINORVER 0 - -#define UZ_PATCHLEVEL 0 - -#define UZ_VER_STRING "6.0" /* keep in sync with Version numbers! */ - -#ifndef IZ_COMPANY_NAME /* might be already defined... */ -# define IZ_COMPANY_NAME "Info-ZIP" -#endif - -/* these are obsolete but remain for backward compatibility: */ -#if (defined(OS2) || defined(__OS2__)) -# define D2_MAJORVER UZ_MAJORVER /* DLL for OS/2 */ -# define D2_MINORVER UZ_MINORVER -# define D2_PATCHLEVEL UZ_PATCHLEVEL -#endif - -#define DW_MAJORVER UZ_MAJORVER /* DLL for MS Windows */ -#define DW_MINORVER UZ_MINORVER -#define DW_PATCHLEVEL UZ_PATCHLEVEL - -#define WIN_VERSION_DATE UZ_VERSION_DATE - -#define UNZ_DLL_VERSION UZ_VER_STRING - -/* The following version constants specify the UnZip version that introduced - * the most recent incompatible change (means: change that breaks backward - * compatibility) of a DLL/Library binary API definition. - * - * Currently, UnZip supports three distinct DLL/Library APIs, which each - * carry their own "compatibility level": - * a) The "generic" (console-mode oriented) API has been used on UNIX, - * for example. This API provides a "callable" interface similar to the - * interactive command line of the normal program executables. - * b) The OS/2-only API provides (additional) functions specially tailored - * for interfacing with the REXX shell. - * c) The Win32 DLL API with a pure binary interface which can be used to - * build GUI mode as well as Console mode applications. - * - * Whenever a change that breaks backward compatibility gets applied to - * any of the DLL/Library APIs, the corresponding compatibility level should - * be synchronized with the current UnZip version numbers. - */ -/* generic DLL API minimum compatible version*/ -#define UZ_GENAPI_COMP_MAJOR 6 -#define UZ_GENAPI_COMP_MINOR 0 -#define UZ_GENAPI_COMP_REVIS 0 -/* os2dll API minimum compatible version*/ -#define UZ_OS2API_COMP_MAJOR 6 -#define UZ_OS2API_COMP_MINOR 0 -#define UZ_OS2API_COMP_REVIS 0 -/* windll API minimum compatible version*/ -#define UZ_WINAPI_COMP_MAJOR 6 -#define UZ_WINAPI_COMP_MINOR 0 -#define UZ_WINAPI_COMP_REVIS 0 - -#endif /* !__unzvers_h */ diff --git a/data/windows/unzipfx-catarina/win32/nt.c b/data/windows/unzipfx-catarina/win32/nt.c deleted file mode 100644 index a6cf859..0000000 --- a/data/windows/unzipfx-catarina/win32/nt.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - - Copyright (c) 1996 Scott Field (dedicated to Info-Zip group) - - Module Name: - - nt.c - - Abstract: - - This module implements WinNT security descriptor operations for the - Win32 Info-ZIP project. Operation such as setting file security, - using/querying local and remote privileges, and queuing of operations - is performed here. The contents of this module are only relevant - when the code is running on Windows NT, and the target volume supports - persistent Acl storage. - - User privileges that allow accessing certain privileged aspects of the - security descriptor (such as the Sacl) are only used if the user specified - to do so. - - Author: - - Scott Field (sfield@microsoft.com) - - Last revised: 18 Jan 97 - - */ - -#define WIN32_LEAN_AND_MEAN -#define UNZIP_INTERNAL -#include "../unzip.h" -#include -#ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -#endif -#include "../win32/nt.h" - - -#ifdef NTSD_EAS /* This file is only needed for NTSD handling */ - -/* Borland C++ does not define FILE_SHARE_DELETE. Others also? */ -#ifndef FILE_SHARE_DELETE -# define FILE_SHARE_DELETE 0x00000004 -#endif - -/* This macro definition is missing in old versions of MS' winbase.h. */ -#ifndef InterlockedExchangePointer -# define InterlockedExchangePointer(Target, Value) \ - (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) -#endif - - -/* private prototypes */ - -static BOOL Initialize(VOID); -static VOID GetRemotePrivilegesSet(CHAR *FileName, PDWORD dwRemotePrivileges); -static VOID InitLocalPrivileges(VOID); - - -volatile BOOL bInitialized = FALSE; /* module level stuff initialized? */ -HANDLE hInitMutex = NULL; /* prevent multiple initialization */ - -BOOL g_bRestorePrivilege = FALSE; /* for local set file security override */ -BOOL g_bSaclPrivilege = FALSE; /* for local set sacl operations, only when - restore privilege not present */ - -/* our single cached volume capabilities structure that describes the last - volume root we encountered. A single entry like this works well in the - zip/unzip scenario for a number of reasons: - 1. typically one extraction path during unzip. - 2. typically process one volume at a time during zip, and then move - on to the next. - 3. no cleanup code required and no memory leaks. - 4. simple code. - - This approach should be reworked to a linked list approach if we expect to - be called by many threads which are processing a variety of input/output - volumes, since lock contention and stale data may become a bottleneck. */ - -VOLUMECAPS g_VolumeCaps; -CRITICAL_SECTION VolumeCapsLock; - - -static BOOL Initialize(VOID) -{ - HANDLE hMutex; - HANDLE hOldMutex; - - if (bInitialized) return TRUE; - - hMutex = CreateMutex(NULL, TRUE, NULL); - if(hMutex == NULL) return FALSE; - - hOldMutex = (HANDLE)InterlockedExchangePointer((void *)&hInitMutex, - hMutex); - - if (hOldMutex != NULL) { - /* somebody setup the mutex already */ - InterlockedExchangePointer((void *)&hInitMutex, - hOldMutex); - - CloseHandle(hMutex); /* close new, un-needed mutex */ - - /* wait for initialization to complete and return status */ - WaitForSingleObject(hOldMutex, INFINITE); - ReleaseMutex(hOldMutex); - - return bInitialized; - } - - if (!bInitialized) { - /* initialize module level resources */ - - InitializeCriticalSection( &VolumeCapsLock ); - memset(&g_VolumeCaps, 0, sizeof(VOLUMECAPS)); - - InitLocalPrivileges(); - - bInitialized = TRUE; - } - - InterlockedExchangePointer((void *)&hInitMutex, - NULL); - - ReleaseMutex(hMutex); /* release correct mutex */ - - CloseHandle(hMutex); /* free the no longer needed handle resource */ - - return TRUE; -} - - -BOOL ValidateSecurity(uch *securitydata) -{ - PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; - PACL pAcl; - PSID pSid; - BOOL bAclPresent; - BOOL bDefaulted; - - if(!IsWinNT()) return TRUE; /* don't do anything if not on WinNT */ - - if(!IsValidSecurityDescriptor(sd)) return FALSE; - - /* verify Dacl integrity */ - - if(!GetSecurityDescriptorDacl(sd, &bAclPresent, &pAcl, &bDefaulted)) - return FALSE; - - if(bAclPresent && pAcl!=NULL) { - if(!IsValidAcl(pAcl)) return FALSE; - } - - /* verify Sacl integrity */ - - if(!GetSecurityDescriptorSacl(sd, &bAclPresent, &pAcl, &bDefaulted)) - return FALSE; - - if(bAclPresent && pAcl!=NULL) { - if(!IsValidAcl(pAcl)) return FALSE; - } - - /* verify owner integrity */ - - if(!GetSecurityDescriptorOwner(sd, &pSid, &bDefaulted)) - return FALSE; - - if(pSid != NULL) { - if(!IsValidSid(pSid)) return FALSE; - } - - /* verify group integrity */ - - if(!GetSecurityDescriptorGroup(sd, &pSid, &bDefaulted)) - return FALSE; - - if(pSid != NULL) { - if(!IsValidSid(pSid)) return FALSE; - } - - return TRUE; -} - -static VOID GetRemotePrivilegesSet(char *FileName, PDWORD dwRemotePrivileges) -{ - HANDLE hFile; - - *dwRemotePrivileges = 0; - - /* see if we have the SeRestorePrivilege */ - - hFile = CreateFileA( - FileName, - ACCESS_SYSTEM_SECURITY | WRITE_DAC | WRITE_OWNER | READ_CONTROL, - FILE_SHARE_READ | FILE_SHARE_DELETE, /* no sd updating allowed here */ - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL - ); - - if(hFile != INVALID_HANDLE_VALUE) { - /* no remote way to determine SeRestorePrivilege -- just try a - read/write to simulate it */ - SECURITY_INFORMATION si = DACL_SECURITY_INFORMATION | - SACL_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION | - GROUP_SECURITY_INFORMATION; - PSECURITY_DESCRIPTOR sd; - DWORD cbBuf = 0; - - GetKernelObjectSecurity(hFile, si, NULL, cbBuf, &cbBuf); - - if(ERROR_INSUFFICIENT_BUFFER == GetLastError()) { - if((sd = HeapAlloc(GetProcessHeap(), 0, cbBuf)) != NULL) { - if(GetKernelObjectSecurity(hFile, si, sd, cbBuf, &cbBuf)) { - if(SetKernelObjectSecurity(hFile, si, sd)) - *dwRemotePrivileges |= OVERRIDE_RESTORE; - } - HeapFree(GetProcessHeap(), 0, sd); - } - } - - CloseHandle(hFile); - } else { - - /* see if we have the SeSecurityPrivilege */ - /* note we don't need this if we have SeRestorePrivilege */ - - hFile = CreateFileA( - FileName, - ACCESS_SYSTEM_SECURITY, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, /* max */ - NULL, - OPEN_EXISTING, - 0, - NULL - ); - - if(hFile != INVALID_HANDLE_VALUE) { - CloseHandle(hFile); - *dwRemotePrivileges |= OVERRIDE_SACL; - } - } -} - - -BOOL GetVolumeCaps( - char *rootpath, /* filepath, or NULL */ - char *name, /* filename associated with rootpath */ - PVOLUMECAPS VolumeCaps /* result structure describing capabilities */ - ) -{ - char TempRootPath[MAX_PATH + 1]; - DWORD cchTempRootPath = 0; - BOOL bSuccess = TRUE; /* assume success until told otherwise */ - - if(!bInitialized) if(!Initialize()) return FALSE; - - /* process the input path to produce a consistent path suitable for - compare operations and also suitable for certain picky Win32 API - that don't like forward slashes */ - - if(rootpath != NULL && rootpath[0] != '\0') { - DWORD i; - - cchTempRootPath = lstrlenA(rootpath); - if(cchTempRootPath > MAX_PATH) return FALSE; - - /* copy input, converting forward slashes to back slashes as we go */ - - for(i = 0 ; i <= cchTempRootPath ; i++) { - if(rootpath[i] == '/') TempRootPath[i] = '\\'; - else TempRootPath[i] = rootpath[i]; - } - - /* check for UNC and Null terminate or append trailing \ as - appropriate */ - - /* possible valid UNCs we are passed follow: - \\machine\foo\bar (path is \\machine\foo\) - \\machine\foo (path is \\machine\foo\) - \\machine\foo\ - \\.\c$\ (FIXFIX: Win32API doesn't like this - GetComputerName()) - LATERLATER: handling mounted DFS drives in the future will require - slightly different logic which isn't available today. - This is required because directories can point at - different servers which have differing capabilities. - */ - - if(TempRootPath[0] == '\\' && TempRootPath[1] == '\\') { - DWORD slash = 0; - - for(i = 2 ; i < cchTempRootPath ; i++) { - if(TempRootPath[i] == '\\') { - slash++; - - if(slash == 2) { - i++; - TempRootPath[i] = '\0'; - cchTempRootPath = i; - break; - } - } - } - - /* if there was only one slash found, just tack another onto the - end */ - - if(slash == 1 && TempRootPath[cchTempRootPath] != '\\') { - TempRootPath[cchTempRootPath] = TempRootPath[0]; /* '\\' */ - TempRootPath[cchTempRootPath+1] = '\0'; - cchTempRootPath++; - } - - } else { - - if(TempRootPath[1] == ':') { - - /* drive letter specified, truncate to root */ - TempRootPath[2] = '\\'; - TempRootPath[3] = '\0'; - cchTempRootPath = 3; - } else { - - /* must be file on current drive */ - TempRootPath[0] = '\0'; - cchTempRootPath = 0; - } - - } - - } /* if path != NULL */ - - /* grab lock protecting cached entry */ - EnterCriticalSection( &VolumeCapsLock ); - - if(!g_VolumeCaps.bValid || - lstrcmpiA(g_VolumeCaps.RootPath, TempRootPath) != 0) - { - - /* no match found, build up new entry */ - - DWORD dwFileSystemFlags; - DWORD dwRemotePrivileges = 0; - BOOL bRemote = FALSE; - - /* release lock during expensive operations */ - LeaveCriticalSection( &VolumeCapsLock ); - - bSuccess = GetVolumeInformationA( - (TempRootPath[0] == '\0') ? NULL : TempRootPath, - NULL, 0, - NULL, NULL, - &dwFileSystemFlags, - NULL, 0); - - - /* only if target volume supports Acls, and we were told to use - privileges do we need to go out and test for the remote case */ - - if(bSuccess && (dwFileSystemFlags & FS_PERSISTENT_ACLS) && - VolumeCaps->bUsePrivileges) - { - if(GetDriveTypeA( (TempRootPath[0] == '\0') ? NULL : TempRootPath ) - == DRIVE_REMOTE) - { - bRemote = TRUE; - - /* make a determination about our remote capabilities */ - - GetRemotePrivilegesSet(name, &dwRemotePrivileges); - } - } - - /* always take the lock again, since we release it below */ - EnterCriticalSection( &VolumeCapsLock ); - - /* replace the existing data if successful */ - if(bSuccess) { - - lstrcpynA(g_VolumeCaps.RootPath, TempRootPath, cchTempRootPath+1); - g_VolumeCaps.dwFileSystemFlags = dwFileSystemFlags; - g_VolumeCaps.bRemote = bRemote; - g_VolumeCaps.dwRemotePrivileges = dwRemotePrivileges; - g_VolumeCaps.bValid = TRUE; - } - } - - if(bSuccess) { - /* copy input elements */ - g_VolumeCaps.bUsePrivileges = VolumeCaps->bUsePrivileges; - g_VolumeCaps.dwFileAttributes = VolumeCaps->dwFileAttributes; - - /* give caller results */ - memcpy(VolumeCaps, &g_VolumeCaps, sizeof(VOLUMECAPS)); - } else { - g_VolumeCaps.bValid = FALSE; - } - - LeaveCriticalSection( &VolumeCapsLock ); /* release lock */ - - return bSuccess; -} - - -BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata) -{ - HANDLE hFile; - DWORD dwDesiredAccess = 0; - DWORD dwFlags = 0; - PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; - SECURITY_DESCRIPTOR_CONTROL sdc; - SECURITY_INFORMATION RequestedInfo = 0; - DWORD dwRev; - BOOL bRestorePrivilege = FALSE; - BOOL bSaclPrivilege = FALSE; - BOOL bSuccess; - - if(!bInitialized) if(!Initialize()) return FALSE; - - /* defer directory processing */ - - if(VolumeCaps->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - /* opening a directory requires FILE_FLAG_BACKUP_SEMANTICS */ - dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; - } - - /* evaluate the input security descriptor and act accordingly */ - - if(!IsValidSecurityDescriptor(sd)) - return FALSE; - - if(!GetSecurityDescriptorControl(sd, &sdc, &dwRev)) - return FALSE; - - /* setup privilege usage based on if told we can use privileges, and if so, - what privileges we have */ - - if(VolumeCaps->bUsePrivileges) { - if(VolumeCaps->bRemote) { - /* use remotely determined privileges */ - if(VolumeCaps->dwRemotePrivileges & OVERRIDE_RESTORE) - bRestorePrivilege = TRUE; - - if(VolumeCaps->dwRemotePrivileges & OVERRIDE_SACL) - bSaclPrivilege = TRUE; - - } else { - /* use local privileges */ - bRestorePrivilege = g_bRestorePrivilege; - bSaclPrivilege = g_bSaclPrivilege; - } - } - - - /* if a Dacl is present write Dacl out */ - /* if we have SeRestorePrivilege, write owner and group info out */ - - if(sdc & SE_DACL_PRESENT) { - dwDesiredAccess |= WRITE_DAC; - RequestedInfo |= DACL_SECURITY_INFORMATION; - - if(bRestorePrivilege) { - dwDesiredAccess |= WRITE_OWNER; - RequestedInfo |= (OWNER_SECURITY_INFORMATION | - GROUP_SECURITY_INFORMATION); - } - } - - /* if a Sacl is present and we have either SeRestorePrivilege or - SeSystemSecurityPrivilege try to write Sacl out */ - - if((sdc & SE_SACL_PRESENT) && (bRestorePrivilege || bSaclPrivilege)) { - dwDesiredAccess |= ACCESS_SYSTEM_SECURITY; - RequestedInfo |= SACL_SECURITY_INFORMATION; - } - - if(RequestedInfo == 0) /* nothing to do */ - return FALSE; - - if(bRestorePrivilege) - dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; - - hFile = CreateFileA( - resource, - dwDesiredAccess, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,/* max sharing */ - NULL, - OPEN_EXISTING, - dwFlags, - NULL - ); - - if(hFile == INVALID_HANDLE_VALUE) - return FALSE; - - bSuccess = SetKernelObjectSecurity(hFile, RequestedInfo, sd); - - CloseHandle(hFile); - - return bSuccess; -} - -static VOID InitLocalPrivileges(VOID) -{ - HANDLE hToken; - TOKEN_PRIVILEGES tp; - - /* try to enable some interesting privileges that give us the ability - to get some security information that we normally cannot. - - note that enabling privileges is only relevant on the local machine; - when accessing files that are on a remote machine, any privileges - that are present on the remote machine get enabled by default. */ - - if(!OpenProcessToken(GetCurrentProcess(), - TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) - return; - - tp.PrivilegeCount = 1; - tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - if(LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &tp.Privileges[0].Luid)) { - - /* try to enable SeRestorePrivilege; if this succeeds, we can write - all aspects of the security descriptor */ - - if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && - GetLastError() == ERROR_SUCCESS) g_bRestorePrivilege = TRUE; - - } - - /* try to enable SeSystemSecurityPrivilege, if SeRestorePrivilege not - present; if this succeeds, we can write the Sacl */ - - if(!g_bRestorePrivilege && - LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid)) { - - if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && - GetLastError() == ERROR_SUCCESS) g_bSaclPrivilege = TRUE; - } - - CloseHandle(hToken); -} -#endif /* NTSD_EAS */ diff --git a/data/windows/unzipfx-catarina/win32/nt.h b/data/windows/unzipfx-catarina/win32/nt.h deleted file mode 100644 index 774c754..0000000 --- a/data/windows/unzipfx-catarina/win32/nt.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* nt.h: central header for EF_NTSD "SD" extra field */ - -#ifndef _NT_H -#define _NT_H - -#define NTSD_BUFFERSIZE (1024) /* threshold to cause malloc() */ -#define OVERRIDE_BACKUP 1 /* we have SeBackupPrivilege on remote */ -#define OVERRIDE_RESTORE 2 /* we have SeRestorePrivilege on remote */ -#define OVERRIDE_SACL 4 /* we have SeSystemSecurityPrivilege on remote */ - -typedef struct { - BOOL bValid; /* are our contents valid? */ - BOOL bUsePrivileges; /* use privilege overrides? */ - DWORD dwFileSystemFlags; /* describes target file system */ - BOOL bRemote; /* is volume remote? */ - DWORD dwRemotePrivileges; /* relevant only on remote volumes */ - DWORD dwFileAttributes; - char RootPath[MAX_PATH+1]; /* path to network / filesystem */ -} VOLUMECAPS, *PVOLUMECAPS, *LPVOLUMECAPS; - -BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata); -BOOL GetVolumeCaps(char *rootpath, char *name, PVOLUMECAPS VolumeCaps); -BOOL ValidateSecurity(uch *securitydata); - -#endif /* _NT_H */ diff --git a/data/windows/unzipfx-catarina/win32/w32cfg.h b/data/windows/unzipfx-catarina/win32/w32cfg.h deleted file mode 100644 index 0e4f584..0000000 --- a/data/windows/unzipfx-catarina/win32/w32cfg.h +++ /dev/null @@ -1,571 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - Win32 specific configuration section: - ---------------------------------------------------------------------------*/ - -#ifndef __w32cfg_h -#define __w32cfg_h - -#ifdef __MINGW32__ -# define USE_STRM_INPUT -#endif - -#ifdef __CYGWIN__ -/* We treat the file system underneath the Cygwin Unix emulator environment - * as "native VFAT/NTFS" and use the WIN32 API for its special attributes... - */ -# ifdef UNIX -# undef UNIX -# endif -#endif - -#if (defined(_MSC_VER) && !defined(MSC)) -# define MSC -#endif - -/* enable multibyte character set support by default */ -#if (!defined(_MBCS) && !defined(NO_MBCS)) -# define _MBCS -#endif -#if (defined(_MBCS) && defined(NO_MBCS)) -# undef _MBCS -#endif -#if (defined(__CYGWIN__) && defined(_MBCS)) -# undef _MBCS /* Cygwin RTL lacks support for __mb_cur_max */ -#endif -#if (defined(__DJGPP__) && !defined(__EMX__) && defined(_MBCS)) -# undef _MBCS /* __mb_cur_max missing for RSXNTdj 1.6 beta */ -#endif - -#include /* off_t, time_t, dev_t, ... */ -#include -#include /* read(), open(), etc. */ -#include -#if ((defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)) -# define tzset _tzset -#endif -#if (defined(__LCC__) && !defined(tzset)) -# define tzset _tzset -#endif -#ifdef W32_USE_IZ_TIMEZONE -# ifdef __BORLANDC__ -# define tzname tzname -# define IZTZ_DEFINESTDGLOBALS -# endif -# ifdef __WATCOMC__ -# define IZTZ_DEFINESTDGLOBALS -# endif -# ifndef tzset -# define tzset _tzset -# endif -# ifndef timezone -# define timezone _timezone -# endif -# ifndef daylight -# define daylight _daylight -# endif -# ifndef tzname -# define tzname _tzname -# endif -# if (!defined(NEED__ISINDST) && !defined(__BORLANDC__)) -# define NEED__ISINDST -# endif -# ifdef IZTZ_GETLOCALETZINFO -# undef IZTZ_GETLOCALETZINFO -# endif -# define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone -#endif /* W32_USE_IZ_TIMEZONE */ -#include -#if (!defined(__RSXNT__) && !defined(__CYGWIN__)) -# include /* mkdir() */ -#endif -#include -#ifdef __CYGWIN__ -# include - extern int setmode(int, int); /* this is missing in */ -#endif -#if (defined(MSC) || defined(__WATCOMC__) || defined(__MINGW32__)) -# include -#else -# include -#endif -#define GOT_UTIMBUF - -#ifdef _MBCS -# if (!defined(__EMX__) && !defined(__DJGPP__) && !defined(__CYGWIN__)) -# if (!defined(__MINGW32__) || defined(__MSVCRT__)) -# include -# include - /* for MSC (and compatible compilers), use routines supplied by RTL */ -# define CLEN(ptr) _mbclen((const uch *)(ptr)) -# define PREINCSTR(ptr) (ptr = (char *)_mbsinc((const uch *)(ptr))) -# define MBSCHR(str, c) (char *)_mbschr((const uch *)(str), (c)) -# define MBSRCHR(str, c) (char *)_mbsrchr((const uch *)(str), (c)) -# endif -# endif -# if (defined(__MINGW32__) && !defined(MB_CUR_MAX)) -# ifdef __MSVCRT__ - extern int *__p___mb_cur_max(void); -# define MB_CUR_MAX (*__p___mb_cur_max()) -# else - extern int *_imp____mb_cur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif -# endif -# if (defined(__LCC__) && !defined(MB_CUR_MAX)) - extern int *_imp____mb_cur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# endif -# if (defined(__DJGPP__) && !defined(__EMX__) && !defined(MB_CUR_MAX)) - extern int *_imp____mb_cur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# endif -#endif - -/* for UnZip, the "basic" part of the win32 api is sufficient */ -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif - -#if defined(__FILEIO_C) -# ifndef __CYGWIN__ -# include -# endif -# include -# ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -# endif -# ifndef TIME_ZONE_ID_INVALID -# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL -# endif -#endif -#if (defined(__ENVARGS_C) || defined(__EXTRACT_C) || defined(__UNZIP_C) || \ - defined(ZCRYPT_INTERNAL)) -# include -# ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -# endif -# ifndef TIME_ZONE_ID_INVALID -# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL -# endif -#endif - -#ifndef Cdecl -# define Cdecl __cdecl -#endif - -/* the following definitions are considered as "obsolete" by Microsoft and - * might be missing in some versions of - */ -#ifndef AnsiToOem -# define AnsiToOem CharToOemA -#endif -#ifndef OemToAnsi -# define OemToAnsi OemToCharA -#endif - -#define DIR_END '\\' /* OS uses '\\' as directory separator */ -#define DIR_END2 '/' /* also check for '/' (RTL may convert) */ -#ifdef DATE_FORMAT -# undef DATE_FORMAT -#endif -#define DATE_FORMAT dateformat() -#ifdef DATE_SEPCHAR -# undef DATE_SEPCHAR -#endif -#define DATE_SEPCHAR dateseparator() -#define lenEOL 2 -#define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} - -#if (defined(__RSXNT__) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (defined(MSC) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (defined(__CYGWIN__) && defined(HAVE_MKTIME)) -# undef HAVE_MKTIME /* Cygnus' mktime() implementation is buggy */ -#endif -#if (defined(W32_USE_IZ_TIMEZONE) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -#endif -#if (!defined(NO_DIR_ATTRIB) && !defined(SET_DIR_ATTRIB)) -# define SET_DIR_ATTRIB -#endif -#if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -#endif -#if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS)) -# define NTSD_EAS /* enable NTSD support unless explicitly suppressed */ -#endif -#if (defined(NTSD_EAS) && !defined(RESTORE_ACL)) -# define RESTORE_ACL /* "restore ACLs" only needed when NTSD_EAS active */ -#endif -#if (!defined(NO_UNICODE_SUPPORT) && !defined(UNICODE_SUPPORT)) -# define UNICODE_SUPPORT /* enable UTF-8 filename support by default */ -#endif -#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR)) -# define UNICODE_WCHAR /* wchar_t is UTF-16 encoded on WIN32 */ -#endif -#ifdef UTF8_MAYBE_NATIVE -# undef UTF8_MAYBE_NATIVE /* UTF-8 cannot be system charset on WIN32 */ -#endif - -/* The following compiler systems provide or use a runtime library with a - * locale-aware isprint() implementation. For these systems, the "enhanced" - * unprintable charcode detection in fnfilter() gets enabled. - */ -#if (!defined(HAVE_WORKING_ISPRINT) && !defined(NO_WORKING_ISPRINT)) -# if defined(MSC) || defined(__BORLANDC__) -# define HAVE_WORKING_ISPRINT -# endif -# if defined(__MINGW32__) && defined(__MSVCRT__) -# define HAVE_WORKING_ISPRINT -# endif -#endif - -/* WIN32 runs solely on little-endian processors; enable support - * for the 32-bit optimized CRC-32 C code by default. - */ -#ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -#endif -#if !defined(IZ_CRC_LE_OPTIMIZ) && !defined(NO_CRC_OPTIMIZ) -# define IZ_CRC_LE_OPTIMIZ -#endif - -/* handlers for OEM <--> ANSI string conversions */ -#ifdef __RSXNT__ - /* RSXNT uses OEM coded strings in functions supplied by C RTL */ -# ifdef CRTL_CP_IS_ISO -# undef CRTL_CP_IS_ISO -# endif -# ifndef CRTL_CP_IS_OEM -# define CRTL_CP_IS_OEM -# endif -#else - /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */ -# ifndef CRTL_CP_IS_ISO -# define CRTL_CP_IS_ISO -# endif -# ifdef CRTL_CP_IS_OEM -# undef CRTL_CP_IS_OEM -# endif -#endif - -#ifdef CRTL_CP_IS_ISO - /* C RTL's file system support assumes ANSI coded strings */ -# define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst) -# define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst) -#endif /* CRTL_CP_IS_ISO */ -#ifdef CRTL_CP_IS_OEM - /* C RTL's file system support assumes OEM coded strings */ -# define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst) -# define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst) -# define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -#endif /* CRTL_CP_IS_OEM */ -#define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1) -#define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1) -#ifndef WINDLL - /* Despite best intentions, for the command-line version UzpPassword() - * could return either character set, depending on whether running under - * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */ -# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) -# define STR_TO_CP3(dst, src) (OemToAnsi(src, dst), dst) -#else - /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */ -# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) -#endif -/* dummy defines to disable these functions, they are not needed */ -#define STR_TO_OEM -#define STR_TO_ISO - -/* Static variables that we have to add to Uz_Globs: */ -#define SYSTEM_SPECIFIC_GLOBALS \ - int created_dir, renamed_fullpath, fnlen;\ - unsigned nLabelDrive;\ - char lastRootPath[4];\ - int lastVolOldFAT, lastVolLocTim;\ - char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\ - ZCONST char *wildname;\ - char *dirname, matchname[FILNAMSIZ];\ - int rootlen, have_dirname, dirnamelen, notfirstcall;\ - zvoid *wild_dir; - -/* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by */ -/* both mapname() and checkdir(). */ -/* lastRootPath, lastVolOldFAT and lastVolLocTim are used by */ -/* IsVolumeOldFAT() and NTQueryVolInfo(). */ -/* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */ -/* are used by checkdir(). */ -/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ -/* and notfirstcall are used by do_wild(). */ - -/* This replacement for C-RTL-supplied getch() (or similar) functionality - * avoids leaving unabsorbed LFs in the keyboard buffer under Windows95, - * and supports the +[0] feature. - */ -int getch_win32 OF((void)); - -/* Up to now, all versions of Microsoft C runtime libraries lack the support - * for customized (non-US) switching rules between daylight saving time and - * standard time in the TZ environment variable string. - * But non-US timezone rules are correctly supported when timezone information - * is read from the OS system settings in the Win32 registry. - * The following work-around deletes any TZ environment setting from - * the process environment. This results in a fallback of the RTL time - * handling code to the (correctly interpretable) OS system settings, read - * from the registry. - */ -#ifdef USE_EF_UT_TIME -# if (defined(__WATCOMC__) || defined(__CYGWIN__) || \ - defined(W32_USE_IZ_TIMEZONE)) -# define iz_w32_prepareTZenv() -# else -# define iz_w32_prepareTZenv() putenv("TZ=") -# endif -#endif - -/* This patch of stat() is useful for at least two compilers. It is */ -/* difficult to take a stat() of a root directory under Windows95, so */ -/* zstat_win32() detects that case and fills in suitable values. */ -#ifndef __RSXNT__ -# ifndef W32_STATROOT_FIX -# define W32_STATROOT_FIX -# endif -#endif /* !__RSXNT__ */ - -#define W32_STAT_BANDAID -#if defined(REENTRANT) -# define __W32STAT_GLOBALS__ Uz_Globs *pG, -# define __W32STAT_G__ pG, -#else -# define __W32STAT_GLOBALS__ -# define __W32STAT_G__ -#endif -#ifdef SSTAT -# undef SSTAT -#endif -#ifdef WILD_STAT_BUG -# define SSTAT(path, pbuf) (iswild(path) || zstat_win32(__W32STAT_G__ path, pbuf)) -#else -# define SSTAT(path, pbuf) zstat_win32(__W32STAT_G__ path, pbuf) -#endif - -#ifdef __WATCOMC__ -# ifdef __386__ -# ifndef WATCOMC_386 -# define WATCOMC_386 -# endif -# define __32BIT__ -# undef far -# define far -# undef near -# define near -# undef Cdecl -# define Cdecl - -/* gaah -- Watcom's docs claim that _get_osfhandle exists, but it doesn't. */ -# define _get_osfhandle _os_handle - -/* Get asm routines to link properly without using "__cdecl": */ -# ifndef USE_ZLIB -# pragma aux crc32 "_*" parm caller [] value [eax] modify [eax] -# pragma aux get_crc_table "_*" parm caller [] value [eax] \ - modify [eax ecx edx] -# endif /* !USE_ZLIB */ -# endif /* __386__ */ -#endif /* __WATCOMC__ */ - -#define SCREENWIDTH 80 -#define SCREENSIZE(scrrows, scrcols) screensize(scrrows, scrcols) -int screensize(int *tt_rows, int *tt_cols); - -/* on the DOS or NT console screen, line-wraps are always enabled */ -#define SCREENLWRAP 1 -#define TABSIZE 8 - - -/* 64-bit-Integers & Large File Support - * (pasted here from Zip 3b, osdep.h - Myles Bennett 7-jun-2004) - * (updated from Zip 3.0d - Ed Gordon 6-oct-2004) - * - * If this is set it is assumed that the port - * supports 64-bit file calls. The types are - * defined here. Any local implementations are - * in w32i64.c and the prototypes for the calls are - * in unzip.h. Note that a port must support - * these calls fully or should not set - * LARGE_FILE_SUPPORT. - */ - -/* Automatically set ZIP64_SUPPORT if supported */ - -#ifndef NO_ZIP64_SUPPORT -# ifndef ZIP64_SUPPORT -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) -# define ZIP64_SUPPORT -# elif defined(__LCC__) - /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */ -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) -# define ZIP64_SUPPORT -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */ -# endif -# endif -#endif - -#ifdef ZIP64_SUPPORT - /* base type for file offsets and file sizes */ -# if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) - typedef long long zoff_t; -# else - /* all other compilers use this as intrinsic 64-bit type */ - typedef __int64 zoff_t; -# endif -# define ZOFF_T_DEFINED - - /* user-defined types and format strings for 64-bit numbers and - * file pointer functions (these depend on the rtl library and library - * headers used; they are NOT compiler-specific) - */ -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__LCC__) - /* MS C and VC, MinGW32, lcc32 */ - /* these systems use the Microsoft C RTL */ - - /* 64-bit stat struct */ - typedef struct _stati64 z_stat; -# define Z_STAT_DEFINED - -# ifdef __LCC__ - /* The LCC headers lack these declarations of MSC rtl functions in - sys/stat.h. */ - struct _stati64 { - unsigned int st_dev; - unsigned short st_ino; - unsigned short st_mode; - short st_nlink; - short st_uid; - short st_gid; - unsigned int st_rdev; - __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; - }; - int _stati64(const char *, struct _stati64 *); - int _fstati64(int, struct _stati64 *); - __int64 _lseeki64(int, __int64, int); -# endif /* __LCC__ */ - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "I64" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n" - -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C 5.2 or newer */ - - /* 64-bit stat struct */ - typedef struct stati64 z_stat; -# define Z_STAT_DEFINED - - /* Borland C does not provide a 64-bit-capable _lseeki64(), so we - need to use the stdio.h stream functions instead. */ -# ifndef USE_STRM_INPUT -# define USE_STRM_INPUT -# endif - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "L" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9Lu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9Lu %9lu file%s\n" - -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) - /* WATCOM C */ - - /* 64-bit stat struct */ - typedef struct _stati64 z_stat; -# define Z_STAT_DEFINED - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "ll" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9llu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9llu %9lu file%s\n" - -# elif (defined(__IBMC__) && (__IBMC__ >= 350)) - /* IBM C */ - - /* 64-bit stat struct */ - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "I64" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n" - -# endif - -#endif - -/* If port has LARGE_FILE_SUPPORT then define here - to make automatic unless overridden */ - -#ifndef LARGE_FILE_SUPPORT -# ifndef NO_LARGE_FILE_SUPPORT -# if defined(_MSC_VER) || defined(__MINGW32__) -# define LARGE_FILE_SUPPORT -# elif defined(__LCC__) - /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */ -# elif defined(__CYGWIN__) -# define LARGE_FILE_SUPPORT -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) -# define LARGE_FILE_SUPPORT -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */ -# endif -# endif -#endif - - -#ifndef LARGE_FILE_SUPPORT - /* No Large File Support */ - - /* base type for file offsets and file sizes */ - typedef long zoff_t; -# define ZOFF_T_DEFINED - - /* stat struct */ - typedef struct stat z_stat; -# define Z_STAT_DEFINED - -# define FZOFFT_FMT "l" -# define FZOFFT_HEX_WID_VALUE "8" - - -# define SHORTHDRSTATS "%9lu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9lu %9lu file%s\n" - -#endif /* LARGE_FILE_SUPPORT */ - -#endif /* !__w32cfg_h */ diff --git a/data/windows/unzipfx-catarina/win32/win32.c b/data/windows/unzipfx-catarina/win32/win32.c deleted file mode 100644 index 410207f..0000000 --- a/data/windows/unzipfx-catarina/win32/win32.c +++ /dev/null @@ -1,3139 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - win32.c - - 32-bit Windows-specific (NT/9x) routines for use with Info-ZIP's UnZip 5.3 - and later. - - Contains: GetLoadPath() - Opendir() - Readdir() - Closedir() - SetSD() set security descriptor on file - FindSDExtraField() extract SD e.f. block from extra field - IsWinNT() indicate type of WIN32 platform - test_NTSD() test integrity of NT security data - utime2NtfsFileTime() - utime2VFatFileTime() - FStampIsLocTime() - NtfsFileTime2utime() - VFatFileTime2utime() - getNTfiletime() - SetFileSize() - close_outfile() - defer_dir_attribs() - set_direc_attribs() - stamp_file() - isfloppy() - NTQueryVolInfo() - IsVolumeOldFAT() - do_wild() - mapattr() - mapname() - maskDOSdevice() - map2fat() - checkdir() - dateformat() - dateseparator() - version() - screensize() - zstat_win32() - conv_to_rule() - GetPlatformLocalTimezone() - getch_win32() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "../unzip.h" -#include /* must be AFTER unzip.h to avoid struct G problems */ -#ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -#endif -#include "../win32/nt.h" - -#ifndef FUNZIP /* most of this file is not used with fUnZip */ - -/* some non-MS runtime headers (e.g. lcc) may miss this definition */ -#ifndef FILE_WRITE_ATTRIBUTES -# define FILE_WRITE_ATTRIBUTES 0x0100 -#endif - -#if (defined(__EMX__) || defined(__CYGWIN__)) -# define MKDIR(path,mode) mkdir(path,mode) -#else -# define MKDIR(path,mode) mkdir(path) -#endif - -#ifdef HAVE_WORKING_DIRENT_H -# undef HAVE_WORKING_DIRENT_H -#endif -/* The emxrtl dirent support of (__GO32__ || __EMX__) converts to lowercase! */ -#if defined(__CYGWIN__) -# define HAVE_WORKING_DIRENT_H -#endif - -#ifndef SFX -# ifdef HAVE_WORKING_DIRENT_H -# include /* use readdir() */ -# define zdirent dirent -# define zDIR DIR -# define Opendir opendir -# define Readdir readdir -# define Closedir closedir -# else /* !HAVE_WORKING_DIRENT_H */ - typedef struct zdirent { - char reserved [21]; - char ff_attrib; - short ff_ftime; - short ff_fdate; - long size; - char d_name[MAX_PATH]; - int d_first; - HANDLE d_hFindFile; - } zDIR; - - static zDIR *Opendir (const char *n); - static struct zdirent *Readdir (zDIR *d); - static void Closedir (zDIR *d); -# endif /* ?HAVE_WORKING_DIRENT_H */ -#endif /* !SFX */ - -#ifdef SET_DIR_ATTRIB -typedef struct NTdirattr { /* struct for holding unix style directory */ - struct NTdirattr *next; /* info until can be sorted and set at end */ - char *fn; /* filename of directory */ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - FILETIME Accft; /* NT file time type, `last access' time */ - FILETIME Creft; /* NT file time type, `file creation' time */ - int gotTime; - unsigned perms; /* same as min_info.file_attr */ -#ifdef NTSD_EAS - unsigned SDlen; /* length of SD data in buf */ -#endif - char buf[1]; /* buffer stub for directory SD and name */ -} NTdirattr; -#define NtAtt(d) ((NTdirattr *)d) /* typecast shortcut */ -#endif /* SET_DIR_ATTRIB */ - - -/* Function prototypes */ -#ifdef NTSD_EAS - static int SetSD(__GPRO__ char *path, unsigned fperms, - uch *eb_ptr, unsigned eb_len); - static int FindSDExtraField(__GPRO__ - uch *ef_ptr, unsigned ef_len, - uch **p_ebSD_ptr, unsigned *p_ebSD_len); -#endif - -#ifndef NO_W32TIMES_IZFIX - static void utime2NtfsFileTime(time_t ut, FILETIME *pft); -#endif -static void utime2VFatFileTime(time_t ut, FILETIME *pft, int clipDosMin); -#if (defined(W32_STAT_BANDAID) && !defined(NO_W32TIMES_IZFIX)) - static int NtfsFileTime2utime(const FILETIME *pft, time_t *ut); -#endif -#ifdef W32_STAT_BANDAID - static int VFatFileTime2utime(const FILETIME *pft, time_t *ut); -#endif -static int FStampIsLocTime(__GPRO__ const char *path); - - -static int getNTfiletime (__GPRO__ FILETIME *pModFT, FILETIME *pAccFT, - FILETIME *pCreFT); -static int isfloppy (int nDrive); -static int NTQueryVolInfo (__GPRO__ const char *name); -static int IsVolumeOldFAT (__GPRO__ const char *name); -static void maskDOSdevice (__GPRO__ char *pathcomp); -static void map2fat (char *pathcomp, char **pEndFAT); - - -#if (defined(__MINGW32__) && !defined(USE_MINGW_GLOBBING)) - int _CRT_glob = 0; /* suppress command line globbing by C RTL */ -#endif - -#ifdef ACORN_FTYPE_NFS -/* Acorn bits for NFS filetyping */ -typedef struct { - uch ID[2]; - uch size[2]; - uch ID_2[4]; - uch loadaddr[4]; - uch execaddr[4]; - uch attr[4]; -} RO_extra_block; - -#endif /* ACORN_FTYPE_NFS */ - -/* static int created_dir; */ /* used by mapname(), checkdir() */ -/* static int renamed_fullpath; */ /* ditto */ -/* static int fnlen; */ /* ditto */ -/* static unsigned nLabelDrive; */ /* ditto */ - -extern char Far TruncNTSD[]; /* in extract.c */ - - - -#ifdef SFX - -/**************************/ -/* Function GetLoadPath() */ -/**************************/ - -char *GetLoadPath(__GPRO) -{ -#ifdef MSC - extern char *_pgmptr; - return _pgmptr; - -#else /* use generic API call */ - - GetModuleFileName(NULL, G.filename, FILNAMSIZ); - _ISO_INTERN(G.filename); /* translate to codepage of C rtl's stdio */ - return G.filename; -#endif - -} /* end function GetLoadPath() */ - - - - - -#else /* !SFX */ - -#ifndef HAVE_WORKING_DIRENT_H - -/**********************/ /* Borrowed from ZIP 2.0 sources */ -/* Function Opendir() */ /* Difference: no special handling for */ -/**********************/ /* hidden or system files. */ - -static zDIR *Opendir(n) - const char *n; /* directory to open */ -{ - zDIR *d; /* malloc'd return value */ - char *p; /* malloc'd temporary string */ - WIN32_FIND_DATAA fd; - extent len = strlen(n); - - /* Start searching for files in directory n */ - - if ((d = (zDIR *)malloc(sizeof(zDIR))) == NULL || - (p = malloc(strlen(n) + 5)) == NULL) - { - if (d != (zDIR *)NULL) - free((void *)d); - return (zDIR *)NULL; - } - INTERN_TO_ISO(n, p); - if (len > 0) { - if (p[len-1] == ':') - p[len++] = '.'; /* x: => x:. */ - else if (p[len-1] == '/' || p[len-1] == '\\') - --len; /* foo/ => foo */ - } - strcpy(p+len, "/*"); - - if (INVALID_HANDLE_VALUE == (d->d_hFindFile = FindFirstFileA(p, &fd))) { - free((zvoid *)d); - free((zvoid *)p); - return NULL; - } - strcpy(d->d_name, fd.cFileName); - - free((zvoid *)p); - d->d_first = 1; - return d; - -} /* end of function Opendir() */ - - - - -/**********************/ /* Borrowed from ZIP 2.0 sources */ -/* Function Readdir() */ /* Difference: no special handling for */ -/**********************/ /* hidden or system files. */ - -static struct zdirent *Readdir(d) - zDIR *d; /* directory stream from which to read */ -{ - /* Return pointer to first or next directory entry, or NULL if end. */ - - if ( d->d_first ) - d->d_first = 0; - else - { - WIN32_FIND_DATAA fd; - - if ( !FindNextFileA(d->d_hFindFile, &fd) ) - return NULL; - - ISO_TO_INTERN(fd.cFileName, d->d_name); - } - return (struct zdirent *)d; - -} /* end of function Readdir() */ - - - - -/***********************/ -/* Function Closedir() */ /* Borrowed from ZIP 2.0 sources */ -/***********************/ - -static void Closedir(d) - zDIR *d; /* directory stream to close */ -{ - FindClose(d->d_hFindFile); - free(d); -} - -#endif /* !HAVE_WORKING_DIRENT_H */ -#endif /* ?SFX */ - - - - -#ifdef NTSD_EAS - -/**********************/ -/* Function SetSD() */ /* return almost-PK errors */ -/**********************/ - -static int SetSD(__G__ path, fperms, eb_ptr, eb_len) - __GDEF - char *path; - unsigned fperms; - uch *eb_ptr; - unsigned eb_len; -{ - ulg ntsd_ucSize; - VOLUMECAPS VolumeCaps; - uch *security_data; - int error; - - ntsd_ucSize = makelong(eb_ptr + (EB_HEADSIZE+EB_UCSIZE_P)); - if (ntsd_ucSize > 0L && eb_len <= (EB_NTSD_L_LEN + EB_CMPRHEADLEN)) - return IZ_EF_TRUNC; /* no compressed data! */ - - /* provide useful input */ - VolumeCaps.dwFileAttributes = fperms; - VolumeCaps.bUsePrivileges = (uO.X_flag > 1); - - /* check target volume capabilities - just fall through - * and try if fail */ - if (GetVolumeCaps(G.rootpath, path, &VolumeCaps) && - !(VolumeCaps.dwFileSystemFlags & FS_PERSISTENT_ACLS)) - return PK_OK; - - /* allocate storage for uncompressed data */ - security_data = (uch *)malloc((extent)ntsd_ucSize); - if (security_data == (uch *)NULL) - return PK_MEM4; - - error = memextract(__G__ security_data, ntsd_ucSize, - (eb_ptr + (EB_HEADSIZE+EB_NTSD_L_LEN)), (ulg)(eb_len - EB_NTSD_L_LEN)); - - if (error == PK_OK) { - if (SecuritySet(path, &VolumeCaps, security_data)) { - error = PK_COOL; - if (!uO.tflag && QCOND2) - Info(slide, 0, ((char *)slide, " (%ld bytes security)", - ntsd_ucSize)); - } - } - - free(security_data); - return error; -} - - - - -/********************************/ /* scan extra fields for something */ -/* Function FindSDExtraField() */ /* we happen to know */ -/********************************/ -/* Returns TRUE when a valid NTFS SD block is found. - * Address and size of the NTSD e.f. block are passed up to the caller. - * In case of more than one valid NTSD block in the e.f., the last block - * found is passed up. - * Returns FALSE and leaves the content of the ebSD_ptr and ebSD_len - * parameters untouched when no valid NTFS SD block is found. */ -static int FindSDExtraField(__GPRO__ - uch *ef_ptr, unsigned ef_len, - uch **p_ebSD_ptr, unsigned *p_ebSD_len) -{ - int rc = FALSE; - - if (!uO.X_flag) - return FALSE; /* user said don't process ACLs; for now, no other - extra block types are handled here */ - - while (ef_len >= EB_HEADSIZE) - { - unsigned eb_id = makeword(EB_ID + ef_ptr); - unsigned eb_len = makeword(EB_LEN + ef_ptr); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "FindSDExtraField: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) - { - /* process security descriptor extra data if: - Caller is WinNT AND - Target local/remote drive supports acls AND - Target file is not a directory (else we defer processing - until later) - */ - case EF_NTSD: - if (!IsWinNT()) - break; /* OS not capable of handling NTFS attributes */ - - if (eb_len < EB_NTSD_L_LEN) - break; /* not a valid NTSD extra field */ - - /* check if we know how to handle this version */ - if (*(ef_ptr + (EB_HEADSIZE+EB_NTSD_VERSION)) - > (uch)EB_NTSD_MAX_VER) - break; - - *p_ebSD_ptr = ef_ptr; - *p_ebSD_len = eb_len; - rc = TRUE; - break; - -#ifdef DEBUG - case EF_OS2: - case EF_AV: - case EF_PKVMS: - case EF_PKW32: - case EF_PKUNIX: - case EF_IZVMS: - case EF_IZUNIX: - case EF_IZUNIX2: - case EF_TIME: - case EF_MAC3: - case EF_JLMAC: - case EF_ZIPIT: - case EF_VMCMS: - case EF_MVS: - case EF_ACL: - case EF_ATHEOS: - case EF_BEOS: - case EF_QDOS: - case EF_AOSVS: - case EF_SPARK: - case EF_MD5: - case EF_ASIUNIX: - break; /* shut up for other known e.f. blocks */ -#endif /* DEBUG */ - - default: - Trace((stderr, - "FindSDExtraField: unknown extra field block, ID=%u\n", - eb_id)); - break; - } - - ef_ptr += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return rc; -} - - - - -#ifndef SFX - -/**************************/ -/* Function test_NTSD() */ /* returns PK_WARN when NTSD data is invalid */ -/**************************/ - -#ifdef __BORLANDC__ -/* Turn off warning about not using all parameters for this function only */ -#pragma argsused -#endif -int test_NTSD(__G__ eb, eb_size, eb_ucptr, eb_ucsize) - __GDEF - uch *eb; - unsigned eb_size; - uch *eb_ucptr; - ulg eb_ucsize; -{ - return (ValidateSecurity(eb_ucptr) ? PK_OK : PK_WARN); -} /* end function test_NTSD() */ - -#endif /* !SFX */ -#endif /* NTSD_EAS */ - - - - -/**********************/ -/* Function IsWinNT() */ -/**********************/ - -int IsWinNT(void) /* returns TRUE if real NT, FALSE if Win9x or Win32s */ -{ - static DWORD g_PlatformId = 0xFFFFFFFF; /* saved platform indicator */ - - if (g_PlatformId == 0xFFFFFFFF) { - /* note: GetVersionEx() doesn't exist on WinNT 3.1 */ - if (GetVersion() < 0x80000000) - g_PlatformId = TRUE; - else - g_PlatformId = FALSE; - } - return (int)g_PlatformId; -} - - -/* DEBUG_TIME insertion: */ -#ifdef DEBUG_TIME -static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft); - -static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft) -{ - SYSTEMTIME w32tm; - int rval; - - rval = FileTimeToSystemTime(pft, &w32tm); - if (!rval) { - fprintf(hdo, "%s\n %08lX,%08lX (%s) -> Conversion failed !!!\n", - TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), - (isloc ? "local" : "UTC")); - } else { - fprintf(hdo, "%s\n %08lx,%08lx -> %04u-%02u-%02u, %02u:%02u:%02u %s\n", - TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), - w32tm.wYear, w32tm.wMonth, w32tm.wDay, w32tm.wHour, - w32tm.wMinute, w32tm.wSecond, (isloc ? "local" : "UTC")); - } - return rval; -} -#define FTTrace(x) show_NTFileTime x -#else -#define FTTrace(x) -#endif /* DEBUG_TIME */ -/* end of DEBUG_TIME insertion */ - -#ifndef IZ_USE_INT64 -# if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) - typedef long long LLONG64; - typedef unsigned long long ULLNG64; -# define IZ_USE_INT64 -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif (defined(_MSC_VER) && (_MSC_VER >= 1100)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif (defined(__IBMC__) && (__IBMC__ >= 350)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif defined(HAVE_INT64) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# endif -#endif - -/* scale factor and offset for conversion time_t -> FILETIME */ -#define NT_QUANTA_PER_UNIX 10000000L -#define UNIX_TIME_ZERO_HI 0x019DB1DEUL -#define UNIX_TIME_ZERO_LO 0xD53E8000UL -/* special FILETIME values for bound-checks */ -#define UNIX_TIME_UMAX_HI 0x0236485EUL -#define UNIX_TIME_UMAX_LO 0xD4A5E980UL -#define UNIX_TIME_SMIN_HI 0x0151669EUL -#define UNIX_TIME_SMIN_LO 0xD53E8000UL -#define UNIX_TIME_SMAX_HI 0x01E9FD1EUL -#define UNIX_TIME_SMAX_LO 0xD4A5E980UL -#define DOSTIME_MIN_FT_HI 0x01A8E79FUL -#define DOSTIME_MIN_FT_LO 0xE1D58000UL -/* time_t equivalent of DOSTIME_MINIMUM */ -#define UTIME_1980_JAN_01_00_00 315532800L - - -#ifndef NO_W32TIMES_IZFIX -/*********************************/ -/* Function utime2NtfsFileTime() */ /* convert Unix time_t format into the */ -/*********************************/ /* form used by SetFileTime() in NT/9x */ - -static void utime2NtfsFileTime(time_t ut, FILETIME *pft) -{ -#ifdef IZ_USE_INT64 - ULLNG64 NTtime; - - /* NT_QUANTA_PER_UNIX is small enough so that "ut * NT_QUANTA_PER_UNIX" - * cannot overflow in 64-bit signed calculation, regardless whether "ut" - * is signed or unsigned. */ - NTtime = ((LLONG64)ut * NT_QUANTA_PER_UNIX) + - ((ULLNG64)UNIX_TIME_ZERO_LO + ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); - pft->dwLowDateTime = (DWORD)NTtime; - pft->dwHighDateTime = (DWORD)(NTtime >> 32); - -#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ - unsigned int b1, b2, carry = 0; - unsigned long r0, r1, r2, r3; - long r4; /* signed, to catch environments with signed time_t */ - - b1 = ut & 0xFFFF; - b2 = (ut >> 16) & 0xFFFF; /* if ut is over 32 bits, too bad */ - r1 = b1 * (NT_QUANTA_PER_UNIX & 0xFFFF); - r2 = b1 * (NT_QUANTA_PER_UNIX >> 16); - r3 = b2 * (NT_QUANTA_PER_UNIX & 0xFFFF); - r4 = b2 * (NT_QUANTA_PER_UNIX >> 16); - r0 = (r1 + (r2 << 16)) & 0xFFFFFFFFL; - if (r0 < r1) - carry++; - r1 = r0; - r0 = (r0 + (r3 << 16)) & 0xFFFFFFFFL; - if (r0 < r1) - carry++; - pft->dwLowDateTime = r0 + UNIX_TIME_ZERO_LO; - if (pft->dwLowDateTime < r0) - carry++; - pft->dwHighDateTime = r4 + (r2 >> 16) + (r3 >> 16) - + UNIX_TIME_ZERO_HI + carry; -#endif /* ?IZ_USE_INT64 */ - -} /* end function utime2NtfsFileTime() */ -#endif /* !NO_W32TIMES_IZFIX */ - - - -/*********************************/ -/* Function utime2VFatFileTime() */ /* convert Unix time_t format into the */ -/*********************************/ /* form used by SetFileTime() in NT/9x */ - -static void utime2VFatFileTime(time_t ut, FILETIME *pft, int clipDosMin) -{ - time_t utc = ut; - struct tm *ltm; - SYSTEMTIME w32tm; - FILETIME lft; - - /* The milliseconds field gets always initialized to 0. */ - w32tm.wMilliseconds = 0; - -#ifdef __BORLANDC__ /* Borland C++ 5.x crashes when trying to reference tm */ - if (utc < UTIME_1980_JAN_01_00_00) - utc = UTIME_1980_JAN_01_00_00; -#endif - ltm = localtime(&utc); - if (ltm == (struct tm *)NULL) - /* localtime() did not accept given utc time value; try to use - the UTC value */ - ltm = gmtime(&utc); - if (ltm == (struct tm *)NULL) { - if (ut <= (UTIME_1980_JAN_01_00_00 + 86400)) { - /* use DOSTIME_MINIMUM date instead of "early" failure dates */ - w32tm.wYear = 1980; - w32tm.wMonth = 1; - w32tm.wDay = 1; - w32tm.wHour = 0; - w32tm.wMinute = 0; - w32tm.wSecond = 0; - } else { - /* as a last resort, use the current system time */ - GetLocalTime(&w32tm); - } - } else if (clipDosMin && (ltm->tm_year < 80)) { - w32tm.wYear = 1980; - w32tm.wMonth = 1; - w32tm.wDay = 1; - w32tm.wHour = 0; - w32tm.wMinute = 0; - w32tm.wSecond = 0; - } else { - w32tm.wYear = ltm->tm_year + 1900; /* year + 1900 -> year */ - w32tm.wMonth = ltm->tm_mon + 1; /* 0..11 -> 1..12 */ - w32tm.wDay = ltm->tm_mday; /* 1..31 */ - w32tm.wHour = ltm->tm_hour; /* 0..23 */ - w32tm.wMinute = ltm->tm_min; /* 0..59 */ - w32tm.wSecond = ltm->tm_sec; /* 0..61 in ANSI C */ - } - - SystemTimeToFileTime(&w32tm, &lft); - LocalFileTimeToFileTime(&lft, pft); - -} /* end function utime2VFatFileTime() */ - - - - /* nonzero if `y' is a leap year, else zero */ -#define leap(y) (((y)%4 == 0 && (y)%100 != 0) || (y)%400 == 0) - /* number of leap years from 1970 to `y' (not including `y' itself) */ -#define nleap(y) (((y)-1969)/4 - ((y)-1901)/100 + ((y)-1601)/400) - -extern ZCONST ush ydays[]; /* defined in fileio.c */ - -#if (defined(W32_STAT_BANDAID) && !defined(NO_W32TIMES_IZFIX)) -/*********************************/ -/* Function NtfsFileTime2utime() */ -/*********************************/ - -static int NtfsFileTime2utime(const FILETIME *pft, time_t *ut) -{ -#ifdef IZ_USE_INT64 - ULLNG64 NTtime; - - NTtime = ((ULLNG64)pft->dwLowDateTime + - ((ULLNG64)pft->dwHighDateTime << 32)); - -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if (NTtime < ((ULLNG64)UNIX_TIME_SMIN_LO + - ((ULLNG64)UNIX_TIME_SMIN_HI << 32))) { - *ut = (time_t)LONG_MIN; - return FALSE; - } - if (NTtime > ((ULLNG64)UNIX_TIME_SMAX_LO + - ((ULLNG64)UNIX_TIME_SMAX_HI << 32))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if (NTtime < ((ULLNG64)UNIX_TIME_ZERO_LO + - ((ULLNG64)UNIX_TIME_ZERO_HI << 32))) { - *ut = (time_t)0; - return FALSE; - } - if (NTtime > ((ULLNG64)UNIX_TIME_UMAX_LO + - ((ULLNG64)UNIX_TIME_UMAX_HI << 32))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - - NTtime -= ((ULLNG64)UNIX_TIME_ZERO_LO + - ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); - *ut = (time_t)(NTtime / (unsigned long)NT_QUANTA_PER_UNIX); - return TRUE; -#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ - time_t days; - SYSTEMTIME w32tm; - -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && - (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { - *ut = (time_t)LONG_MIN; - return FALSE; - if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || - ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && - (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { - *ut = (time_t)0; - return FALSE; - } - if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - - FileTimeToSystemTime(pft, &w32tm); - - /* set `days' to the number of days into the year */ - days = w32tm.wDay - 1 + ydays[w32tm.wMonth-1] + - (w32tm.wMonth > 2 && leap (w32tm.wYear)); - - /* now set `days' to the number of days since 1 Jan 1970 */ - days += 365 * (time_t)(w32tm.wYear - 1970) + - (time_t)(nleap(w32tm.wYear)); - - *ut = (time_t)(86400L * days + 3600L * (time_t)w32tm.wHour + - (time_t)(60 * w32tm.wMinute + w32tm.wSecond)); - return TRUE; -#endif /* ?IZ_USE_INT64 */ -} /* end function NtfsFileTime2utime() */ -#endif /* W32_STAT_BANDAID && !NO_W32TIMES_IZFIX */ - - - -#ifdef W32_STAT_BANDAID -/*********************************/ -/* Function VFatFileTime2utime() */ -/*********************************/ - -static int VFatFileTime2utime(const FILETIME *pft, time_t *ut) -{ - FILETIME lft; -#ifndef HAVE_MKTIME - WORD wDOSDate, wDOSTime; -#else - SYSTEMTIME w32tm; - struct tm ltm; -#endif - - if (!FileTimeToLocalFileTime(pft, &lft)) { - /* if pft cannot be converted to local time, set ut to current time */ - time(ut); - return FALSE; - } - FTTrace((stdout, "VFatFT2utime, feed for mktime()", 1, &lft)); -#ifndef HAVE_MKTIME - /* This version of the FILETIME-to-UNIXTIME conversion function - * uses DOS-DATE-TIME format as intermediate stage. For modification - * and access times, this is no problem. But, the extra fine resolution - * of the VFAT-stored creation time gets lost. - */ - if (!FileTimeToDosDateTime(&lft, &wDOSDate, &wDOSTime)) { - static const FILETIME dosmin_ft = - {DOSTIME_MIN_FT_LO, DOSTIME_MIN_FT_HI}; - if (CompareFileTime(&lft, &dosmin_ft) <= 0) { - /* underflow -> set to minimum DOS time */ - wDOSDate = (WORD)((DWORD)DOSTIME_MINIMUM >> 16); - wDOSTime = (WORD)DOSTIME_MINIMUM; - } else { - /* overflow -> set to maximum DOS time */ - wDOSDate = (WORD)0xFF9F; /* 2107-12-31 */ - wDOSTime = (WORD)0xBF7D; /* 23:59:58 */ - } - } - TTrace((stdout,"DosDateTime is %04u-%02u-%02u %02u:%02u:%02u\n", - (unsigned)((wDOSDate>>9)&0x7f)+1980,(unsigned)((wDOSDate>>5)&0x0f), - (unsigned)(wDOSDate&0x1f),(unsigned)((wDOSTime>>11)&0x1f), - (unsigned)((wDOSTime>>5)&0x3f),(unsigned)((wDOSTime<<1)&0x3e))); - *ut = dos_to_unix_time(((ulg)wDOSDate << 16) | (ulg)wDOSTime); - - /* a cheap error check: dos_to_unix_time() only returns an odd time - * when clipping at maximum time_t value. DOS_DATE_TIME values have - * a resolution of 2 seconds and are therefore even numbers. - */ - return (((*ut)&1) == (time_t)0); -#else /* HAVE_MKTIME */ - FileTimeToSystemTime(&lft, &w32tm); -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ - /* TODO: The range checks are not accurate, the actual limits may - * be off by one daylight-saving-time shift (typically 1 hour), - * depending on the current state of "is_dst". - */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && - (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { - *ut = (time_t)LONG_MIN; - return FALSE; - if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || - ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && - (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { - *ut = (time_t)0; - return FALSE; - } - if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - ltm.tm_year = w32tm.wYear - 1900; - ltm.tm_mon = w32tm.wMonth - 1; - ltm.tm_mday = w32tm.wDay; - ltm.tm_hour = w32tm.wHour; - ltm.tm_min = w32tm.wMinute; - ltm.tm_sec = w32tm.wSecond; - ltm.tm_isdst = -1; /* let mktime determine if DST is in effect */ - *ut = mktime(<m); - - /* a cheap error check: mktime returns "(time_t)-1L" on conversion errors. - * Normally, we would have to apply a consistency check because "-1" - * could also be a valid time. But, it is quite unlikely to read back odd - * time numbers from file systems that store time stamps in DOS format. - * (The only known exception is creation time on VFAT partitions.) - */ - return (*ut != (time_t)-1L); -#endif /* ?HAVE_MKTIME */ - -} /* end function VFatFileTime2utime() */ -#endif /* W32_STAT_BANDAID */ - - - -/******************************/ -/* Function FStampIsLocTime() */ -/******************************/ - -static int FStampIsLocTime(__GPRO__ const char *path) -{ - return (NTQueryVolInfo(__G__ path) ? G.lastVolLocTim : FALSE); -} - - - -#ifndef NO_W32TIMES_IZFIX -# define UTIME_2_IZFILETIME(ut, pft) \ - if (fs_uses_loctime) {utime2VFatFileTime(ut, pft, TRUE);} \ - else {utime2NtfsFileTime(ut, pft);} -#else -# define UTIME_2_IZFILETIME(ut, pft) \ - utime2VFatFileTime(ut, pft, fs_uses_loctime); -#endif - - - -/****************************/ /* Get the file time in a format that */ -/* Function getNTfiletime() */ /* can be used by SetFileTime() in NT */ -/****************************/ - -static int getNTfiletime(__G__ pModFT, pAccFT, pCreFT) - __GDEF - FILETIME *pModFT; - FILETIME *pAccFT; - FILETIME *pCreFT; -{ -#ifdef USE_EF_UT_TIME - unsigned eb_izux_flg; - iztimes z_utime; /* struct for Unix-style actime & modtime, + creatime */ -#endif - int fs_uses_loctime = FStampIsLocTime(__G__ G.filename); - - /* Copy and/or convert time and date variables, if necessary; - * return a flag indicating which time stamps are available. */ -#ifdef USE_EF_UT_TIME - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - ((eb_izux_flg = ef_scan_for_izux(G.extra_field, - G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, - &z_utime, NULL)) & EB_UT_FL_MTIME)) - { - TTrace((stderr, "getNTfiletime: Unix e.f. modif. time = %lu\n", - z_utime.mtime)); - UTIME_2_IZFILETIME(z_utime.mtime, pModFT) - if (eb_izux_flg & EB_UT_FL_ATIME) { - UTIME_2_IZFILETIME(z_utime.atime, pAccFT) - } - if (eb_izux_flg & EB_UT_FL_CTIME) { - UTIME_2_IZFILETIME(z_utime.ctime, pCreFT) - } - return (int)eb_izux_flg; - } -#endif /* USE_EF_UT_TIME */ -#ifndef NO_W32TIMES_IZFIX - if (!fs_uses_loctime) { - time_t ux_modtime; - - ux_modtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - utime2NtfsFileTime(ux_modtime, pModFT); - } else -#endif /* NO_W32TIMES_IZFIX */ - { - FILETIME lft; - - DosDateTimeToFileTime((WORD)(G.lrec.last_mod_dos_datetime >> 16), - (WORD)(G.lrec.last_mod_dos_datetime & 0xFFFFL), - &lft); - LocalFileTimeToFileTime(&lft, pModFT); - } - *pAccFT = *pModFT; - return (EB_UT_FL_MTIME | EB_UT_FL_ATIME); - -} /* end function getNTfiletime() */ - - - - -/**************************/ -/* Function SetFileSize() */ -/**************************/ - -int SetFileSize(FILE *file, zusz_t filesize) -{ -#ifdef __RSXNT__ - /* RSXNT environment lacks a translation function from C file pointer - to Win32-API file handle. So, simply do nothing. */ - return 0; -#else /* !__RSXNT__ */ - /* not yet verified, if that really creates an unfragmented file - rommel@ars.de - */ - HANDLE os_fh; -#ifdef Z_UINT8_DEFINED - LARGE_INTEGER fsbuf; -#endif - - /* Win9x supports FAT file system, only; presetting file size does - not help to prevent fragmentation. */ - if (!IsWinNT()) return 0; - - /* Win32-API calls require access to the Win32 file handle. - The interface function used to retrieve the Win32 handle for - a file opened by the C rtl is non-standard and may not be - available for every Win32 compiler environment. - (see also win32/win32.c of the Zip distribution) - */ - os_fh = (HANDLE)_get_osfhandle(fileno(file)); - /* move file pointer behind the last byte of the expected file size */ -#ifdef Z_UINT8_DEFINED - fsbuf.QuadPart = filesize; - if ((SetFilePointer(os_fh, fsbuf.LowPart, &fsbuf.HighPart, FILE_BEGIN) - == 0xFFFFFFFF) && GetLastError() != NO_ERROR) -#else - if (SetFilePointer(os_fh, (ulg)filesize, 0, FILE_BEGIN) == 0xFFFFFFFF) -#endif - return -1; - /* extend/truncate file to the current position */ - if (SetEndOfFile(os_fh) == 0) - return -1; - /* move file position pointer back to the start of the file! */ - return (SetFilePointer(os_fh, 0, 0, FILE_BEGIN) == 0xFFFFFFFF) ? -1 : 0; -#endif /* ?__RSXNT__ */ -} /* end function SetFileSize() */ - - - - -/****************************/ -/* Function close_outfile() */ -/****************************/ - -void close_outfile(__G) - __GDEF -{ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - FILETIME Accft; /* NT file time type, `last access' time */ - FILETIME Creft; /* NT file time type, `file creation' time */ - HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */ - int gotTime; -#ifdef NTSD_EAS - uch *ebSDptr; - unsigned ebSDlen; -#endif -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - -#ifndef __RSXNT__ - if (IsWinNT()) { - /* Truncate the file to the current position. - * This is needed to remove excess allocation in case the - * extraction has failed or stopped prematurely. */ - SetEndOfFile((HANDLE)_get_osfhandle(fileno(G.outfile))); - } -#endif - - /* Close the file and then re-open it using the Win32 - * CreateFile call, so that the file can be created - * with GENERIC_WRITE access, otherwise the SetFileTime - * call will fail. */ - fclose(G.outfile); - - /* don't set the time stamp and attributes on standard output */ - if (uO.cflag) - return; - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - gotTime = getNTfiletime(__G__ &Modft, &Accft, &Creft); - - /* open a handle to the file before processing extra fields; - we do this in case new security on file prevents us from updating - time stamps */ - hFile = CreateFileA(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - } else { - gotTime = 0; - } - - /* sfield@microsoft.com: set attributes before time in case we decide to - support other filetime members later. This also allows us to apply - attributes before the security is changed, which may prevent this - from succeeding otherwise. Also, since most files don't have - any interesting attributes, only change them if something other than - FILE_ATTRIBUTE_ARCHIVE appears in the attributes. This works well - as an optimization because FILE_ATTRIBUTE_ARCHIVE gets applied to the - file anyway, when it's created new. */ - if ((G.pInfo->file_attr & 0x7F) & ~FILE_ATTRIBUTE_ARCHIVE) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes\n", - (int)GetLastError())); - } - -#ifdef NTSD_EAS - /* set NTFS SD extra fields */ - if (G.extra_field && /* zipfile extra field may have extended attribs */ - FindSDExtraField(__G__ G.extra_field, G.lrec.extra_field_length, - &ebSDptr, &ebSDlen)) - { - int err = SetSD(__G__ Ansi_Fname, G.pInfo->file_attr, - ebSDptr, ebSDlen); - - if (err == IZ_EF_TRUNC) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), - ebSDlen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), uO.qflag? "\n":"")); - } - } -#endif /* NTSD_EAS */ - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - if ( hFile == INVALID_HANDLE_VALUE ) - Info(slide, 1, ((char *)slide, - "\nCreateFile() error %d when trying set file time\n", - (int)GetLastError())); - else { - if (gotTime) { - FILETIME *pModft = (gotTime & EB_UT_FL_MTIME) ? &Modft : NULL; - FILETIME *pAccft = (gotTime & EB_UT_FL_ATIME) ? &Accft : NULL; - FILETIME *pCreft = (gotTime & EB_UT_FL_CTIME) ? &Creft : NULL; - - if (!SetFileTime(hFile, pCreft, pAccft, pModft)) - Info(slide, 0, ((char *)slide, - "\nSetFileTime failed: %d\n", (int)GetLastError())); - } - CloseHandle(hFile); - } - } - - return; - -#undef Ansi_Fname - -} /* end function close_outfile() */ - - - - -#ifdef SET_DIR_ATTRIB - -int defer_dir_attribs(__G__ pd) - __GDEF - direntry **pd; -{ - NTdirattr *d_entry; -#ifdef NTSD_EAS - uch *ebSDptr; - unsigned ebSDlen; -#endif - - /* Win9x does not support setting directory time stamps. */ - if (!IsWinNT()) { - *pd = (direntry *)NULL; - return PK_OK; - } - -#ifdef NTSD_EAS - /* set extended attributes from extra fields */ - if (G.extra_field && /* zipfile e.f. may have extended attribs */ - FindSDExtraField(__G__ G.extra_field, G.lrec.extra_field_length, - &ebSDptr, &ebSDlen)) { - /* ebSDlen contains the payload size of the e.f. block, but - we store it including the e.b. header. */ - ebSDlen += EB_HEADSIZE; - } else { - /* no NTSD e.f. block -> no space needed to allocate */ - ebSDlen = 0; - } -#endif /* NTSD_EAS */ - - d_entry = (NTdirattr *)malloc(sizeof(NTdirattr) -#ifdef NTSD_EAS - + ebSDlen -#endif - + strlen(G.filename)); - *pd = (direntry *)d_entry; - if (d_entry == (NTdirattr *)NULL) { - return PK_MEM; - } -#ifdef NTSD_EAS - if (ebSDlen > 0) - memcpy(d_entry->buf, ebSDptr, ebSDlen); - d_entry->SDlen = ebSDlen; - d_entry->fn = d_entry->buf + ebSDlen; -#else - d_entry->fn = d_entry->buf; -#endif - - strcpy(d_entry->fn, G.filename); - - d_entry->perms = G.pInfo->file_attr; - - d_entry->gotTime = (uO.D_flag <= 0 - ? getNTfiletime(__G__ &(d_entry->Modft), - &(d_entry->Accft), &(d_entry->Creft)) - : 0); - return PK_OK; -} /* end function defer_dir_attribs() */ - - -int set_direc_attribs(__G__ d) - __GDEF - direntry *d; -{ - int errval; - HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */ -#ifdef __RSXNT__ - char *ansi_name; -#endif - - /* Win9x does not support setting directory time stamps. */ - if (!IsWinNT()) - return PK_OK; - - errval = PK_OK; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - ansi_name = (char *)alloca(strlen(d->fn) + 1); - INTERN_TO_ISO(d->fn, ansi_name); -# define Ansi_Dirname ansi_name -#else -# define Ansi_Dirname d->fn -#endif - - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - /* Open a handle to the directory before processing extra fields; - we do this in case new security on file prevents us from updating - time stamps. - Although the WIN32 documentation recommends to use GENERIC_WRITE - access flag to create the handle for SetFileTime(), this is too - demanding for directories with the "read-only" attribute bit set. - So we use the more specific flag FILE_WRITE_ATTRIBUTES here to - request the minimum required access rights. (This problem is a - Windows bug that has been silently fixed in Windows XP SP2.) */ - hFile = CreateFileA(Ansi_Dirname, FILE_WRITE_ATTRIBUTES, - FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); - } - -#ifdef NTSD_EAS - if (NtAtt(d)->SDlen > 0) { - int err; - - if (QCOND2) { - Info(slide, 1, ((char *)slide, " set attrib: %-22s ", - FnFilter1(d->fn))); - } - - /* set NTFS SD extra fields */ - err = SetSD(__G__ Ansi_Dirname, NtAtt(d)->perms, - NtAtt(d)->buf, NtAtt(d)->SDlen - EB_HEADSIZE); - if (err == IZ_EF_TRUNC) { - if (!QCOND2) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(d->fn))); - Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), - NtAtt(d)->SDlen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n")); - } else if (QCOND2) { - Info(slide, 0, ((char *)slide, "\n")); - } - if (errval < err) - errval = err; - } -#endif /* NTSD_EAS */ - - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - if (hFile == INVALID_HANDLE_VALUE) { - Info(slide, 1, ((char *)slide, - "warning: CreateFile() error %d (set file times for %s)\n", - (int)GetLastError(), FnFilter1(d->fn))); - if (!errval) - errval = PK_WARN; - } else { - if (NtAtt(d)->gotTime) { - FILETIME *pModft = (NtAtt(d)->gotTime & EB_UT_FL_MTIME) - ? &(NtAtt(d)->Modft) : NULL; - FILETIME *pAccft = (NtAtt(d)->gotTime & EB_UT_FL_ATIME) - ? &(NtAtt(d)->Accft) : NULL; - FILETIME *pCreft = (NtAtt(d)->gotTime & EB_UT_FL_CTIME) - ? &(NtAtt(d)->Creft) : NULL; - - if (!SetFileTime(hFile, pCreft, pAccft, pModft)) { - Info(slide, 0, ((char *)slide, - "warning: SetFileTime() for %s error %d\n", - FnFilter1(d->fn), (int)GetLastError())); - if (!errval) - errval = PK_WARN; - } - } - CloseHandle(hFile); - } - } - - return errval; -} /* end function set_direc_attribs() */ - -#endif /* SET_DIR_ATTRIB */ - - - - -#ifdef TIMESTAMP - -/*************************/ -/* Function stamp_file() */ -/*************************/ - -int stamp_file(__GPRO__ ZCONST char *fname, time_t modtime) -{ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - HANDLE hFile; /* File handle defined in NT */ - int errstat = 0; /* return status: 0 == "OK", -1 == "Failure" */ - int fs_uses_loctime = FStampIsLocTime(__G__ fname); -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(fname) + 1); - - INTERN_TO_ISO(fname, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname fname -#endif - - /* open a handle to the file to prepare setting the mod-time stamp */ - hFile = CreateFileA(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if ( hFile == INVALID_HANDLE_VALUE ) { - errstat = -1; - } else { - /* convert time_t modtime into WIN32 native 64bit format */ - UTIME_2_IZFILETIME(modtime, &Modft) - /* set Access and Modification times of the file to modtime */ - if (!SetFileTime(hFile, NULL, &Modft, &Modft)) { - errstat = -1; - } - CloseHandle(hFile); - } - - return errstat; - -#undef Ansi_Fname -} /* end function stamp_file() */ - -#endif /* TIMESTAMP */ - - - - -/***********************/ -/* Function isfloppy() */ /* more precisely, is it removable? */ -/***********************/ - -static int isfloppy(int nDrive) /* 1 == A:, 2 == B:, etc. */ -{ - char rootPathName[4]; - - rootPathName[0] = (char)('A' + nDrive - 1); /* build the root path */ - rootPathName[1] = ':'; /* name, e.g. "A:/" */ - rootPathName[2] = '/'; - rootPathName[3] = '\0'; - - return (GetDriveTypeA(rootPathName) == DRIVE_REMOVABLE); - -} /* end function isfloppy() */ - - - - -/*****************************/ -/* Function NTQueryVolInfo() */ -/*****************************/ - -/* - * Note: 8.3 limits on filenames apply only to old-style FAT filesystems. - * More recent versions of Windows (Windows NT 3.5 / Windows 4.0) - * can support long filenames (LFN) on FAT filesystems. Check the - * filesystem maximum component length field to detect LFN support. - */ - -static int NTQueryVolInfo(__GPRO__ const char *name) -{ - /* static char lastRootPath[4] = ""; */ - /* static int lastVolOldFAT; */ - /* static int lastVolLocTim; */ - char *tmp0; - char tmp1[MAX_PATH], tmp2[MAX_PATH]; - DWORD volSerNo, maxCompLen, fileSysFlags; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(name) + 1); - - INTERN_TO_ISO(name, ansi_name); - name = ansi_name; -#endif - - if ((!strncmp(name, "//", 2) || !strncmp(name, "\\\\", 2)) && - (name[2] != '\0' && name[2] != '/' && name[2] != '\\')) { - /* GetFullPathname() and GetVolumeInformation() do not work - * on UNC names. For now, we return "error". - * **FIXME**: check if UNC name is mapped to a drive letter - * and use mapped drive for volume info query. - */ - return FALSE; - } - if (isalpha((uch)name[0]) && (name[1] == ':')) - tmp0 = (char *)name; - else - { - if (!GetFullPathNameA(name, MAX_PATH, tmp1, &tmp0)) - return FALSE; - tmp0 = &tmp1[0]; - } - if (strncmp(G.lastRootPath, tmp0, 2) != 0) { - /* For speed, we skip repeated queries for the same device */ - strncpy(G.lastRootPath, tmp0, 2); /* Build the root path name, */ - G.lastRootPath[2] = '/'; /* e.g. "A:/" */ - G.lastRootPath[3] = '\0'; - - if (!GetVolumeInformationA((LPCSTR)G.lastRootPath, - (LPSTR)tmp1, (DWORD)MAX_PATH, - &volSerNo, &maxCompLen, &fileSysFlags, - (LPSTR)tmp2, (DWORD)MAX_PATH)) { - G.lastRootPath[0] = '\0'; - return FALSE; - } - - /* LFNs are available if the component length is > 12 */ - G.lastVolOldFAT = (maxCompLen <= 12); -/* G.lastVolOldFAT = !strncmp(strupr(tmp2), "FAT", 3); old version */ - - /* Volumes in (V)FAT and (OS/2) HPFS format store file timestamps in - * local time! - */ - G.lastVolLocTim = !strncmp(strupr(tmp2), "VFAT", 4) || - !strncmp(tmp2, "HPFS", 4) || - !strncmp(tmp2, "FAT", 3); - } - - return TRUE; - -} /* end function NTQueryVolInfo() */ - - - - -/*****************************/ -/* Function IsVolumeOldFAT() */ -/*****************************/ - -static int IsVolumeOldFAT(__GPRO__ const char *name) -{ - return (NTQueryVolInfo(__G__ name) ? G.lastVolOldFAT : FALSE); -} - - - - -#ifndef SFX - -/************************/ -/* Function do_wild() */ /* identical to OS/2 version */ -/************************/ - -char *do_wild(__G__ wildspec) - __GDEF - ZCONST char *wildspec; /* only used first time on a given dir */ -{ -/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in w32cfg.h: - static zDIR *wild_dir = NULL; - static ZCONST char *wildname; - static char *dirname, matchname[FILNAMSIZ]; - static int notfirstcall=FALSE, have_dirname, dirnamelen; -*/ - char *fnamestart; - struct zdirent *file; - - /* Even when we're just returning wildspec, we *always* do so in - * matchname[]--calling routine is allowed to append four characters - * to the returned string, and wildspec may be a pointer to argv[]. - */ - if (!G.notfirstcall) { /* first call: must initialize everything */ - G.notfirstcall = TRUE; - - if (!iswild(wildspec)) { - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - G.have_dirname = FALSE; - G.wild_dir = NULL; - return G.matchname; - } - - /* break the wildspec into a directory part and a wildcard filename */ - if ((G.wildname = MBSRCHR(wildspec, '/')) == (ZCONST char *)NULL && - (G.wildname = MBSRCHR(wildspec, ':')) == (ZCONST char *)NULL) { - G.dirname = "."; - G.dirnamelen = 1; - G.have_dirname = FALSE; - G.wildname = wildspec; - } else { - ++G.wildname; /* point at character after '/' or ':' */ - G.dirnamelen = G.wildname - wildspec; - if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == NULL) { - Info(slide, 1, ((char *)slide, - "warning: cannot allocate wildcard buffers\n")); - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; /* but maybe filespec was not a wildcard */ - } - strncpy(G.dirname, wildspec, G.dirnamelen); - G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ - G.have_dirname = TRUE; - } - Trace((stderr, "do_wild: dirname = [%s]\n", FnFilter1(G.dirname))); - - if ((G.wild_dir = (zvoid *)Opendir(G.dirname)) != NULL) { - if (G.have_dirname) { - strcpy(G.matchname, G.dirname); - fnamestart = G.matchname + G.dirnamelen; - } else - fnamestart = G.matchname; - while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { - Trace((stderr, "do_wild: Readdir returns %s\n", - FnFilter1(file->d_name))); - strcpy(fnamestart, file->d_name); - if (MBSRCHR(fnamestart, '.') == (char *)NULL) - strcat(fnamestart, "."); - if (match(fnamestart, G.wildname, TRUE WISEP) && - /* skip "." and ".." directory entries */ - strcmp(fnamestart, ".") && strcmp(fnamestart, "..")) { - Trace((stderr, "do_wild: match() succeeds\n")); - /* remove trailing dot */ - fnamestart = plastchar(fnamestart, strlen(fnamestart)); - if (*fnamestart == '.') - *fnamestart = '\0'; - return G.matchname; - } - } - /* if we get to here directory is exhausted, so close it */ - Closedir((zDIR *)G.wild_dir); - G.wild_dir = NULL; - } - Trace((stderr, "do_wild: Opendir(%s) returns NULL\n", - FnFilter1(G.dirname))); - - /* return the raw wildspec in case that works (e.g., directory not - * searchable, but filespec was not wild and file is readable) */ - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; - } - - /* last time through, might have failed opendir but returned raw wildspec */ - if (G.wild_dir == NULL) { - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - } - - /* If we've gotten this far, we've read and matched at least one entry - * successfully (in a previous call), so dirname has been copied into - * matchname already. - */ - if (G.have_dirname) { - /* strcpy(G.matchname, G.dirname); */ - fnamestart = G.matchname + G.dirnamelen; - } else - fnamestart = G.matchname; - while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - strcpy(fnamestart, file->d_name); - if (MBSRCHR(fnamestart, '.') == (char *)NULL) - strcat(fnamestart, "."); - if (match(fnamestart, G.wildname, TRUE WISEP)) { - Trace((stderr, "do_wild: match() succeeds\n")); - /* remove trailing dot */ - fnamestart = plastchar(fnamestart, strlen(fnamestart)); - if (*fnamestart == '.') - *fnamestart = '\0'; - return G.matchname; - } - } - - Closedir((zDIR *)G.wild_dir); /* at least one entry read; nothing left */ - G.wild_dir = NULL; - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - -} /* end function do_wild() */ - -#endif /* !SFX */ - - - -/**********************/ -/* Function mapattr() */ -/**********************/ - -/* Identical to MS-DOS, OS/2 versions. However, NT has a lot of extra - * permission stuff, so this function should probably be extended in the - * future. */ - -int mapattr(__G) - __GDEF -{ - /* set archive bit for file entries (file is not backed up): */ - G.pInfo->file_attr = ((unsigned)G.crec.external_file_attributes | - (G.crec.external_file_attributes & FILE_ATTRIBUTE_DIRECTORY ? - 0 : FILE_ATTRIBUTE_ARCHIVE)) & 0xff; - return 0; - -} /* end function mapattr() */ - - - - -/************************/ -/* Function mapname() */ -/************************/ - -int mapname(__G__ renamed) - __GDEF - int renamed; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - caution (truncated filename) - * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) - * MPN_ERR_SKIP - error -> skip entry - * MPN_ERR_TOOLONG - error -> path is too long - * MPN_NOMEM - error (memory allocation failed) -> skip entry - * [also MPN_VOL_LABEL, MPN_CREATED_DIR] - */ -{ - char pathcomp[FILNAMSIZ]; /* path-component buffer */ - char *pp, *cp=NULL; /* character pointers */ - char *lastsemi = NULL; /* pointer to last semi-colon in pathcomp */ -#ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ - RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ -#endif - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ - int error; - register unsigned workch; /* hold the character being tested */ - - -/*--------------------------------------------------------------------------- - Initialize various pointers and counters and stuff. - ---------------------------------------------------------------------------*/ - - /* can create path as long as not just freshening, or if user told us */ - G.create_dirs = (!uO.fflag || renamed); - - G.created_dir = FALSE; /* not yet */ - G.renamed_fullpath = FALSE; - G.fnlen = strlen(G.filename); - - if (renamed) { - cp = G.filename; /* point to beginning of renamed name... */ - if (*cp) do { - if (*cp == '\\') /* convert backslashes to forward */ - *cp = '/'; - } while (*PREINCSTR(cp)); - cp = G.filename; - /* use temporary rootpath if user gave full pathname */ - if (G.filename[0] == '/') { - G.renamed_fullpath = TRUE; - pathcomp[0] = '/'; /* copy the '/' and terminate */ - pathcomp[1] = '\0'; - ++cp; - } else if (isalpha((uch)G.filename[0]) && G.filename[1] == ':') { - G.renamed_fullpath = TRUE; - pp = pathcomp; - *pp++ = *cp++; /* copy the "d:" (+ '/', possibly) */ - *pp++ = *cp++; - if (*cp == '/') - *pp++ = *cp++; /* otherwise add "./"? */ - *pp = '\0'; - } - } - - /* pathcomp is ignored unless renamed_fullpath is TRUE: */ - if ((error = checkdir(__G__ pathcomp, INIT)) != 0) /* init path buffer */ - return error; /* ...unless no mem or vol label on hard disk */ - - *pathcomp = '\0'; /* initialize translation buffer */ - pp = pathcomp; /* point to translation buffer */ - if (!renamed) { /* cp already set if renamed */ - if (uO.jflag) /* junking directories */ - cp = (char *)MBSRCHR(G.filename, '/'); - if (cp == NULL) /* no '/' or not junking dirs */ - cp = G.filename; /* point to internal zipfile-member pathname */ - else - ++cp; /* point to start of last component of path */ - } - -/*--------------------------------------------------------------------------- - Begin main loop through characters in filename. - ---------------------------------------------------------------------------*/ - - for (; (workch = (uch)*cp) != 0; INCSTR(cp)) { - - switch (workch) { - case '/': /* can assume -j flag not given */ - *pp = '\0'; - maskDOSdevice(__G__ pathcomp); - if (strcmp(pathcomp, ".") == 0) { - /* don't bother appending "./" to the path */ - *pathcomp = '\0'; - } else if (!uO.ddotflag && strcmp(pathcomp, "..") == 0) { - /* "../" dir traversal detected, skip over it */ - *pathcomp = '\0'; - killed_ddot = TRUE; /* set "show message" flag */ - } - /* when path component is not empty, append it now */ - if (*pathcomp != '\0' && - ((error = checkdir(__G__ pathcomp, APPEND_DIR)) - & MPN_MASK) > MPN_INF_TRUNC) - return error; - pp = pathcomp; /* reset conversion buffer for next piece */ - lastsemi = (char *)NULL; /* leave direct. semi-colons alone */ - break; - - case ':': /* drive spec not stored, so no colon allowed */ - case '\\': /* '\\' may come as normal filename char (not */ - case '<': /* dir sep char!) from unix-like file system */ - case '>': /* no redirection symbols allowed either */ - case '|': /* no pipe signs allowed */ - case '"': /* no double quotes allowed */ - case '?': /* no wildcards allowed */ - case '*': - *pp++ = '_'; /* these rules apply equally to FAT and NTFS */ - break; - case ';': /* start of VMS version? */ - lastsemi = pp; /* remove VMS version later... */ - *pp++ = ';'; /* but keep semicolon for now */ - break; - -#ifdef ACORN_FTYPE_NFS - case ',': /* NFS filetype extension */ - lastcomma = pp; - *pp++ = ','; /* keep for now; may need to remove */ - break; /* later, if requested */ -#endif - - case ' ': /* keep spaces unless specifically */ - /* NT cannot create filenames with spaces on FAT volumes */ - if (uO.sflag || IsVolumeOldFAT(__G__ G.filename)) - *pp++ = '_'; - else - *pp++ = ' '; - break; - - default: - /* allow European characters in filenames: */ - if (isprint(workch) || workch >= 127) -#ifdef _MBCS - { - memcpy(pp, cp, CLEN(cp)); - INCSTR(pp); - } -#else - *pp++ = (char)workch; -#endif - } /* end switch */ - - } /* end while loop */ - - /* Show warning when stripping insecure "parent dir" path components */ - if (killed_ddot && QCOND2) { - Info(slide, 0, ((char *)slide, - "warning: skipped \"../\" path component(s) in %s\n", - FnFilter1(G.filename))); - if (!(error & ~MPN_MASK)) - error = (error & MPN_MASK) | PK_WARN; - } - -/*--------------------------------------------------------------------------- - Report if directory was created (and no file to create: filename ended - in '/'), check name to be sure it exists, and combine path and name be- - fore exiting. - ---------------------------------------------------------------------------*/ - - if (lastchar(G.filename, G.fnlen) == '/') { -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - checkdir(__G__ G.filename, GETPATH); - if (G.created_dir) { - if (QCOND2) { - Info(slide, 0, ((char *)slide, " creating: %-22s\n", - FnFilter1(G.filename))); - } - - /* set file attributes: - The default for newly created directories is "DIR attribute - flags set", so there is no need to change attributes unless - one of the DOS style attribute flags is set. The readonly - attribute need not be masked, since it does not prevent - modifications in the new directory. */ - if(G.pInfo->file_attr & (0x7F & ~FILE_ATTRIBUTE_DIRECTORY)) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes for %s\n", - (int)GetLastError(), FnFilter1(G.filename))); - } - - /* set dir time (note trailing '/') */ - return (error & ~MPN_MASK) | MPN_CREATED_DIR; - } else if (IS_OVERWRT_ALL) { - /* overwrite attributes of existing directory on user's request */ - - /* set file attributes: */ - if(G.pInfo->file_attr & (0x7F & ~FILE_ATTRIBUTE_DIRECTORY)) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes for %s\n", - (int)GetLastError(), FnFilter1(G.filename))); - } - } - /* dir existed already; don't look for data to extract */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; - } - - *pp = '\0'; /* done with pathcomp: terminate it */ - - /* if not saving them, remove VMS version numbers (appended "###") */ - if (!uO.V_flag && lastsemi) { - pp = lastsemi + 1; /* semi-colon was kept: expect #'s after */ - while (isdigit((uch)(*pp))) - ++pp; - if (*pp == '\0') /* only digits between ';' and end: nuke */ - *lastsemi = '\0'; - } - -#ifdef ACORN_FTYPE_NFS - /* translate Acorn filetype information if asked to do so */ - if (uO.acorn_nfs_ext && - (ef_spark = (RO_extra_block *) - getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) - != (RO_extra_block *)NULL) - { - /* file *must* have a RISC OS extra field */ - long ft = (long)makelong(ef_spark->loadaddr); - /*32-bit*/ - if (lastcomma) { - pp = lastcomma + 1; - while (isxdigit((uch)(*pp))) ++pp; - if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ - } - if ((ft & 1<<31)==0) ft=0x000FFD00; - sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); - } -#endif /* ACORN_FTYPE_NFS */ - - maskDOSdevice(__G__ pathcomp); - - if (*pathcomp == '\0') { - Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", - FnFilter1(G.filename))); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - - checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ - checkdir(__G__ G.filename, GETPATH); - - if (G.pInfo->vollabel) { /* set the volume label now */ - char drive[4]; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - - /* Build a drive string, e.g. "b:" */ - drive[0] = (char)('a' + G.nLabelDrive - 1); - strcpy(drive + 1, ":\\"); - if (QCOND2) - Info(slide, 0, ((char *)slide, "labelling %s %-22s\n", drive, - FnFilter1(G.filename))); - if (!SetVolumeLabelA(drive, Ansi_Fname)) { - Info(slide, 1, ((char *)slide, - "mapname: error setting volume label\n")); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - /* success: skip the "extraction" quietly */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; -#undef Ansi_Fname - } - - Trace((stderr, "mapname returns with filename = [%s] (error = %d)\n\n", - FnFilter1(G.filename), error)); - return error; - -} /* end function mapname() */ - - - - -/****************************/ -/* Function maskDOSdevice() */ -/****************************/ - -static void maskDOSdevice(__G__ pathcomp) - __GDEF - char *pathcomp; -{ -/*--------------------------------------------------------------------------- - Put an underscore in front of the file name if the file name is a - DOS/WINDOWS device name like CON.*, AUX.*, PRN.*, etc. Trying to - extract such a file would fail at best and wedge us at worst. - ---------------------------------------------------------------------------*/ -#if !defined(S_IFCHR) && defined(_S_IFCHR) -# define S_IFCHR _S_IFCHR -#endif -#if !defined(S_ISCHR) -# if defined(_S_ISCHR) -# define S_ISCHR(m) _S_ISCHR(m) -# elif defined(S_IFCHR) -# define S_ISCHR(m) ((m) & S_IFCHR) -# endif -#endif - -#ifdef DEBUG - if (zstat(pathcomp, &G.statbuf) == 0) { - Trace((stderr, - "maskDOSdevice() stat(\"%s\", buf) st_mode result: %X, %o\n", - FnFilter1(pathcomp), G.statbuf.st_mode, G.statbuf.st_mode)); - } else { - Trace((stderr, "maskDOSdevice() stat(\"%s\", buf) failed\n", - FnFilter1(pathcomp))); - } -#endif - if (zstat(pathcomp, &G.statbuf) == 0 && S_ISCHR(G.statbuf.st_mode)) { - extent i; - - /* pathcomp contains a name of a DOS character device (builtin or - * installed device driver). - * Prepend a '_' to allow creation of the item in the file system. - */ - for (i = strlen(pathcomp) + 1; i > 0; --i) - pathcomp[i] = pathcomp[i - 1]; - pathcomp[0] = '_'; - } -} /* end function maskDOSdevice() */ - - - - - -/**********************/ -/* Function map2fat() */ /* Not quite identical to OS/2 version */ -/**********************/ - -static void map2fat(pathcomp, pEndFAT) - char *pathcomp, **pEndFAT; -{ - char *ppc = pathcomp; /* variable pointer to pathcomp */ - char *pEnd = *pEndFAT; /* variable pointer to buildpathFAT */ - char *pBegin = *pEndFAT; /* constant pointer to start of this comp. */ - char *last_dot = NULL; /* last dot not converted to underscore */ - register unsigned workch; /* hold the character being tested */ - - - /* Only need check those characters which are legal in NTFS but not - * in FAT: to get here, must already have passed through mapname. - * Also must truncate path component to ensure 8.3 compliance. - */ - while ((workch = (uch)*ppc++) != 0) { - switch (workch) { - case '[': - case ']': - case '+': - case ',': - case ';': - case '=': - *pEnd++ = '_'; /* convert brackets to underscores */ - break; - - case '.': - if (pEnd == *pEndFAT) { /* nothing appended yet... */ - if (*ppc == '\0') /* don't bother appending a */ - break; /* "./" component to the path */ - else if (*ppc == '.' && ppc[1] == '\0') { /* "../" */ - *pEnd++ = '.'; /* add first dot, */ - *pEnd++ = '.'; /* add second dot, and */ - ++ppc; /* skip over to pathcomp's end */ - } else { /* FAT doesn't allow null filename */ - *pEnd++ = '_'; /* bodies, so map .exrc -> _exrc */ - } /* (_.exr would keep max 3 chars) */ - } else { /* found dot within path component */ - last_dot = pEnd; /* point at last dot so far... */ - *pEnd++ = '_'; /* convert to underscore for now */ - } - break; - - default: - *pEnd++ = (char)workch; - - } /* end switch */ - } /* end while loop */ - - *pEnd = '\0'; /* terminate buildpathFAT */ - - /* NOTE: keep in mind that pEnd points to the end of the path - * component, and *pEndFAT still points to the *beginning* of it... - * Also note that the algorithm does not try to get too fancy: - * if there are no dots already, the name either gets truncated - * at 8 characters or the last underscore is converted to a dot - * (only if more characters are saved that way). In no case is - * a dot inserted between existing characters. - */ - if (last_dot == NULL) { /* no dots: check for underscores... */ - char *plu = MBSRCHR(pBegin, '_'); /* pointer to last underscore */ - - if ((plu != NULL) && /* found underscore: convert to dot? */ - (MIN(plu - pBegin, 8) + MIN(pEnd - plu - 1, 3) > 8)) { - last_dot = plu; /* be lazy: drop through to next if-blk */ - } else if ((pEnd - *pEndFAT) > 8) { - /* no underscore; or converting underscore to dot would save less - chars than leaving everything in the basename */ - *pEndFAT += 8; /* truncate at 8 chars */ - **pEndFAT = '\0'; - } else - *pEndFAT = pEnd; /* whole thing fits into 8 chars or less */ - } - - if (last_dot != NULL) { /* one dot is OK: */ - *last_dot = '.'; /* put it back in */ - - if ((last_dot - pBegin) > 8) { - char *p, *q; - int i; - - p = last_dot; - q = last_dot = pBegin + 8; - for (i = 0; (i < 4) && *p; ++i) /* too many chars in basename: */ - *q++ = *p++; /* shift .ext left and trun- */ - *q = '\0'; /* cate/terminate it */ - *pEndFAT = q; - } else if ((pEnd - last_dot) > 4) { /* too many chars in extension */ - *pEndFAT = last_dot + 4; - **pEndFAT = '\0'; - } else - *pEndFAT = pEnd; /* filename is fine; point at terminating zero */ - - if ((last_dot - pBegin) > 0 && last_dot[-1] == ' ') - last_dot[-1] = '_'; /* NO blank in front of '.'! */ - } -} /* end function map2fat() */ - - - - -/***********************/ /* Borrowed from os2.c for UnZip 5.1. */ -/* Function checkdir() */ /* Difference: no EA stuff */ -/***********************/ /* HPFS stuff works on NTFS too */ - -int checkdir(__G__ pathcomp, flag) - __GDEF - char *pathcomp; - int flag; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename - * MPN_INF_SKIP - path doesn't exist, not allowed to create - * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path - * exists and is not a directory, but is supposed to be - * MPN_ERR_TOOLONG - path is too long - * MPN_NOMEM - can't allocate memory for filename buffers - */ -{ - /* static int rootlen = 0; */ /* length of rootpath */ - /* static char *rootpath; */ /* user's "extract-to" directory */ - /* static char *buildpathHPFS; */ /* full path (so far) to extracted file, */ - /* static char *buildpathFAT; */ /* both HPFS/EA (main) and FAT versions */ - /* static char *endHPFS; */ /* corresponding pointers to end of */ - /* static char *endFAT; */ /* buildpath ('\0') */ - -# define FN_MASK 7 -# define FUNCTION (flag & FN_MASK) - - - -/*--------------------------------------------------------------------------- - APPEND_DIR: append the path component to the path being built and check - for its existence. If doesn't exist and we are creating directories, do - so for this one; else signal success or error as appropriate. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_DIR) { - char *p = pathcomp; - int too_long = FALSE; - - Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); - while ((*G.endHPFS = *p++) != '\0') /* copy to HPFS filename */ - ++G.endHPFS; - if (!IsVolumeOldFAT(__G__ G.buildpathHPFS)) { - p = pathcomp; - while ((*G.endFAT = *p++) != '\0') /* copy to FAT filename, too */ - ++G.endFAT; - } else - map2fat(pathcomp, &G.endFAT); /* map into FAT fn, update endFAT */ - - /* GRR: could do better check, see if overrunning buffer as we go: - * check endHPFS-buildpathHPFS after each append, set warning variable - * if within 20 of FILNAMSIZ; then if var set, do careful check when - * appending. Clear variable when begin new path. */ - - /* next check: need to append '/', at least one-char name, '\0' */ - if ((G.endHPFS-G.buildpathHPFS) > FILNAMSIZ-3) - too_long = TRUE; /* check if extracting dir? */ -#ifdef FIX_STAT_BUG - /* Borland C++ 5.0 does not handle a call to stat() well if the - * directory does not exist (it tends to crash in strange places.) - * This is apparently a problem only when compiling for GUI rather - * than console. The code below attempts to work around this problem. - */ - if (access(G.buildpathFAT, 0) != 0) { - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path doesn't exist: nothing to do */ - return MPN_INF_SKIP; - } - if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } -#endif /* FIX_STAT_BUG */ - if (SSTAT(G.buildpathFAT, &G.statbuf)) /* path doesn't exist */ - { - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path doesn't exist: nothing to do */ - return MPN_INF_SKIP; - } - if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } else if (!S_ISDIR(G.statbuf.st_mode)) { - Info(slide, 1, ((char *)slide, - "checkdir error: %s exists but is not directory\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path existed but wasn't dir */ - return MPN_ERR_SKIP; - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - *G.endHPFS++ = '/'; - *G.endFAT++ = '/'; - *G.endHPFS = *G.endFAT = '\0'; - Trace((stderr, "buildpathHPFS now = [%s]\nbuildpathFAT now = [%s]\n", - FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); - return MPN_OK; - - } /* end if (FUNCTION == APPEND_DIR) */ - -/*--------------------------------------------------------------------------- - GETPATH: copy full FAT path to the string pointed at by pathcomp (want - filename to reflect name used on disk, not EAs; if full path is HPFS, - buildpathFAT and buildpathHPFS will be identical). Also free both paths. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == GETPATH) { - Trace((stderr, "getting and freeing FAT path [%s]\n", - FnFilter1(G.buildpathFAT))); - Trace((stderr, "freeing HPFS path [%s]\n", - FnFilter1(G.buildpathHPFS))); - strcpy(pathcomp, G.buildpathFAT); - free(G.buildpathFAT); - free(G.buildpathHPFS); - G.buildpathHPFS = G.buildpathFAT = G.endHPFS = G.endFAT = NULL; - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - APPEND_NAME: assume the path component is the filename; append it and - return without checking for existence. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_NAME) { - char *p = pathcomp; - int error = MPN_OK; - - Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); - /* The buildpathHPFS buffer has been allocated large enough to - * hold the complete combined name, so there is no need to check - * for OS filename size limit overflow within the copy loop. - */ - while ((*G.endHPFS = *p++) != '\0') { /* copy to HPFS filename */ - ++G.endHPFS; - } - /* Now, check for OS filename size overflow. When detected, the - * mapped HPFS name is truncated and a warning message is shown. - */ - if ((G.endHPFS-G.buildpathHPFS) >= FILNAMSIZ) { - G.buildpathHPFS[FILNAMSIZ-1] = '\0'; - Info(slide, 1, ((char *)slide, - "checkdir warning: path too long; truncating\n \ - %s\n -> %s\n", - FnFilter1(G.filename), FnFilter2(G.buildpathHPFS))); - error = MPN_INF_TRUNC; /* filename truncated */ - } - - /* The buildpathFAT buffer has the same allocated size as the - * buildpathHPFS buffer, so there is no need for an overflow check - * within the following copy loop, either. - */ - if (G.pInfo->vollabel || !IsVolumeOldFAT(__G__ G.buildpathHPFS)) { - /* copy to FAT filename, too */ - p = pathcomp; - while ((*G.endFAT = *p++) != '\0') - ++G.endFAT; - } else - /* map into FAT fn, update endFAT */ - map2fat(pathcomp, &G.endFAT); - - /* Check that the FAT path does not exceed the FILNAMSIZ limit, and - * truncate when neccessary. - * Note that truncation can only happen when the HPFS path (which is - * never shorter than the FAT path) has been already truncated. - * So, emission of the warning message and setting the error code - * has already happened. - */ - if ((G.endFAT-G.buildpathFAT) >= FILNAMSIZ) - G.buildpathFAT[FILNAMSIZ-1] = '\0'; - Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT: %s\n", - FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); - - return error; /* could check for existence, prompt for new name... */ - - } /* end if (FUNCTION == APPEND_NAME) */ - -/*--------------------------------------------------------------------------- - INIT: allocate and initialize buffer space for the file currently being - extracted. If file was renamed with an absolute path, don't prepend the - extract-to path. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == INIT) { - Trace((stderr, "initializing buildpathHPFS and buildpathFAT to ")); -#ifdef ACORN_FTYPE_NFS - if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+1)) -#endif - == NULL) - return MPN_NOMEM; -#ifdef ACORN_FTYPE_NFS - if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+1)) -#endif - == NULL) { - free(G.buildpathHPFS); - return MPN_NOMEM; - } - if (G.pInfo->vollabel) { /* use root or renamed path, but don't store */ -/* GRR: for network drives, do strchr() and return IZ_VOL_LABEL if not [1] */ - if (G.renamed_fullpath && pathcomp[1] == ':') - *G.buildpathHPFS = (char)ToLower(*pathcomp); - else if (!G.renamed_fullpath && G.rootlen > 1 && - G.rootpath[1] == ':') - *G.buildpathHPFS = (char)ToLower(*G.rootpath); - else { - char tmpN[MAX_PATH], *tmpP; - if (GetFullPathNameA(".", MAX_PATH, tmpN, &tmpP) > MAX_PATH) - { /* by definition of MAX_PATH we should never get here */ - Info(slide, 1, ((char *)slide, - "checkdir warning: current dir path too long\n")); - return MPN_INF_TRUNC; /* can't get drive letter */ - } - G.nLabelDrive = *tmpN - 'a' + 1; - *G.buildpathHPFS = (char)(G.nLabelDrive - 1 + 'a'); - } - G.nLabelDrive = *G.buildpathHPFS - 'a' + 1; /* save for mapname() */ - if (uO.volflag == 0 || *G.buildpathHPFS < 'a' /* no labels/bogus? */ - || (uO.volflag == 1 && !isfloppy(G.nLabelDrive))) { /* !fixed */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - return MPN_VOL_LABEL; /* skipping with message */ - } - *G.buildpathHPFS = '\0'; - } else if (G.renamed_fullpath) /* pathcomp = valid data */ - strcpy(G.buildpathHPFS, pathcomp); - else if (G.rootlen > 0) - strcpy(G.buildpathHPFS, G.rootpath); - else - *G.buildpathHPFS = '\0'; - G.endHPFS = G.buildpathHPFS; - G.endFAT = G.buildpathFAT; - while ((*G.endFAT = *G.endHPFS) != '\0') { - ++G.endFAT; - ++G.endHPFS; - } - Trace((stderr, "[%s]\n", FnFilter1(G.buildpathHPFS))); - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - ROOT: if appropriate, store the path in rootpath and create it if neces- - sary; else assume it's a zipfile member and return. This path segment - gets used in extracting all members from every zipfile specified on the - command line. Note that under OS/2 and MS-DOS, if a candidate extract-to - directory specification includes a drive letter (leading "x:"), it is - treated just as if it had a trailing '/'--that is, one directory level - will be created if the path doesn't exist, unless this is otherwise pro- - hibited (e.g., freshening). - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) || defined(SFX_EXDIR)) - if (FUNCTION == ROOT) { - Trace((stderr, "initializing root path to [%s]\n", - FnFilter1(pathcomp))); - if (pathcomp == NULL) { - G.rootlen = 0; - return MPN_OK; - } - if (G.rootlen > 0) /* rootpath was already set, nothing to do */ - return MPN_OK; - if ((G.rootlen = strlen(pathcomp)) > 0) { - int had_trailing_pathsep=FALSE, has_drive=FALSE, add_dot=FALSE; - char *tmproot; - - if ((tmproot = (char *)malloc(G.rootlen+3)) == (char *)NULL) { - G.rootlen = 0; - return MPN_NOMEM; - } - strcpy(tmproot, pathcomp); - if (isalpha((uch)tmproot[0]) && tmproot[1] == ':') - has_drive = TRUE; /* drive designator */ - if (tmproot[G.rootlen-1] == '/' || tmproot[G.rootlen-1] == '\\') { - tmproot[--G.rootlen] = '\0'; - had_trailing_pathsep = TRUE; - } - if (has_drive && (G.rootlen == 2)) { - if (!had_trailing_pathsep) /* i.e., original wasn't "x:/" */ - add_dot = TRUE; /* relative path: add '.' before '/' */ - } else if (G.rootlen > 0) { /* need not check "x:." and "x:/" */ - if (SSTAT(tmproot, &G.statbuf) || !S_ISDIR(G.statbuf.st_mode)) - { - /* path does not exist */ - if (!G.create_dirs /* || iswild(tmproot) */ ) { - free(tmproot); - G.rootlen = 0; - /* treat as stored file */ - return MPN_INF_SKIP; - } - /* create directory (could add loop here scanning tmproot - * to create more than one level, but really necessary?) */ - if (MKDIR(tmproot, 0777) == -1) { - Info(slide, 1, ((char *)slide, - "checkdir: cannot create extraction directory: %s\n", - FnFilter1(tmproot))); - free(tmproot); - G.rootlen = 0; - /* path didn't exist, tried to create, failed: */ - /* file exists, or need 2+ subdir levels */ - return MPN_ERR_SKIP; - } - } - } - if (add_dot) /* had just "x:", make "x:." */ - tmproot[G.rootlen++] = '.'; - tmproot[G.rootlen++] = '/'; - tmproot[G.rootlen] = '\0'; - if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { - free(tmproot); - G.rootlen = 0; - return MPN_NOMEM; - } - Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); - } - return MPN_OK; - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - END: free rootpath, immediately prior to program exit. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == END) { - Trace((stderr, "freeing rootpath\n")); - if (G.rootlen > 0) { - free(G.rootpath); - G.rootlen = 0; - } - return MPN_OK; - } - - return MPN_INVALID; /* should never reach */ - -} /* end function checkdir() */ - - - - - -#ifndef SFX - -/*************************/ -/* Function dateformat() */ -/*************************/ - -int dateformat() -{ - char df[2]; /* LOCALE_IDATE has a maximum value of 2 */ - - if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IDATE, df, 2) != 0) { - switch (df[0]) - { - case '0': - return DF_MDY; - case '1': - return DF_DMY; - case '2': - return DF_YMD; - } - } - return DF_MDY; -} - - -/****************************/ -/* Function dateseparator() */ -/****************************/ - -char dateseparator() -{ - char df[2]; /* use only if it is one character */ - - if ((GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDATE, df, 2) != 0) && - (df[0] != '\0')) - return df[0]; - else - return '-'; -} - - -#ifndef WINDLL - -/************************/ -/* Function version() */ -/************************/ - -void version(__G) - __GDEF -{ - int len; -#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__DJGPP__)) - char buf[80]; -#if (defined(_MSC_VER) && (_MSC_VER > 900)) - char buf2[80]; -#endif -#endif - - len = sprintf((char *)slide, CompiledWith, - -#if defined(_MSC_VER) /* MSC == VC++, but what about SDK compiler? */ - (sprintf(buf, "Microsoft C %d.%02d ", _MSC_VER/100, _MSC_VER%100), buf), -# if (_MSC_VER == 800) - "(Visual C++ v1.1)", -# elif (_MSC_VER == 850) - "(Windows NT v3.5 SDK)", -# elif (_MSC_VER == 900) - "(Visual C++ v2.x)", -# elif (_MSC_VER > 900) - (sprintf(buf2, "(Visual C++ %d.%d)", _MSC_VER/100 - 6, _MSC_VER%100/10), - buf2), -# else - "(bad version)", -# endif -#elif defined(__WATCOMC__) -# if (__WATCOMC__ % 10 > 0) - (sprintf(buf, "Watcom C/C++ %d.%02d", __WATCOMC__ / 100, - __WATCOMC__ % 100), buf), "", -# else - (sprintf(buf, "Watcom C/C++ %d.%d", __WATCOMC__ / 100, - (__WATCOMC__ % 100) / 10), buf), "", -# endif -#elif defined(__BORLANDC__) - "Borland C++", -# if (__BORLANDC__ < 0x0200) - " 1.0", -# elif (__BORLANDC__ == 0x0200) - " 2.0", -# elif (__BORLANDC__ == 0x0400) - " 3.0", -# elif (__BORLANDC__ == 0x0410) /* __TURBOC__ = 0x0310 */ - " 3.1", -# elif (__BORLANDC__ == 0x0452) /* __TURBOC__ = 0x0320 */ - " 4.0 or 4.02", -# elif (__BORLANDC__ == 0x0460) /* __TURBOC__ = 0x0340 */ - " 4.5", -# elif (__BORLANDC__ == 0x0500) /* __TURBOC__ = 0x0340 */ - " 5.0", -# elif (__BORLANDC__ == 0x0520) /* __TURBOC__ = 0x0520 */ - " 5.2 (C++ Builder 1.0)", -# elif (__BORLANDC__ == 0x0530) /* __TURBOC__ = 0x0530 */ - " 5.3 (C++ Builder 3.0)", -# elif (__BORLANDC__ == 0x0540) /* __TURBOC__ = 0x0540 */ - " 5.4 (C++ Builder 4.0)", -# elif (__BORLANDC__ == 0x0550) /* __TURBOC__ = 0x0550 */ - " 5.5 (C++ Builder 5.0)", -# elif (__BORLANDC__ == 0x0551) /* __TURBOC__ = 0x0551 */ - " 5.5.1 (C++ Builder 5.0.1)", -# elif (__BORLANDC__ == 0x0560) /* __TURBOC__ = 0x0560 */ - " 6.0 (C++ Builder 6.0)", -# else - " later than 6.0", -# endif -#elif defined(__LCC__) - "LCC-Win32", "", -#elif defined(__GNUC__) -# if defined(__RSXNT__) -# if (defined(__DJGPP__) && !defined(__EMX__)) - (sprintf(buf, "rsxnt(djgpp v%d.%02d) / gcc ", - __DJGPP__, __DJGPP_MINOR__), buf), -# elif defined(__DJGPP__) - (sprintf(buf, "rsxnt(emx+djgpp v%d.%02d) / gcc ", - __DJGPP__, __DJGPP_MINOR__), buf), -# elif (defined(__GO32__) && !defined(__EMX__)) - "rsxnt(djgpp v1.x) / gcc ", -# elif defined(__GO32__) - "rsxnt(emx + djgpp v1.x) / gcc ", -# elif defined(__EMX__) - "rsxnt(emx)+gcc ", -# else - "rsxnt(unknown) / gcc ", -# endif -# elif defined(__CYGWIN__) - "cygnus win32 / gcc ", -# elif defined(__MINGW32__) - "mingw32 / gcc ", -# else - "gcc ", -# endif - __VERSION__, -#else /* !_MSC_VER, !__WATCOMC__, !__BORLANDC__, !__LCC__, !__GNUC__ */ - "unknown compiler (SDK?)", "", -#endif /* ?compilers */ - - "\nWindows 9x / Windows NT/2K/XP/2K3", " (32-bit)", - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - - (*G.message)((zvoid *)&G, slide, (ulg)len, 0); - - return; - -} /* end function version() */ - -#endif /* !WINDLL */ -#endif /* !SFX */ - - - -#ifdef MORE - -int screensize(int *tt_rows, int *tt_cols) -{ - HANDLE hstdout; - CONSOLE_SCREEN_BUFFER_INFO scr; - - hstdout = GetStdHandle(STD_OUTPUT_HANDLE); - GetConsoleScreenBufferInfo(hstdout, &scr); - if (tt_rows != NULL) *tt_rows = scr.srWindow.Bottom - scr.srWindow.Top + 1; - if (tt_cols != NULL) *tt_cols = scr.srWindow.Right - scr.srWindow.Left + 1; - return 0; /* signal success */ -} - -#endif /* MORE */ - - - -#ifdef W32_STAT_BANDAID - -/* All currently known variants of WIN32 operating systems (Windows 95/98, - * WinNT 3.x, 4.0, 5.x) have a nasty bug in the OS kernel concerning - * conversions between UTC and local time: In the time conversion functions - * of the Win32 API, the timezone offset (including seasonal daylight saving - * shift) between UTC and local time evaluation is erratically based on the - * current system time. The correct evaluation must determine the offset - * value as it {was/is/will be} for the actual time to be converted. - * - * Newer versions of MS C runtime lib's stat() returns utc time-stamps so - * that localtime(timestamp) corresponds to the (potentially false) local - * time shown by the OS' system programs (Explorer, command shell dir, etc.) - * The RSXNT port follows the same strategy, but fails to recognize the - * access-time attribute. - * - * For the NTFS file system (and other filesystems that store time-stamps - * as UTC values), this results in st_mtime (, st_{c|a}time) fields which - * are not stable but vary according to the seasonal change of "daylight - * saving time in effect / not in effect". - * - * Other C runtime libs (CygWin), or the crtdll.dll supplied with Win9x/NT - * return the unix-time equivalent of the UTC FILETIME values as got back - * from the Win32 API call. This time, return values from NTFS are correct - * whereas utimes from files on (V)FAT volumes vary according to the DST - * switches. - * - * To achieve timestamp consistency of UTC (UT extra field) values in - * Zip archives, the Info-ZIP programs require work-around code for - * proper time handling in stat() (and other time handling routines). - * - * However, nowadays most other programs on Windows systems use the - * time conversion strategy of Microsofts C runtime lib "msvcrt.dll". - * To improve interoperability in environments where a "consistent" (but - * false) "UTC<-->LocalTime" conversion is preferred over "stable" time - * stamps, the Info-ZIP specific time conversion handling can be - * deactivated by defining the preprocessor flag NO_W32TIMES_IZFIX. - */ -/* stat() functions under Windows95 tend to fail for root directories. * - * Watcom and Borland, at least, are affected by this bug. Watcom made * - * a partial fix for 11.0 but still missed some cases. This substitute * - * detects the case and fills in reasonable values. Otherwise we get * - * effects like failure to extract to a root dir because it's not found. */ - -int zstat_win32(__W32STAT_GLOBALS__ const char *path, z_stat *buf) -{ - if (!zstat(path, buf)) - { - /* stat was successful, now redo the time-stamp fetches */ -#ifndef NO_W32TIMES_IZFIX - int fs_uses_loctime = FStampIsLocTime(__G__ path); -#endif - HANDLE h; - FILETIME Modft, Accft, Creft; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_path = (char *)alloca(strlen(path) + 1); - - INTERN_TO_ISO(path, ansi_path); -# define Ansi_Path ansi_path -#else -# define Ansi_Path path -#endif - - TTrace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime)); - h = CreateFileA(Ansi_Path, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h != INVALID_HANDLE_VALUE) { - BOOL ftOK = GetFileTime(h, &Creft, &Accft, &Modft); - CloseHandle(h); - - if (ftOK) { - FTTrace((stdout, "GetFileTime returned Modft", 0, &Modft)); - FTTrace((stdout, "GetFileTime returned Creft", 0, &Creft)); -#ifndef NO_W32TIMES_IZFIX - if (!fs_uses_loctime) { - /* On a filesystem that stores UTC timestamps, we refill - * the time fields of the struct stat buffer by directly - * using the UTC values as returned by the Win32 - * GetFileTime() API call. - */ - NtfsFileTime2utime(&Modft, &(buf->st_mtime)); - if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) - NtfsFileTime2utime(&Accft, &(buf->st_atime)); - else - buf->st_atime = buf->st_mtime; - if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) - NtfsFileTime2utime(&Creft, &(buf->st_ctime)); - else - buf->st_ctime = buf->st_mtime; - TTrace((stdout,"NTFS, recalculated modtime %08lx\n", - buf->st_mtime)); - } else -#endif /* NO_W32TIMES_IZFIX */ - { - /* On VFAT and FAT-like filesystems, the FILETIME values - * are converted back to the stable local time before - * converting them to UTC unix time-stamps. - */ - VFatFileTime2utime(&Modft, &(buf->st_mtime)); - if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) - VFatFileTime2utime(&Accft, &(buf->st_atime)); - else - buf->st_atime = buf->st_mtime; - if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) - VFatFileTime2utime(&Creft, &(buf->st_ctime)); - else - buf->st_ctime = buf->st_mtime; - TTrace((stdout, "VFAT, recalculated modtime %08lx\n", - buf->st_mtime)); - } - } - } -# undef Ansi_Path - return 0; - } -#ifdef W32_STATROOT_FIX - else - { - DWORD flags; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_path = (char *)alloca(strlen(path) + 1); - - INTERN_TO_ISO(path, ansi_path); -# define Ansi_Path ansi_path -#else -# define Ansi_Path path -#endif - - flags = GetFileAttributesA(Ansi_Path); - if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) { - Trace((stderr, "\nstat(\"%s\",...) failed on existing directory\n", - FnFilter1(path))); - memset(buf, 0, sizeof(z_stat)); - buf->st_atime = buf->st_ctime = buf->st_mtime = - dos_to_unix_time(DOSTIME_MINIMUM); /* 1-1-80 */ - buf->st_mode = S_IFDIR | S_IREAD | - ((flags & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE); - return 0; - } /* assumes: stat() won't fail on non-dirs without good reason */ -# undef Ansi_Path - } -#endif /* W32_STATROOT_FIX */ - return -1; -} - -#endif /* W32_STAT_BANDAID */ - - - -#ifdef W32_USE_IZ_TIMEZONE -#include "timezone.h" -#define SECSPERMIN 60 -#define MINSPERHOUR 60 -#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule); - -static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule) -{ - if (lpw32tm->wYear != 0) { - ptrule->r_type = JULIAN_DAY; - ptrule->r_day = ydays[lpw32tm->wMonth - 1] + lpw32tm->wDay; - } else { - ptrule->r_type = MONTH_NTH_DAY_OF_WEEK; - ptrule->r_mon = lpw32tm->wMonth; - ptrule->r_day = lpw32tm->wDayOfWeek; - ptrule->r_week = lpw32tm->wDay; - } - ptrule->r_time = (long)lpw32tm->wHour * SECSPERHOUR + - (long)(lpw32tm->wMinute * SECSPERMIN) + - (long)lpw32tm->wSecond; -} - -int GetPlatformLocalTimezone(register struct state * ZCONST sp, - void (*fill_tzstate_from_rules)(struct state * ZCONST sp_res, - ZCONST struct rule * ZCONST start, - ZCONST struct rule * ZCONST end)) -{ - TIME_ZONE_INFORMATION tzinfo; - DWORD res; - - /* read current timezone settings from registry if TZ envvar missing */ - res = GetTimeZoneInformation(&tzinfo); - if (res != TIME_ZONE_ID_INVALID) - { - struct rule startrule, stoprule; - - conv_to_rule(&(tzinfo.StandardDate), &stoprule); - conv_to_rule(&(tzinfo.DaylightDate), &startrule); - sp->timecnt = 0; - sp->ttis[0].tt_abbrind = 0; - if ((sp->charcnt = - WideCharToMultiByte(CP_ACP, 0, tzinfo.StandardName, -1, - sp->chars, sizeof(sp->chars), NULL, NULL)) - == 0) - sp->chars[sp->charcnt++] = '\0'; - sp->ttis[1].tt_abbrind = sp->charcnt; - sp->charcnt += - WideCharToMultiByte(CP_ACP, 0, tzinfo.DaylightName, -1, - sp->chars + sp->charcnt, - sizeof(sp->chars) - sp->charcnt, NULL, NULL); - if ((sp->charcnt - sp->ttis[1].tt_abbrind) == 0) - sp->chars[sp->charcnt++] = '\0'; - sp->ttis[0].tt_gmtoff = - (tzinfo.Bias + tzinfo.StandardBias) - * MINSPERHOUR; - sp->ttis[1].tt_gmtoff = - (tzinfo.Bias + tzinfo.DaylightBias) - * MINSPERHOUR; - sp->ttis[0].tt_isdst = 0; - sp->ttis[1].tt_isdst = 1; - sp->typecnt = (startrule.r_mon == 0 && stoprule.r_mon == 0) ? 1 : 2; - - if (sp->typecnt > 1) - (*fill_tzstate_from_rules)(sp, &startrule, &stoprule); - return TRUE; - } - return FALSE; -} -#endif /* W32_USE_IZ_TIMEZONE */ - -#endif /* !FUNZIP */ - - - -#ifndef WINDLL -/* This replacement getch() function was originally created for Watcom C - * and then additionally used with CYGWIN. Since UnZip 5.4, all other Win32 - * ports apply this replacement rather that their supplied getch() (or - * alike) function. There are problems with unabsorbed LF characters left - * over in the keyboard buffer under Win95 (and 98) when ENTER was pressed. - * (Under Win95, ENTER returns two(!!) characters: CR-LF.) This problem - * does not appear when run on a WinNT console prompt! - */ - -/* Watcom 10.6's getch() does not handle Alt+. */ -/* Note that if PASSWD_FROM_STDIN is defined, the file containing */ -/* the password must have a carriage return after the word, not a */ -/* Unix-style newline (linefeed only). This discards linefeeds. */ - -int getch_win32(void) -{ - HANDLE stin; - DWORD rc; - unsigned char buf[2]; - int ret = -1; - DWORD odemode = ~(DWORD)0; - -# ifdef PASSWD_FROM_STDIN - stin = GetStdHandle(STD_INPUT_HANDLE); -# else - stin = CreateFileA("CONIN$", GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - if (stin == INVALID_HANDLE_VALUE) - return -1; -# endif - if (GetConsoleMode(stin, &odemode)) - SetConsoleMode(stin, ENABLE_PROCESSED_INPUT); /* raw except ^C noticed */ - if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) - ret = buf[0]; - /* when the user hits return we get CR LF. We discard the LF, not the CR, - * because when we call this for the first time after a previous input - * such as the one for "replace foo? [y]es, ..." the LF may still be in - * the input stream before whatever the user types at our prompt. */ - if (ret == '\n') - if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) - ret = buf[0]; - if (odemode != ~(DWORD)0) - SetConsoleMode(stin, odemode); -# ifndef PASSWD_FROM_STDIN - CloseHandle(stin); -# endif - return ret; -} -#endif /* !WINDLL */ - - - -#if (defined(UNICODE_SUPPORT) && !defined(FUNZIP)) -/* convert wide character string to multi-byte character string */ -char *wide_to_local_string(wide_string, escape_all) - ZCONST zwchar *wide_string; - int escape_all; -{ - int i; - wchar_t wc; - int bytes_char; - int default_used; - int wsize = 0; - int max_bytes = 9; - char buf[9]; - char *buffer = NULL; - char *local_string = NULL; - - for (wsize = 0; wide_string[wsize]; wsize++) ; - - if (max_bytes < MB_CUR_MAX) - max_bytes = MB_CUR_MAX; - - if ((buffer = (char *)malloc(wsize * max_bytes + 1)) == NULL) { - return NULL; - } - - /* convert it */ - buffer[0] = '\0'; - for (i = 0; i < wsize; i++) { - if (sizeof(wchar_t) < 4 && wide_string[i] > 0xFFFF) { - /* wchar_t probably 2 bytes */ - /* could do surrogates if state_dependent and wctomb can do */ - wc = zwchar_to_wchar_t_default_char; - } else { - wc = (wchar_t)wide_string[i]; - } - /* Unter some vendor's C-RTL, the Wide-to-MultiByte conversion functions - * (like wctomb() et. al.) do not use the same codepage as the other - * string arguments I/O functions (fopen, mkdir, rmdir etc.). - * Therefore, we have to fall back to the underlying Win32-API call to - * achieve a consistent behaviour for all supported compiler environments. - * Failing RTLs are for example: - * Borland (locale uses OEM-CP as default, but I/O functions expect ANSI - * names) - * Watcom (only "C" locale, wctomb() always uses OEM CP) - * (in other words: all supported environments except the Microsoft RTLs) - */ - bytes_char = WideCharToMultiByte( - CP_ACP, WC_COMPOSITECHECK, - &wc, 1, - (LPSTR)buf, sizeof(buf), - NULL, &default_used); - if (default_used) - bytes_char = -1; - if (escape_all) { - if (bytes_char == 1 && (uch)buf[0] <= 0x7f) { - /* ASCII */ - strncat(buffer, buf, 1); - } else { - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } else if (bytes_char > 0) { - /* multi-byte char */ - strncat(buffer, buf, bytes_char); - } else { - /* no MB for this wide */ - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } - if ((local_string = (char *)realloc(buffer, strlen(buffer) + 1)) == NULL) { - free(buffer); - return NULL; - } - - return local_string; -} - - -#if 0 -wchar_t *utf8_to_wchar_string(utf8_string) - char *utf8_string; /* path to get utf-8 name for */ -{ - wchar_t *qw; - int ulen; - int ulenw; - - if (utf8_string == NULL) - return NULL; - - /* get length */ - ulenw = MultiByteToWideChar( - CP_UTF8, /* UTF-8 code page */ - 0, /* flags for character-type options */ - utf8_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - NULL, /* buffer */ - 0 ); /* buffer length (0 = return length) */ - if (ulenw == 0) { - /* failed */ - return NULL; - } - ulenw++; - /* get length in bytes */ - ulen = sizeof(wchar_t) * (ulenw + 1); - if ((qw = (wchar_t *)malloc(ulen + 1)) == NULL) { - return NULL; - } - /* convert multibyte to wide */ - ulen = MultiByteToWideChar( - CP_UTF8, /* UTF-8 code page */ - 0, /* flags for character-type options */ - utf8_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - qw, /* buffer */ - ulenw); /* buffer length (0 = return length) */ - if (ulen == 0) { - /* failed */ - free(qw); - return NULL; - } - - return qw; -} - -wchar_t *local_to_wchar_string(local_string) - char *local_string; /* path of local name */ -{ - wchar_t *qw; - int ulen; - int ulenw; - - if (local_string == NULL) - return NULL; - - /* get length */ - ulenw = MultiByteToWideChar( - CP_ACP, /* ANSI code page */ - 0, /* flags for character-type options */ - local_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - NULL, /* buffer */ - 0 ); /* buffer length (0 = return length) */ - if (ulenw == 0) { - /* failed */ - return NULL; - } - ulenw++; - /* get length in bytes */ - ulen = sizeof(wchar_t) * (ulenw + 1); - if ((qw = (wchar_t *)malloc(ulen + 1)) == NULL) { - return NULL; - } - /* convert multibyte to wide */ - ulen = MultiByteToWideChar( - CP_ACP, /* ANSI code page */ - 0, /* flags for character-type options */ - local_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - qw, /* buffer */ - ulenw); /* buffer length (0 = return length) */ - if (ulen == 0) { - /* failed */ - free(qw); - return NULL; - } - - return qw; -} -#endif /* 0 */ -#endif /* UNICODE_SUPPORT && !FUNZIP */ - - - -/* --------------------------------------------------- */ -/* Large File Support - * - * Initial functions by E. Gordon and R. Nausedat - * 9/10/2003 - * Lifted from Zip 3b, win32.c and place here by Myles Bennett - * 7/6/2004 - * - * These implement 64-bit file support for Windows. The - * defines and headers are in win32/w32cfg.h. - * - * Moved to win32i64.c by Mike White to avoid conflicts in - * same name functions in WiZ using UnZip and Zip libraries. - * 9/25/2003 - */ diff --git a/data/windows/unzipfx-catarina/win32/win32i64.c b/data/windows/unzipfx-catarina/win32/win32i64.c deleted file mode 100644 index e303c8f..0000000 --- a/data/windows/unzipfx-catarina/win32/win32i64.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - win32/win32i64.c - UnZip 6 - - 64-bit filesize support for WIN32 Zip and UnZip. - ---------------------------------------------------------------------------*/ - -#include "../zip.h" - -/* --------------------------------------------------- */ -/* Large File Support - * - * Initial functions by E. Gordon and R. Nausedat - * 9/10/2003 - * - * These implement 64-bit file support for Windows. The - * defines and headers are in win32/osdep.h. - * - * These moved from win32.c by Mike White to avoid conflicts - * in WiZ of same name functions in UnZip and Zip libraries. - * 9/25/04 EG - */ - -#if defined(LARGE_FILE_SUPPORT) && !defined(__CYGWIN__) -# ifdef USE_STRM_INPUT - -# ifndef zftello -/* 64-bit buffered ftello - * - * Win32 does not provide a 64-bit buffered - * ftell (in the published api anyway) so below provides - * hopefully close version. - * We have not gotten _telli64 to work with buffered - * streams. Below cheats by using fgetpos improperly and - * may not work on other ports. - */ - -zoff_t zftello(stream) - FILE *stream; -{ - fpos_t fpos = 0; - - if (fgetpos(stream, &fpos) != 0) { - return -1L; - } else { - return fpos; - } -} -# endif /* ndef zftello */ - - -# ifndef zfseeko -/* 64-bit buffered fseeko - * - * Win32 does not provide a 64-bit buffered - * fseeko, so use _lseeki64 and fflush. Note - * that SEEK_CUR can lose track of location - * if fflush is done between the last buffered - * io and this call. - */ - -int zfseeko(stream, offset, origin) - FILE *stream; - zoff_t offset; - int origin; -{ - - /* fseek() or its replacements are supposed to clear the eof status - of the stream. fflush() and _lseeki64() do not touch the stream's - eof flag, so we have to do it manually. */ -#if ((defined(_MSC_VER) && (_MSC_VER >= 1200)) || \ - (defined(__MINGW32__) && defined(__MSVCRT_VERSION__))) - /* For the MSC environment (VS 6 or higher), and for recent releases of - the MinGW environment, we "know" the internals of the FILE structure. - So, we can clear just the EOF bit of the status flag. */ - stream->_flag &= ~_IOEOF; -#else - /* Unfortunately, there is no standard "cleareof()" function, so we have - to use clearerr(). This has the unwanted side effect of clearing the - ferror() state as well. */ - clearerr(stream); -#endif - - if (origin == SEEK_CUR) { - /* instead of synching up lseek easier just to figure and - use an absolute offset */ - offset += zftello(stream); - origin = SEEK_SET; - } - fflush(stream); - if (_lseeki64(fileno(stream), offset, origin) == (zoff_t)-1L) { - return -1; - } else { - return 0; - } -} -# endif /* ndef fseeko */ -# endif /* USE_STRM_INPUT */ -#endif /* Win32 LARGE_FILE_SUPPORT */ - -#if 0 -FILE* zfopen(filename, mode) -const char *filename; -const char *mode; -{ - FILE* fTemp; - - fTemp = fopen(filename, mode); - if( fTemp == NULL ) - return NULL; - - /* sorry, could not make VC60 and its rtl work properly without setting the - * file buffer to NULL. the problem seems to be _telli64 which seems to - * return the max stream position, comments are welcome - */ - setbuf(fTemp, NULL); - - return fTemp; -} -#endif -/* --------------------------------------------------- */ diff --git a/data/windows/unzipfx-catarina/zip.h b/data/windows/unzipfx-catarina/zip.h deleted file mode 100644 index 4043bf1..0000000 --- a/data/windows/unzipfx-catarina/zip.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2003-May-08 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* This is a dummy zip.h to allow the source files shared with Zip - (crypt.c, crc32.c, ttyio.c, win32/win32i64.c) to compile for UnZip. - (In case you are looking for the Info-ZIP license, please follow - the pointers above.) */ - -#ifndef __zip_h /* don't include more than once */ -#define __zip_h - -#define UNZIP_INTERNAL -#include "unzip.h" - -#define local static - -#define ZE_MEM PK_MEM -#define ziperr(c, h) return - -#endif /* !__zip_h */ diff --git a/data/windows/unzipfx-catarina/zipinfo.c b/data/windows/unzipfx-catarina/zipinfo.c deleted file mode 100644 index a92bca9..0000000 --- a/data/windows/unzipfx-catarina/zipinfo.c +++ /dev/null @@ -1,2315 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - zipinfo.c Greg Roelofs et al. - - This file contains all of the ZipInfo-specific listing routines for UnZip. - - Contains: zi_opts() - zi_end_central() - zipinfo() - zi_long() - zi_short() - zi_time() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - - -#ifndef NO_ZIPINFO /* strings use up too much space in small-memory systems */ - -/* Define OS-specific attributes for use on ALL platforms--the S_xxxx - * versions of these are defined differently (or not defined) by different - * compilers and operating systems. */ - -#define UNX_IFMT 0170000 /* Unix file type mask */ -#define UNX_IFREG 0100000 /* Unix regular file */ -#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ -#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ -#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ -#define UNX_IFDIR 0040000 /* Unix directory */ -#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ -#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ -#define UNX_ISUID 04000 /* Unix set user id on execution */ -#define UNX_ISGID 02000 /* Unix set group id on execution */ -#define UNX_ISVTX 01000 /* Unix directory permissions control */ -#define UNX_ENFMT UNX_ISGID /* Unix record locking enforcement flag */ -#define UNX_IRWXU 00700 /* Unix read, write, execute: owner */ -#define UNX_IRUSR 00400 /* Unix read permission: owner */ -#define UNX_IWUSR 00200 /* Unix write permission: owner */ -#define UNX_IXUSR 00100 /* Unix execute permission: owner */ -#define UNX_IRWXG 00070 /* Unix read, write, execute: group */ -#define UNX_IRGRP 00040 /* Unix read permission: group */ -#define UNX_IWGRP 00020 /* Unix write permission: group */ -#define UNX_IXGRP 00010 /* Unix execute permission: group */ -#define UNX_IRWXO 00007 /* Unix read, write, execute: other */ -#define UNX_IROTH 00004 /* Unix read permission: other */ -#define UNX_IWOTH 00002 /* Unix write permission: other */ -#define UNX_IXOTH 00001 /* Unix execute permission: other */ - -#define VMS_IRUSR UNX_IRUSR /* VMS read/owner */ -#define VMS_IWUSR UNX_IWUSR /* VMS write/owner */ -#define VMS_IXUSR UNX_IXUSR /* VMS execute/owner */ -#define VMS_IRGRP UNX_IRGRP /* VMS read/group */ -#define VMS_IWGRP UNX_IWGRP /* VMS write/group */ -#define VMS_IXGRP UNX_IXGRP /* VMS execute/group */ -#define VMS_IROTH UNX_IROTH /* VMS read/other */ -#define VMS_IWOTH UNX_IWOTH /* VMS write/other */ -#define VMS_IXOTH UNX_IXOTH /* VMS execute/other */ - -#define AMI_IFMT 06000 /* Amiga file type mask */ -#define AMI_IFDIR 04000 /* Amiga directory */ -#define AMI_IFREG 02000 /* Amiga regular file */ -#define AMI_IHIDDEN 00200 /* to be supported in AmigaDOS 3.x */ -#define AMI_ISCRIPT 00100 /* executable script (text command file) */ -#define AMI_IPURE 00040 /* allow loading into resident memory */ -#define AMI_IARCHIVE 00020 /* not modified since bit was last set */ -#define AMI_IREAD 00010 /* can be opened for reading */ -#define AMI_IWRITE 00004 /* can be opened for writing */ -#define AMI_IEXECUTE 00002 /* executable image, a loadable runfile */ -#define AMI_IDELETE 00001 /* can be deleted */ - -#define THS_IFMT 0xF000 /* Theos file type mask */ -#define THS_IFIFO 0x1000 /* pipe */ -#define THS_IFCHR 0x2000 /* char device */ -#define THS_IFSOCK 0x3000 /* socket */ -#define THS_IFDIR 0x4000 /* directory */ -#define THS_IFLIB 0x5000 /* library */ -#define THS_IFBLK 0x6000 /* block device */ -#define THS_IFREG 0x8000 /* regular file */ -#define THS_IFREL 0x9000 /* relative (direct) */ -#define THS_IFKEY 0xA000 /* keyed */ -#define THS_IFIND 0xB000 /* indexed */ -#define THS_IFRND 0xC000 /* ???? */ -#define THS_IFR16 0xD000 /* 16 bit real mode program */ -#define THS_IFP16 0xE000 /* 16 bit protected mode prog */ -#define THS_IFP32 0xF000 /* 32 bit protected mode prog */ -#define THS_IMODF 0x0800 /* modified */ -#define THS_INHID 0x0400 /* not hidden */ -#define THS_IEUSR 0x0200 /* erase permission: owner */ -#define THS_IRUSR 0x0100 /* read permission: owner */ -#define THS_IWUSR 0x0080 /* write permission: owner */ -#define THS_IXUSR 0x0040 /* execute permission: owner */ -#define THS_IROTH 0x0004 /* read permission: other */ -#define THS_IWOTH 0x0002 /* write permission: other */ -#define THS_IXOTH 0x0001 /* execute permission: other */ - -#ifdef OLD_THEOS_EXTRA -# include "theos/oldstat.h" -#endif - -#ifndef NSK_UNSTRUCTURED -# define NSK_UNSTRUCTURED 0 -#endif -#ifndef NSK_OBJECTFILECODE -# define NSK_OBJECTFILECODE 100 -#endif -#ifndef NSK_EDITFILECODE -# define NSK_EDITFILECODE 101 -#endif - -#define LFLAG 3 /* short "ls -l" type listing */ - -static int zi_long OF((__GPRO__ zusz_t *pEndprev, int error_in_archive)); -static int zi_short OF((__GPRO)); -static void zi_showMacTypeCreator - OF((__GPRO__ uch *ebfield)); -static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, - ZCONST time_t *modtimez, char *d_t_str)); - - -/**********************************************/ -/* Strings used in zipinfo.c (ZipInfo half) */ -/**********************************************/ - -static ZCONST char nullStr[] = ""; -static ZCONST char PlurSufx[] = "s"; - -static ZCONST char Far ZipInfHeader2[] = - "Zip file size: %s bytes, number of entries: %s\n"; -static ZCONST char Far EndCentDirRec[] = "\nEnd-of-central-directory record:\n"; -static ZCONST char Far LineSeparators[] = "-------------------------------\n\n"; -static ZCONST char Far ZipFSizeVerbose[] = "\ - Zip archive file size: %s (%sh)\n"; -static ZCONST char Far ActOffsetCentDir[] = "\ - Actual end-cent-dir record offset: %s (%sh)\n\ - Expected end-cent-dir record offset: %s (%sh)\n\ - (based on the length of the central directory and its expected offset)\n\n"; -static ZCONST char Far SinglePartArchive1[] = "\ - This zipfile constitutes the sole disk of a single-part archive; its\n\ - central directory contains %s %s.\n\ - The central directory is %s (%sh) bytes long,\n"; -static ZCONST char Far SinglePartArchive2[] = "\ - and its (expected) offset in bytes from the beginning of the zipfile\n\ - is %s (%sh).\n\n"; -static ZCONST char Far MultiPartArchive1[] = "\ - This zipfile constitutes disk %lu of a multi-part archive. The central\n\ - directory starts on disk %lu at an offset within that archive part\n"; -static ZCONST char Far MultiPartArchive2[] = "\ - of %s (%sh) bytes. The entire\n\ - central directory is %s (%sh) bytes long.\n"; -static ZCONST char Far MultiPartArchive3[] = "\ - %s of the archive entries %s contained within this zipfile volume,\n\ - out of a total of %s %s.\n\n"; - -static ZCONST char Far CentralDirEntry[] = - "\nCentral directory entry #%lu:\n---------------------------\n\n"; -static ZCONST char Far ZipfileStats[] = - "%lu file%s, %s bytes uncompressed, %s bytes compressed: %s%d.%d%%\n"; - -/* zi_long() strings */ -static ZCONST char Far OS_FAT[] = "MS-DOS, OS/2 or NT FAT"; -static ZCONST char Far OS_Amiga[] = "Amiga"; -static ZCONST char Far OS_VMS[] = "VMS"; -static ZCONST char Far OS_Unix[] = "Unix"; -static ZCONST char Far OS_VMCMS[] = "VM/CMS"; -static ZCONST char Far OS_AtariST[] = "Atari ST"; -static ZCONST char Far OS_HPFS[] = "OS/2 or NT HPFS"; -static ZCONST char Far OS_Macintosh[] = "Macintosh HFS"; -static ZCONST char Far OS_ZSystem[] = "Z-System"; -static ZCONST char Far OS_CPM[] = "CP/M"; -static ZCONST char Far OS_TOPS20[] = "TOPS-20"; -static ZCONST char Far OS_NTFS[] = "NTFS"; -static ZCONST char Far OS_QDOS[] = "SMS/QDOS"; -static ZCONST char Far OS_Acorn[] = "Acorn RISC OS"; -static ZCONST char Far OS_MVS[] = "MVS"; -static ZCONST char Far OS_VFAT[] = "Win32 VFAT"; -static ZCONST char Far OS_AtheOS[] = "AtheOS"; -static ZCONST char Far OS_BeOS[] = "BeOS"; -static ZCONST char Far OS_Tandem[] = "Tandem NSK"; -static ZCONST char Far OS_Theos[] = "Theos"; -static ZCONST char Far OS_MacDarwin[] = "Mac OS/X (Darwin)"; -#ifdef OLD_THEOS_EXTRA - static ZCONST char Far OS_TheosOld[] = "Theos (Old)"; -#endif /* OLD_THEOS_EXTRA */ - -static ZCONST char Far MthdNone[] = "none (stored)"; -static ZCONST char Far MthdShrunk[] = "shrunk"; -static ZCONST char Far MthdRedF1[] = "reduced (factor 1)"; -static ZCONST char Far MthdRedF2[] = "reduced (factor 2)"; -static ZCONST char Far MthdRedF3[] = "reduced (factor 3)"; -static ZCONST char Far MthdRedF4[] = "reduced (factor 4)"; -static ZCONST char Far MthdImplode[] = "imploded"; -static ZCONST char Far MthdToken[] = "tokenized"; -static ZCONST char Far MthdDeflate[] = "deflated"; -static ZCONST char Far MthdDeflat64[] = "deflated (enhanced-64k)"; -static ZCONST char Far MthdDCLImplode[] = "imploded (PK DCL)"; -static ZCONST char Far MthdBZip2[] = "bzipped"; -static ZCONST char Far MthdLZMA[] = "LZMA-ed"; -static ZCONST char Far MthdTerse[] = "tersed (IBM)"; -static ZCONST char Far MthdLZ77[] = "LZ77-compressed (IBM)"; -static ZCONST char Far MthdWavPack[] = "WavPacked"; -static ZCONST char Far MthdPPMd[] = "PPMd-ed"; - -static ZCONST char Far DeflNorm[] = "normal"; -static ZCONST char Far DeflMax[] = "maximum"; -static ZCONST char Far DeflFast[] = "fast"; -static ZCONST char Far DeflSFast[] = "superfast"; - -static ZCONST char Far ExtraBytesPreceding[] = - " There are an extra %s bytes preceding this file.\n\n"; - -static ZCONST char Far UnknownNo[] = "unknown (%d)"; - -#ifdef ZIP64_SUPPORT - static ZCONST char Far LocalHeaderOffset[] = - "\n offset of local header from start of archive: %s\n\ - (%sh) bytes\n"; -#else - static ZCONST char Far LocalHeaderOffset[] = - "\n offset of local header from start of archive: %s (%sh) bytes\n"; -#endif -static ZCONST char Far HostOS[] = - " file system or operating system of origin: %s\n"; -static ZCONST char Far EncodeSWVer[] = - " version of encoding software: %u.%u\n"; -static ZCONST char Far MinOSCompReq[] = - " minimum file system compatibility required: %s\n"; -static ZCONST char Far MinSWVerReq[] = - " minimum software version required to extract: %u.%u\n"; -static ZCONST char Far CompressMethod[] = - " compression method: %s\n"; -static ZCONST char Far SlideWindowSizeImplode[] = - " size of sliding dictionary (implosion): %cK\n"; -static ZCONST char Far ShannonFanoTrees[] = - " number of Shannon-Fano trees (implosion): %c\n"; -static ZCONST char Far CompressSubtype[] = - " compression sub-type (deflation): %s\n"; -static ZCONST char Far FileSecurity[] = - " file security status: %sencrypted\n"; -static ZCONST char Far ExtendedLocalHdr[] = - " extended local header: %s\n"; -static ZCONST char Far FileModDate[] = - " file last modified on (DOS date/time): %s\n"; -#ifdef USE_EF_UT_TIME - static ZCONST char Far UT_FileModDate[] = - " file last modified on (UT extra field modtime): %s %s\n"; - static ZCONST char Far LocalTime[] = "local"; -#ifndef NO_GMTIME - static ZCONST char Far GMTime[] = "UTC"; -#endif -#endif /* USE_EF_UT_TIME */ -static ZCONST char Far CRC32Value[] = - " 32-bit CRC value (hex): %.8lx\n"; -static ZCONST char Far CompressedFileSize[] = - " compressed size: %s bytes\n"; -static ZCONST char Far UncompressedFileSize[] = - " uncompressed size: %s bytes\n"; -static ZCONST char Far FilenameLength[] = - " length of filename: %u characters\n"; -static ZCONST char Far ExtraFieldLength[] = - " length of extra field: %u bytes\n"; -static ZCONST char Far FileCommentLength[] = - " length of file comment: %u characters\n"; -static ZCONST char Far FileDiskNum[] = - " disk number on which file begins: disk %lu\n"; -static ZCONST char Far ApparentFileType[] = - " apparent file type: %s\n"; -static ZCONST char Far VMSFileAttributes[] = - " VMS file attributes (%06o octal): %s\n"; -static ZCONST char Far AmigaFileAttributes[] = - " Amiga file attributes (%06o octal): %s\n"; -static ZCONST char Far UnixFileAttributes[] = - " Unix file attributes (%06o octal): %s\n"; -static ZCONST char Far NonMSDOSFileAttributes[] = - " non-MSDOS external file attributes: %06lX hex\n"; -static ZCONST char Far MSDOSFileAttributes[] = - " MS-DOS file attributes (%02X hex): none\n"; -static ZCONST char Far MSDOSFileAttributesRO[] = - " MS-DOS file attributes (%02X hex): read-only\n"; -static ZCONST char Far MSDOSFileAttributesAlpha[] = - " MS-DOS file attributes (%02X hex): %s%s%s%s%s%s%s%s\n"; -static ZCONST char Far TheosFileAttributes[] = - " Theos file attributes (%04X hex): %s\n"; - -static ZCONST char Far TheosFTypLib[] = "Library "; -static ZCONST char Far TheosFTypDir[] = "Directory "; -static ZCONST char Far TheosFTypReg[] = "Sequential "; -static ZCONST char Far TheosFTypRel[] = "Direct "; -static ZCONST char Far TheosFTypKey[] = "Keyed "; -static ZCONST char Far TheosFTypInd[] = "Indexed "; -static ZCONST char Far TheosFTypR16[] = " 86 program "; -static ZCONST char Far TheosFTypP16[] = "286 program "; -static ZCONST char Far TheosFTypP32[] = "386 program "; -static ZCONST char Far TheosFTypUkn[] = "??? "; - -static ZCONST char Far ExtraFieldTrunc[] = "\n\ - error: EF data block (type 0x%04x) size %u exceeds remaining extra field\n\ - space %u; block length has been truncated.\n"; -static ZCONST char Far ExtraFields[] = "\n\ - The central-directory extra field contains:"; -static ZCONST char Far ExtraFieldType[] = "\n\ - - A subfield with ID 0x%04x (%s) and %u data bytes"; -static ZCONST char Far efPKSZ64[] = "PKWARE 64-bit sizes"; -static ZCONST char Far efAV[] = "PKWARE AV"; -static ZCONST char Far efOS2[] = "OS/2"; -static ZCONST char Far efPKVMS[] = "PKWARE VMS"; -static ZCONST char Far efPKWin32[] = "PKWARE Win32"; -static ZCONST char Far efPKUnix[] = "PKWARE Unix"; -static ZCONST char Far efIZVMS[] = "Info-ZIP VMS"; -static ZCONST char Far efIZUnix[] = "old Info-ZIP Unix/OS2/NT"; -static ZCONST char Far efIZUnix2[] = "Unix UID/GID (16-bit)"; -static ZCONST char Far efIZUnix3[] = "Unix UID/GID (any size)"; -static ZCONST char Far efTime[] = "universal time"; -static ZCONST char Far efU8Path[] = "UTF8 path name"; -static ZCONST char Far efU8Commnt[] = "UTF8 entry comment"; -static ZCONST char Far efJLMac[] = "old Info-ZIP Macintosh"; -static ZCONST char Far efMac3[] = "new Info-ZIP Macintosh"; -static ZCONST char Far efZipIt[] = "ZipIt Macintosh"; -static ZCONST char Far efSmartZip[] = "SmartZip Macintosh"; -static ZCONST char Far efZipIt2[] = "ZipIt Macintosh (short)"; -static ZCONST char Far efVMCMS[] = "VM/CMS"; -static ZCONST char Far efMVS[] = "MVS"; -static ZCONST char Far efACL[] = "OS/2 ACL"; -static ZCONST char Far efNTSD[] = "Security Descriptor"; -static ZCONST char Far efAtheOS[] = "AtheOS"; -static ZCONST char Far efBeOS[] = "BeOS"; -static ZCONST char Far efQDOS[] = "SMS/QDOS"; -static ZCONST char Far efAOSVS[] = "AOS/VS"; -static ZCONST char Far efSpark[] = "Acorn SparkFS"; -static ZCONST char Far efMD5[] = "Fred Kantor MD5"; -static ZCONST char Far efASiUnix[] = "ASi Unix"; -static ZCONST char Far efTandem[] = "Tandem NSK"; -static ZCONST char Far efTheos[] = "Theos"; -static ZCONST char Far efUnknown[] = "unknown"; - -static ZCONST char Far OS2EAs[] = ".\n\ - The local extra field has %lu bytes of OS/2 extended attributes.\n\ - (May not match OS/2 \"dir\" amount due to storage method)"; -static ZCONST char Far izVMSdata[] = ". The extra\n\ - field is %s and has %u bytes of VMS %s information%s"; -static ZCONST char Far izVMSstored[] = "stored"; -static ZCONST char Far izVMSrleenc[] = "run-length encoded"; -static ZCONST char Far izVMSdeflat[] = "deflated"; -static ZCONST char Far izVMScunknw[] = "compressed(?)"; -static ZCONST char Far *izVMScomp[4] = - {izVMSstored, izVMSrleenc, izVMSdeflat, izVMScunknw}; -static ZCONST char Far ACLdata[] = ".\n\ - The local extra field has %lu bytes of access control list information"; -static ZCONST char Far NTSDData[] = ".\n\ - The local extra field has %lu bytes of NT security descriptor data"; -static ZCONST char Far UTdata[] = ".\n\ - The local extra field has UTC/GMT %s time%s"; -static ZCONST char Far UTmodification[] = "modification"; -static ZCONST char Far UTaccess[] = "access"; -static ZCONST char Far UTcreation[] = "creation"; -static ZCONST char Far U8PthCmnComplete[] = ".\n\ - The UTF8 data of the extra field (V%u, ASCII name CRC `%.8lx') are:\n "; -static ZCONST char Far U8PthCmnF24[] = ". The first\n\ - 24 UTF8 bytes in the extra field (V%u, ASCII name CRC `%.8lx') are:\n "; -static ZCONST char Far ZipItFname[] = ".\n\ - The Mac long filename is %s"; -static ZCONST char Far Mac3data[] = ".\n\ - The local extra field has %lu bytes of %scompressed Macintosh\n\ - finder attributes"; - /* MacOSdata[] is used by EF_MAC3, EF_ZIPIT, EF_ZIPIT2 and EF_JLEE e. f. */ -static ZCONST char Far MacOSdata[] = ".\n\ - The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'"; -static ZCONST char Far MacOSdata1[] = ".\n\ - The associated file has type code `0x%lx' and creator code `0x%lx'"; -static ZCONST char Far MacOSJLEEflags[] = ".\n File is marked as %s"; -static ZCONST char Far MacOS_RF[] = "Resource-fork"; -static ZCONST char Far MacOS_DF[] = "Data-fork"; -static ZCONST char Far MacOSMAC3flags[] = ".\n\ - File is marked as %s, File Dates are in %d Bit"; -static ZCONST char Far AtheOSdata[] = ".\n\ - The local extra field has %lu bytes of %scompressed AtheOS file attributes"; -static ZCONST char Far BeOSdata[] = ".\n\ - The local extra field has %lu bytes of %scompressed BeOS file attributes"; - /* The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'" */ -static ZCONST char Far QDOSdata[] = ".\n\ - The QDOS extra field subtype is `%c%c%c%c'"; -static ZCONST char Far AOSVSdata[] = ".\n\ - The AOS/VS extra field revision is %d.%d"; -static ZCONST char Far TandemUnstr[] = "Unstructured"; -static ZCONST char Far TandemRel[] = "Relative"; -static ZCONST char Far TandemEntry[] = "Entry Sequenced"; -static ZCONST char Far TandemKey[] = "Key Sequenced"; -static ZCONST char Far TandemEdit[] = "Edit"; -static ZCONST char Far TandemObj[] = "Object"; -static ZCONST char Far *TandemFileformat[6] = - {TandemUnstr, TandemRel, TandemEntry, TandemKey, TandemEdit, TandemObj}; -static ZCONST char Far Tandemdata[] = ".\n\ - The file was originally a Tandem %s file, with file code %u"; -static ZCONST char Far MD5data[] = ".\n\ - The 128-bit MD5 signature is %s"; -#ifdef CMS_MVS - static ZCONST char Far VmMvsExtraField[] = ".\n\ - The stored file open mode (FLDATA TYPE) is \"%s\""; - static ZCONST char Far VmMvsInvalid[] = "[invalid]"; -#endif /* CMS_MVS */ - -static ZCONST char Far First20[] = ". The first\n 20 are: "; -static ZCONST char Far ColonIndent[] = ":\n "; -static ZCONST char Far efFormat[] = " %02x"; - -static ZCONST char Far lExtraFieldType[] = "\n\ - There %s a local extra field with ID 0x%04x (%s) and\n\ - %u data bytes (%s).\n"; -static ZCONST char Far efIZuid[] = - "GMT modification/access times and Unix UID/GID"; -static ZCONST char Far efIZnouid[] = "GMT modification/access times only"; - - -static ZCONST char Far NoFileComment[] = "\n There is no file comment.\n"; -static ZCONST char Far FileCommBegin[] = "\n\ -------------------------- file comment begins ----------------------------\n"; -static ZCONST char Far FileCommEnd[] = "\ --------------------------- file comment ends -----------------------------\n"; - -/* zi_time() strings */ -static ZCONST char Far BogusFmt[] = "%03d"; -static ZCONST char Far shtYMDHMTime[] = "%02u-%s-%02u %02u:%02u"; -static ZCONST char Far lngYMDHMSTime[] = "%u %s %u %02u:%02u:%02u"; -static ZCONST char Far DecimalTime[] = "%04u%02u%02u.%02u%02u%02u"; -#ifdef USE_EF_UT_TIME - static ZCONST char Far lngYMDHMSTimeError[] = "???? ??? ?? ??:??:??"; -#endif - - - - - -#ifndef WINDLL - -/************************/ -/* Function zi_opts() */ -/************************/ - -int zi_opts(__G__ pargc, pargv) - int *pargc; - char ***pargv; - __GDEF -{ - char **argv, *s; - int argc, c, error=FALSE, negative=0; - int hflag_slmv=TRUE, hflag_2=FALSE; /* diff options => diff defaults */ - int tflag_slm=TRUE, tflag_2v=FALSE; - int explicit_h=FALSE, explicit_t=FALSE; - - -#ifdef MACOS - uO.lflag = LFLAG; /* reset default on each call */ -#endif - G.extract_flag = FALSE; /* zipinfo does not extract to disk */ - argc = *pargc; - argv = *pargv; - - while (--argc > 0 && (*++argv)[0] == '-') { - s = argv[0] + 1; - while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ - switch (c) { - case '-': - ++negative; - break; - case '1': /* shortest listing: JUST filenames */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 1; - break; - case '2': /* just filenames, plus headers if specified */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 2; - break; -#ifndef CMS_MVS - case ('C'): /* -C: match filenames case-insensitively */ - if (negative) - uO.C_flag = FALSE, negative = 0; - else - uO.C_flag = TRUE; - break; -#endif /* !CMS_MVS */ - case 'h': /* header line */ - if (negative) - hflag_2 = hflag_slmv = FALSE, negative = 0; - else { - hflag_2 = hflag_slmv = explicit_h = TRUE; - if (uO.lflag == -1) - uO.lflag = 0; - } - break; - case 'l': /* longer form of "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 5; - break; - case 'm': /* medium form of "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 4; - break; -#ifdef MORE - case 'M': /* send output through built-in "more" */ - if (negative) - G.M_flag = FALSE, negative = 0; - else - G.M_flag = TRUE; - break; -#endif - case 's': /* default: shorter "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 3; - break; - case 't': /* totals line */ - if (negative) - tflag_2v = tflag_slm = FALSE, negative = 0; - else { - tflag_2v = tflag_slm = explicit_t = TRUE; - if (uO.lflag == -1) - uO.lflag = 0; - } - break; - case ('T'): /* use (sortable) decimal time format */ - if (negative) - uO.T_flag = FALSE, negative = 0; - else - uO.T_flag = TRUE; - break; -#ifdef UNICODE_SUPPORT - case ('U'): /* escape UTF-8, or disable UTF-8 support */ - if (negative) { - uO.U_flag = MAX(uO.U_flag-negative,0); - negative = 0; - } else - uO.U_flag++; - break; -#endif /* UNICODE_SUPPORT */ - case 'v': /* turbo-verbose listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 10; - break; -#ifdef WILD_STOP_AT_DIR - case ('W'): /* Wildcard interpretation (stop at '/'?) */ - if (negative) - uO.W_flag = FALSE, negative = 0; - else - uO.W_flag = TRUE; - break; -#endif /* WILD_STOP_AT_DIR */ - case 'z': /* print zipfile comment */ - if (negative) - uO.zflag = negative = 0; - else - uO.zflag = 1; - break; - case 'Z': /* ZipInfo mode: ignore */ - break; - default: - error = TRUE; - break; - } - } - } - if ((argc-- == 0) || error) { - *pargc = argc; - *pargv = argv; - return USAGE(error); - } - -#ifdef MORE - if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func useless */ - G.M_flag = 0; -#endif - - /* if no listing options given (or all negated), or if only -h/-t given - * with individual files specified, use default listing format */ - if ((uO.lflag < 0) || ((argc > 0) && (uO.lflag == 0))) - uO.lflag = LFLAG; - - /* set header and totals flags to default or specified values */ - switch (uO.lflag) { - case 0: /* 0: can only occur if either -t or -h explicitly given; */ - case 2: /* therefore set both flags equal to normally false value */ - uO.hflag = hflag_2; - uO.tflag = tflag_2v; - break; - case 1: /* only filenames, *always* */ - uO.hflag = FALSE; - uO.tflag = FALSE; - uO.zflag = FALSE; - break; - case 3: - case 4: - case 5: - uO.hflag = ((argc > 0) && !explicit_h)? FALSE : hflag_slmv; - uO.tflag = ((argc > 0) && !explicit_t)? FALSE : tflag_slm; - break; - case 10: - uO.hflag = hflag_slmv; - uO.tflag = tflag_2v; - break; - } - - *pargc = argc; - *pargv = argv; - return 0; - -} /* end function zi_opts() */ - -#endif /* !WINDLL */ - - - - - -/*******************************/ -/* Function zi_end_central() */ -/*******************************/ - -void zi_end_central(__G) - __GDEF -{ -/*--------------------------------------------------------------------------- - Print out various interesting things about the zipfile. - ---------------------------------------------------------------------------*/ - - if (uO.lflag > 9) { - /* verbose format */ - Info(slide, 0, ((char *)slide, LoadFarString(EndCentDirRec))); - Info(slide, 0, ((char *)slide, LoadFarString(LineSeparators))); - - Info(slide, 0, ((char *)slide, LoadFarString(ZipFSizeVerbose), - FmZofft(G.ziplen, "11", NULL), - FmZofft(G.ziplen, FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(ActOffsetCentDir), - FmZofft(G.real_ecrec_offset, "11", "u"), - FmZofft(G.real_ecrec_offset, FZOFFT_HEX_DOT_WID, "X"), - FmZofft(G.expect_ecrec_offset, "11", "u"), - FmZofft(G.expect_ecrec_offset, FZOFFT_HEX_DOT_WID, "X"))); - - if (G.ecrec.number_this_disk == 0) { - Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive1), - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"), - (G.ecrec.total_entries_central_dir == 1)? "entry" : "entries", - FmZofft(G.ecrec.size_central_directory, NULL, "u"), - FmZofft(G.ecrec.size_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive2), - FmZofft(G.ecrec.offset_start_central_directory, NULL, "u"), - FmZofft(G.ecrec.offset_start_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - } else { - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive1), - (ulg)(G.ecrec.number_this_disk + 1), - (ulg)(G.ecrec.num_disk_start_cdir + 1))); - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive2), - FmZofft(G.ecrec.offset_start_central_directory, NULL, "u"), - FmZofft(G.ecrec.offset_start_central_directory, - FZOFFT_HEX_DOT_WID, "X"), - FmZofft(G.ecrec.size_central_directory, NULL, "u"), - FmZofft(G.ecrec.size_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive3), - FmZofft(G.ecrec.num_entries_centrl_dir_ths_disk, NULL, "u"), - (G.ecrec.num_entries_centrl_dir_ths_disk == 1)? "is" : "are", - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"), - (G.ecrec.total_entries_central_dir == 1) ? "entry" : "entries")); - } - } - else if (uO.hflag) { - /* print zip file size and number of contained entries: */ - Info(slide, 0, ((char *)slide, LoadFarString(ZipInfHeader2), - FmZofft(G.ziplen, NULL, NULL), - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"))); - } - -} /* end function zi_end_central() */ - - - - - -/************************/ -/* Function zipinfo() */ -/************************/ - -int zipinfo(__G) /* return PK-type error code */ - __GDEF -{ - int do_this_file=FALSE, error, error_in_archive=PK_COOL; - int *fn_matched=NULL, *xn_matched=NULL; - ulg j, members=0L; - zusz_t tot_csize=0L, tot_ucsize=0L; - zusz_t endprev; /* buffers end of previous entry for zi_long()'s check - * of extra bytes */ - - -/*--------------------------------------------------------------------------- - Malloc space for check on unmatched filespecs (no big deal if one or both - are NULL). - ---------------------------------------------------------------------------*/ - - if (G.filespecs > 0 && - (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != NULL) - for (j = 0; j < G.filespecs; ++j) - fn_matched[j] = FALSE; - - if (G.xfilespecs > 0 && - (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != NULL) - for (j = 0; j < G.xfilespecs; ++j) - xn_matched[j] = FALSE; - -/*--------------------------------------------------------------------------- - Set file pointer to start of central directory, then loop through cen- - tral directory entries. Check that directory-entry signature bytes are - actually there (just a precaution), then process the entry. We know - the entire central directory is on this disk: we wouldn't have any of - this information unless the end-of-central-directory record was on this - disk, and we wouldn't have gotten to this routine unless this is also - the disk on which the central directory starts. In practice, this had - better be the *only* disk in the archive, but maybe someday we'll add - multi-disk support. - ---------------------------------------------------------------------------*/ - - uO.L_flag = FALSE; /* zipinfo mode: never convert name to lowercase */ - G.pInfo = G.info; /* (re-)initialize, (just to make sure) */ - G.pInfo->textmode = 0; /* so one can read on screen (is this ever used?) */ - - /* reset endprev for new zipfile; account for multi-part archives (?) */ - endprev = (G.crec.relative_offset_local_header == 4L)? 4L : 0L; - - - for (j = 1L;; j++) { - if (readbuf(__G__ G.sig, 4) == 0) { - error_in_archive = PK_EOF; - break; - } - if (memcmp(G.sig, central_hdr_sig, 4)) { /* is it a CentDir entry? */ - /* no new central directory entry - * -> is the number of processed entries compatible with the - * number of entries as stored in the end_central record? - */ - if (((j - 1) & - (ulg)(G.ecrec.have_ecr64 ? MASK_ZUCN64 : MASK_ZUCN16)) - == (ulg)G.ecrec.total_entries_central_dir) - { - /* "j modulus 4T/64k" matches the reported 64/16-bit-unsigned - * number of directory entries -> probably, the regular - * end of the central directory has been reached - */ - break; - } else { - Info(slide, 0x401, - ((char *)slide, LoadFarString(CentSigMsg), j)); - Info(slide, 0x401, - ((char *)slide, LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; /* sig not found */ - break; - } - } - /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag, ...: */ - if ((error = process_cdir_file_hdr(__G)) != PK_COOL) { - error_in_archive = error; /* only PK_EOF defined */ - break; - } - - if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) /* fatal */ - break; - } - - if (!G.process_all_files) { /* check if specified on command line */ - unsigned i; - - if (G.filespecs == 0) - do_this_file = TRUE; - else { /* check if this entry matches an `include' argument */ - do_this_file = FALSE; - for (i = 0; i < G.filespecs; i++) - if (match(G.filename, G.pfnames[i], uO.C_flag WISEP)) { - do_this_file = TRUE; - if (fn_matched) - fn_matched[i] = TRUE; - break; /* found match, so stop looping */ - } - } - if (do_this_file) { /* check if this is an excluded file */ - for (i = 0; i < G.xfilespecs; i++) - if (match(G.filename, G.pxnames[i], uO.C_flag WISEP)) { - do_this_file = FALSE; /* ^-- ignore case in match */ - if (xn_matched) - xn_matched[i] = TRUE; - break; - } - } - } - - /*----------------------------------------------------------------------- - If current file was specified on command line, or if no names were - specified, do the listing for this file. Otherwise, get rid of the - file comment and go back for the next file. - -----------------------------------------------------------------------*/ - - if (G.process_all_files || do_this_file) { - - /* Read the extra field, if any. The extra field info is required - * for resolving the Zip64 sizes/offsets and may be used in more - * analysis of the entry below. - */ - if ((error = do_string(__G__ G.crec.extra_field_length, - EXTRA_FIELD)) != 0) - { - if (G.extra_field != NULL) { - free(G.extra_field); - G.extra_field = NULL; - } - error_in_archive = error; - /* The premature return in case of a "fatal" error (PK_EOF) is - * delayed until we analyze the extra field contents. - * This allows us to display all the other info that has been - * successfully read in. - */ - } - - switch (uO.lflag) { - case 1: - case 2: - fnprint(__G); - SKIP_(G.crec.file_comment_length) - break; - - case 3: - case 4: - case 5: - if ((error = zi_short(__G)) != PK_COOL) { - error_in_archive = error; /* might be warning */ - } - break; - - case 10: - Info(slide, 0, ((char *)slide, - LoadFarString(CentralDirEntry), j)); - if ((error = zi_long(__G__ &endprev, - error_in_archive)) != PK_COOL) { - error_in_archive = error; /* might be warning */ - } - break; - - default: - SKIP_(G.crec.file_comment_length) - break; - - } /* end switch (lflag) */ - if (error > PK_WARN) /* fatal */ - break; - - tot_csize += G.crec.csize; - tot_ucsize += G.crec.ucsize; - if (G.crec.general_purpose_bit_flag & 1) - tot_csize -= 12; /* don't count encryption header */ - ++members; - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, - G.filename, (zvoid *)&G.crec.ucsize)) { - /* cancel operation by user request */ - error_in_archive = IZ_CTRLC; - break; - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif - - } else { /* not listing this file */ - SKIP_(G.crec.extra_field_length) - SKIP_(G.crec.file_comment_length) - if (endprev != 0) endprev = 0; - - } /* end if (list member?) */ - - } /* end for-loop (j: member files) */ - -/*--------------------------------------------------------------------------- - Check that we actually found requested files; if so, print totals. - ---------------------------------------------------------------------------*/ - - if ((error_in_archive <= PK_WARN) && uO.tflag) { - char *sgn = ""; - int cfactor = ratio(tot_ucsize, tot_csize); - - if (cfactor < 0) { - sgn = "-"; - cfactor = -cfactor; - } - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileStats), - members, (members==1L)? nullStr:PlurSufx, - FmZofft(tot_ucsize, NULL, "u"), - FmZofft(tot_csize, NULL, "u"), - sgn, cfactor/10, cfactor%10)); - } - -/*--------------------------------------------------------------------------- - Check for unmatched filespecs on command line and print warning if any - found. - ---------------------------------------------------------------------------*/ - - if (fn_matched) { - if (error_in_archive <= PK_WARN) - for (j = 0; j < G.filespecs; ++j) - if (!fn_matched[j]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[j])); - free((zvoid *)fn_matched); - } - if (xn_matched) { - if (error_in_archive <= PK_WARN) - for (j = 0; j < G.xfilespecs; ++j) - if (!xn_matched[j]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExclFilenameNotMatched), G.pxnames[j])); - free((zvoid *)xn_matched); - } - - - /* Skip the following checks in case of a premature listing break. */ - if (error_in_archive <= PK_WARN) { - -/*--------------------------------------------------------------------------- - Double check that we're back at the end-of-central-directory record. - ---------------------------------------------------------------------------*/ - - if ( (memcmp(G.sig, - (G.ecrec.have_ecr64 ? - end_central64_sig : end_central_sig), - 4) != 0) - && (!G.ecrec.is_zip64_archive) - && (memcmp(G.sig, end_central_sig, 4) != 0) - ) { /* just to make sure again */ - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); - error_in_archive = PK_WARN; /* didn't find sig */ - } - - /* Set specific return code when no files have been found. */ - if (members == 0L && error_in_archive <= PK_WARN) - error_in_archive = PK_FIND; - - if (uO.lflag >= 10) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - } - - return error_in_archive; - -} /* end function zipinfo() */ - - - - - -/************************/ -/* Function zi_long() */ -/************************/ - -static int zi_long(__G__ pEndprev, error_in_archive) - /* return PK-type error code */ - __GDEF - zusz_t *pEndprev; /* for zi_long() check of extra bytes */ - int error_in_archive; /* may signal premature return */ -{ -#ifdef USE_EF_UT_TIME - iztimes z_utime; -#endif - int error; - unsigned hostnum, hostver, extnum, extver, methid, methnum, xattr; - char workspace[12], attribs[22]; - ZCONST char *varmsg_str; - char unkn[16]; - static ZCONST char Far *os[NUM_HOSTS] = { - OS_FAT, OS_Amiga, OS_VMS, OS_Unix, OS_VMCMS, OS_AtariST, OS_HPFS, - OS_Macintosh, OS_ZSystem, OS_CPM, OS_TOPS20, OS_NTFS, OS_QDOS, - OS_Acorn, OS_VFAT, OS_MVS, OS_BeOS, OS_Tandem, OS_Theos, OS_MacDarwin, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - OS_AtheOS - }; - static ZCONST char Far *method[NUM_METHODS] = { - MthdNone, MthdShrunk, MthdRedF1, MthdRedF2, MthdRedF3, MthdRedF4, - MthdImplode, MthdToken, MthdDeflate, MthdDeflat64, MthdDCLImplode, - MthdBZip2, MthdLZMA, MthdTerse, MthdLZ77, MthdWavPack, MthdPPMd - }; - static ZCONST char Far *dtypelng[4] = { - DeflNorm, DeflMax, DeflFast, DeflSFast - }; - - -/*--------------------------------------------------------------------------- - Check whether there's any extra space inside the zipfile. If *pEndprev is - zero, it's probably a signal that OS/2 extra fields are involved (with - unknown compressed size). We won't worry about prepended junk here... - ---------------------------------------------------------------------------*/ - - if (G.crec.relative_offset_local_header != *pEndprev && *pEndprev > 0L) { - /* GRR DEBUG - Info(slide, 0, ((char *)slide, - " [crec.relative_offset_local_header = %lu, endprev = %lu]\n", - G.crec.relative_offset_local_header, *pEndprev)); - */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtraBytesPreceding), - FmZofft((G.crec.relative_offset_local_header - (*pEndprev)), - NULL, NULL))); - } - - /* calculate endprev for next time around (problem: extra fields may - * differ in length between local and central-directory records) */ - *pEndprev = G.crec.relative_offset_local_header + (4L + LREC_SIZE) + - G.crec.filename_length + G.crec.extra_field_length + G.crec.csize; - -/*--------------------------------------------------------------------------- - Print out various interesting things about the compressed file. - ---------------------------------------------------------------------------*/ - - hostnum = (unsigned)(G.pInfo->hostnum); - hostver = (unsigned)(G.pInfo->hostver); - extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); - extver = (unsigned)G.crec.version_needed_to_extract[0]; - methid = (unsigned)G.crec.compression_method; - methnum = find_compr_idx(G.crec.compression_method); - - (*G.message)((zvoid *)&G, (uch *)" ", 2L, 0); fnprint(__G); - - Info(slide, 0, ((char *)slide, LoadFarString(LocalHeaderOffset), - FmZofft(G.crec.relative_offset_local_header, NULL, "u"), - FmZofft(G.crec.relative_offset_local_header, FZOFFT_HEX_DOT_WID, "X"))); - - if (hostnum >= NUM_HOSTS) { - sprintf(unkn, LoadFarString(UnknownNo), - (int)G.crec.version_made_by[1]); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(os[hostnum]); -#ifdef OLD_THEOS_EXTRA - if (hostnum == FS_VFAT_ && hostver == 20) { - /* entry made by old non-official THEOS port zip archive */ - varmsg_str = LoadFarStringSmall(OS_TheosOld); - } -#endif /* OLD_THEOS_EXTRA */ - } - Info(slide, 0, ((char *)slide, LoadFarString(HostOS), varmsg_str)); - Info(slide, 0, ((char *)slide, LoadFarString(EncodeSWVer), hostver/10, - hostver%10)); - - if ((extnum >= NUM_HOSTS) || (os[extnum] == NULL)) { - sprintf(unkn, LoadFarString(UnknownNo), - (int)G.crec.version_needed_to_extract[1]); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(os[extnum]); - } - Info(slide, 0, ((char *)slide, LoadFarString(MinOSCompReq), varmsg_str)); - Info(slide, 0, ((char *)slide, LoadFarString(MinSWVerReq), extver/10, - extver%10)); - - if (methnum >= NUM_METHODS) { - sprintf(unkn, LoadFarString(UnknownNo), G.crec.compression_method); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(method[methnum]); - } - Info(slide, 0, ((char *)slide, LoadFarString(CompressMethod), varmsg_str)); - if (methid == IMPLODED) { - Info(slide, 0, ((char *)slide, LoadFarString(SlideWindowSizeImplode), - (G.crec.general_purpose_bit_flag & 2)? '8' : '4')); - Info(slide, 0, ((char *)slide, LoadFarString(ShannonFanoTrees), - (G.crec.general_purpose_bit_flag & 4)? '3' : '2')); - } else if (methid == DEFLATED || methid == ENHDEFLATED) { - ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); - - Info(slide, 0, ((char *)slide, LoadFarString(CompressSubtype), - LoadFarStringSmall(dtypelng[dnum]))); - } - - Info(slide, 0, ((char *)slide, LoadFarString(FileSecurity), - (G.crec.general_purpose_bit_flag & 1) ? nullStr : "not ")); - Info(slide, 0, ((char *)slide, LoadFarString(ExtendedLocalHdr), - (G.crec.general_purpose_bit_flag & 8) ? "yes" : "no")); - /* print upper 3 bits for amusement? */ - - /* For printing of date & time, a "char d_t_buf[21]" is required. - * To save stack space, we reuse the "char attribs[22]" buffer which - * is not used yet. - */ -# define d_t_buf attribs - - zi_time(__G__ &G.crec.last_mod_dos_datetime, NULL, d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(FileModDate), d_t_buf)); -#ifdef USE_EF_UT_TIME - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, - G.crec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME)) - { - TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ - d_t_buf[0] = (char)0; /* signal "show local time" */ - zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), - d_t_buf, LoadFarStringSmall(LocalTime))); -#ifndef NO_GMTIME - d_t_buf[0] = (char)1; /* signal "show UTC (GMT) time" */ - zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), - d_t_buf, LoadFarStringSmall(GMTime))); -#endif /* !NO_GMTIME */ - } -#endif /* USE_EF_UT_TIME */ - - Info(slide, 0, ((char *)slide, LoadFarString(CRC32Value), G.crec.crc32)); - Info(slide, 0, ((char *)slide, LoadFarString(CompressedFileSize), - FmZofft(G.crec.csize, NULL, "u"))); - Info(slide, 0, ((char *)slide, LoadFarString(UncompressedFileSize), - FmZofft(G.crec.ucsize, NULL, "u"))); - Info(slide, 0, ((char *)slide, LoadFarString(FilenameLength), - G.crec.filename_length)); - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldLength), - G.crec.extra_field_length)); - Info(slide, 0, ((char *)slide, LoadFarString(FileCommentLength), - G.crec.file_comment_length)); - Info(slide, 0, ((char *)slide, LoadFarString(FileDiskNum), - (ulg)(G.crec.disk_number_start + 1))); - Info(slide, 0, ((char *)slide, LoadFarString(ApparentFileType), - (G.crec.internal_file_attributes & 1)? "text" - : (G.crec.internal_file_attributes & 2)? "ebcdic" - : "binary")); /* changed to accept EBCDIC */ -#ifdef ATARI - printf(" external file attributes (hex): %.8lx\n", - G.crec.external_file_attributes); -#endif - xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); - if (hostnum == VMS_) { - char *p=attribs, *q=attribs+1; - int i, j, k; - - for (k = 0; k < 12; ++k) - workspace[k] = 0; - if (xattr & VMS_IRUSR) - workspace[0] = 'R'; - if (xattr & VMS_IWUSR) { - workspace[1] = 'W'; - workspace[3] = 'D'; - } - if (xattr & VMS_IXUSR) - workspace[2] = 'E'; - if (xattr & VMS_IRGRP) - workspace[4] = 'R'; - if (xattr & VMS_IWGRP) { - workspace[5] = 'W'; - workspace[7] = 'D'; - } - if (xattr & VMS_IXGRP) - workspace[6] = 'E'; - if (xattr & VMS_IROTH) - workspace[8] = 'R'; - if (xattr & VMS_IWOTH) { - workspace[9] = 'W'; - workspace[11] = 'D'; - } - if (xattr & VMS_IXOTH) - workspace[10] = 'E'; - - *p++ = '('; - for (k = j = 0; j < 3; ++j) { /* loop over groups of permissions */ - for (i = 0; i < 4; ++i, ++k) /* loop over perms within a group */ - if (workspace[k]) - *p++ = workspace[k]; - *p++ = ','; /* group separator */ - if (j == 0) - while ((*p++ = *q++) != ',') - ; /* system, owner perms are same */ - } - *p-- = '\0'; - *p = ')'; /* overwrite last comma */ - Info(slide, 0, ((char *)slide, LoadFarString(VMSFileAttributes), xattr, - attribs)); - - } else if (hostnum == AMIGA_) { - switch (xattr & AMI_IFMT) { - case AMI_IFDIR: attribs[0] = 'd'; break; - case AMI_IFREG: attribs[0] = '-'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; - attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; - attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; - attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; - attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; - attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; - attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; - attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; - attribs[9] = 0; /* better dlm the string */ - Info(slide, 0, ((char *)slide, LoadFarString(AmigaFileAttributes), - xattr, attribs)); - - } else if (hostnum == THEOS_) { - ZCONST char Far *fpFtyp; - - switch (xattr & THS_IFMT) { - case THS_IFLIB: fpFtyp = TheosFTypLib; break; - case THS_IFDIR: fpFtyp = TheosFTypDir; break; - case THS_IFREG: fpFtyp = TheosFTypReg; break; - case THS_IFREL: fpFtyp = TheosFTypRel; break; - case THS_IFKEY: fpFtyp = TheosFTypKey; break; - case THS_IFIND: fpFtyp = TheosFTypInd; break; - case THS_IFR16: fpFtyp = TheosFTypR16; break; - case THS_IFP16: fpFtyp = TheosFTypP16; break; - case THS_IFP32: fpFtyp = TheosFTypP32; break; - default: fpFtyp = TheosFTypUkn; break; - } - strcpy(attribs, LoadFarStringSmall(fpFtyp)); - attribs[12] = (xattr & THS_INHID) ? '.' : 'H'; - attribs[13] = (xattr & THS_IMODF) ? '.' : 'M'; - attribs[14] = (xattr & THS_IWOTH) ? '.' : 'W'; - attribs[15] = (xattr & THS_IROTH) ? '.' : 'R'; - attribs[16] = (xattr & THS_IEUSR) ? '.' : 'E'; - attribs[17] = (xattr & THS_IXUSR) ? '.' : 'X'; - attribs[18] = (xattr & THS_IWUSR) ? '.' : 'W'; - attribs[19] = (xattr & THS_IRUSR) ? '.' : 'R'; - attribs[20] = 0; - Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), - xattr, attribs)); - -#ifdef OLD_THEOS_EXTRA - } else if (hostnum == FS_VFAT_ && hostver == 20) { - /* process old non-official THEOS port zip archive */ - ZCONST char Far *fpFtyp; - - switch (xattr & _THS_IFMT) { - case _THS_IFLIB: fpFtyp = TheosFTypLib; break; - case _THS_IFDIR: fpFtyp = TheosFTypDir; break; - case _THS_IFREG: fpFtyp = TheosFTypReg; break; - case _THS_IODRC: fpFtyp = TheosFTypRel; break; - case _THS_IOKEY: fpFtyp = TheosFTypKey; break; - case _THS_IOIND: fpFtyp = TheosFTypInd; break; - case _THS_IOPRG: fpFtyp = TheosFTypR16; break; - case _THS_IO286: fpFtyp = TheosFTypP16; break; - case _THS_IO386: fpFtyp = TheosFTypP32; break; - default: fpFtyp = TheosFTypUkn; break; - } - strcpy(attribs, LoadFarStringSmall(fpFtyp)); - attribs[12] = (xattr & _THS_HIDDN) ? 'H' : '.'; - attribs[13] = (xattr & _THS_IXOTH) ? '.' : 'X'; - attribs[14] = (xattr & _THS_IWOTH) ? '.' : 'W'; - attribs[15] = (xattr & _THS_IROTH) ? '.' : 'R'; - attribs[16] = (xattr & _THS_IEUSR) ? '.' : 'E'; - attribs[17] = (xattr & _THS_IXUSR) ? '.' : 'X'; - attribs[18] = (xattr & _THS_IWUSR) ? '.' : 'W'; - attribs[19] = (xattr & _THS_IRUSR) ? '.' : 'R'; - attribs[20] = 0; - Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), - xattr, attribs)); -#endif /* OLD_THEOS_EXTRA */ - - } else if ((hostnum != FS_FAT_) && (hostnum != FS_HPFS_) && - (hostnum != FS_NTFS_) && (hostnum != FS_VFAT_) && - (hostnum != ACORN_) && - (hostnum != VM_CMS_) && (hostnum != MVS_)) - { /* assume Unix-like */ - switch ((unsigned)(xattr & UNX_IFMT)) { - case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; - case (unsigned)UNX_IFREG: attribs[0] = '-'; break; - case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; - case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; - case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; - case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; - case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; - attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; - attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; - - attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; - attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; - attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; - - if (xattr & UNX_IXUSR) - attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; - else - attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S = undefined */ - if (xattr & UNX_IXGRP) - attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ - else - attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; - if (xattr & UNX_IXOTH) - attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ - else - attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T = undefined */ - attribs[10] = 0; - - Info(slide, 0, ((char *)slide, LoadFarString(UnixFileAttributes), xattr, - attribs)); - - } else { - Info(slide, 0, ((char *)slide, LoadFarString(NonMSDOSFileAttributes), - G.crec.external_file_attributes >> 8)); - - } /* endif (hostnum: external attributes format) */ - - if ((xattr=(unsigned)(G.crec.external_file_attributes & 0xFF)) == 0) - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributes), - xattr)); - else if (xattr == 1) - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesRO), - xattr)); - else - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesAlpha), - xattr, (xattr&1)? "rdo " : nullStr, - (xattr&2)? "hid " : nullStr, - (xattr&4)? "sys " : nullStr, - (xattr&8)? "lab " : nullStr, - (xattr&16)? "dir " : nullStr, - (xattr&32)? "arc " : nullStr, - (xattr&64)? "lnk " : nullStr, - (xattr&128)? "exe" : nullStr)); - -/*--------------------------------------------------------------------------- - Analyze the extra field, if any, and print the file comment, if any (the - filename has already been printed, above). That finishes up this file - entry... - ---------------------------------------------------------------------------*/ - - if (G.crec.extra_field_length > 0) { - uch *ef_ptr = G.extra_field; - ush ef_len = G.crec.extra_field_length; - ush eb_id, eb_datalen; - ZCONST char Far *ef_fieldname; - - if (error_in_archive > PK_WARN) /* fatal: can't continue */ - /* delayed "fatal error" return from extra field reading */ - return error_in_archive; - if (G.extra_field == (uch *)NULL) - return PK_ERR; /* not consistent with crec length */ - - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFields))); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(&ef_ptr[EB_ID]); - eb_datalen = makeword(&ef_ptr[EB_LEN]); - ef_ptr += EB_HEADSIZE; - ef_len -= EB_HEADSIZE; - - if (eb_datalen > (ush)ef_len) { - Info(slide, 0x421, ((char *)slide, - LoadFarString(ExtraFieldTrunc), eb_id, eb_datalen, ef_len)); - eb_datalen = ef_len; - } - - switch (eb_id) { - case EF_PKSZ64: - ef_fieldname = efPKSZ64; - if ((G.crec.relative_offset_local_header - & (~(zusz_t)0xFFFFFFFFL)) != 0) { - /* Subtract the size of the 64bit local offset from - the local e.f. size, local Z64 e.f. block has no - offset; when only local offset present, the entire - local PKSZ64 block is missing. */ - *pEndprev -= (eb_datalen == 8 ? 12 : 8); - } - break; - case EF_AV: - ef_fieldname = efAV; - break; - case EF_OS2: - ef_fieldname = efOS2; - break; - case EF_ACL: - ef_fieldname = efACL; - break; - case EF_NTSD: - ef_fieldname = efNTSD; - break; - case EF_PKVMS: - ef_fieldname = efPKVMS; - break; - case EF_IZVMS: - ef_fieldname = efIZVMS; - break; - case EF_PKW32: - ef_fieldname = efPKWin32; - break; - case EF_PKUNIX: - ef_fieldname = efPKUnix; - break; - case EF_IZUNIX: - ef_fieldname = efIZUnix; - if (hostnum == UNIX_ && *pEndprev > 0L) - *pEndprev += 4L; /* also have UID/GID in local copy */ - break; - case EF_IZUNIX2: - ef_fieldname = efIZUnix2; - if (*pEndprev > 0L) - *pEndprev += 4L; /* 4 byte UID/GID in local copy */ - break; - case EF_IZUNIX3: - ef_fieldname = efIZUnix3; -#if 0 - if (*pEndprev > 0L) - *pEndprev += 4L; /* 4 byte UID/GID in local copy */ -#endif - break; - case EF_TIME: - ef_fieldname = efTime; - break; - case EF_UNIPATH: - ef_fieldname = efU8Path; - break; - case EF_UNICOMNT: - ef_fieldname = efU8Commnt; - break; - case EF_MAC3: - ef_fieldname = efMac3; - break; - case EF_JLMAC: - ef_fieldname = efJLMac; - break; - case EF_ZIPIT: - ef_fieldname = efZipIt; - break; - case EF_ZIPIT2: - ef_fieldname = efZipIt2; - break; - case EF_VMCMS: - ef_fieldname = efVMCMS; - break; - case EF_MVS: - ef_fieldname = efMVS; - break; - case EF_ATHEOS: - ef_fieldname = efAtheOS; - break; - case EF_BEOS: - ef_fieldname = efBeOS; - break; - case EF_QDOS: - ef_fieldname = efQDOS; - break; - case EF_AOSVS: - ef_fieldname = efAOSVS; - break; - case EF_SPARK: /* from RISC OS */ - ef_fieldname = efSpark; - break; - case EF_MD5: - ef_fieldname = efMD5; - break; - case EF_ASIUNIX: - ef_fieldname = efASiUnix; - break; - case EF_TANDEM: - ef_fieldname = efTandem; - break; - case EF_SMARTZIP: - ef_fieldname = efSmartZip; - break; - case EF_THEOS: -#ifdef OLD_THEOS_EXTRA - case EF_THEOSO: -#endif - ef_fieldname = efTheos; - break; - default: - ef_fieldname = efUnknown; - break; - } - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldType), - eb_id, LoadFarStringSmall(ef_fieldname), eb_datalen)); - - /* additional, field-specific information: */ - switch (eb_id) { - case EF_OS2: - case EF_ACL: - if (eb_datalen >= EB_OS2_HLEN) { - if (eb_id == EF_OS2) - ef_fieldname = OS2EAs; - else - ef_fieldname = ACLdata; - Info(slide, 0, ((char *)slide, - LoadFarString(ef_fieldname), makelong(ef_ptr))); - *pEndprev = 0L; /* no clue about csize of local */ - } else { - goto ef_default_display; - } - break; - case EF_NTSD: - if (eb_datalen >= EB_NTSD_C_LEN) { - Info(slide, 0, ((char *)slide, LoadFarString(NTSDData), - makelong(ef_ptr))); - *pEndprev = 0L; /* no clue about csize of local */ - } else { - goto ef_default_display; - } - break; - case EF_IZVMS: - if (eb_datalen >= 8) { - char *p, q[8]; - unsigned compr = makeword(ef_ptr+EB_IZVMS_FLGS) - & EB_IZVMS_BCMASK; - - *q = '\0'; - if (compr > 3) - compr = 3; - switch (makelong(ef_ptr)) { - case 0x42414656: /* "VFAB" */ - p = "FAB"; break; - case 0x4C4C4156: /* "VALL" */ - p = "XABALL"; break; - case 0x43484656: /* "VFHC" */ - p = "XABFHC"; break; - case 0x54414456: /* "VDAT" */ - p = "XABDAT"; break; - case 0x54445256: /* "VRDT" */ - p = "XABRDT"; break; - case 0x4F525056: /* "VPRO" */ - p = "XABPRO"; break; - case 0x59454B56: /* "VKEY" */ - p = "XABKEY"; break; - case 0x56534D56: /* "VMSV" */ - p = "version"; - if (eb_datalen >= 16) { - /* put termitation first, for A_TO_N() */ - q[7] = '\0'; - q[0] = ' '; - q[1] = '('; - strncpy(q+2, - (char *)ef_ptr+EB_IZVMS_HLEN, 4); - A_TO_N(q+2); - q[6] = ')'; - } - break; - default: - p = "unknown"; - } - Info(slide, 0, ((char *)slide, - LoadFarString(izVMSdata), - LoadFarStringSmall(izVMScomp[compr]), - makeword(ef_ptr+EB_IZVMS_UCSIZ), p, q)); - } else { - goto ef_default_display; - } - break; - case EF_TIME: - if (eb_datalen > 0) { - char types[80]; - int num = 0, len; - - *types = '\0'; - if (*ef_ptr & 1) { - strcpy(types, LoadFarString(UTmodification)); - ++num; - } - if (*ef_ptr & 2) { - len = strlen(types); - if (num) - types[len++] = '/'; - strcpy(types+len, LoadFarString(UTaccess)); - ++num; - if (*pEndprev > 0L) - *pEndprev += 4L; - } - if (*ef_ptr & 4) { - len = strlen(types); - if (num) - types[len++] = '/'; - strcpy(types+len, LoadFarString(UTcreation)); - ++num; - if (*pEndprev > 0L) - *pEndprev += 4L; - } - if (num > 0) - Info(slide, 0, ((char *)slide, - LoadFarString(UTdata), types, - num == 1? nullStr : PlurSufx)); - } - break; - case EF_UNIPATH: - case EF_UNICOMNT: - if (eb_datalen >= 5) { - unsigned i, n; - ulg name_crc = makelong(ef_ptr+1); - - if (eb_datalen <= 29) { - Info(slide, 0, ((char *)slide, - LoadFarString(U8PthCmnComplete), - (unsigned)ef_ptr[0], name_crc)); - n = eb_datalen; - } else { - Info(slide, 0, ((char *)slide, - LoadFarString(U8PthCmnF24), - (unsigned)ef_ptr[0], name_crc)); - n = 29; - } - for (i = 5; i < n; ++i) - Info(slide, 0, ((char *)slide, - LoadFarString(efFormat), ef_ptr[i])); - } else { - goto ef_default_display; - } - break; - case EF_MAC3: - if (eb_datalen >= EB_MAC3_HLEN) { - ulg eb_uc = makelong(ef_ptr); - unsigned mac3_flgs = makeword(ef_ptr+EB_FLGS_OFFS); - unsigned eb_is_uc = mac3_flgs & EB_M3_FL_UNCMPR; - - Info(slide, 0, ((char *)slide, LoadFarString(Mac3data), - eb_uc, eb_is_uc ? "un" : nullStr)); - if (eb_is_uc) { - if (*pEndprev > 0L) - *pEndprev += makelong(ef_ptr); - } else { - *pEndprev = 0L; /* no clue about csize of local */ - } - - Info(slide, 0, ((char *)slide, - LoadFarString(MacOSMAC3flags), - LoadFarStringSmall(mac3_flgs & EB_M3_FL_DATFRK ? - MacOS_DF : MacOS_RF), - (mac3_flgs & EB_M3_FL_TIME64 ? 64 : 32))); - zi_showMacTypeCreator(__G__ &ef_ptr[6]); - } else { - goto ef_default_display; - } - break; - case EF_ZIPIT2: - if (eb_datalen >= 5 && - makelong(ef_ptr) == 0x5449505A /* "ZPIT" */) { - - if (eb_datalen >= 12) { - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - } - } else { - goto ef_default_display; - } - break; - case EF_ZIPIT: - if (eb_datalen >= 5 && - makelong(ef_ptr) == 0x5449505A /* "ZPIT" */) { - unsigned fnlen = ef_ptr[4]; - - if ((unsigned)eb_datalen >= fnlen + (5 + 8)) { - uch nullchar = ef_ptr[fnlen+5]; - - ef_ptr[fnlen+5] = '\0'; /* terminate filename */ - A_TO_N(ef_ptr+5); - Info(slide, 0, ((char *)slide, - LoadFarString(ZipItFname), (char *)ef_ptr+5)); - ef_ptr[fnlen+5] = nullchar; - zi_showMacTypeCreator(__G__ &ef_ptr[fnlen+5]); - } - } else { - goto ef_default_display; - } - break; - case EF_JLMAC: - if (eb_datalen >= 40 && - makelong(ef_ptr) == 0x45454C4A /* "JLEE" */) - { - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - - Info(slide, 0, ((char *)slide, - LoadFarString(MacOSJLEEflags), - LoadFarStringSmall(ef_ptr[31] & 1 ? - MacOS_DF : MacOS_RF))); - } else { - goto ef_default_display; - } - break; - case EF_SMARTZIP: - if ((eb_datalen == EB_SMARTZIP_HLEN) && - makelong(ef_ptr) == 0x70695A64 /* "dZip" */) { - char filenameBuf[32]; - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - memcpy(filenameBuf, &ef_ptr[33], 31); - filenameBuf[ef_ptr[32]] = '\0'; - A_TO_N(filenameBuf); - Info(slide, 0, ((char *)slide, - LoadFarString(ZipItFname), filenameBuf)); - } else { - goto ef_default_display; - } - break; -#ifdef CMS_MVS - case EF_VMCMS: - case EF_MVS: - { - char type[100]; - - Info(slide, 0, ((char *)slide, - LoadFarString(VmMvsExtraField), - (getVMMVSexfield(type, ef_ptr-EB_HEADSIZE, - (unsigned)eb_datalen) > 0)? - type : LoadFarStringSmall(VmMvsInvalid))); - } - break; -#endif /* CMS_MVS */ - case EF_ATHEOS: - case EF_BEOS: - if (eb_datalen >= EB_BEOS_HLEN) { - ulg eb_uc = makelong(ef_ptr); - unsigned eb_is_uc = - *(ef_ptr+EB_FLGS_OFFS) & EB_BE_FL_UNCMPR; - - if (eb_id == EF_ATHEOS) - ef_fieldname = AtheOSdata; - else - ef_fieldname = BeOSdata; - Info(slide, 0, ((char *)slide, - LoadFarString(ef_fieldname), - eb_uc, eb_is_uc ? "un" : nullStr)); - if (eb_is_uc) { - if (*pEndprev > 0L) - *pEndprev += makelong(ef_ptr); - } else { - *pEndprev = 0L; /* no clue about csize of local */ - } - } else { - goto ef_default_display; - } - break; - case EF_QDOS: - if (eb_datalen >= 4) { - Info(slide, 0, ((char *)slide, LoadFarString(QDOSdata), - ef_ptr[0], ef_ptr[1], ef_ptr[2], ef_ptr[3])); - } else { - goto ef_default_display; - } - break; - case EF_AOSVS: - if (eb_datalen >= 5) { - Info(slide, 0, ((char *)slide, LoadFarString(AOSVSdata), - ((int)(uch)ef_ptr[4])/10, ((int)(uch)ef_ptr[4])%10)); - } else { - goto ef_default_display; - } - break; - case EF_TANDEM: - if (eb_datalen == 20) { - unsigned type, code; - - type = (ef_ptr[18] & 0x60) >> 5; - code = makeword(ef_ptr); - /* Arrg..., Tandem e.f. uses BigEndian byte-order */ - code = ((code << 8) & 0xff00) | ((code >> 8) & 0x00ff); - if (type == NSK_UNSTRUCTURED) { - if (code == NSK_EDITFILECODE) - type = 4; - else if (code == NSK_OBJECTFILECODE) - type = 5; - } - Info(slide, 0, ((char *)slide, - LoadFarString(Tandemdata), - LoadFarStringSmall(TandemFileformat[type]), - code)); - } else { - goto ef_default_display; - } - break; - case EF_MD5: - if (eb_datalen >= 19) { - char md5[33]; - int i; - - for (i = 0; i < 16; ++i) - sprintf(&md5[i<<1], "%02x", ef_ptr[15-i]); - md5[32] = '\0'; - Info(slide, 0, ((char *)slide, LoadFarString(MD5data), - md5)); - break; - } /* else: fall through !! */ - default: -ef_default_display: - if (eb_datalen > 0) { - unsigned i, n; - - if (eb_datalen <= 24) { - Info(slide, 0, ((char *)slide, - LoadFarString(ColonIndent))); - n = eb_datalen; - } else { - Info(slide, 0, ((char *)slide, - LoadFarString(First20))); - n = 20; - } - for (i = 0; i < n; ++i) - Info(slide, 0, ((char *)slide, - LoadFarString(efFormat), ef_ptr[i])); - } - break; - } - (*G.message)((zvoid *)&G, (uch *)".", 1L, 0); - - ef_ptr += eb_datalen; - ef_len -= eb_datalen; - } - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - } - - /* high bit == Unix/OS2/NT GMT times (mtime, atime); next bit == UID/GID */ - if ((xattr = (unsigned)((G.crec.external_file_attributes & 0xC000) >> 12)) - & 8) - { - if (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_) - { - Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), - "is", EF_IZUNIX, LoadFarStringSmall(efIZUnix), - (unsigned)(xattr&12), (xattr&4)? efIZuid : efIZnouid)); - if (*pEndprev > 0L) - *pEndprev += (ulg)(xattr&12); - } - else if (hostnum == FS_FAT_ && !(xattr&4)) - Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), - "may be", EF_IZUNIX, LoadFarStringSmall(efIZUnix), 8, - efIZnouid)); - } - - if (!G.crec.file_comment_length) - Info(slide, 0, ((char *)slide, LoadFarString(NoFileComment))); - else { - Info(slide, 0, ((char *)slide, LoadFarString(FileCommBegin))); - if ((error = do_string(__G__ G.crec.file_comment_length, DISPL_8)) != - PK_COOL) - { - error_in_archive = error; /* might be warning */ - if (error > PK_WARN) /* fatal */ - return error; - } - Info(slide, 0, ((char *)slide, LoadFarString(FileCommEnd))); - } - - return error_in_archive; - -} /* end function zi_long() */ - - - - - -/*************************/ -/* Function zi_short() */ -/*************************/ - -static int zi_short(__G) /* return PK-type error code */ - __GDEF -{ -#ifdef USE_EF_UT_TIME - iztimes z_utime; - time_t *z_modtim; -#endif - int k, error, error_in_archive=PK_COOL; - unsigned hostnum, hostver, methid, methnum, xattr; - char *p, workspace[12], attribs[16]; - char methbuf[5]; - static ZCONST char dtype[5]="NXFS"; /* normal, maximum, fast, superfast */ - static ZCONST char Far os[NUM_HOSTS+1][4] = { - "fat", "ami", "vms", "unx", "cms", "atr", "hpf", "mac", "zzz", - "cpm", "t20", "ntf", "qds", "aco", "vft", "mvs", "be ", "nsk", - "ths", "osx", "???", "???", "???", "???", "???", "???", "???", - "???", "???", "???", "ath", "???" - }; -#ifdef OLD_THEOS_EXTRA - static ZCONST char Far os_TheosOld[] = "tho"; -#endif - static ZCONST char Far method[NUM_METHODS+1][5] = { - "stor", "shrk", "re:1", "re:2", "re:3", "re:4", "i#:#", "tokn", - "def#", "d64#", "dcli", "bzp2", "lzma", "ters", "lz77", "wavp", - "ppmd", "u###" - }; - - -/*--------------------------------------------------------------------------- - Print out various interesting things about the compressed file. - ---------------------------------------------------------------------------*/ - - methid = (unsigned)(G.crec.compression_method); - methnum = find_compr_idx(G.crec.compression_method); - hostnum = (unsigned)(G.pInfo->hostnum); - hostver = (unsigned)(G.pInfo->hostver); -/* - extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); - extver = (unsigned)G.crec.version_needed_to_extract[0]; - */ - - zfstrcpy(methbuf, method[methnum]); - if (methid == IMPLODED) { - methbuf[1] = (char)((G.crec.general_purpose_bit_flag & 2)? '8' : '4'); - methbuf[3] = (char)((G.crec.general_purpose_bit_flag & 4)? '3' : '2'); - } else if (methid == DEFLATED || methid == ENHDEFLATED) { - ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); - methbuf[3] = dtype[dnum]; - } else if (methnum >= NUM_METHODS) { /* unknown */ - sprintf(&methbuf[1], "%03u", G.crec.compression_method); - } - - for (k = 0; k < 15; ++k) - attribs[k] = ' '; - attribs[15] = 0; - - xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); - switch (hostnum) { - case VMS_: - { int i, j; - - for (k = 0; k < 12; ++k) - workspace[k] = 0; - if (xattr & VMS_IRUSR) - workspace[0] = 'R'; - if (xattr & VMS_IWUSR) { - workspace[1] = 'W'; - workspace[3] = 'D'; - } - if (xattr & VMS_IXUSR) - workspace[2] = 'E'; - if (xattr & VMS_IRGRP) - workspace[4] = 'R'; - if (xattr & VMS_IWGRP) { - workspace[5] = 'W'; - workspace[7] = 'D'; - } - if (xattr & VMS_IXGRP) - workspace[6] = 'E'; - if (xattr & VMS_IROTH) - workspace[8] = 'R'; - if (xattr & VMS_IWOTH) { - workspace[9] = 'W'; - workspace[11] = 'D'; - } - if (xattr & VMS_IXOTH) - workspace[10] = 'E'; - - p = attribs; - for (k = j = 0; j < 3; ++j) { /* groups of permissions */ - for (i = 0; i < 4; ++i, ++k) /* perms within a group */ - if (workspace[k]) - *p++ = workspace[k]; - *p++ = ','; /* group separator */ - } - *--p = ' '; /* overwrite last comma */ - if ((p - attribs) < 12) - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - } - break; - - case AMIGA_: - switch (xattr & AMI_IFMT) { - case AMI_IFDIR: attribs[0] = 'd'; break; - case AMI_IFREG: attribs[0] = '-'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; - attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; - attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; - attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; - attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; - attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; - attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; - attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - case THEOS_: - switch (xattr & THS_IFMT) { - case THS_IFLIB: *attribs = 'L'; break; - case THS_IFDIR: *attribs = 'D'; break; - case THS_IFCHR: *attribs = 'C'; break; - case THS_IFREG: *attribs = 'S'; break; - case THS_IFREL: *attribs = 'R'; break; - case THS_IFKEY: *attribs = 'K'; break; - case THS_IFIND: *attribs = 'I'; break; - case THS_IFR16: *attribs = 'P'; break; - case THS_IFP16: *attribs = '2'; break; - case THS_IFP32: *attribs = '3'; break; - default: *attribs = '?'; break; - } - attribs[1] = (xattr & THS_INHID) ? '.' : 'H'; - attribs[2] = (xattr & THS_IMODF) ? '.' : 'M'; - attribs[3] = (xattr & THS_IWOTH) ? '.' : 'W'; - attribs[4] = (xattr & THS_IROTH) ? '.' : 'R'; - attribs[5] = (xattr & THS_IEUSR) ? '.' : 'E'; - attribs[6] = (xattr & THS_IXUSR) ? '.' : 'X'; - attribs[7] = (xattr & THS_IWUSR) ? '.' : 'W'; - attribs[8] = (xattr & THS_IRUSR) ? '.' : 'R'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - case FS_VFAT_: -#ifdef OLD_THEOS_EXTRA - if (hostver == 20) { - switch (xattr & _THS_IFMT) { - case _THS_IFLIB: *attribs = 'L'; break; - case _THS_IFDIR: *attribs = 'd'; break; - case _THS_IFCHR: *attribs = 'c'; break; - case _THS_IFREG: *attribs = 'S'; break; - case _THS_IODRC: *attribs = 'D'; break; - case _THS_IOKEY: *attribs = 'K'; break; - case _THS_IOIND: *attribs = 'I'; break; - case _THS_IOPRG: *attribs = 'P'; break; - case _THS_IO286: *attribs = '2'; break; - case _THS_IO386: *attribs = '3'; break; - default: *attribs = '?'; break; - } - attribs[1] = (xattr & _THS_HIDDN) ? 'H' : '.'; - attribs[2] = (xattr & _THS_IXOTH) ? '.' : 'X'; - attribs[3] = (xattr & _THS_IWOTH) ? '.' : 'W'; - attribs[4] = (xattr & _THS_IROTH) ? '.' : 'R'; - attribs[5] = (xattr & _THS_IEUSR) ? '.' : 'E'; - attribs[6] = (xattr & _THS_IXUSR) ? '.' : 'X'; - attribs[7] = (xattr & _THS_IWUSR) ? '.' : 'W'; - attribs[8] = (xattr & _THS_IRUSR) ? '.' : 'R'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - } /* else: fall through! */ -#endif /* OLD_THEOS_EXTRA */ - - case FS_FAT_: - case FS_HPFS_: - case FS_NTFS_: - case VM_CMS_: - case MVS_: - case ACORN_: - if (hostnum != FS_FAT_ || - (unsigned)(xattr & 0700) != - ((unsigned)0400 | - ((unsigned)!(G.crec.external_file_attributes & 1) << 7) | - ((unsigned)(G.crec.external_file_attributes & 0x10) << 2)) - ) - { - xattr = (unsigned)(G.crec.external_file_attributes & 0xFF); - sprintf(attribs, ".r.-... %u.%u", hostver/10, hostver%10); - attribs[2] = (xattr & 0x01)? '-' : 'w'; - attribs[5] = (xattr & 0x02)? 'h' : '-'; - attribs[6] = (xattr & 0x04)? 's' : '-'; - attribs[4] = (xattr & 0x20)? 'a' : '-'; - if (xattr & 0x10) { - attribs[0] = 'd'; - attribs[3] = 'x'; - } else - attribs[0] = '-'; - if (IS_VOLID(xattr)) - attribs[0] = 'V'; - else if ((p = MBSRCHR(G.filename, '.')) != (char *)NULL) { - ++p; - if (STRNICMP(p, "com", 3) == 0 || - STRNICMP(p, "exe", 3) == 0 || - STRNICMP(p, "btm", 3) == 0 || - STRNICMP(p, "cmd", 3) == 0 || - STRNICMP(p, "bat", 3) == 0) - attribs[3] = 'x'; - } - break; - } /* else: fall through! */ - - default: /* assume Unix-like */ - switch ((unsigned)(xattr & UNX_IFMT)) { - case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; - case (unsigned)UNX_IFREG: attribs[0] = '-'; break; - case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; - case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; - case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; - case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; - case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; - attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; - attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; - attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; - attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; - attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; - - if (xattr & UNX_IXUSR) - attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; - else - attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S==undefined */ - if (xattr & UNX_IXGRP) - attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ - else - /* attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; real 4.3BSD */ - attribs[6] = (xattr & UNX_ISGID)? 'S' : '-'; /* SunOS 4.1.x */ - if (xattr & UNX_IXOTH) - attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ - else - attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T==undefined */ - - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - } /* end switch (hostnum: external attributes format) */ - -#ifdef OLD_THEOS_EXTRA - Info(slide, 0, ((char *)slide, "%s %s %s ", attribs, - LoadFarStringSmall(((hostnum == FS_VFAT_ && hostver == 20) ? - os_TheosOld : - os[hostnum])), - FmZofft(G.crec.ucsize, "8", "u"))); -#else - Info(slide, 0, ((char *)slide, "%s %s %s ", attribs, - LoadFarStringSmall(os[hostnum]), - FmZofft(G.crec.ucsize, "8", "u"))); -#endif - Info(slide, 0, ((char *)slide, "%c", - (G.crec.general_purpose_bit_flag & 1)? - ((G.crec.internal_file_attributes & 1)? 'T' : 'B') : /* encrypted */ - ((G.crec.internal_file_attributes & 1)? 't' : 'b'))); /* plaintext */ - k = (G.crec.extra_field_length || - /* a local-only "UX" (old Unix/OS2/NT GMT times "IZUNIX") e.f.? */ - ((G.crec.external_file_attributes & 0x8000) && - (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_))); - Info(slide, 0, ((char *)slide, "%c", k? - ((G.crec.general_purpose_bit_flag & 8)? 'X' : 'x') : /* extra field */ - ((G.crec.general_purpose_bit_flag & 8)? 'l' : '-'))); /* no extra field */ - /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ extended local header or not */ - - if (uO.lflag == 4) { - zusz_t csiz = G.crec.csize; - - if (G.crec.general_purpose_bit_flag & 1) - csiz -= 12; /* if encrypted, don't count encryption header */ - Info(slide, 0, ((char *)slide, "%3d%%", - (ratio(G.crec.ucsize,csiz)+5)/10)); - } else if (uO.lflag == 5) - Info(slide, 0, ((char *)slide, " %s", - FmZofft(G.crec.csize, "8", "u"))); - - /* For printing of date & time, a "char d_t_buf[16]" is required. - * To save stack space, we reuse the "char attribs[16]" buffer whose - * content is no longer needed. - */ -# define d_t_buf attribs -#ifdef USE_EF_UT_TIME - z_modtim = G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, - G.crec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME) - ? &z_utime.mtime : NULL; - TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ - d_t_buf[0] = (char)0; /* signal "show local time" */ -#else -# define z_modtim NULL -#endif - Info(slide, 0, ((char *)slide, " %s %s ", methbuf, - zi_time(__G__ &G.crec.last_mod_dos_datetime, z_modtim, d_t_buf))); - fnprint(__G); - -/*--------------------------------------------------------------------------- - Skip the file comment, if any (the filename has already been printed, - above). That finishes up this file entry... - ---------------------------------------------------------------------------*/ - - SKIP_(G.crec.file_comment_length) - - return error_in_archive; - -} /* end function zi_short() */ - - - - - -/**************************************/ -/* Function zi_showMacTypeCreator() */ -/**************************************/ - -static void zi_showMacTypeCreator(__G__ ebfield) - __GDEF - uch *ebfield; -{ - /* not every Type / Creator character is printable */ - if (isprint(native(ebfield[0])) && isprint(native(ebfield[1])) && - isprint(native(ebfield[2])) && isprint(native(ebfield[3])) && - isprint(native(ebfield[4])) && isprint(native(ebfield[5])) && - isprint(native(ebfield[6])) && isprint(native(ebfield[7]))) { - Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata), - native(ebfield[0]), native(ebfield[1]), - native(ebfield[2]), native(ebfield[3]), - native(ebfield[4]), native(ebfield[5]), - native(ebfield[6]), native(ebfield[7]))); - } else { - Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata1), - (((ulg)ebfield[0]) << 24) + - (((ulg)ebfield[1]) << 16) + - (((ulg)ebfield[2]) << 8) + - ((ulg)ebfield[3]), - (((ulg)ebfield[4]) << 24) + - (((ulg)ebfield[5]) << 16) + - (((ulg)ebfield[6]) << 8) + - ((ulg)ebfield[7]))); - } -} /* end function zi_showMacTypeCreator() */ - - - - - -/************************/ -/* Function zi_time() */ -/************************/ - -static char *zi_time(__G__ datetimez, modtimez, d_t_str) - __GDEF - ZCONST ulg *datetimez; - ZCONST time_t *modtimez; - char *d_t_str; -{ - unsigned yr, mo, dy, hh, mm, ss; - char monthbuf[4]; - ZCONST char *monthstr; - static ZCONST char Far month[12][4] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; -#ifdef USE_EF_UT_TIME - struct tm *t; -#endif - - - -/*--------------------------------------------------------------------------- - Convert the file-modification date and time info to a string of the form - "1991 Feb 23 17:15:00", "23-Feb-91 17:15" or "19910223.171500", depending - on values of lflag and T_flag. If using Unix-time extra fields, convert - to local time or not, depending on value of first character in d_t_str[]. - ---------------------------------------------------------------------------*/ - -#ifdef USE_EF_UT_TIME - if (modtimez != NULL) { -#ifndef NO_GMTIME - /* check for our secret message from above... */ - t = (d_t_str[0] == (char)1)? gmtime(modtimez) : localtime(modtimez); -#else - t = localtime(modtimez); -#endif - if (uO.lflag > 9 && t == (struct tm *)NULL) - /* time conversion error in verbose listing format, - * return string with '?' instead of data - */ - return (strcpy(d_t_str, LoadFarString(lngYMDHMSTimeError))); - } else - t = (struct tm *)NULL; - if (t != (struct tm *)NULL) { - mo = (unsigned)(t->tm_mon + 1); - dy = (unsigned)(t->tm_mday); - yr = (unsigned)(t->tm_year); - - hh = (unsigned)(t->tm_hour); - mm = (unsigned)(t->tm_min); - ss = (unsigned)(t->tm_sec); - } else -#endif /* USE_EF_UT_TIME */ - { - yr = ((unsigned)(*datetimez >> 25) & 0x7f) + 80; - mo = ((unsigned)(*datetimez >> 21) & 0x0f); - dy = ((unsigned)(*datetimez >> 16) & 0x1f); - - hh = (((unsigned)*datetimez >> 11) & 0x1f); - mm = (((unsigned)*datetimez >> 5) & 0x3f); - ss = (((unsigned)*datetimez << 1) & 0x3e); - } - - if (mo == 0 || mo > 12) { - sprintf(monthbuf, LoadFarString(BogusFmt), mo); - monthstr = monthbuf; - } else - monthstr = LoadFarStringSmall(month[mo-1]); - - if (uO.lflag > 9) /* verbose listing format */ - sprintf(d_t_str, LoadFarString(lngYMDHMSTime), yr+1900, monthstr, dy, - hh, mm, ss); - else if (uO.T_flag) - sprintf(d_t_str, LoadFarString(DecimalTime), yr+1900, mo, dy, - hh, mm, ss); - else /* was: if ((uO.lflag >= 3) && (uO.lflag <= 5)) */ - sprintf(d_t_str, LoadFarString(shtYMDHMTime), yr%100, monthstr, dy, - hh, mm); - - return d_t_str; - -} /* end function zi_time() */ - -#endif /* !NO_ZIPINFO */ diff --git a/data/windows/unzipfx-catia/.gitignore b/data/windows/unzipfx-catia/.gitignore deleted file mode 100644 index 27745fc..0000000 --- a/data/windows/unzipfx-catia/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ - -*~ -*.o -*.exe -*.zip - -unzipfx2cat diff --git a/data/windows/unzipfx-catia/Makefile.linux b/data/windows/unzipfx-catia/Makefile.linux deleted file mode 100644 index ed4a0d9..0000000 --- a/data/windows/unzipfx-catia/Makefile.linux +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/Makefile -f - -CC ?= gcc - -BUILD_FLAGS = -DSFX -DLINUX -I. -I.. $(CFLAGS) -O2 -BUILD_FLAGS += -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -BUILD_FLAGS += -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -D_MBCS - -LINK_FLAGS = -static $(LDFLAGS) - -OBJ = crc32.o crypt.o extract.o fileio.o globals.o inflate.o match.o process.o ttyio.o ubz2err.o unzip.o zipinfo.o -OBJ += unix/unix.o -OBJ += unzipfx/appDetails.o - -# ----------------------------- - -all: unzipfx2cat - -unzipfx2cat: $(OBJ) - $(CC) $^ $(LINK_FLAGS) -o $@ - -clean: - rm -f *~ $(OBJ) - -# ----------------------------- - -.c.o: - $(CC) $< $(BUILD_FLAGS) -c -o $@ diff --git a/data/windows/unzipfx-catia/Makefile.win32 b/data/windows/unzipfx-catia/Makefile.win32 deleted file mode 100644 index ac407e7..0000000 --- a/data/windows/unzipfx-catia/Makefile.win32 +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/Makefile -f - -CC ?= gcc -WINDRES ?= windres - -BUILD_FLAGS = -DSFX -DWIN32 -DWINDOWS -DFORCE_UNIX_OVER_WIN32 -I. -I.. $(CFLAGS) -O2 -BUILD_FLAGS += -DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -BUILD_FLAGS += -DNO_LCHMOD -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -D_MBCS - -LINK_FLAGS = -static -mwindows -lkernel32 $(LDFLAGS) - -OBJ = crc32.o crypt.o extract.o fileio.o globals.o inflate.o match.o process.o ttyio.o ubz2err.o unzip.o zipinfo.o -OBJ += win32/nt.o win32/win32.o win32/win32i64.o -OBJ += unzipfx/appDetails.o -OBJ += icon.o - -# ----------------------------- - -all: unzipfx2cat.exe - -unzipfx2cat.exe: $(OBJ) - $(CC) $^ $(LINK_FLAGS) -o $@ - -icon.o: ../../../resources/ico/catia.rc - $(WINDRES) -i $< -o $@ -O coff - -clean: - rm -f *~ $(OBJ) - -# ----------------------------- - -.c.o: - $(CC) $< $(BUILD_FLAGS) -c -o $@ diff --git a/data/windows/unzipfx-catia/README b/data/windows/unzipfx-catia/README deleted file mode 100644 index b061075..0000000 --- a/data/windows/unzipfx-catia/README +++ /dev/null @@ -1,11 +0,0 @@ -This is a special build of unzip's unzipfx tool, modified to allow full application bundles. -You get a static linked binary that extracts your files into a temporary location, then executes the main program (defined by you). - -Currently working under Linux only, but should be fairly easy to get it into other OSes (unzip itself is already available in many, including Windows, MacOS, Linux and BeOS). - - -To get a static unzipfx application, you do: - 1 - create a zip file of your application bundle, with a single parent/root directory (this directory and the main app-name must match) - 2 - edit unzipfx/appDetails.h and set SFX_APP_MININAME as the directory name set in step 1 - 3 - compile this tool using the appropriate makefile (eg: make -f Makefile.linux). That will give you 'unzipfx2cat' binary - 4 - concatenate your zip file over the 'unzipfx2cat' binary (eg: cat unzipfx2cat myapp.zip > myapp) diff --git a/data/windows/unzipfx-catia/consts.h b/data/windows/unzipfx-catia/consts.h deleted file mode 100644 index 5dfc0a0..0000000 --- a/data/windows/unzipfx-catia/consts.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 1990-2001 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - consts.h - - This file contains global, initialized variables that never change. It is - included by unzip.c and windll/windll.c. - - ---------------------------------------------------------------------------*/ - - -/* And'ing with mask_bits[n] masks the lower n bits */ -ZCONST unsigned near mask_bits[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - -ZCONST char Far VersionDate[] = UZ_VERSION_DATE; /* now defined in unzvers.h */ - -#ifndef SFX - ZCONST char Far EndSigMsg[] = - "\nnote: didn't find end-of-central-dir signature at end of central dir.\n"; -#endif - -ZCONST char Far CentSigMsg[] = - "error: expected central file header signature not found (file #%lu).\n"; -ZCONST char Far SeekMsg[] = - "error [%s]: attempt to seek before beginning of zipfile\n%s"; -ZCONST char Far FilenameNotMatched[] = "caution: filename not matched: %s\n"; -ZCONST char Far ExclFilenameNotMatched[] = - "caution: excluded filename not matched: %s\n"; - -#ifdef VMS - ZCONST char Far ReportMsg[] = "\ - (please check that you have transferred or created the zipfile in the\n\ - appropriate BINARY mode--this includes ftp, Kermit, AND unzip'd zipfiles)\n"; -#else - ZCONST char Far ReportMsg[] = "\ - (please check that you have transferred or created the zipfile in the\n\ - appropriate BINARY mode and that you have compiled UnZip properly)\n"; -#endif - -#ifndef SFX - ZCONST char Far Zipnfo[] = "zipinfo"; - ZCONST char Far CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; -#endif diff --git a/data/windows/unzipfx-catia/crc32.c b/data/windows/unzipfx-catia/crc32.c deleted file mode 100644 index 02f504d..0000000 --- a/data/windows/unzipfx-catia/crc32.c +++ /dev/null @@ -1,732 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - * - * Thanks to Rodney Brown for his contribution of faster - * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing - * tables for updating the shift register in one step with three exclusive-ors - * instead of four steps with four exclusive-ors. This results about a factor - * of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. - */ - -/* $Id: crc32.c,v 2.0 2007/01/07 05:20:36 spc Exp $ */ - -#define __CRC32_C /* identifies this source module */ - -#include "zip.h" - -#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) - -#ifndef ZCONST -# define ZCONST const -#endif - -#include "crc32.h" - -/* When only the table of precomputed CRC values is needed, only the basic - system-independent table containing 256 entries is created; any support - for "unfolding" optimization is disabled. - */ -#if (defined(USE_ZLIB) || defined(CRC_TABLE_ONLY)) -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# undef IZ_CRCOPTIM_UNFOLDTBL -# endif -#endif /* (USE_ZLIB || CRC_TABLE_ONLY) */ - -#if defined(IZ_CRCOPTIM_UNFOLDTBL) -# define CRC_TBLS 4 -#else -# define CRC_TBLS 1 -#endif - - -/* - Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: - x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. - - Polynomials over GF(2) are represented in binary, one bit per coefficient, - with the lowest powers in the most significant bit. Then adding polynomials - is just exclusive-or, and multiplying a polynomial by x is a right shift by - one. If we call the above polynomial p, and represent a byte as the - polynomial q, also with the lowest power in the most significant bit (so the - byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, - where a mod b means the remainder after dividing a by b. - - This calculation is done using the shift-register method of multiplying and - taking the remainder. The register is initialized to zero, and for each - incoming bit, x^32 is added mod p to the register if the bit is a one (where - x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by - x (which is shifting right by one and adding x^32 mod p if the bit shifted - out is a one). We start with the highest power (least significant bit) of - q and repeat for all eight bits of q. - - The first (or only) table is simply the CRC of all possible eight bit values. - This is all the information needed to generate CRC's on data a byte-at-a-time - for all combinations of CRC register values and incoming bytes. - The remaining 3 tables (if IZ_CRCOPTIM_UNFOLDTBL is enabled) allow for - word-at-a-time CRC calculation, where a word is four bytes. -*/ - -#ifdef DYNAMIC_CRC_TABLE - -/* ========================================================================= - * Make the crc table. This function is needed only if you want to compute - * the table dynamically. - */ - -local void make_crc_table OF((void)); - -#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) - error: Dynamic allocation of CRC table not safe with reentrant code. -#endif /* DYNALLOC_CRCTAB && REENTRANT */ - -#ifdef DYNALLOC_CRCTAB - local ulg near *crc_table = NULL; -# if 0 /* not used, since sizeof("near *") <= sizeof(int) */ - /* Use this section when access to a "local int" is faster than access to - a "local pointer" (e.g.: i86 16bit code with far pointers). */ - local int crc_table_empty = 1; -# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) -# define MARK_CRCTAB_FILLED crc_table_empty = 0 -# define MARK_CRCTAB_EMPTY crc_table_empty = 1 -# else - /* Use this section on systems where the size of pointers and ints is - equal (e.g.: all 32bit systems). */ -# define CRC_TABLE_IS_EMPTY (crc_table == NULL) -# define MARK_CRCTAB_FILLED crc_table = crctab_p -# define MARK_CRCTAB_EMPTY crc_table = NULL -# endif -#else /* !DYNALLOC_CRCTAB */ - local ulg near crc_table[CRC_TBLS*256]; - local int crc_table_empty = 1; -# define CRC_TABLE_IS_EMPTY (crc_table_empty != 0) -# define MARK_CRCTAB_FILLED crc_table_empty = 0 -#endif /* ?DYNALLOC_CRCTAB */ - - -local void make_crc_table() -{ - ulg c; /* crc shift register */ - int n; /* counter for all possible eight bit values */ - int k; /* byte being shifted into crc apparatus */ -#ifdef DYNALLOC_CRCTAB - ulg near *crctab_p; /* temporary pointer to allocated crc_table area */ -#else /* !DYNALLOC_CRCTAB */ -# define crctab_p crc_table -#endif /* DYNALLOC_CRCTAB */ - -#ifdef COMPUTE_XOR_PATTERN - /* This piece of code has been left here to explain how the XOR pattern - * used in the creation of the crc_table values can be recomputed. - * For production versions of this function, it is more efficient to - * supply the resultant pattern at compile time. - */ - ulg xor; /* polynomial exclusive-or pattern */ - /* terms of polynomial defining this crc (except x^32): */ - static ZCONST uch p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - /* make exclusive-or pattern from polynomial (0xedb88320L) */ - xor = 0L; - for (n = 0; n < sizeof(p)/sizeof(uch); n++) - xor |= 1L << (31 - p[n]); -#else -# define xor 0xedb88320L -#endif - -#ifdef DYNALLOC_CRCTAB - crctab_p = (ulg near *) nearmalloc (CRC_TBLS*256*sizeof(ulg)); - if (crctab_p == NULL) { - ziperr(ZE_MEM, "crc_table allocation"); - } -#endif /* DYNALLOC_CRCTAB */ - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (ulg)n; - for (k = 8; k; k--) - c = c & 1 ? xor ^ (c >> 1) : c >> 1; - crctab_p[n] = REV_BE(c); - } - -#ifdef IZ_CRCOPTIM_UNFOLDTBL - /* generate crc for each value followed by one, two, and three zeros */ - for (n = 0; n < 256; n++) { - c = crctab_p[n]; - for (k = 1; k < 4; k++) { - c = CRC32(c, 0, crctab_p); - crctab_p[k*256+n] = c; - } - } -#endif /* IZ_CRCOPTIM_UNFOLDTBL */ - - MARK_CRCTAB_FILLED; -} - -#else /* !DYNAMIC_CRC_TABLE */ - -#ifdef DYNALLOC_CRCTAB - error: Inconsistent flags, DYNALLOC_CRCTAB without DYNAMIC_CRC_TABLE. -#endif - -/* ======================================================================== - * Table of CRC-32's of all single-byte values (made by make_crc_table) - */ -local ZCONST ulg near crc_table[CRC_TBLS*256] = { -# ifdef IZ_CRC_BE_OPTIMIZ - 0x00000000L, 0x96300777L, 0x2c610eeeL, 0xba510999L, 0x19c46d07L, - 0x8ff46a70L, 0x35a563e9L, 0xa395649eL, 0x3288db0eL, 0xa4b8dc79L, - 0x1ee9d5e0L, 0x88d9d297L, 0x2b4cb609L, 0xbd7cb17eL, 0x072db8e7L, - 0x911dbf90L, 0x6410b71dL, 0xf220b06aL, 0x4871b9f3L, 0xde41be84L, - 0x7dd4da1aL, 0xebe4dd6dL, 0x51b5d4f4L, 0xc785d383L, 0x56986c13L, - 0xc0a86b64L, 0x7af962fdL, 0xecc9658aL, 0x4f5c0114L, 0xd96c0663L, - 0x633d0ffaL, 0xf50d088dL, 0xc8206e3bL, 0x5e10694cL, 0xe44160d5L, - 0x727167a2L, 0xd1e4033cL, 0x47d4044bL, 0xfd850dd2L, 0x6bb50aa5L, - 0xfaa8b535L, 0x6c98b242L, 0xd6c9bbdbL, 0x40f9bcacL, 0xe36cd832L, - 0x755cdf45L, 0xcf0dd6dcL, 0x593dd1abL, 0xac30d926L, 0x3a00de51L, - 0x8051d7c8L, 0x1661d0bfL, 0xb5f4b421L, 0x23c4b356L, 0x9995bacfL, - 0x0fa5bdb8L, 0x9eb80228L, 0x0888055fL, 0xb2d90cc6L, 0x24e90bb1L, - 0x877c6f2fL, 0x114c6858L, 0xab1d61c1L, 0x3d2d66b6L, 0x9041dc76L, - 0x0671db01L, 0xbc20d298L, 0x2a10d5efL, 0x8985b171L, 0x1fb5b606L, - 0xa5e4bf9fL, 0x33d4b8e8L, 0xa2c90778L, 0x34f9000fL, 0x8ea80996L, - 0x18980ee1L, 0xbb0d6a7fL, 0x2d3d6d08L, 0x976c6491L, 0x015c63e6L, - 0xf4516b6bL, 0x62616c1cL, 0xd8306585L, 0x4e0062f2L, 0xed95066cL, - 0x7ba5011bL, 0xc1f40882L, 0x57c40ff5L, 0xc6d9b065L, 0x50e9b712L, - 0xeab8be8bL, 0x7c88b9fcL, 0xdf1ddd62L, 0x492dda15L, 0xf37cd38cL, - 0x654cd4fbL, 0x5861b24dL, 0xce51b53aL, 0x7400bca3L, 0xe230bbd4L, - 0x41a5df4aL, 0xd795d83dL, 0x6dc4d1a4L, 0xfbf4d6d3L, 0x6ae96943L, - 0xfcd96e34L, 0x468867adL, 0xd0b860daL, 0x732d0444L, 0xe51d0333L, - 0x5f4c0aaaL, 0xc97c0dddL, 0x3c710550L, 0xaa410227L, 0x10100bbeL, - 0x86200cc9L, 0x25b56857L, 0xb3856f20L, 0x09d466b9L, 0x9fe461ceL, - 0x0ef9de5eL, 0x98c9d929L, 0x2298d0b0L, 0xb4a8d7c7L, 0x173db359L, - 0x810db42eL, 0x3b5cbdb7L, 0xad6cbac0L, 0x2083b8edL, 0xb6b3bf9aL, - 0x0ce2b603L, 0x9ad2b174L, 0x3947d5eaL, 0xaf77d29dL, 0x1526db04L, - 0x8316dc73L, 0x120b63e3L, 0x843b6494L, 0x3e6a6d0dL, 0xa85a6a7aL, - 0x0bcf0ee4L, 0x9dff0993L, 0x27ae000aL, 0xb19e077dL, 0x44930ff0L, - 0xd2a30887L, 0x68f2011eL, 0xfec20669L, 0x5d5762f7L, 0xcb676580L, - 0x71366c19L, 0xe7066b6eL, 0x761bd4feL, 0xe02bd389L, 0x5a7ada10L, - 0xcc4add67L, 0x6fdfb9f9L, 0xf9efbe8eL, 0x43beb717L, 0xd58eb060L, - 0xe8a3d6d6L, 0x7e93d1a1L, 0xc4c2d838L, 0x52f2df4fL, 0xf167bbd1L, - 0x6757bca6L, 0xdd06b53fL, 0x4b36b248L, 0xda2b0dd8L, 0x4c1b0aafL, - 0xf64a0336L, 0x607a0441L, 0xc3ef60dfL, 0x55df67a8L, 0xef8e6e31L, - 0x79be6946L, 0x8cb361cbL, 0x1a8366bcL, 0xa0d26f25L, 0x36e26852L, - 0x95770cccL, 0x03470bbbL, 0xb9160222L, 0x2f260555L, 0xbe3bbac5L, - 0x280bbdb2L, 0x925ab42bL, 0x046ab35cL, 0xa7ffd7c2L, 0x31cfd0b5L, - 0x8b9ed92cL, 0x1daede5bL, 0xb0c2649bL, 0x26f263ecL, 0x9ca36a75L, - 0x0a936d02L, 0xa906099cL, 0x3f360eebL, 0x85670772L, 0x13570005L, - 0x824abf95L, 0x147ab8e2L, 0xae2bb17bL, 0x381bb60cL, 0x9b8ed292L, - 0x0dbed5e5L, 0xb7efdc7cL, 0x21dfdb0bL, 0xd4d2d386L, 0x42e2d4f1L, - 0xf8b3dd68L, 0x6e83da1fL, 0xcd16be81L, 0x5b26b9f6L, 0xe177b06fL, - 0x7747b718L, 0xe65a0888L, 0x706a0fffL, 0xca3b0666L, 0x5c0b0111L, - 0xff9e658fL, 0x69ae62f8L, 0xd3ff6b61L, 0x45cf6c16L, 0x78e20aa0L, - 0xeed20dd7L, 0x5483044eL, 0xc2b30339L, 0x612667a7L, 0xf71660d0L, - 0x4d476949L, 0xdb776e3eL, 0x4a6ad1aeL, 0xdc5ad6d9L, 0x660bdf40L, - 0xf03bd837L, 0x53aebca9L, 0xc59ebbdeL, 0x7fcfb247L, 0xe9ffb530L, - 0x1cf2bdbdL, 0x8ac2bacaL, 0x3093b353L, 0xa6a3b424L, 0x0536d0baL, - 0x9306d7cdL, 0x2957de54L, 0xbf67d923L, 0x2e7a66b3L, 0xb84a61c4L, - 0x021b685dL, 0x942b6f2aL, 0x37be0bb4L, 0xa18e0cc3L, 0x1bdf055aL, - 0x8def022dL -# ifdef IZ_CRCOPTIM_UNFOLDTBL - , - 0x00000000L, 0x41311b19L, 0x82623632L, 0xc3532d2bL, 0x04c56c64L, - 0x45f4777dL, 0x86a75a56L, 0xc796414fL, 0x088ad9c8L, 0x49bbc2d1L, - 0x8ae8effaL, 0xcbd9f4e3L, 0x0c4fb5acL, 0x4d7eaeb5L, 0x8e2d839eL, - 0xcf1c9887L, 0x5112c24aL, 0x1023d953L, 0xd370f478L, 0x9241ef61L, - 0x55d7ae2eL, 0x14e6b537L, 0xd7b5981cL, 0x96848305L, 0x59981b82L, - 0x18a9009bL, 0xdbfa2db0L, 0x9acb36a9L, 0x5d5d77e6L, 0x1c6c6cffL, - 0xdf3f41d4L, 0x9e0e5acdL, 0xa2248495L, 0xe3159f8cL, 0x2046b2a7L, - 0x6177a9beL, 0xa6e1e8f1L, 0xe7d0f3e8L, 0x2483dec3L, 0x65b2c5daL, - 0xaaae5d5dL, 0xeb9f4644L, 0x28cc6b6fL, 0x69fd7076L, 0xae6b3139L, - 0xef5a2a20L, 0x2c09070bL, 0x6d381c12L, 0xf33646dfL, 0xb2075dc6L, - 0x715470edL, 0x30656bf4L, 0xf7f32abbL, 0xb6c231a2L, 0x75911c89L, - 0x34a00790L, 0xfbbc9f17L, 0xba8d840eL, 0x79dea925L, 0x38efb23cL, - 0xff79f373L, 0xbe48e86aL, 0x7d1bc541L, 0x3c2ade58L, 0x054f79f0L, - 0x447e62e9L, 0x872d4fc2L, 0xc61c54dbL, 0x018a1594L, 0x40bb0e8dL, - 0x83e823a6L, 0xc2d938bfL, 0x0dc5a038L, 0x4cf4bb21L, 0x8fa7960aL, - 0xce968d13L, 0x0900cc5cL, 0x4831d745L, 0x8b62fa6eL, 0xca53e177L, - 0x545dbbbaL, 0x156ca0a3L, 0xd63f8d88L, 0x970e9691L, 0x5098d7deL, - 0x11a9ccc7L, 0xd2fae1ecL, 0x93cbfaf5L, 0x5cd76272L, 0x1de6796bL, - 0xdeb55440L, 0x9f844f59L, 0x58120e16L, 0x1923150fL, 0xda703824L, - 0x9b41233dL, 0xa76bfd65L, 0xe65ae67cL, 0x2509cb57L, 0x6438d04eL, - 0xa3ae9101L, 0xe29f8a18L, 0x21cca733L, 0x60fdbc2aL, 0xafe124adL, - 0xeed03fb4L, 0x2d83129fL, 0x6cb20986L, 0xab2448c9L, 0xea1553d0L, - 0x29467efbL, 0x687765e2L, 0xf6793f2fL, 0xb7482436L, 0x741b091dL, - 0x352a1204L, 0xf2bc534bL, 0xb38d4852L, 0x70de6579L, 0x31ef7e60L, - 0xfef3e6e7L, 0xbfc2fdfeL, 0x7c91d0d5L, 0x3da0cbccL, 0xfa368a83L, - 0xbb07919aL, 0x7854bcb1L, 0x3965a7a8L, 0x4b98833bL, 0x0aa99822L, - 0xc9fab509L, 0x88cbae10L, 0x4f5def5fL, 0x0e6cf446L, 0xcd3fd96dL, - 0x8c0ec274L, 0x43125af3L, 0x022341eaL, 0xc1706cc1L, 0x804177d8L, - 0x47d73697L, 0x06e62d8eL, 0xc5b500a5L, 0x84841bbcL, 0x1a8a4171L, - 0x5bbb5a68L, 0x98e87743L, 0xd9d96c5aL, 0x1e4f2d15L, 0x5f7e360cL, - 0x9c2d1b27L, 0xdd1c003eL, 0x120098b9L, 0x533183a0L, 0x9062ae8bL, - 0xd153b592L, 0x16c5f4ddL, 0x57f4efc4L, 0x94a7c2efL, 0xd596d9f6L, - 0xe9bc07aeL, 0xa88d1cb7L, 0x6bde319cL, 0x2aef2a85L, 0xed796bcaL, - 0xac4870d3L, 0x6f1b5df8L, 0x2e2a46e1L, 0xe136de66L, 0xa007c57fL, - 0x6354e854L, 0x2265f34dL, 0xe5f3b202L, 0xa4c2a91bL, 0x67918430L, - 0x26a09f29L, 0xb8aec5e4L, 0xf99fdefdL, 0x3accf3d6L, 0x7bfde8cfL, - 0xbc6ba980L, 0xfd5ab299L, 0x3e099fb2L, 0x7f3884abL, 0xb0241c2cL, - 0xf1150735L, 0x32462a1eL, 0x73773107L, 0xb4e17048L, 0xf5d06b51L, - 0x3683467aL, 0x77b25d63L, 0x4ed7facbL, 0x0fe6e1d2L, 0xccb5ccf9L, - 0x8d84d7e0L, 0x4a1296afL, 0x0b238db6L, 0xc870a09dL, 0x8941bb84L, - 0x465d2303L, 0x076c381aL, 0xc43f1531L, 0x850e0e28L, 0x42984f67L, - 0x03a9547eL, 0xc0fa7955L, 0x81cb624cL, 0x1fc53881L, 0x5ef42398L, - 0x9da70eb3L, 0xdc9615aaL, 0x1b0054e5L, 0x5a314ffcL, 0x996262d7L, - 0xd85379ceL, 0x174fe149L, 0x567efa50L, 0x952dd77bL, 0xd41ccc62L, - 0x138a8d2dL, 0x52bb9634L, 0x91e8bb1fL, 0xd0d9a006L, 0xecf37e5eL, - 0xadc26547L, 0x6e91486cL, 0x2fa05375L, 0xe836123aL, 0xa9070923L, - 0x6a542408L, 0x2b653f11L, 0xe479a796L, 0xa548bc8fL, 0x661b91a4L, - 0x272a8abdL, 0xe0bccbf2L, 0xa18dd0ebL, 0x62defdc0L, 0x23efe6d9L, - 0xbde1bc14L, 0xfcd0a70dL, 0x3f838a26L, 0x7eb2913fL, 0xb924d070L, - 0xf815cb69L, 0x3b46e642L, 0x7a77fd5bL, 0xb56b65dcL, 0xf45a7ec5L, - 0x370953eeL, 0x763848f7L, 0xb1ae09b8L, 0xf09f12a1L, 0x33cc3f8aL, - 0x72fd2493L - , - 0x00000000L, 0x376ac201L, 0x6ed48403L, 0x59be4602L, 0xdca80907L, - 0xebc2cb06L, 0xb27c8d04L, 0x85164f05L, 0xb851130eL, 0x8f3bd10fL, - 0xd685970dL, 0xe1ef550cL, 0x64f91a09L, 0x5393d808L, 0x0a2d9e0aL, - 0x3d475c0bL, 0x70a3261cL, 0x47c9e41dL, 0x1e77a21fL, 0x291d601eL, - 0xac0b2f1bL, 0x9b61ed1aL, 0xc2dfab18L, 0xf5b56919L, 0xc8f23512L, - 0xff98f713L, 0xa626b111L, 0x914c7310L, 0x145a3c15L, 0x2330fe14L, - 0x7a8eb816L, 0x4de47a17L, 0xe0464d38L, 0xd72c8f39L, 0x8e92c93bL, - 0xb9f80b3aL, 0x3cee443fL, 0x0b84863eL, 0x523ac03cL, 0x6550023dL, - 0x58175e36L, 0x6f7d9c37L, 0x36c3da35L, 0x01a91834L, 0x84bf5731L, - 0xb3d59530L, 0xea6bd332L, 0xdd011133L, 0x90e56b24L, 0xa78fa925L, - 0xfe31ef27L, 0xc95b2d26L, 0x4c4d6223L, 0x7b27a022L, 0x2299e620L, - 0x15f32421L, 0x28b4782aL, 0x1fdeba2bL, 0x4660fc29L, 0x710a3e28L, - 0xf41c712dL, 0xc376b32cL, 0x9ac8f52eL, 0xada2372fL, 0xc08d9a70L, - 0xf7e75871L, 0xae591e73L, 0x9933dc72L, 0x1c259377L, 0x2b4f5176L, - 0x72f11774L, 0x459bd575L, 0x78dc897eL, 0x4fb64b7fL, 0x16080d7dL, - 0x2162cf7cL, 0xa4748079L, 0x931e4278L, 0xcaa0047aL, 0xfdcac67bL, - 0xb02ebc6cL, 0x87447e6dL, 0xdefa386fL, 0xe990fa6eL, 0x6c86b56bL, - 0x5bec776aL, 0x02523168L, 0x3538f369L, 0x087faf62L, 0x3f156d63L, - 0x66ab2b61L, 0x51c1e960L, 0xd4d7a665L, 0xe3bd6464L, 0xba032266L, - 0x8d69e067L, 0x20cbd748L, 0x17a11549L, 0x4e1f534bL, 0x7975914aL, - 0xfc63de4fL, 0xcb091c4eL, 0x92b75a4cL, 0xa5dd984dL, 0x989ac446L, - 0xaff00647L, 0xf64e4045L, 0xc1248244L, 0x4432cd41L, 0x73580f40L, - 0x2ae64942L, 0x1d8c8b43L, 0x5068f154L, 0x67023355L, 0x3ebc7557L, - 0x09d6b756L, 0x8cc0f853L, 0xbbaa3a52L, 0xe2147c50L, 0xd57ebe51L, - 0xe839e25aL, 0xdf53205bL, 0x86ed6659L, 0xb187a458L, 0x3491eb5dL, - 0x03fb295cL, 0x5a456f5eL, 0x6d2fad5fL, 0x801b35e1L, 0xb771f7e0L, - 0xeecfb1e2L, 0xd9a573e3L, 0x5cb33ce6L, 0x6bd9fee7L, 0x3267b8e5L, - 0x050d7ae4L, 0x384a26efL, 0x0f20e4eeL, 0x569ea2ecL, 0x61f460edL, - 0xe4e22fe8L, 0xd388ede9L, 0x8a36abebL, 0xbd5c69eaL, 0xf0b813fdL, - 0xc7d2d1fcL, 0x9e6c97feL, 0xa90655ffL, 0x2c101afaL, 0x1b7ad8fbL, - 0x42c49ef9L, 0x75ae5cf8L, 0x48e900f3L, 0x7f83c2f2L, 0x263d84f0L, - 0x115746f1L, 0x944109f4L, 0xa32bcbf5L, 0xfa958df7L, 0xcdff4ff6L, - 0x605d78d9L, 0x5737bad8L, 0x0e89fcdaL, 0x39e33edbL, 0xbcf571deL, - 0x8b9fb3dfL, 0xd221f5ddL, 0xe54b37dcL, 0xd80c6bd7L, 0xef66a9d6L, - 0xb6d8efd4L, 0x81b22dd5L, 0x04a462d0L, 0x33cea0d1L, 0x6a70e6d3L, - 0x5d1a24d2L, 0x10fe5ec5L, 0x27949cc4L, 0x7e2adac6L, 0x494018c7L, - 0xcc5657c2L, 0xfb3c95c3L, 0xa282d3c1L, 0x95e811c0L, 0xa8af4dcbL, - 0x9fc58fcaL, 0xc67bc9c8L, 0xf1110bc9L, 0x740744ccL, 0x436d86cdL, - 0x1ad3c0cfL, 0x2db902ceL, 0x4096af91L, 0x77fc6d90L, 0x2e422b92L, - 0x1928e993L, 0x9c3ea696L, 0xab546497L, 0xf2ea2295L, 0xc580e094L, - 0xf8c7bc9fL, 0xcfad7e9eL, 0x9613389cL, 0xa179fa9dL, 0x246fb598L, - 0x13057799L, 0x4abb319bL, 0x7dd1f39aL, 0x3035898dL, 0x075f4b8cL, - 0x5ee10d8eL, 0x698bcf8fL, 0xec9d808aL, 0xdbf7428bL, 0x82490489L, - 0xb523c688L, 0x88649a83L, 0xbf0e5882L, 0xe6b01e80L, 0xd1dadc81L, - 0x54cc9384L, 0x63a65185L, 0x3a181787L, 0x0d72d586L, 0xa0d0e2a9L, - 0x97ba20a8L, 0xce0466aaL, 0xf96ea4abL, 0x7c78ebaeL, 0x4b1229afL, - 0x12ac6fadL, 0x25c6adacL, 0x1881f1a7L, 0x2feb33a6L, 0x765575a4L, - 0x413fb7a5L, 0xc429f8a0L, 0xf3433aa1L, 0xaafd7ca3L, 0x9d97bea2L, - 0xd073c4b5L, 0xe71906b4L, 0xbea740b6L, 0x89cd82b7L, 0x0cdbcdb2L, - 0x3bb10fb3L, 0x620f49b1L, 0x55658bb0L, 0x6822d7bbL, 0x5f4815baL, - 0x06f653b8L, 0x319c91b9L, 0xb48adebcL, 0x83e01cbdL, 0xda5e5abfL, - 0xed3498beL - , - 0x00000000L, 0x6567bcb8L, 0x8bc809aaL, 0xeeafb512L, 0x5797628fL, - 0x32f0de37L, 0xdc5f6b25L, 0xb938d79dL, 0xef28b4c5L, 0x8a4f087dL, - 0x64e0bd6fL, 0x018701d7L, 0xb8bfd64aL, 0xddd86af2L, 0x3377dfe0L, - 0x56106358L, 0x9f571950L, 0xfa30a5e8L, 0x149f10faL, 0x71f8ac42L, - 0xc8c07bdfL, 0xada7c767L, 0x43087275L, 0x266fcecdL, 0x707fad95L, - 0x1518112dL, 0xfbb7a43fL, 0x9ed01887L, 0x27e8cf1aL, 0x428f73a2L, - 0xac20c6b0L, 0xc9477a08L, 0x3eaf32a0L, 0x5bc88e18L, 0xb5673b0aL, - 0xd00087b2L, 0x6938502fL, 0x0c5fec97L, 0xe2f05985L, 0x8797e53dL, - 0xd1878665L, 0xb4e03addL, 0x5a4f8fcfL, 0x3f283377L, 0x8610e4eaL, - 0xe3775852L, 0x0dd8ed40L, 0x68bf51f8L, 0xa1f82bf0L, 0xc49f9748L, - 0x2a30225aL, 0x4f579ee2L, 0xf66f497fL, 0x9308f5c7L, 0x7da740d5L, - 0x18c0fc6dL, 0x4ed09f35L, 0x2bb7238dL, 0xc518969fL, 0xa07f2a27L, - 0x1947fdbaL, 0x7c204102L, 0x928ff410L, 0xf7e848a8L, 0x3d58149bL, - 0x583fa823L, 0xb6901d31L, 0xd3f7a189L, 0x6acf7614L, 0x0fa8caacL, - 0xe1077fbeL, 0x8460c306L, 0xd270a05eL, 0xb7171ce6L, 0x59b8a9f4L, - 0x3cdf154cL, 0x85e7c2d1L, 0xe0807e69L, 0x0e2fcb7bL, 0x6b4877c3L, - 0xa20f0dcbL, 0xc768b173L, 0x29c70461L, 0x4ca0b8d9L, 0xf5986f44L, - 0x90ffd3fcL, 0x7e5066eeL, 0x1b37da56L, 0x4d27b90eL, 0x284005b6L, - 0xc6efb0a4L, 0xa3880c1cL, 0x1ab0db81L, 0x7fd76739L, 0x9178d22bL, - 0xf41f6e93L, 0x03f7263bL, 0x66909a83L, 0x883f2f91L, 0xed589329L, - 0x546044b4L, 0x3107f80cL, 0xdfa84d1eL, 0xbacff1a6L, 0xecdf92feL, - 0x89b82e46L, 0x67179b54L, 0x027027ecL, 0xbb48f071L, 0xde2f4cc9L, - 0x3080f9dbL, 0x55e74563L, 0x9ca03f6bL, 0xf9c783d3L, 0x176836c1L, - 0x720f8a79L, 0xcb375de4L, 0xae50e15cL, 0x40ff544eL, 0x2598e8f6L, - 0x73888baeL, 0x16ef3716L, 0xf8408204L, 0x9d273ebcL, 0x241fe921L, - 0x41785599L, 0xafd7e08bL, 0xcab05c33L, 0x3bb659edL, 0x5ed1e555L, - 0xb07e5047L, 0xd519ecffL, 0x6c213b62L, 0x094687daL, 0xe7e932c8L, - 0x828e8e70L, 0xd49eed28L, 0xb1f95190L, 0x5f56e482L, 0x3a31583aL, - 0x83098fa7L, 0xe66e331fL, 0x08c1860dL, 0x6da63ab5L, 0xa4e140bdL, - 0xc186fc05L, 0x2f294917L, 0x4a4ef5afL, 0xf3762232L, 0x96119e8aL, - 0x78be2b98L, 0x1dd99720L, 0x4bc9f478L, 0x2eae48c0L, 0xc001fdd2L, - 0xa566416aL, 0x1c5e96f7L, 0x79392a4fL, 0x97969f5dL, 0xf2f123e5L, - 0x05196b4dL, 0x607ed7f5L, 0x8ed162e7L, 0xebb6de5fL, 0x528e09c2L, - 0x37e9b57aL, 0xd9460068L, 0xbc21bcd0L, 0xea31df88L, 0x8f566330L, - 0x61f9d622L, 0x049e6a9aL, 0xbda6bd07L, 0xd8c101bfL, 0x366eb4adL, - 0x53090815L, 0x9a4e721dL, 0xff29cea5L, 0x11867bb7L, 0x74e1c70fL, - 0xcdd91092L, 0xa8beac2aL, 0x46111938L, 0x2376a580L, 0x7566c6d8L, - 0x10017a60L, 0xfeaecf72L, 0x9bc973caL, 0x22f1a457L, 0x479618efL, - 0xa939adfdL, 0xcc5e1145L, 0x06ee4d76L, 0x6389f1ceL, 0x8d2644dcL, - 0xe841f864L, 0x51792ff9L, 0x341e9341L, 0xdab12653L, 0xbfd69aebL, - 0xe9c6f9b3L, 0x8ca1450bL, 0x620ef019L, 0x07694ca1L, 0xbe519b3cL, - 0xdb362784L, 0x35999296L, 0x50fe2e2eL, 0x99b95426L, 0xfcdee89eL, - 0x12715d8cL, 0x7716e134L, 0xce2e36a9L, 0xab498a11L, 0x45e63f03L, - 0x208183bbL, 0x7691e0e3L, 0x13f65c5bL, 0xfd59e949L, 0x983e55f1L, - 0x2106826cL, 0x44613ed4L, 0xaace8bc6L, 0xcfa9377eL, 0x38417fd6L, - 0x5d26c36eL, 0xb389767cL, 0xd6eecac4L, 0x6fd61d59L, 0x0ab1a1e1L, - 0xe41e14f3L, 0x8179a84bL, 0xd769cb13L, 0xb20e77abL, 0x5ca1c2b9L, - 0x39c67e01L, 0x80fea99cL, 0xe5991524L, 0x0b36a036L, 0x6e511c8eL, - 0xa7166686L, 0xc271da3eL, 0x2cde6f2cL, 0x49b9d394L, 0xf0810409L, - 0x95e6b8b1L, 0x7b490da3L, 0x1e2eb11bL, 0x483ed243L, 0x2d596efbL, - 0xc3f6dbe9L, 0xa6916751L, 0x1fa9b0ccL, 0x7ace0c74L, 0x9461b966L, - 0xf10605deL -# endif /* IZ_CRCOPTIM_UNFOLDTBL */ -# else /* !IZ_CRC_BE_OPTIMIZ */ - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL -# ifdef IZ_CRCOPTIM_UNFOLDTBL - , - 0x00000000L, 0x191b3141L, 0x32366282L, 0x2b2d53c3L, 0x646cc504L, - 0x7d77f445L, 0x565aa786L, 0x4f4196c7L, 0xc8d98a08L, 0xd1c2bb49L, - 0xfaefe88aL, 0xe3f4d9cbL, 0xacb54f0cL, 0xb5ae7e4dL, 0x9e832d8eL, - 0x87981ccfL, 0x4ac21251L, 0x53d92310L, 0x78f470d3L, 0x61ef4192L, - 0x2eaed755L, 0x37b5e614L, 0x1c98b5d7L, 0x05838496L, 0x821b9859L, - 0x9b00a918L, 0xb02dfadbL, 0xa936cb9aL, 0xe6775d5dL, 0xff6c6c1cL, - 0xd4413fdfL, 0xcd5a0e9eL, 0x958424a2L, 0x8c9f15e3L, 0xa7b24620L, - 0xbea97761L, 0xf1e8e1a6L, 0xe8f3d0e7L, 0xc3de8324L, 0xdac5b265L, - 0x5d5daeaaL, 0x44469febL, 0x6f6bcc28L, 0x7670fd69L, 0x39316baeL, - 0x202a5aefL, 0x0b07092cL, 0x121c386dL, 0xdf4636f3L, 0xc65d07b2L, - 0xed705471L, 0xf46b6530L, 0xbb2af3f7L, 0xa231c2b6L, 0x891c9175L, - 0x9007a034L, 0x179fbcfbL, 0x0e848dbaL, 0x25a9de79L, 0x3cb2ef38L, - 0x73f379ffL, 0x6ae848beL, 0x41c51b7dL, 0x58de2a3cL, 0xf0794f05L, - 0xe9627e44L, 0xc24f2d87L, 0xdb541cc6L, 0x94158a01L, 0x8d0ebb40L, - 0xa623e883L, 0xbf38d9c2L, 0x38a0c50dL, 0x21bbf44cL, 0x0a96a78fL, - 0x138d96ceL, 0x5ccc0009L, 0x45d73148L, 0x6efa628bL, 0x77e153caL, - 0xbabb5d54L, 0xa3a06c15L, 0x888d3fd6L, 0x91960e97L, 0xded79850L, - 0xc7cca911L, 0xece1fad2L, 0xf5facb93L, 0x7262d75cL, 0x6b79e61dL, - 0x4054b5deL, 0x594f849fL, 0x160e1258L, 0x0f152319L, 0x243870daL, - 0x3d23419bL, 0x65fd6ba7L, 0x7ce65ae6L, 0x57cb0925L, 0x4ed03864L, - 0x0191aea3L, 0x188a9fe2L, 0x33a7cc21L, 0x2abcfd60L, 0xad24e1afL, - 0xb43fd0eeL, 0x9f12832dL, 0x8609b26cL, 0xc94824abL, 0xd05315eaL, - 0xfb7e4629L, 0xe2657768L, 0x2f3f79f6L, 0x362448b7L, 0x1d091b74L, - 0x04122a35L, 0x4b53bcf2L, 0x52488db3L, 0x7965de70L, 0x607eef31L, - 0xe7e6f3feL, 0xfefdc2bfL, 0xd5d0917cL, 0xcccba03dL, 0x838a36faL, - 0x9a9107bbL, 0xb1bc5478L, 0xa8a76539L, 0x3b83984bL, 0x2298a90aL, - 0x09b5fac9L, 0x10aecb88L, 0x5fef5d4fL, 0x46f46c0eL, 0x6dd93fcdL, - 0x74c20e8cL, 0xf35a1243L, 0xea412302L, 0xc16c70c1L, 0xd8774180L, - 0x9736d747L, 0x8e2de606L, 0xa500b5c5L, 0xbc1b8484L, 0x71418a1aL, - 0x685abb5bL, 0x4377e898L, 0x5a6cd9d9L, 0x152d4f1eL, 0x0c367e5fL, - 0x271b2d9cL, 0x3e001cddL, 0xb9980012L, 0xa0833153L, 0x8bae6290L, - 0x92b553d1L, 0xddf4c516L, 0xc4eff457L, 0xefc2a794L, 0xf6d996d5L, - 0xae07bce9L, 0xb71c8da8L, 0x9c31de6bL, 0x852aef2aL, 0xca6b79edL, - 0xd37048acL, 0xf85d1b6fL, 0xe1462a2eL, 0x66de36e1L, 0x7fc507a0L, - 0x54e85463L, 0x4df36522L, 0x02b2f3e5L, 0x1ba9c2a4L, 0x30849167L, - 0x299fa026L, 0xe4c5aeb8L, 0xfdde9ff9L, 0xd6f3cc3aL, 0xcfe8fd7bL, - 0x80a96bbcL, 0x99b25afdL, 0xb29f093eL, 0xab84387fL, 0x2c1c24b0L, - 0x350715f1L, 0x1e2a4632L, 0x07317773L, 0x4870e1b4L, 0x516bd0f5L, - 0x7a468336L, 0x635db277L, 0xcbfad74eL, 0xd2e1e60fL, 0xf9ccb5ccL, - 0xe0d7848dL, 0xaf96124aL, 0xb68d230bL, 0x9da070c8L, 0x84bb4189L, - 0x03235d46L, 0x1a386c07L, 0x31153fc4L, 0x280e0e85L, 0x674f9842L, - 0x7e54a903L, 0x5579fac0L, 0x4c62cb81L, 0x8138c51fL, 0x9823f45eL, - 0xb30ea79dL, 0xaa1596dcL, 0xe554001bL, 0xfc4f315aL, 0xd7626299L, - 0xce7953d8L, 0x49e14f17L, 0x50fa7e56L, 0x7bd72d95L, 0x62cc1cd4L, - 0x2d8d8a13L, 0x3496bb52L, 0x1fbbe891L, 0x06a0d9d0L, 0x5e7ef3ecL, - 0x4765c2adL, 0x6c48916eL, 0x7553a02fL, 0x3a1236e8L, 0x230907a9L, - 0x0824546aL, 0x113f652bL, 0x96a779e4L, 0x8fbc48a5L, 0xa4911b66L, - 0xbd8a2a27L, 0xf2cbbce0L, 0xebd08da1L, 0xc0fdde62L, 0xd9e6ef23L, - 0x14bce1bdL, 0x0da7d0fcL, 0x268a833fL, 0x3f91b27eL, 0x70d024b9L, - 0x69cb15f8L, 0x42e6463bL, 0x5bfd777aL, 0xdc656bb5L, 0xc57e5af4L, - 0xee530937L, 0xf7483876L, 0xb809aeb1L, 0xa1129ff0L, 0x8a3fcc33L, - 0x9324fd72L - , - 0x00000000L, 0x01c26a37L, 0x0384d46eL, 0x0246be59L, 0x0709a8dcL, - 0x06cbc2ebL, 0x048d7cb2L, 0x054f1685L, 0x0e1351b8L, 0x0fd13b8fL, - 0x0d9785d6L, 0x0c55efe1L, 0x091af964L, 0x08d89353L, 0x0a9e2d0aL, - 0x0b5c473dL, 0x1c26a370L, 0x1de4c947L, 0x1fa2771eL, 0x1e601d29L, - 0x1b2f0bacL, 0x1aed619bL, 0x18abdfc2L, 0x1969b5f5L, 0x1235f2c8L, - 0x13f798ffL, 0x11b126a6L, 0x10734c91L, 0x153c5a14L, 0x14fe3023L, - 0x16b88e7aL, 0x177ae44dL, 0x384d46e0L, 0x398f2cd7L, 0x3bc9928eL, - 0x3a0bf8b9L, 0x3f44ee3cL, 0x3e86840bL, 0x3cc03a52L, 0x3d025065L, - 0x365e1758L, 0x379c7d6fL, 0x35dac336L, 0x3418a901L, 0x3157bf84L, - 0x3095d5b3L, 0x32d36beaL, 0x331101ddL, 0x246be590L, 0x25a98fa7L, - 0x27ef31feL, 0x262d5bc9L, 0x23624d4cL, 0x22a0277bL, 0x20e69922L, - 0x2124f315L, 0x2a78b428L, 0x2bbade1fL, 0x29fc6046L, 0x283e0a71L, - 0x2d711cf4L, 0x2cb376c3L, 0x2ef5c89aL, 0x2f37a2adL, 0x709a8dc0L, - 0x7158e7f7L, 0x731e59aeL, 0x72dc3399L, 0x7793251cL, 0x76514f2bL, - 0x7417f172L, 0x75d59b45L, 0x7e89dc78L, 0x7f4bb64fL, 0x7d0d0816L, - 0x7ccf6221L, 0x798074a4L, 0x78421e93L, 0x7a04a0caL, 0x7bc6cafdL, - 0x6cbc2eb0L, 0x6d7e4487L, 0x6f38fadeL, 0x6efa90e9L, 0x6bb5866cL, - 0x6a77ec5bL, 0x68315202L, 0x69f33835L, 0x62af7f08L, 0x636d153fL, - 0x612bab66L, 0x60e9c151L, 0x65a6d7d4L, 0x6464bde3L, 0x662203baL, - 0x67e0698dL, 0x48d7cb20L, 0x4915a117L, 0x4b531f4eL, 0x4a917579L, - 0x4fde63fcL, 0x4e1c09cbL, 0x4c5ab792L, 0x4d98dda5L, 0x46c49a98L, - 0x4706f0afL, 0x45404ef6L, 0x448224c1L, 0x41cd3244L, 0x400f5873L, - 0x4249e62aL, 0x438b8c1dL, 0x54f16850L, 0x55330267L, 0x5775bc3eL, - 0x56b7d609L, 0x53f8c08cL, 0x523aaabbL, 0x507c14e2L, 0x51be7ed5L, - 0x5ae239e8L, 0x5b2053dfL, 0x5966ed86L, 0x58a487b1L, 0x5deb9134L, - 0x5c29fb03L, 0x5e6f455aL, 0x5fad2f6dL, 0xe1351b80L, 0xe0f771b7L, - 0xe2b1cfeeL, 0xe373a5d9L, 0xe63cb35cL, 0xe7fed96bL, 0xe5b86732L, - 0xe47a0d05L, 0xef264a38L, 0xeee4200fL, 0xeca29e56L, 0xed60f461L, - 0xe82fe2e4L, 0xe9ed88d3L, 0xebab368aL, 0xea695cbdL, 0xfd13b8f0L, - 0xfcd1d2c7L, 0xfe976c9eL, 0xff5506a9L, 0xfa1a102cL, 0xfbd87a1bL, - 0xf99ec442L, 0xf85cae75L, 0xf300e948L, 0xf2c2837fL, 0xf0843d26L, - 0xf1465711L, 0xf4094194L, 0xf5cb2ba3L, 0xf78d95faL, 0xf64fffcdL, - 0xd9785d60L, 0xd8ba3757L, 0xdafc890eL, 0xdb3ee339L, 0xde71f5bcL, - 0xdfb39f8bL, 0xddf521d2L, 0xdc374be5L, 0xd76b0cd8L, 0xd6a966efL, - 0xd4efd8b6L, 0xd52db281L, 0xd062a404L, 0xd1a0ce33L, 0xd3e6706aL, - 0xd2241a5dL, 0xc55efe10L, 0xc49c9427L, 0xc6da2a7eL, 0xc7184049L, - 0xc25756ccL, 0xc3953cfbL, 0xc1d382a2L, 0xc011e895L, 0xcb4dafa8L, - 0xca8fc59fL, 0xc8c97bc6L, 0xc90b11f1L, 0xcc440774L, 0xcd866d43L, - 0xcfc0d31aL, 0xce02b92dL, 0x91af9640L, 0x906dfc77L, 0x922b422eL, - 0x93e92819L, 0x96a63e9cL, 0x976454abL, 0x9522eaf2L, 0x94e080c5L, - 0x9fbcc7f8L, 0x9e7eadcfL, 0x9c381396L, 0x9dfa79a1L, 0x98b56f24L, - 0x99770513L, 0x9b31bb4aL, 0x9af3d17dL, 0x8d893530L, 0x8c4b5f07L, - 0x8e0de15eL, 0x8fcf8b69L, 0x8a809decL, 0x8b42f7dbL, 0x89044982L, - 0x88c623b5L, 0x839a6488L, 0x82580ebfL, 0x801eb0e6L, 0x81dcdad1L, - 0x8493cc54L, 0x8551a663L, 0x8717183aL, 0x86d5720dL, 0xa9e2d0a0L, - 0xa820ba97L, 0xaa6604ceL, 0xaba46ef9L, 0xaeeb787cL, 0xaf29124bL, - 0xad6fac12L, 0xacadc625L, 0xa7f18118L, 0xa633eb2fL, 0xa4755576L, - 0xa5b73f41L, 0xa0f829c4L, 0xa13a43f3L, 0xa37cfdaaL, 0xa2be979dL, - 0xb5c473d0L, 0xb40619e7L, 0xb640a7beL, 0xb782cd89L, 0xb2cddb0cL, - 0xb30fb13bL, 0xb1490f62L, 0xb08b6555L, 0xbbd72268L, 0xba15485fL, - 0xb853f606L, 0xb9919c31L, 0xbcde8ab4L, 0xbd1ce083L, 0xbf5a5edaL, - 0xbe9834edL - , - 0x00000000L, 0xb8bc6765L, 0xaa09c88bL, 0x12b5afeeL, 0x8f629757L, - 0x37def032L, 0x256b5fdcL, 0x9dd738b9L, 0xc5b428efL, 0x7d084f8aL, - 0x6fbde064L, 0xd7018701L, 0x4ad6bfb8L, 0xf26ad8ddL, 0xe0df7733L, - 0x58631056L, 0x5019579fL, 0xe8a530faL, 0xfa109f14L, 0x42acf871L, - 0xdf7bc0c8L, 0x67c7a7adL, 0x75720843L, 0xcdce6f26L, 0x95ad7f70L, - 0x2d111815L, 0x3fa4b7fbL, 0x8718d09eL, 0x1acfe827L, 0xa2738f42L, - 0xb0c620acL, 0x087a47c9L, 0xa032af3eL, 0x188ec85bL, 0x0a3b67b5L, - 0xb28700d0L, 0x2f503869L, 0x97ec5f0cL, 0x8559f0e2L, 0x3de59787L, - 0x658687d1L, 0xdd3ae0b4L, 0xcf8f4f5aL, 0x7733283fL, 0xeae41086L, - 0x525877e3L, 0x40edd80dL, 0xf851bf68L, 0xf02bf8a1L, 0x48979fc4L, - 0x5a22302aL, 0xe29e574fL, 0x7f496ff6L, 0xc7f50893L, 0xd540a77dL, - 0x6dfcc018L, 0x359fd04eL, 0x8d23b72bL, 0x9f9618c5L, 0x272a7fa0L, - 0xbafd4719L, 0x0241207cL, 0x10f48f92L, 0xa848e8f7L, 0x9b14583dL, - 0x23a83f58L, 0x311d90b6L, 0x89a1f7d3L, 0x1476cf6aL, 0xaccaa80fL, - 0xbe7f07e1L, 0x06c36084L, 0x5ea070d2L, 0xe61c17b7L, 0xf4a9b859L, - 0x4c15df3cL, 0xd1c2e785L, 0x697e80e0L, 0x7bcb2f0eL, 0xc377486bL, - 0xcb0d0fa2L, 0x73b168c7L, 0x6104c729L, 0xd9b8a04cL, 0x446f98f5L, - 0xfcd3ff90L, 0xee66507eL, 0x56da371bL, 0x0eb9274dL, 0xb6054028L, - 0xa4b0efc6L, 0x1c0c88a3L, 0x81dbb01aL, 0x3967d77fL, 0x2bd27891L, - 0x936e1ff4L, 0x3b26f703L, 0x839a9066L, 0x912f3f88L, 0x299358edL, - 0xb4446054L, 0x0cf80731L, 0x1e4da8dfL, 0xa6f1cfbaL, 0xfe92dfecL, - 0x462eb889L, 0x549b1767L, 0xec277002L, 0x71f048bbL, 0xc94c2fdeL, - 0xdbf98030L, 0x6345e755L, 0x6b3fa09cL, 0xd383c7f9L, 0xc1366817L, - 0x798a0f72L, 0xe45d37cbL, 0x5ce150aeL, 0x4e54ff40L, 0xf6e89825L, - 0xae8b8873L, 0x1637ef16L, 0x048240f8L, 0xbc3e279dL, 0x21e91f24L, - 0x99557841L, 0x8be0d7afL, 0x335cb0caL, 0xed59b63bL, 0x55e5d15eL, - 0x47507eb0L, 0xffec19d5L, 0x623b216cL, 0xda874609L, 0xc832e9e7L, - 0x708e8e82L, 0x28ed9ed4L, 0x9051f9b1L, 0x82e4565fL, 0x3a58313aL, - 0xa78f0983L, 0x1f336ee6L, 0x0d86c108L, 0xb53aa66dL, 0xbd40e1a4L, - 0x05fc86c1L, 0x1749292fL, 0xaff54e4aL, 0x322276f3L, 0x8a9e1196L, - 0x982bbe78L, 0x2097d91dL, 0x78f4c94bL, 0xc048ae2eL, 0xd2fd01c0L, - 0x6a4166a5L, 0xf7965e1cL, 0x4f2a3979L, 0x5d9f9697L, 0xe523f1f2L, - 0x4d6b1905L, 0xf5d77e60L, 0xe762d18eL, 0x5fdeb6ebL, 0xc2098e52L, - 0x7ab5e937L, 0x680046d9L, 0xd0bc21bcL, 0x88df31eaL, 0x3063568fL, - 0x22d6f961L, 0x9a6a9e04L, 0x07bda6bdL, 0xbf01c1d8L, 0xadb46e36L, - 0x15080953L, 0x1d724e9aL, 0xa5ce29ffL, 0xb77b8611L, 0x0fc7e174L, - 0x9210d9cdL, 0x2aacbea8L, 0x38191146L, 0x80a57623L, 0xd8c66675L, - 0x607a0110L, 0x72cfaefeL, 0xca73c99bL, 0x57a4f122L, 0xef189647L, - 0xfdad39a9L, 0x45115eccL, 0x764dee06L, 0xcef18963L, 0xdc44268dL, - 0x64f841e8L, 0xf92f7951L, 0x41931e34L, 0x5326b1daL, 0xeb9ad6bfL, - 0xb3f9c6e9L, 0x0b45a18cL, 0x19f00e62L, 0xa14c6907L, 0x3c9b51beL, - 0x842736dbL, 0x96929935L, 0x2e2efe50L, 0x2654b999L, 0x9ee8defcL, - 0x8c5d7112L, 0x34e11677L, 0xa9362eceL, 0x118a49abL, 0x033fe645L, - 0xbb838120L, 0xe3e09176L, 0x5b5cf613L, 0x49e959fdL, 0xf1553e98L, - 0x6c820621L, 0xd43e6144L, 0xc68bceaaL, 0x7e37a9cfL, 0xd67f4138L, - 0x6ec3265dL, 0x7c7689b3L, 0xc4caeed6L, 0x591dd66fL, 0xe1a1b10aL, - 0xf3141ee4L, 0x4ba87981L, 0x13cb69d7L, 0xab770eb2L, 0xb9c2a15cL, - 0x017ec639L, 0x9ca9fe80L, 0x241599e5L, 0x36a0360bL, 0x8e1c516eL, - 0x866616a7L, 0x3eda71c2L, 0x2c6fde2cL, 0x94d3b949L, 0x090481f0L, - 0xb1b8e695L, 0xa30d497bL, 0x1bb12e1eL, 0x43d23e48L, 0xfb6e592dL, - 0xe9dbf6c3L, 0x516791a6L, 0xccb0a91fL, 0x740cce7aL, 0x66b96194L, - 0xde0506f1L -# endif /* IZ_CRCOPTIM_UNFOLDTBL */ -# endif /* ? IZ_CRC_BE_OPTIMIZ */ -}; -#endif /* ?DYNAMIC_CRC_TABLE */ - -/* use "OF((void))" here to work around a Borland TC++ 1.0 problem */ -#ifdef USE_ZLIB -ZCONST uLongf *get_crc_table OF((void)) -#else -ZCONST ulg near *get_crc_table OF((void)) -#endif -{ -#ifdef DYNAMIC_CRC_TABLE - if (CRC_TABLE_IS_EMPTY) - make_crc_table(); -#endif -#ifdef USE_ZLIB - return (ZCONST uLongf *)crc_table; -#else - return crc_table; -#endif -} - -#ifdef DYNALLOC_CRCTAB -void free_crc_table() -{ - if (!CRC_TABLE_IS_EMPTY) - { - nearfree((ulg near *)crc_table); - MARK_CRCTAB_EMPTY; - } -} -#endif - -#ifndef USE_ZLIB -#ifndef CRC_TABLE_ONLY -#ifndef ASM_CRC - -#define DO1(crc, buf) crc = CRC32(crc, *buf++, crc_32_tab) -#define DO2(crc, buf) DO1(crc, buf); DO1(crc, buf) -#define DO4(crc, buf) DO2(crc, buf); DO2(crc, buf) -#define DO8(crc, buf) DO4(crc, buf); DO4(crc, buf) - -#if (defined(IZ_CRC_BE_OPTIMIZ) || defined(IZ_CRC_LE_OPTIMIZ)) - -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# ifdef IZ_CRC_BE_OPTIMIZ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = crc_32_tab[c & 0xff] ^ crc_32_tab[256+((c>>8) & 0xff)] ^ \ - crc_32_tab[2*256+((c>>16) & 0xff)] ^ crc_32_tab[3*256+(c>>24)] -# else /* !IZ_CRC_BE_OPTIMIZ */ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = crc_32_tab[3*256+(c & 0xff)] ^ crc_32_tab[2*256+((c>>8) & 0xff)] \ - ^ crc_32_tab[256+((c>>16) & 0xff)] ^ crc_32_tab[c>>24] -# endif /* ?IZ_CRC_BE_OPTIMIZ */ -# else /* !IZ_CRCOPTIM_UNFOLDTBL */ -# define DO_OPT4(c, buf4) c ^= *(buf4)++; \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab); \ - c = CRC32UPD(c, crc_32_tab) -# endif /* ?IZ_CRCOPTIM_UNFOLDTBL */ - -# define DO_OPT16(crc, buf4) DO_OPT4(crc, buf4); DO_OPT4(crc, buf4); \ - DO_OPT4(crc, buf4); DO_OPT4(crc, buf4); - -#endif /* (IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ - - -/* ========================================================================= */ -ulg crc32(crc, buf, len) - ulg crc; /* crc shift register */ - register ZCONST uch *buf; /* pointer to bytes to pump through */ - extent len; /* number of bytes in buf[] */ -/* Run a set of bytes through the crc shift register. If buf is a NULL - pointer, then initialize the crc shift register contents instead. - Return the current crc in either case. */ -{ - register z_uint4 c; - register ZCONST ulg near *crc_32_tab; - - if (buf == NULL) return 0L; - - crc_32_tab = get_crc_table(); - - c = (REV_BE((z_uint4)crc) ^ 0xffffffffL); - -#if (defined(IZ_CRC_BE_OPTIMIZ) || defined(IZ_CRC_LE_OPTIMIZ)) - /* Align buf pointer to next DWORD boundary. */ - while (len && ((ptrdiff_t)buf & 3)) { - DO1(c, buf); - len--; - } - { - ZCONST z_uint4 *buf4 = (ZCONST z_uint4 *)buf; - while (len >= 16) { - DO_OPT16(c, buf4); - len -= 16; - } - while (len >= 4) { - DO_OPT4(c, buf4); - len -= 4; - } - buf = (ZCONST uch *)buf4; - } -#else /* !(IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ -#ifndef NO_UNROLLED_LOOPS - while (len >= 8) { - DO8(c, buf); - len -= 8; - } -#endif /* !NO_UNROLLED_LOOPS */ -#endif /* ?(IZ_CRC_BE_OPTIMIZ || IZ_CRC_LE_OPTIMIZ) */ - if (len) do { - DO1(c, buf); - } while (--len); - - return REV_BE(c) ^ 0xffffffffL; /* (instead of ~c for 64-bit machines) */ -} -#endif /* !ASM_CRC */ -#endif /* !CRC_TABLE_ONLY */ -#endif /* !USE_ZLIB */ -#endif /* !USE_ZLIB || USE_OWN_CRCTAB */ diff --git a/data/windows/unzipfx-catia/crc32.h b/data/windows/unzipfx-catia/crc32.h deleted file mode 100644 index 83af240..0000000 --- a/data/windows/unzipfx-catia/crc32.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* crc32.h -- compute the CRC-32 of a data stream - * Copyright (C) 1995 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#ifndef __crc32_h -#define __crc32_h /* identifies this source module */ - -/* This header should be read AFTER zip.h resp. unzip.h - * (the latter with UNZIP_INTERNAL defined...). - */ - -#ifndef OF -# define OF(a) a -#endif -#ifndef ZCONST -# define ZCONST const -#endif - -#ifdef DYNALLOC_CRCTAB - void free_crc_table OF((void)); -#endif -#ifndef USE_ZLIB - ZCONST ulg near *get_crc_table OF((void)); -#endif -#if (defined(USE_ZLIB) || defined(CRC_TABLE_ONLY)) -# ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -# endif -#else /* !(USE_ZLIB || CRC_TABLE_ONLY) */ - ulg crc32 OF((ulg crc, ZCONST uch *buf, extent len)); -#endif /* ?(USE_ZLIB || CRC_TABLE_ONLY) */ - -#ifndef CRC_32_TAB -# define CRC_32_TAB crc_32_tab -#endif - -#ifdef CRC32 -# undef CRC32 -#endif -#ifdef IZ_CRC_BE_OPTIMIZ -# define CRC32UPD(c, crctab) (crctab[((c) >> 24)] ^ ((c) << 8)) -# define CRC32(c, b, crctab) (crctab[(((int)(c) >> 24) ^ (b))] ^ ((c) << 8)) -# define REV_BE(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ - (((w)&0xff00)<<8)+(((w)&0xff)<<24)) -#else -# define CRC32UPD(c, crctab) (crctab[((int)(c)) & 0xff] ^ ((c) >> 8)) -# define CRC32(c, b, crctab) (crctab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -# define REV_BE(w) w -#endif - -#endif /* !__crc32_h */ diff --git a/data/windows/unzipfx-catia/crypt.c b/data/windows/unzipfx-catia/crypt.c deleted file mode 100644 index 784e411..0000000 --- a/data/windows/unzipfx-catia/crypt.c +++ /dev/null @@ -1,653 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in (un)zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The main encryption/decryption source code for Info-Zip software was - originally written in Europe. To the best of our knowledge, it can - be freely distributed in both source and object forms from any country, - including the USA under License Exception TSU of the U.S. Export - Administration Regulations (section 740.13(e)) of 6 June 2002. - - NOTE on copyright history: - Previous versions of this source package (up to version 2.8) were - not copyrighted and put in the public domain. If you cannot comply - with the Info-Zip LICENSE, you may want to look for one of those - public domain versions. - */ - -/* - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - */ - -#define ZCRYPT_INTERNAL -#include "zip.h" -#include "crypt.h" -#include "ttyio.h" - -#if CRYPT - -#ifndef FALSE -# define FALSE 0 -#endif - -#ifdef ZIP - /* For the encoding task used in Zip (and ZipCloak), we want to initialize - the crypt algorithm with some reasonably unpredictable bytes, see - the crypthead() function. The standard rand() library function is - used to supply these `random' bytes, which in turn is initialized by - a srand() call. The srand() function takes an "unsigned" (at least 16bit) - seed value as argument to determine the starting point of the rand() - pseudo-random number generator. - This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with - Seed1 supplied by the current time (= "(unsigned)time()") and Seed2 - as some (hopefully) nondeterministic bitmask. On many (most) systems, - we use some "process specific" number, as the PID or something similar, - but when nothing unpredictable is available, a fixed number may be - sufficient. - NOTE: - 1.) This implementation requires the availability of the following - standard UNIX C runtime library functions: time(), rand(), srand(). - On systems where some of them are missing, the environment that - incorporates the crypt routines must supply suitable replacement - functions. - 2.) It is a very bad idea to use a second call to time() to set the - "Seed2" number! In this case, both "Seed1" and "Seed2" would be - (almost) identical, resulting in a (mostly) "zero" constant seed - number passed to srand(). - - The implementation environment defined in the "zip.h" header should - supply a reasonable definition for ZCR_SEED2 (an unsigned number; for - most implementations of rand() and srand(), only the lower 16 bits are - significant!). An example that works on many systems would be - "#define ZCR_SEED2 (unsigned)getpid()". - The default definition for ZCR_SEED2 supplied below should be regarded - as a fallback to allow successful compilation in "beta state" - environments. - */ -# include /* time() function supplies first part of crypt seed */ - /* "last resort" source for second part of crypt seed pattern */ -# ifndef ZCR_SEED2 -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */ -# endif -# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -# undef GLOBAL -# endif -# define GLOBAL(g) g -#else /* !ZIP */ -# define GLOBAL(g) G.g -#endif /* ?ZIP */ - - -#ifdef UNZIP - /* char *key = (char *)NULL; moved to globals.h */ -# ifndef FUNZIP - local int testp OF((__GPRO__ ZCONST uch *h)); - local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key)); -# endif -#endif /* UNZIP */ - -#ifndef UNZIP /* moved to globals.h for UnZip */ -# ifndef Z_UINT4_DEFINED -# if !defined(NO_LIMITS_H) -# if (defined(UINT_MAX) && (UINT_MAX == 0xffffffffUL)) - typedef unsigned int z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(ULONG_MAX) && (ULONG_MAX == 0xffffffffUL)) - typedef unsigned long z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(USHRT_MAX) && (USHRT_MAX == 0xffffffffUL)) - typedef unsigned short z_uint4; -# define Z_UINT4_DEFINED -# endif -# endif -# endif -# endif /* !NO_LIMITS_H */ -# endif /* !Z_UINT4_DEFINED */ -# ifndef Z_UINT4_DEFINED - typedef ulg z_uint4; -# define Z_UINT4_DEFINED -# endif - local z_uint4 keys[3]; /* keys defining the pseudo-random sequence */ -#endif /* !UNZIP */ - -#ifndef Trace -# ifdef CRYPT_DEBUG -# define Trace(x) fprintf x -# else -# define Trace(x) -# endif -#endif - -#include "crc32.h" - -#ifdef IZ_CRC_BE_OPTIMIZ - local z_uint4 near crycrctab[256]; - local z_uint4 near *cry_crctb_p = NULL; - local z_uint4 near *crytab_init OF((__GPRO)); -# define CRY_CRC_TAB cry_crctb_p -# undef CRC32 -# define CRC32(c, b, crctab) (crctab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -#else -# define CRY_CRC_TAB CRC_32_TAB -#endif /* ?IZ_CRC_BE_OPTIMIZ */ - -/*********************************************************************** - * Return the next byte in the pseudo-random sequence - */ -int decrypt_byte(__G) - __GDEF -{ - unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an - * unpredictable manner on 16-bit systems; not a problem - * with any known compiler so far, though */ - - temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2; - return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -} - -/*********************************************************************** - * Update the encryption keys with the next byte of plain text - */ -int update_keys(__G__ c) - __GDEF - int c; /* byte of plain text */ -{ - GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c, CRY_CRC_TAB); - GLOBAL(keys[1]) = (GLOBAL(keys[1]) - + (GLOBAL(keys[0]) & 0xff)) - * 134775813L + 1; - { - register int keyshift = (int)(GLOBAL(keys[1]) >> 24); - GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift, CRY_CRC_TAB); - } - return c; -} - - -/*********************************************************************** - * Initialize the encryption keys and the random header according to - * the given password. - */ -void init_keys(__G__ passwd) - __GDEF - ZCONST char *passwd; /* password string with which to modify keys */ -{ -#ifdef IZ_CRC_BE_OPTIMIZ - if (cry_crctb_p == NULL) { - cry_crctb_p = crytab_init(__G); - } -#endif - GLOBAL(keys[0]) = 305419896L; - GLOBAL(keys[1]) = 591751049L; - GLOBAL(keys[2]) = 878082192L; - while (*passwd != '\0') { - update_keys(__G__ (int)*passwd); - passwd++; - } -} - - -/*********************************************************************** - * Initialize the local copy of the table of precomputed crc32 values. - * Whereas the public crc32-table is optimized for crc32 calculations - * on arrays of bytes, the crypt code needs the crc32 values in an - * byte-order-independent form as 32-bit unsigned numbers. On systems - * with Big-Endian byte order using the optimized crc32 code, this - * requires inverting the byte-order of the values in the - * crypt-crc32-table. - */ -#ifdef IZ_CRC_BE_OPTIMIZ -local z_uint4 near *crytab_init(__G) - __GDEF -{ - int i; - - for (i = 0; i < 256; i++) { - crycrctab[i] = REV_BE(CRC_32_TAB[i]); - } - return crycrctab; -} -#endif - - -#ifdef ZIP - -/*********************************************************************** - * Write encryption header to file zfile using the password passwd - * and the cyclic redundancy check crc. - */ -void crypthead(passwd, crc, zfile) - ZCONST char *passwd; /* password string */ - ulg crc; /* crc of file being encrypted */ - FILE *zfile; /* where to write header */ -{ - int n; /* index in random header */ - int t; /* temporary */ - int c; /* random byte */ - uch header[RAND_HEAD_LEN]; /* random header */ - static unsigned calls = 0; /* ensure different random header each time */ - - /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the - * output of rand() to get less predictability, since rand() is - * often poorly implemented. - */ - if (++calls == 1) { - srand((unsigned)time(NULL) ^ ZCR_SEED2); - } - init_keys(passwd); - for (n = 0; n < RAND_HEAD_LEN-2; n++) { - c = (rand() >> 7) & 0xff; - header[n] = (uch)zencode(c, t); - } - /* Encrypt random header (last two bytes is high word of crc) */ - init_keys(passwd); - for (n = 0; n < RAND_HEAD_LEN-2; n++) { - header[n] = (uch)zencode(header[n], t); - } - header[RAND_HEAD_LEN-2] = (uch)zencode((int)(crc >> 16) & 0xff, t); - header[RAND_HEAD_LEN-1] = (uch)zencode((int)(crc >> 24) & 0xff, t); - fwrite(header, 1, RAND_HEAD_LEN, f); -} - - -#ifdef UTIL - -/*********************************************************************** - * Encrypt the zip entry described by z from file source to file dest - * using the password passwd. Return an error code in the ZE_ class. - */ -int zipcloak(z, source, dest, passwd) - struct zlist far *z; /* zip entry to encrypt */ - FILE *source, *dest; /* source and destination files */ - ZCONST char *passwd; /* password string */ -{ - int c; /* input byte */ - int res; /* result code */ - ulg n; /* holds offset and counts size */ - ush flag; /* previous flags */ - int t; /* temporary */ - int ztemp; /* temporary storage for zencode value */ - - /* Set encrypted bit, clear extended local header bit and write local - header to output file */ - if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; - z->off = n; - flag = z->flg; - z->flg |= 1, z->flg &= ~8; - z->lflg |= 1, z->lflg &= ~8; - z->siz += RAND_HEAD_LEN; - if ((res = putlocal(z, dest)) != ZE_OK) return res; - - /* Initialize keys with password and write random header */ - crypthead(passwd, z->crc, dest); - - /* Skip local header in input file */ - if (fseek(source, (long)((4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext), - SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - - /* Encrypt data */ - for (n = z->siz - RAND_HEAD_LEN; n; n--) { - if ((c = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - ztemp = zencode(c, t); - putc(ztemp, dest); - } - /* Skip extended local header in input file if there is one */ - if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if (fflush(dest) == EOF) return ZE_TEMP; - - /* Update number of bytes written to output file */ - tempzn += (4 + LOCHEAD) + z->nam + z->ext + z->siz; - - return ZE_OK; -} - -/*********************************************************************** - * Decrypt the zip entry described by z from file source to file dest - * using the password passwd. Return an error code in the ZE_ class. - */ -int zipbare(z, source, dest, passwd) - struct zlist far *z; /* zip entry to encrypt */ - FILE *source, *dest; /* source and destination files */ - ZCONST char *passwd; /* password string */ -{ -#ifdef ZIP10 - int c0 /* byte preceding the last input byte */ -#endif - int c1; /* last input byte */ - ulg offset; /* used for file offsets */ - ulg size; /* size of input data */ - int r; /* size of encryption header */ - int res; /* return code */ - ush flag; /* previous flags */ - - /* Save position and skip local header in input file */ - if ((offset = (ulg)ftell(source)) == (ulg)-1L || - fseek(source, (long)((4 + LOCHEAD) + (ulg)z->nam + (ulg)z->ext), - SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - /* Initialize keys with password */ - init_keys(passwd); - - /* Decrypt encryption header, save last two bytes */ - c1 = 0; - for (r = RAND_HEAD_LEN; r; r--) { -#ifdef ZIP10 - c0 = c1; -#endif - if ((c1 = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - Trace((stdout, " (%02x)", c1)); - zdecode(c1); - Trace((stdout, " %02x", c1)); - } - Trace((stdout, "\n")); - - /* If last two bytes of header don't match crc (or file time in the - * case of an extended local header), back up and just copy. For - * pkzip 2.0, the check has been reduced to one byte only. - */ -#ifdef ZIP10 - if ((ush)(c0 | (c1<<8)) != - (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) { -#else - if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) { -#endif - if (fseek(source, offset, SEEK_SET)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if ((res = zipcopy(z, source, dest)) != ZE_OK) return res; - return ZE_MISS; - } - - /* Clear encrypted bit and local header bit, and write local header to - output file */ - if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; - z->off = offset; - flag = z->flg; - z->flg &= ~9; - z->lflg &= ~9; - z->siz -= RAND_HEAD_LEN; - if ((res = putlocal(z, dest)) != ZE_OK) return res; - - /* Decrypt data */ - for (size = z->siz; size; size--) { - if ((c1 = getc(source)) == EOF) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - zdecode(c1); - putc(c1, dest); - } - /* Skip extended local header in input file if there is one */ - if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { - return ferror(source) ? ZE_READ : ZE_EOF; - } - if (fflush(dest) == EOF) return ZE_TEMP; - - /* Update number of bytes written to output file */ - tempzn += (4 + LOCHEAD) + z->nam + z->ext + z->siz; - - return ZE_OK; -} - - -#else /* !UTIL */ - -/*********************************************************************** - * If requested, encrypt the data in buf, and in any case call fwrite() - * with the arguments to zfwrite(). Return what fwrite() returns. - * - * A bug has been found when encrypting large files. See trees.c - * for details and the fix. - */ -unsigned zfwrite(buf, item_size, nb, f) - zvoid *buf; /* data buffer */ - extent item_size; /* size of each item in bytes */ - extent nb; /* number of items */ - FILE *f; /* file to write to */ -{ - int t; /* temporary */ - - if (key != (char *)NULL) { /* key is the global password pointer */ - ulg size; /* buffer size */ - char *p = (char*)buf; /* steps through buffer */ - - /* Encrypt data in buffer */ - for (size = item_size*(ulg)nb; size != 0; p++, size--) { - *p = (char)zencode(*p, t); - } - } - /* Write the buffer out */ - return fwrite(buf, item_size, nb, f); -} - -#endif /* ?UTIL */ -#endif /* ZIP */ - - -#if (defined(UNZIP) && !defined(FUNZIP)) - -/*********************************************************************** - * Get the password and set up keys for current zipfile member. - * Return PK_ class error. - */ -int decrypt(__G__ passwrd) - __GDEF - ZCONST char *passwrd; -{ - ush b; - int n, r; - uch h[RAND_HEAD_LEN]; - - Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt))); - - /* get header once (turn off "encrypted" flag temporarily so we don't - * try to decrypt the same data twice) */ - GLOBAL(pInfo->encrypted) = FALSE; - defer_leftover_input(__G); - for (n = 0; n < RAND_HEAD_LEN; n++) { - b = NEXTBYTE; - h[n] = (uch)b; - Trace((stdout, " (%02x)", h[n])); - } - undefer_input(__G); - GLOBAL(pInfo->encrypted) = TRUE; - - if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */ - GLOBAL(newzip) = FALSE; - if (passwrd != (char *)NULL) { /* user gave password on command line */ - if (!GLOBAL(key)) { - if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) == - (char *)NULL) - return PK_MEM2; - strcpy(GLOBAL(key), passwrd); - GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */ - } - } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */ - free(GLOBAL(key)); - GLOBAL(key) = (char *)NULL; - } - } - - /* if have key already, test it; else allocate memory for it */ - if (GLOBAL(key)) { - if (!testp(__G__ h)) - return PK_COOL; /* existing password OK (else prompt for new) */ - else if (GLOBAL(nopwd)) - return PK_WARN; /* user indicated no more prompting */ - } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) - return PK_MEM2; - - /* try a few keys */ - n = 0; - do { - r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1, - GLOBAL(zipfn), GLOBAL(filename)); - if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */ - free (GLOBAL(key)); - GLOBAL(key) = NULL; - return PK_MEM2; - } - if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */ - *GLOBAL(key) = '\0'; /* We try the NIL password, ... */ - n = 0; /* and cancel fetch for this item. */ - } - if (!testp(__G__ h)) - return PK_COOL; - if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */ - GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */ - } while (n > 0); - - return PK_WARN; - -} /* end function decrypt() */ - - - -/*********************************************************************** - * Test the password. Return -1 if bad, 0 if OK. - */ -local int testp(__G__ h) - __GDEF - ZCONST uch *h; -{ - int r; - char *key_translated; - - /* On systems with "obscure" native character coding (e.g., EBCDIC), - * the first test translates the password to the "main standard" - * character coding. */ - -#ifdef STR_TO_CP1 - /* allocate buffer for translated password */ - if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) - return -1; - /* first try, test password translated "standard" charset */ - r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key))); -#else /* !STR_TO_CP1 */ - /* first try, test password as supplied on the extractor's host */ - r = testkey(__G__ h, GLOBAL(key)); -#endif /* ?STR_TO_CP1 */ - -#ifdef STR_TO_CP2 - if (r != 0) { -#ifndef STR_TO_CP1 - /* now prepare for second (and maybe third) test with translated pwd */ - if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) - return -1; -#endif - /* second try, password translated to alternate ("standard") charset */ - r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key))); -#ifdef STR_TO_CP3 - if (r != 0) - /* third try, password translated to another "standard" charset */ - r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key))); -#endif -#ifndef STR_TO_CP1 - free(key_translated); -#endif - } -#endif /* STR_TO_CP2 */ - -#ifdef STR_TO_CP1 - free(key_translated); - if (r != 0) { - /* last resort, test password as supplied on the extractor's host */ - r = testkey(__G__ h, GLOBAL(key)); - } -#endif /* STR_TO_CP1 */ - - return r; - -} /* end function testp() */ - - -local int testkey(__G__ h, key) - __GDEF - ZCONST uch *h; /* decrypted header */ - ZCONST char *key; /* decryption password to test */ -{ - ush b; -#ifdef ZIP10 - ush c; -#endif - int n; - uch *p; - uch hh[RAND_HEAD_LEN]; /* decrypted header */ - - /* set keys and save the encrypted header */ - init_keys(__G__ key); - memcpy(hh, h, RAND_HEAD_LEN); - - /* check password */ - for (n = 0; n < RAND_HEAD_LEN; n++) { - zdecode(hh[n]); - Trace((stdout, " %02x", hh[n])); - } - - Trace((stdout, - "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", - GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), - GLOBAL(pInfo->ExtLocHdr) ? "true":"false")); - Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n", - GLOBAL(incnt), - GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf)))); - - /* same test as in zipbare(): */ - -#ifdef ZIP10 /* check two bytes */ - c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1]; - Trace((stdout, - " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n", - (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16), - ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff)))); - if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ? - ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) : - (ush)(GLOBAL(lrec.crc32) >> 16))) - return -1; /* bad */ -#else - b = hh[RAND_HEAD_LEN-1]; - Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", - b, (ush)(GLOBAL(lrec.crc32) >> 24), - ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff)); - if (b != (GLOBAL(pInfo->ExtLocHdr) ? - ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff : - (ush)(GLOBAL(lrec.crc32) >> 24))) - return -1; /* bad */ -#endif - /* password OK: decrypt current buffer contents before leaving */ - for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ? - (int)GLOBAL(csize) : GLOBAL(incnt), - p = GLOBAL(inptr); n--; p++) - zdecode(*p); - return 0; /* OK */ - -} /* end function testkey() */ - -#endif /* UNZIP && !FUNZIP */ - -#else /* !CRYPT */ - -/* something "externally visible" to shut up compiler/linker warnings */ -int zcr_dummy; - -#endif /* ?CRYPT */ diff --git a/data/windows/unzipfx-catia/crypt.h b/data/windows/unzipfx-catia/crypt.h deleted file mode 100644 index 0c533e9..0000000 --- a/data/windows/unzipfx-catia/crypt.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2005-Feb-10 or later - (the contents of which are also included in (un)zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE] - - The main encryption/decryption source code for Info-Zip software was - originally written in Europe. To the best of our knowledge, it can - be freely distributed in both source and object forms from any country, - including the USA under License Exception TSU of the U.S. Export - Administration Regulations (section 740.13(e)) of 6 June 2002. - - NOTE on copyright history: - Previous versions of this source package (up to version 2.8) were - not copyrighted and put in the public domain. If you cannot comply - with the Info-Zip LICENSE, you may want to look for one of those - public domain versions. - */ - -#ifndef __crypt_h /* don't include more than once */ -#define __crypt_h - -#ifdef CRYPT -# undef CRYPT -#endif -/* - Logic of selecting "full crypt" code: - a) default behaviour: - - dummy crypt code when compiling UnZipSFX stub, to minimize size - - full crypt code when used to compile Zip, UnZip and fUnZip - b) USE_CRYPT defined: - - always full crypt code - c) NO_CRYPT defined: - - never full crypt code - NO_CRYPT takes precedence over USE_CRYPT - */ -#if defined(NO_CRYPT) -# define CRYPT 0 /* dummy version */ -#else -#if defined(USE_CRYPT) -# define CRYPT 1 /* full version */ -#else -#if !defined(SFX) -# define CRYPT 1 /* full version for zip and main unzip */ -#else -# define CRYPT 0 /* dummy version for unzip sfx */ -#endif -#endif /* ?USE_CRYPT */ -#endif /* ?NO_CRYPT */ - -#if CRYPT -/* full version */ - -#ifdef CR_BETA -# undef CR_BETA /* this is not a beta release */ -#endif - -#define CR_MAJORVER 2 -#define CR_MINORVER 11 -#ifdef CR_BETA -# define CR_BETA_VER "c BETA" -# define CR_VERSION_DATE "05 Jan 2007" /* last real code change */ -#else -# define CR_BETA_VER "" -# define CR_VERSION_DATE "05 Jan 2007" /* last public release date */ -# define CR_RELEASE -#endif - -#ifndef __G /* UnZip only, for now (DLL stuff) */ -# define __G -# define __G__ -# define __GDEF -# define __GPRO void -# define __GPRO__ -#endif - -#if defined(MSDOS) || defined(OS2) || defined(WIN32) -# ifndef DOS_OS2_W32 -# define DOS_OS2_W32 -# endif -#endif - -#if defined(DOS_OS2_W32) || defined(__human68k__) -# ifndef DOS_H68_OS2_W32 -# define DOS_H68_OS2_W32 -# endif -#endif - -#if defined(VM_CMS) || defined(MVS) -# ifndef CMS_MVS -# define CMS_MVS -# endif -#endif - -/* To allow combining of Zip and UnZip static libraries in a single binary, - * the Zip and UnZip versions of the crypt core functions have to be named - * differently. - */ -#ifdef ZIP -# ifdef REALLY_SHORT_SYMS -# define decrypt_byte zdcrby -# else -# define decrypt_byte zp_decrypt_byte -# endif -# define update_keys zp_update_keys -# define init_keys zp_init_keys -#else /* !ZIP */ -# ifdef REALLY_SHORT_SYMS -# define decrypt_byte dcrbyt -# endif -#endif /* ?ZIP */ - -#define IZ_PWLEN 80 /* input buffer size for reading encryption key */ -#ifndef PWLEN /* for compatibility with previous zcrypt release... */ -# define PWLEN IZ_PWLEN -#endif -#define RAND_HEAD_LEN 12 /* length of encryption random header */ - -/* the crc_32_tab array has to be provided externally for the crypt calculus */ - -/* encode byte c, using temp t. Warning: c must not have side effects. */ -#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c)) - -/* decode byte c in place */ -#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G)) - -int decrypt_byte OF((__GPRO)); -int update_keys OF((__GPRO__ int c)); -void init_keys OF((__GPRO__ ZCONST char *passwd)); - -#ifdef ZIP - void crypthead OF((ZCONST char *, ulg, FILE *)); -# ifdef UTIL - int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); - int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -# else - unsigned zfwrite OF((zvoid *, extent, extent, FILE *)); - extern char *key; -# endif -#endif /* ZIP */ - -#if (defined(UNZIP) && !defined(FUNZIP)) - int decrypt OF((__GPRO__ ZCONST char *passwrd)); -#endif - -#ifdef FUNZIP - extern int encrypted; -# ifdef NEXTBYTE -# undef NEXTBYTE -# endif -# define NEXTBYTE \ - (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in)) -#endif /* FUNZIP */ - -#else /* !CRYPT */ -/* dummy version */ - -#define zencode -#define zdecode - -#define zfwrite fwrite - -#endif /* ?CRYPT */ -#endif /* !__crypt_h */ diff --git a/data/windows/unzipfx-catia/ebcdic.h b/data/windows/unzipfx-catia/ebcdic.h deleted file mode 100644 index 3aa587e..0000000 --- a/data/windows/unzipfx-catia/ebcdic.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ebcdic.h - - The CECP 1047 (Extended de-facto EBCDIC) <-> ISO 8859-1 conversion tables, - from ftp://aix1.segi.ulg.ac.be/pub/docs/iso8859/iso8859.networking - - NOTES: - (OS/390 port 12/97) - These table no longer represent the standard mappings (for example in the - OS/390 iconv utility). In order to follow current standards I remapped - ebcdic x0a to ascii x15 and - ebcdic x85 to ascii x25 (and vice-versa) - Without these changes, newlines in auto-convert text files appeared - as literal \045. - I'm not sure what effect this remap would have on the MVS and CMS ports, so - I ifdef'd these changes. Hopefully these ifdef's can be removed when the - MVS/CMS folks test the new mappings. - - Christian Spieler , 27-Apr-1998 - The problem mentioned by Paul von Behren was already observed previously - on VM/CMS, during the preparation of the CMS&MVS port of UnZip 5.20 in - 1996. At that point, the ebcdic tables were not changed since they seemed - to be an adopted standard (to my knowledge, these tables are still used - as presented in mainfraime KERMIT). Instead, the "end-of-line" conversion - feature of Zip's and UnZip's "text-translation" mode was used to force - correct mappings between ASCII and EBCDIC newline markers. - Before interchanging the ASCII mappings of the EBCDIC control characters - "NL" 0x25 and "LF" 0x15 according to the OS/390 setting, we have to - make sure that EBCDIC 0x15 is never used as line termination. - - ---------------------------------------------------------------------------*/ - -#ifndef __ebcdic_h /* prevent multiple inclusions */ -#define __ebcdic_h - - -#ifndef ZCONST -# define ZCONST const -#endif - -#ifdef EBCDIC -#ifndef MTS /* MTS uses a slightly "special" EBCDIC code page */ - -ZCONST uch ebcdic[] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ -#ifdef OS390 - 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#else - 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#endif - 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ - 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ - 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ - 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ - 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ - 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ - 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ - 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D, /* 58 - 5F */ - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ - 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ - 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ -#ifdef OS390 - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, /* 80 - 87 */ -#else - 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ -#endif - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ - 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ - 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ - 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ - 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC, /* A8 - AF */ - 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ - 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ - 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ - 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59, /* D8 - DF */ - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ - 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ - 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ -}; - -#if (defined(ZIP) || CRYPT) -ZCONST uch ascii[] = { - 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ - 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ -#ifdef OS390 - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, /* 10 - 17 */ -#else - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ -#endif - 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ -#ifdef OS390 - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, /* 20 - 27 */ -#else - 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ -#endif - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ - 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ - 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ - 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ - 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ - 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E, /* 58 - 5F */ - 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ - 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ - 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ - 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ - 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ - 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ - 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ - 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ - 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ - 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE, /* A8 - AF */ - 0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ - 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7, /* B8 - BF */ - 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ - 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ - 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ - 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ - 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ - 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ - 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ -}; -#endif /* ZIP || CRYPT */ - -#else /* MTS */ - -/* - * This is the MTS ASCII->EBCDIC translation table. It provides a 1-1 - * translation from ISO 8859/1 8-bit ASCII to IBM Code Page 37 EBCDIC. - */ - -ZCONST uch ebcdic[] = { - 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, /* 00 - 07 */ - 0x16, 0x05, 0x25, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ - 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, /* 10 - 17 */ - 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, /* 20 - 27 */ - 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61, /* 28 - 2F */ - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 30 - 37 */ - 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F, /* 38 - 3F */ - 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 40 - 47 */ - 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, /* 48 - 4F */ - 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, /* 50 - 57 */ - 0xE7, 0xE8, 0xE9, 0xBA, 0xE0, 0xBB, 0xB0, 0x6D, /* 58 - 5F */ - 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 60 - 67 */ - 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, /* 68 - 6F */ - 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, /* 70 - 77 */ - 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07, /* 78 - 7F */ - 0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, /* 80 - 87 */ - 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B, /* 88 - 8F */ - 0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, /* 90 - 97 */ - 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF, /* 98 - 9F */ - 0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, /* A0 - A7 */ - 0xBD, 0xB4, 0x9A, 0x8A, 0x5F, 0xCA, 0xAF, 0xBC, /* A8 - AF */ - 0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, /* B0 - B7 */ - 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB, /* B8 - BF */ - 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, /* C0 - C7 */ - 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, /* C8 - CF */ - 0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, /* D0 - D7 */ - 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xAD, 0xAE, 0x59, /* D8 - DF */ - 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, /* E0 - E7 */ - 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, /* E8 - EF */ - 0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, /* F0 - F7 */ - 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF /* F8 - FF */ -}; - -#if (defined(ZIP) || CRYPT) -ZCONST uch ascii[] = { - 0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, /* 00 - 07 */ - 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 08 - 0F */ - 0x10, 0x11, 0x12, 0x13, 0x9D, 0x85, 0x08, 0x87, /* 10 - 17 */ - 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F, /* 18 - 1F */ - 0x80, 0x81, 0x82, 0x83, 0x84, 0x0A, 0x17, 0x1B, /* 20 - 27 */ - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07, /* 28 - 2F */ - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, /* 30 - 37 */ - 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A, /* 38 - 3F */ - 0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, /* 40 - 47 */ - 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C, /* 48 - 4F */ - 0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, /* 50 - 57 */ - 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAC, /* 58 - 5F */ - 0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, /* 60 - 67 */ - 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F, /* 68 - 6F */ - 0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, /* 70 - 77 */ - 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22, /* 78 - 7F */ - 0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 80 - 87 */ - 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1, /* 88 - 8F */ - 0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, /* 90 - 97 */ - 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4, /* 98 - 9F */ - 0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, /* A0 - A7 */ - 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0xDD, 0xDE, 0xAE, /* A8 - AF */ - 0x5E, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, /* B0 - B7 */ - 0xBD, 0xBE, 0x5B, 0x5D, 0xAF, 0xA8, 0xB4, 0xD7, /* B8 - BF */ - 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* C0 - C7 */ - 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5, /* C8 - CF */ - 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, /* D0 - D7 */ - 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF, /* D8 - DF */ - 0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* E0 - E7 */ - 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5, /* E8 - EF */ - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* F0 - F7 */ - 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F /* F8 - FF */ -}; -#endif /* ZIP || CRYPT */ - -#endif /* ?MTS */ -#endif /* EBCDIC */ - -/*--------------------------------------------------------------------------- - - The following conversion tables translate between IBM PC CP 850 - (OEM codepage) and the "Western Europe & America" Windows codepage 1252. - The Windows codepage 1252 contains the ISO 8859-1 "Latin 1" codepage, - with some additional printable characters in the range (0x80 - 0x9F), - that is reserved to control codes in the ISO 8859-1 character table. - - The ISO <--> OEM conversion tables were constructed with the help - of the WIN32 (Win16?) API's OemToAnsi() and AnsiToOem() conversion - functions and have been checked against the CP850 and LATIN1 tables - provided in the MS-Kermit 3.14 distribution. - - ---------------------------------------------------------------------------*/ - -#ifdef IZ_ISO2OEM_ARRAY -ZCONST uch Far iso2oem_850[] = { - 0x3F, 0x3F, 0x27, 0x9F, 0x22, 0x2E, 0xC5, 0xCE, /* 80 - 87 */ - 0x5E, 0x25, 0x53, 0x3C, 0x4F, 0x3F, 0x3F, 0x3F, /* 88 - 8F */ - 0x3F, 0x27, 0x27, 0x22, 0x22, 0x07, 0x2D, 0x2D, /* 90 - 97 */ - 0x7E, 0x54, 0x73, 0x3E, 0x6F, 0x3F, 0x3F, 0x59, /* 98 - 9F */ - 0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* A0 - A7 */ - 0xF9, 0xB8, 0xA6, 0xAE, 0xAA, 0xF0, 0xA9, 0xEE, /* A8 - AF */ - 0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* B0 - B7 */ - 0xF7, 0xFB, 0xA7, 0xAF, 0xAC, 0xAB, 0xF3, 0xA8, /* B8 - BF */ - 0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* C0 - C7 */ - 0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* C8 - CF */ - 0xD1, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* D0 - D7 */ - 0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* D8 - DF */ - 0x85, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* E0 - E7 */ - 0x8A, 0x82, 0x88, 0x89, 0x8D, 0xA1, 0x8C, 0x8B, /* E8 - EF */ - 0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* F0 - F7 */ - 0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98 /* F8 - FF */ -}; -#endif /* IZ_ISO2OEM_ARRAY */ - -#ifdef IZ_OEM2ISO_ARRAY -ZCONST uch Far oem2iso_850[] = { - 0xC7, 0xFC, 0xE9, 0xE2, 0xE4, 0xE0, 0xE5, 0xE7, /* 80 - 87 */ - 0xEA, 0xEB, 0xE8, 0xEF, 0xEE, 0xEC, 0xC4, 0xC5, /* 88 - 8F */ - 0xC9, 0xE6, 0xC6, 0xF4, 0xF6, 0xF2, 0xFB, 0xF9, /* 90 - 97 */ - 0xFF, 0xD6, 0xDC, 0xF8, 0xA3, 0xD8, 0xD7, 0x83, /* 98 - 9F */ - 0xE1, 0xED, 0xF3, 0xFA, 0xF1, 0xD1, 0xAA, 0xBA, /* A0 - A7 */ - 0xBF, 0xAE, 0xAC, 0xBD, 0xBC, 0xA1, 0xAB, 0xBB, /* A8 - AF */ - 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xC1, 0xC2, 0xC0, /* B0 - B7 */ - 0xA9, 0xA6, 0xA6, 0x2B, 0x2B, 0xA2, 0xA5, 0x2B, /* B8 - BF */ - 0x2B, 0x2D, 0x2D, 0x2B, 0x2D, 0x2B, 0xE3, 0xC3, /* C0 - C7 */ - 0x2B, 0x2B, 0x2D, 0x2D, 0xA6, 0x2D, 0x2B, 0xA4, /* C8 - CF */ - 0xF0, 0xD0, 0xCA, 0xCB, 0xC8, 0x69, 0xCD, 0xCE, /* D0 - D7 */ - 0xCF, 0x2B, 0x2B, 0xA6, 0x5F, 0xA6, 0xCC, 0xAF, /* D8 - DF */ - 0xD3, 0xDF, 0xD4, 0xD2, 0xF5, 0xD5, 0xB5, 0xFE, /* E0 - E7 */ - 0xDE, 0xDA, 0xDB, 0xD9, 0xFD, 0xDD, 0xAF, 0xB4, /* E8 - EF */ - 0xAD, 0xB1, 0x3D, 0xBE, 0xB6, 0xA7, 0xF7, 0xB8, /* F0 - F7 */ - 0xB0, 0xA8, 0xB7, 0xB9, 0xB3, 0xB2, 0xA6, 0xA0 /* F8 - FF */ -}; -#endif /* IZ_OEM2ISO_ARRAY */ - -/* The following pointers to the OEM<-->ISO translation tables are used - by the translation code portions. They may get initialized at program - startup to point to the matching static translation tables, or to NULL - to disable OEM-ISO translation. - The compile-time initialization used here provides the backward compatible - setting, as can be found in UnZip 5.52 and earlier. - In case this mechanism will ever get used on a multithreading system that - allows different codepage setups for concurrently running threads, these - pointers should get moved into UnZip's thread-safe global data structure. - */ -#ifdef IZ_ISO2OEM_ARRAY -ZCONST uch Far *iso2oem = iso2oem_850; /* backward compatibility default */ -#endif /* IZ_ISO2OEM_ARRAY */ -#ifdef IZ_OEM2ISO_ARRAY -ZCONST uch Far *oem2iso = oem2iso_850; /* backward compatibility default */ -#endif /* IZ_OEM2ISO_ARRAY */ - -#if defined(THEOS) || defined(THEOS_SUPPORT) -# include "theos/charconv.h" -#endif - -#endif /* __ebcdic_h */ diff --git a/data/windows/unzipfx-catia/extract.c b/data/windows/unzipfx-catia/extract.c deleted file mode 100644 index 1acd769..0000000 --- a/data/windows/unzipfx-catia/extract.c +++ /dev/null @@ -1,2820 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - extract.c - - This file contains the high-level routines ("driver routines") for extrac- - ting and testing zipfile members. It calls the low-level routines in files - explode.c, inflate.c, unreduce.c and unshrink.c. - - Contains: extract_or_test_files() - store_info() - find_compr_idx() - extract_or_test_entrylist() - extract_or_test_member() - TestExtraField() - test_compr_eb() - memextract() - memflush() - extract_izvms_block() (VMS or VMS_TEXT_CONV) - set_deferred_symlink() (SYMLINKS only) - fnfilter() - dircomp() (SET_DIR_ATTRIB only) - UZbunzip2() (USE_BZIP2 only) - - ---------------------------------------------------------------------------*/ - - -#define __EXTRACT_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif -#include "crc32.h" -#include "crypt.h" - -#define GRRDUMP(buf,len) { \ - int i, j; \ - \ - for (j = 0; j < (len)/16; ++j) { \ - printf(" "); \ - for (i = 0; i < 16; ++i) \ - printf("%02x ", (uch)(buf)[i+(j<<4)]); \ - printf("\n "); \ - for (i = 0; i < 16; ++i) { \ - char c = (char)(buf)[i+(j<<4)]; \ - \ - if (c == '\n') \ - printf("\\n "); \ - else if (c == '\r') \ - printf("\\r "); \ - else \ - printf(" %c ", c); \ - } \ - printf("\n"); \ - } \ - if ((len) % 16) { \ - printf(" "); \ - for (i = j<<4; i < (len); ++i) \ - printf("%02x ", (uch)(buf)[i]); \ - printf("\n "); \ - for (i = j<<4; i < (len); ++i) { \ - char c = (char)(buf)[i]; \ - \ - if (c == '\n') \ - printf("\\n "); \ - else if (c == '\r') \ - printf("\\r "); \ - else \ - printf(" %c ", c); \ - } \ - printf("\n"); \ - } \ -} - -static int store_info OF((__GPRO)); -#ifdef SET_DIR_ATTRIB -static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, - ulg *pfilnum, ulg *pnum_bad_pwd, zoff_t *pold_extra_bytes, - unsigned *pnum_dirs, direntry **pdirlist, - int error_in_archive)); -#else -static int extract_or_test_entrylist OF((__GPRO__ unsigned numchunk, - ulg *pfilnum, ulg *pnum_bad_pwd, zoff_t *pold_extra_bytes, - int error_in_archive)); -#endif -static int extract_or_test_member OF((__GPRO)); -#ifndef SFX - static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); - static int test_compr_eb OF((__GPRO__ uch *eb, unsigned eb_size, - unsigned compr_offset, - int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize))); -#endif -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - static void decompress_bits OF((uch *outptr, unsigned needlen, - ZCONST uch *bitptr)); -#endif -#ifdef SYMLINKS - static void set_deferred_symlink OF((__GPRO__ slinkentry *slnk_entry)); -#endif -#ifdef SET_DIR_ATTRIB - static int Cdecl dircomp OF((ZCONST zvoid *a, ZCONST zvoid *b)); -#endif - - - -/*******************************/ -/* Strings used in extract.c */ -/*******************************/ - -static ZCONST char Far VersionMsg[] = - " skipping: %-22s need %s compat. v%u.%u (can do v%u.%u)\n"; -static ZCONST char Far ComprMsgNum[] = - " skipping: %-22s unsupported compression method %u\n"; -#ifndef SFX - static ZCONST char Far ComprMsgName[] = - " skipping: %-22s `%s' method not supported\n"; - static ZCONST char Far CmprNone[] = "store"; - static ZCONST char Far CmprShrink[] = "shrink"; - static ZCONST char Far CmprReduce[] = "reduce"; - static ZCONST char Far CmprImplode[] = "implode"; - static ZCONST char Far CmprTokenize[] = "tokenize"; - static ZCONST char Far CmprDeflate[] = "deflate"; - static ZCONST char Far CmprDeflat64[] = "deflate64"; - static ZCONST char Far CmprDCLImplode[] = "DCL implode"; - static ZCONST char Far CmprBzip[] = "bzip2"; - static ZCONST char Far CmprLZMA[] = "LZMA"; - static ZCONST char Far CmprIBMTerse[] = "IBM/Terse"; - static ZCONST char Far CmprIBMLZ77[] = "IBM LZ77"; - static ZCONST char Far CmprWavPack[] = "WavPack"; - static ZCONST char Far CmprPPMd[] = "PPMd"; - static ZCONST char Far *ComprNames[NUM_METHODS] = { - CmprNone, CmprShrink, CmprReduce, CmprReduce, CmprReduce, CmprReduce, - CmprImplode, CmprTokenize, CmprDeflate, CmprDeflat64, CmprDCLImplode, - CmprBzip, CmprLZMA, CmprIBMTerse, CmprIBMLZ77, CmprWavPack, CmprPPMd - }; - static ZCONST unsigned ComprIDs[NUM_METHODS] = { - STORED, SHRUNK, REDUCED1, REDUCED2, REDUCED3, REDUCED4, - IMPLODED, TOKENIZED, DEFLATED, ENHDEFLATED, DCLIMPLODED, - BZIPPED, LZMAED, IBMTERSED, IBMLZ77ED, WAVPACKED, PPMDED - }; -#endif /* !SFX */ -static ZCONST char Far FilNamMsg[] = - "%s: bad filename length (%s)\n"; -#ifndef SFX - static ZCONST char Far WarnNoMemCFName[] = - "%s: warning, no memory for comparison with local header\n"; - static ZCONST char Far LvsCFNamMsg[] = - "%s: mismatching \"local\" filename (%s),\n\ - continuing with \"central\" filename version\n"; -#endif /* !SFX */ -#if (!defined(SFX) && defined(UNICODE_SUPPORT)) - static ZCONST char Far GP11FlagsDiffer[] = - "file #%lu (%s):\n\ - mismatch between local and central GPF bit 11 (\"UTF-8\"),\n\ - continuing with central flag (IsUTF8 = %d)\n"; -#endif /* !SFX && UNICODE_SUPPORT */ -static ZCONST char Far WrnStorUCSizCSizDiff[] = - "%s: ucsize %s <> csize %s for STORED entry\n\ - continuing with \"compressed\" size value\n"; -static ZCONST char Far ExtFieldMsg[] = - "%s: bad extra field length (%s)\n"; -static ZCONST char Far OffsetMsg[] = - "file #%lu: bad zipfile offset (%s): %ld\n"; -static ZCONST char Far ExtractMsg[] = - "%8sing: %-22s %s%s"; -#ifndef SFX - static ZCONST char Far LengthMsg[] = - "%s %s: %s bytes required to uncompress to %s bytes;\n %s\ - supposed to require %s bytes%s%s%s\n"; -#endif - -static ZCONST char Far BadFileCommLength[] = "%s: bad file comment length\n"; -static ZCONST char Far LocalHdrSig[] = "local header sig"; -static ZCONST char Far BadLocalHdr[] = "file #%lu: bad local header\n"; -static ZCONST char Far AttemptRecompensate[] = - " (attempting to re-compensate)\n"; -#ifndef SFX - static ZCONST char Far BackslashPathSep[] = - "warning: %s appears to use backslashes as path separators\n"; -#endif -static ZCONST char Far AbsolutePathWarning[] = - "warning: stripped absolute path spec from %s\n"; -static ZCONST char Far SkipVolumeLabel[] = - " skipping: %-22s %svolume label\n"; - -#ifdef SET_DIR_ATTRIB /* messages of code for setting directory attributes */ - static ZCONST char Far DirlistEntryNoMem[] = - "warning: cannot alloc memory for dir times/permissions/UID/GID\n"; - static ZCONST char Far DirlistSortNoMem[] = - "warning: cannot alloc memory to sort dir times/perms/etc.\n"; - static ZCONST char Far DirlistSetAttrFailed[] = - "warning: set times/attribs failed for %s\n"; - static ZCONST char Far DirlistFailAttrSum[] = - " failed setting times/attribs for %lu dir entries"; -#endif - -#ifdef SYMLINKS /* messages of the deferred symlinks handler */ - static ZCONST char Far SymLnkWarnNoMem[] = - "warning: deferred symlink (%s) failed:\n\ - out of memory\n"; - static ZCONST char Far SymLnkWarnInvalid[] = - "warning: deferred symlink (%s) failed:\n\ - invalid placeholder file\n"; - static ZCONST char Far SymLnkDeferred[] = - "finishing deferred symbolic links:\n"; - static ZCONST char Far SymLnkFinish[] = - " %-22s -> %s\n"; -#endif - -#ifndef WINDLL - static ZCONST char Far ReplaceQuery[] = -# ifdef VMS - "new version of %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: "; -# else - "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: "; -# endif - static ZCONST char Far AssumeNone[] = - " NULL\n(EOF or read error, treating as \"[N]one\" ...)\n"; - static ZCONST char Far NewNameQuery[] = "new name: "; - static ZCONST char Far InvalidResponse[] = - "error: invalid response [%s]\n"; -#endif /* !WINDLL */ - -static ZCONST char Far ErrorInArchive[] = - "At least one %serror was detected in %s.\n"; -static ZCONST char Far ZeroFilesTested[] = - "Caution: zero files tested in %s.\n"; - -#ifndef VMS - static ZCONST char Far VMSFormatQuery[] = - "\n%s: stored in VMS format. Extract anyway? (y/n) "; -#endif - -#if CRYPT - static ZCONST char Far SkipCannotGetPasswd[] = - " skipping: %-22s unable to get password\n"; - static ZCONST char Far SkipIncorrectPasswd[] = - " skipping: %-22s incorrect password\n"; - static ZCONST char Far FilesSkipBadPasswd[] = - "%lu file%s skipped because of incorrect password.\n"; - static ZCONST char Far MaybeBadPasswd[] = - " (may instead be incorrect password)\n"; -#else - static ZCONST char Far SkipEncrypted[] = - " skipping: %-22s encrypted (not supported)\n"; -#endif - -static ZCONST char Far NoErrInCompData[] = - "No errors detected in compressed data of %s.\n"; -static ZCONST char Far NoErrInTestedFiles[] = - "No errors detected in %s for the %lu file%s tested.\n"; -static ZCONST char Far FilesSkipped[] = - "%lu file%s skipped because of unsupported compression or encoding.\n"; - -static ZCONST char Far ErrUnzipFile[] = " error: %s%s %s\n"; -static ZCONST char Far ErrUnzipNoFile[] = "\n error: %s%s\n"; -static ZCONST char Far NotEnoughMem[] = "not enough memory to "; -static ZCONST char Far InvalidComprData[] = "invalid compressed data to "; -static ZCONST char Far Inflate[] = "inflate"; -#ifdef USE_BZIP2 - static ZCONST char Far BUnzip[] = "bunzip"; -#endif - -#ifndef SFX - static ZCONST char Far Explode[] = "explode"; -#ifndef LZW_CLEAN - static ZCONST char Far Unshrink[] = "unshrink"; -#endif -#endif - -#if (!defined(DELETE_IF_FULL) || !defined(HAVE_UNLINK)) - static ZCONST char Far FileTruncated[] = - "warning: %s is probably truncated\n"; -#endif - -static ZCONST char Far FileUnknownCompMethod[] = - "%s: unknown compression method\n"; -static ZCONST char Far BadCRC[] = " bad CRC %08lx (should be %08lx)\n"; - - /* TruncEAs[] also used in OS/2 mapname(), close_outfile() */ -char ZCONST Far TruncEAs[] = " compressed EA data missing (%d bytes)%s"; -char ZCONST Far TruncNTSD[] = - " compressed WinNT security data missing (%d bytes)%s"; - -#ifndef SFX - static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \ - EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n"; - static ZCONST char Far InvalidComprDataEAs[] = - " invalid compressed data for EAs\n"; -# if (defined(WIN32) && defined(NTSD_EAS)) - static ZCONST char Far InvalidSecurityEAs[] = - " EAs fail security check\n"; -# endif - static ZCONST char Far UnsuppNTSDVersEAs[] = - " unsupported NTSD EAs version %d\n"; - static ZCONST char Far BadCRC_EAs[] = " bad CRC for extended attributes\n"; - static ZCONST char Far UnknComprMethodEAs[] = - " unknown compression method for EAs (%u)\n"; - static ZCONST char Far NotEnoughMemEAs[] = - " out of memory while inflating EAs\n"; - static ZCONST char Far UnknErrorEAs[] = - " unknown error on extended attributes\n"; -#endif /* !SFX */ - -static ZCONST char Far UnsupportedExtraField[] = - "\nerror: unsupported extra-field compression type (%u)--skipping\n"; -static ZCONST char Far BadExtraFieldCRC[] = - "error [%s]: bad extra-field CRC %08lx (should be %08lx)\n"; - - - - - -/**************************************/ -/* Function extract_or_test_files() */ -/**************************************/ - -int extract_or_test_files(__G) /* return PK-type error code */ - __GDEF -{ - unsigned i, j; - zoff_t cd_bufstart; - uch *cd_inptr; - int cd_incnt; - ulg filnum=0L, blknum=0L; - int reached_end; -#ifndef SFX - int no_endsig_found; -#endif - int error, error_in_archive=PK_COOL; - int *fn_matched=NULL, *xn_matched=NULL; - zucn_t members_processed; - ulg num_skipped=0L, num_bad_pwd=0L; - zoff_t old_extra_bytes = 0L; -#ifdef SET_DIR_ATTRIB - unsigned num_dirs=0; - direntry *dirlist=(direntry *)NULL, **sorted_dirlist=(direntry **)NULL; -#endif - - /* - * First, two general initializations are applied. These have been moved - * here from process_zipfiles() because they are only needed for accessing - * and/or extracting the data content of the zip archive. - */ - - /* a) initialize the CRC table pointer (once) */ - if (CRC_32_TAB == NULL) { - if ((CRC_32_TAB = get_crc_table()) == NULL) { - return PK_MEM; - } - } - -#if (!defined(SFX) || defined(SFX_EXDIR)) - /* b) check out if specified extraction root directory exists */ - if (uO.exdir != (char *)NULL && G.extract_flag) { - G.create_dirs = !uO.fflag; - if ((error = checkdir(__G__ uO.exdir, ROOT)) > MPN_INF_SKIP) { - /* out of memory, or file in way */ - return (error == MPN_NOMEM ? PK_MEM : PK_ERR); - } - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - The basic idea of this function is as follows. Since the central di- - rectory lies at the end of the zipfile and the member files lie at the - beginning or middle or wherever, it is not very desirable to simply - read a central directory entry, jump to the member and extract it, and - then jump back to the central directory. In the case of a large zipfile - this would lead to a whole lot of disk-grinding, especially if each mem- - ber file is small. Instead, we read from the central directory the per- - tinent information for a block of files, then go extract/test the whole - block. Thus this routine contains two small(er) loops within a very - large outer loop: the first of the small ones reads a block of files - from the central directory; the second extracts or tests each file; and - the outer one loops over blocks. There's some file-pointer positioning - stuff in between, but that's about it. Btw, it's because of this jump- - ing around that we can afford to be lenient if an error occurs in one of - the member files: we should still be able to go find the other members, - since we know the offset of each from the beginning of the zipfile. - ---------------------------------------------------------------------------*/ - - G.pInfo = G.info; - -#if CRYPT - G.newzip = TRUE; -#endif -#ifndef SFX - G.reported_backslash = FALSE; -#endif - - /* malloc space for check on unmatched filespecs (OK if one or both NULL) */ - if (G.filespecs > 0 && - (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != (int *)NULL) - for (i = 0; i < G.filespecs; ++i) - fn_matched[i] = FALSE; - if (G.xfilespecs > 0 && - (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != (int *)NULL) - for (i = 0; i < G.xfilespecs; ++i) - xn_matched[i] = FALSE; - -/*--------------------------------------------------------------------------- - Begin main loop over blocks of member files. We know the entire central - directory is on this disk: we would not have any of this information un- - less the end-of-central-directory record was on this disk, and we would - not have gotten to this routine unless this is also the disk on which - the central directory starts. In practice, this had better be the ONLY - disk in the archive, but we'll add multi-disk support soon. - ---------------------------------------------------------------------------*/ - - members_processed = 0; -#ifndef SFX - no_endsig_found = FALSE; -#endif - reached_end = FALSE; - while (!reached_end) { - j = 0; -#ifdef AMIGA - memzero(G.filenotes, DIR_BLKSIZ * sizeof(char *)); -#endif - - /* - * Loop through files in central directory, storing offsets, file - * attributes, case-conversion and text-conversion flags until block - * size is reached. - */ - - while ((j < DIR_BLKSIZ)) { - G.pInfo = &G.info[j]; - - if (readbuf(__G__ G.sig, 4) == 0) { - error_in_archive = PK_EOF; - reached_end = TRUE; /* ...so no more left to do */ - break; - } - if (memcmp(G.sig, central_hdr_sig, 4)) { /* is it a new entry? */ - /* no new central directory entry - * -> is the number of processed entries compatible with the - * number of entries as stored in the end_central record? - */ - if ((members_processed - & (G.ecrec.have_ecr64 ? MASK_ZUCN64 : MASK_ZUCN16)) - == G.ecrec.total_entries_central_dir) { -#ifndef SFX - /* yes, so look if we ARE back at the end_central record - */ - no_endsig_found = - ( (memcmp(G.sig, - (G.ecrec.have_ecr64 ? - end_central64_sig : end_central_sig), - 4) != 0) - && (!G.ecrec.is_zip64_archive) - && (memcmp(G.sig, end_central_sig, 4) != 0) - ); -#endif /* !SFX */ - } else { - /* no; we have found an error in the central directory - * -> report it and stop searching for more Zip entries - */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; - } - reached_end = TRUE; /* ...so no more left to do */ - break; - } - /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag */ - if ((error = process_cdir_file_hdr(__G)) != PK_COOL) { - error_in_archive = error; /* only PK_EOF defined */ - reached_end = TRUE; /* ...so no more left to do */ - break; - } - if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal: no more left to do */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilNamMsg), - FnFilter1(G.filename), "central")); - reached_end = TRUE; - break; - } - } - if ((error = do_string(__G__ G.crec.extra_field_length, - EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtFieldMsg), - FnFilter1(G.filename), "central")); - reached_end = TRUE; - break; - } - } -#ifdef AMIGA - G.filenote_slot = j; - if ((error = do_string(__G__ G.crec.file_comment_length, - uO.N_flag ? FILENOTE : SKIP)) != PK_COOL) -#else - if ((error = do_string(__G__ G.crec.file_comment_length, SKIP)) - != PK_COOL) -#endif - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { /* fatal */ - Info(slide, 0x421, ((char *)slide, - LoadFarString(BadFileCommLength), - FnFilter1(G.filename))); - reached_end = TRUE; - break; - } - } - if (G.process_all_files) { - if (store_info(__G)) - ++j; /* file is OK; info[] stored; continue with next */ - else - ++num_skipped; - } else { - int do_this_file; - - if (G.filespecs == 0) - do_this_file = TRUE; - else { /* check if this entry matches an `include' argument */ - do_this_file = FALSE; - for (i = 0; i < G.filespecs; i++) - if (match(G.filename, G.pfnames[i], uO.C_flag WISEP)) { - do_this_file = TRUE; /* ^-- ignore case or not? */ - if (fn_matched) - fn_matched[i] = TRUE; - break; /* found match, so stop looping */ - } - } - if (do_this_file) { /* check if this is an excluded file */ - for (i = 0; i < G.xfilespecs; i++) - if (match(G.filename, G.pxnames[i], uO.C_flag WISEP)) { - do_this_file = FALSE; /* ^-- ignore case or not? */ - if (xn_matched) - xn_matched[i] = TRUE; - break; - } - } - if (do_this_file) { - if (store_info(__G)) - ++j; /* file is OK */ - else - ++num_skipped; /* unsupp. compression or encryption */ - } - } /* end if (process_all_files) */ - - members_processed++; - - } /* end while-loop (adding files to current block) */ - - /* save position in central directory so can come back later */ - cd_bufstart = G.cur_zipfile_bufstart; - cd_inptr = G.inptr; - cd_incnt = G.incnt; - - /*----------------------------------------------------------------------- - Second loop: process files in current block, extracting or testing - each one. - -----------------------------------------------------------------------*/ - - error = extract_or_test_entrylist(__G__ j, - &filnum, &num_bad_pwd, &old_extra_bytes, -#ifdef SET_DIR_ATTRIB - &num_dirs, &dirlist, -#endif - error_in_archive); - if (error != PK_COOL) { - if (error > error_in_archive) - error_in_archive = error; - /* ...and keep going (unless disk full or user break) */ - if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { - /* clear reached_end to signal premature stop ... */ - reached_end = FALSE; - /* ... and cancel scanning the central directory */ - break; - } - } - - - /* - * Jump back to where we were in the central directory, then go and do - * the next batch of files. - */ - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, cd_bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = - zlseek(G.zipfd, cd_bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - read(G.zipfd, (char *)G.inbuf, INBUFSIZ); /* been here before... */ - G.inptr = cd_inptr; - G.incnt = cd_incnt; - ++blknum; - -#ifdef TEST - printf("\ncd_bufstart = %ld (%.8lXh)\n", cd_bufstart, cd_bufstart); - printf("cur_zipfile_bufstart = %ld (%.8lXh)\n", cur_zipfile_bufstart, - cur_zipfile_bufstart); - printf("inptr-inbuf = %d\n", G.inptr-G.inbuf); - printf("incnt = %d\n\n", G.incnt); -#endif - - } /* end while-loop (blocks of files in central directory) */ - -/*--------------------------------------------------------------------------- - Process the list of deferred symlink extractions and finish up - the symbolic links. - ---------------------------------------------------------------------------*/ - -#ifdef SYMLINKS - if (G.slink_last != NULL) { - if (QCOND2) - Info(slide, 0, ((char *)slide, LoadFarString(SymLnkDeferred))); - while (G.slink_head != NULL) { - set_deferred_symlink(__G__ G.slink_head); - /* remove the processed entry from the chain and free its memory */ - G.slink_last = G.slink_head; - G.slink_head = G.slink_last->next; - free(G.slink_last); - } - G.slink_last = NULL; - } -#endif /* SYMLINKS */ - -/*--------------------------------------------------------------------------- - Go back through saved list of directories, sort and set times/perms/UIDs - and GIDs from the deepest level on up. - ---------------------------------------------------------------------------*/ - -#ifdef SET_DIR_ATTRIB - if (num_dirs > 0) { - sorted_dirlist = (direntry **)malloc(num_dirs*sizeof(direntry *)); - if (sorted_dirlist == (direntry **)NULL) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(DirlistSortNoMem))); - while (dirlist != (direntry *)NULL) { - direntry *d = dirlist; - - dirlist = dirlist->next; - free(d); - } - } else { - ulg ndirs_fail = 0; - - if (num_dirs == 1) - sorted_dirlist[0] = dirlist; - else { - for (i = 0; i < num_dirs; ++i) { - sorted_dirlist[i] = dirlist; - dirlist = dirlist->next; - } - qsort((char *)sorted_dirlist, num_dirs, sizeof(direntry *), - dircomp); - } - - Trace((stderr, "setting directory times/perms/attributes\n")); - for (i = 0; i < num_dirs; ++i) { - direntry *d = sorted_dirlist[i]; - - Trace((stderr, "dir = %s\n", d->fn)); - if ((error = set_direc_attribs(__G__ d)) != PK_OK) { - ndirs_fail++; - Info(slide, 0x201, ((char *)slide, - LoadFarString(DirlistSetAttrFailed), d->fn)); - if (!error_in_archive) - error_in_archive = error; - } - free(d); - } - free(sorted_dirlist); - if (!uO.tflag && QCOND2) { - if (ndirs_fail > 0) - Info(slide, 0, ((char *)slide, - LoadFarString(DirlistFailAttrSum), ndirs_fail)); - } - } - } -#endif /* SET_DIR_ATTRIB */ - -/*--------------------------------------------------------------------------- - Check for unmatched filespecs on command line and print warning if any - found. Free allocated memory. (But suppress check when central dir - scan was interrupted prematurely.) - ---------------------------------------------------------------------------*/ - - if (fn_matched) { - if (reached_end) for (i = 0; i < G.filespecs; ++i) - if (!fn_matched[i]) { -#ifdef DLL - if (!G.redirect_data && !G.redirect_text) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[i])); - else - setFileNotFound(__G); -#else - Info(slide, 1, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[i])); -#endif - if (error_in_archive <= PK_WARN) - error_in_archive = PK_FIND; /* some files not found */ - } - free((zvoid *)fn_matched); - } - if (xn_matched) { - if (reached_end) for (i = 0; i < G.xfilespecs; ++i) - if (!xn_matched[i]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExclFilenameNotMatched), G.pxnames[i])); - free((zvoid *)xn_matched); - } - -/*--------------------------------------------------------------------------- - Now, all locally allocated memory has been released. When the central - directory processing has been interrupted prematurely, it is safe to - return immediately. All completeness checks and summary messages are - skipped in this case. - ---------------------------------------------------------------------------*/ - if (!reached_end) - return error_in_archive; - -/*--------------------------------------------------------------------------- - Double-check that we're back at the end-of-central-directory record, and - print quick summary of results, if we were just testing the archive. We - send the summary to stdout so that people doing the testing in the back- - ground and redirecting to a file can just do a "tail" on the output file. - ---------------------------------------------------------------------------*/ - -#ifndef SFX - if (no_endsig_found) { /* just to make sure */ - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); - Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg))); - if (!error_in_archive) /* don't overwrite stronger error */ - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - if (uO.tflag) { - ulg num = filnum - num_bad_pwd; - - if (uO.qflag < 2) { /* GRR 930710: was (uO.qflag == 1) */ - if (error_in_archive) - Info(slide, 0, ((char *)slide, LoadFarString(ErrorInArchive), - (error_in_archive == PK_WARN)? "warning-" : "", G.zipfn)); - else if (num == 0L) - Info(slide, 0, ((char *)slide, LoadFarString(ZeroFilesTested), - G.zipfn)); - else if (G.process_all_files && (num_skipped+num_bad_pwd == 0L)) - Info(slide, 0, ((char *)slide, LoadFarString(NoErrInCompData), - G.zipfn)); - else - Info(slide, 0, ((char *)slide, LoadFarString(NoErrInTestedFiles) - , G.zipfn, num, (num==1L)? "":"s")); - if (num_skipped > 0L) - Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipped), - num_skipped, (num_skipped==1L)? "":"s")); -#if CRYPT - if (num_bad_pwd > 0L) - Info(slide, 0, ((char *)slide, LoadFarString(FilesSkipBadPasswd) - , num_bad_pwd, (num_bad_pwd==1L)? "":"s")); -#endif /* CRYPT */ - } - } - - /* give warning if files not tested or extracted (first condition can still - * happen if zipfile is empty and no files specified on command line) */ - - if ((filnum == 0) && error_in_archive <= PK_WARN) { - if (num_skipped > 0L) - error_in_archive = IZ_UNSUP; /* unsupport. compression/encryption */ - else - error_in_archive = PK_FIND; /* no files found at all */ - } -#if CRYPT - else if ((filnum == num_bad_pwd) && error_in_archive <= PK_WARN) - error_in_archive = IZ_BADPWD; /* bad passwd => all files skipped */ -#endif - else if ((num_skipped > 0L) && error_in_archive <= PK_WARN) - error_in_archive = IZ_UNSUP; /* was PK_WARN; Jean-loup complained */ -#if CRYPT - else if ((num_bad_pwd > 0L) && !error_in_archive) - error_in_archive = PK_WARN; -#endif - - return error_in_archive; - -} /* end function extract_or_test_files() */ - - - - - -/***************************/ -/* Function store_info() */ -/***************************/ - -static int store_info(__G) /* return 0 if skipping, 1 if OK */ - __GDEF -{ -#ifdef USE_BZIP2 -# define UNKN_BZ2 (G.crec.compression_method!=BZIPPED) -#else -# define UNKN_BZ2 TRUE /* bzip2 unknown */ -#endif - -#ifdef USE_LZMA -# define UNKN_LZMA (G.crec.compression_method!=LZMAED) -#else -# define UNKN_LZMA TRUE /* LZMA unknown */ -#endif - -#ifdef USE_WAVP -# define UNKN_WAVP (G.crec.compression_method!=WAVPACKED) -#else -# define UNKN_WAVP TRUE /* WavPack unknown */ -#endif - -#ifdef USE_PPMD -# define UNKN_PPMD (G.crec.compression_method!=PPMDED) -#else -# define UNKN_PPMD TRUE /* PPMd unknown */ -#endif - -#ifdef SFX -# ifdef USE_DEFLATE64 -# define UNKN_COMPR \ - (G.crec.compression_method!=STORED && G.crec.compression_methodENHDEFLATED \ - && UNKN_BZ2 && UNKN_LZMA && UNKN_WAVP && UNKN_PPMD) -# else -# define UNKN_COMPR \ - (G.crec.compression_method!=STORED && G.crec.compression_method!=DEFLATED\ - && UNKN_BZ2 && UNKN_LZMA && UNKN_WAVP && UNKN_PPMD) -# endif -#else -# ifdef COPYRIGHT_CLEAN /* no reduced files */ -# define UNKN_RED (G.crec.compression_method >= REDUCED1 && \ - G.crec.compression_method <= REDUCED4) -# else -# define UNKN_RED FALSE /* reducing not unknown */ -# endif -# ifdef LZW_CLEAN /* no shrunk files */ -# define UNKN_SHR (G.crec.compression_method == SHRUNK) -# else -# define UNKN_SHR FALSE /* unshrinking not unknown */ -# endif -# ifdef USE_DEFLATE64 -# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ - G.crec.compression_method==TOKENIZED || \ - (G.crec.compression_method>ENHDEFLATED && UNKN_BZ2 && UNKN_LZMA \ - && UNKN_WAVP && UNKN_PPMD)) -# else -# define UNKN_COMPR (UNKN_RED || UNKN_SHR || \ - G.crec.compression_method==TOKENIZED || \ - (G.crec.compression_method>DEFLATED && UNKN_BZ2 && UNKN_LZMA \ - && UNKN_WAVP && UNKN_PPMD)) -# endif -#endif - -#if (defined(USE_BZIP2) && (UNZIP_VERSION < UNZIP_BZ2VERS)) - int unzvers_support = (UNKN_BZ2 ? UNZIP_VERSION : UNZIP_BZ2VERS); -# define UNZVERS_SUPPORT unzvers_support -#else -# define UNZVERS_SUPPORT UNZIP_VERSION -#endif - -/*--------------------------------------------------------------------------- - Check central directory info for version/compatibility requirements. - ---------------------------------------------------------------------------*/ - - G.pInfo->encrypted = G.crec.general_purpose_bit_flag & 1; /* bit field */ - G.pInfo->ExtLocHdr = (G.crec.general_purpose_bit_flag & 8) == 8; /* bit */ - G.pInfo->textfile = G.crec.internal_file_attributes & 1; /* bit field */ - G.pInfo->crc = G.crec.crc32; - G.pInfo->compr_size = G.crec.csize; - G.pInfo->uncompr_size = G.crec.ucsize; - - switch (uO.aflag) { - case 0: - G.pInfo->textmode = FALSE; /* bit field */ - break; - case 1: - G.pInfo->textmode = G.pInfo->textfile; /* auto-convert mode */ - break; - default: /* case 2: */ - G.pInfo->textmode = TRUE; - break; - } - - if (G.crec.version_needed_to_extract[1] == VMS_) { - if (G.crec.version_needed_to_extract[0] > VMS_UNZIP_VERSION) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), - FnFilter1(G.filename), "VMS", - G.crec.version_needed_to_extract[0] / 10, - G.crec.version_needed_to_extract[0] % 10, - VMS_UNZIP_VERSION / 10, VMS_UNZIP_VERSION % 10)); - return 0; - } -#ifndef VMS /* won't be able to use extra field, but still have data */ - else if (!uO.tflag && !IS_OVERWRT_ALL) { /* if -o, extract anyway */ - Info(slide, 0x481, ((char *)slide, LoadFarString(VMSFormatQuery), - FnFilter1(G.filename))); - fgets(G.answerbuf, sizeof(G.answerbuf), stdin); - if ((*G.answerbuf != 'y') && (*G.answerbuf != 'Y')) - return 0; - } -#endif /* !VMS */ - /* usual file type: don't need VMS to extract */ - } else if (G.crec.version_needed_to_extract[0] > UNZVERS_SUPPORT) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(VersionMsg), - FnFilter1(G.filename), "PK", - G.crec.version_needed_to_extract[0] / 10, - G.crec.version_needed_to_extract[0] % 10, - UNZVERS_SUPPORT / 10, UNZVERS_SUPPORT % 10)); - return 0; - } - - if (UNKN_COMPR) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) { -#ifndef SFX - unsigned cmpridx; - - if ((cmpridx = find_compr_idx(G.crec.compression_method)) - < NUM_METHODS) - Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgName), - FnFilter1(G.filename), - LoadFarStringSmall(ComprNames[cmpridx]))); - else -#endif - Info(slide, 0x401, ((char *)slide, LoadFarString(ComprMsgNum), - FnFilter1(G.filename), - G.crec.compression_method)); - } - return 0; - } -#if (!CRYPT) - if (G.pInfo->encrypted) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, LoadFarString(SkipEncrypted), - FnFilter1(G.filename))); - return 0; - } -#endif /* !CRYPT */ - -#ifndef SFX - /* store a copy of the central header filename for later comparison */ - if ((G.pInfo->cfilname = zfmalloc(strlen(G.filename) + 1)) == NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(WarnNoMemCFName), - FnFilter1(G.filename))); - } else - zfstrcpy(G.pInfo->cfilname, G.filename); -#endif /* !SFX */ - - /* map whatever file attributes we have into the local format */ - mapattr(__G); /* GRR: worry about return value later */ - - G.pInfo->diskstart = G.crec.disk_number_start; - G.pInfo->offset = (zoff_t)G.crec.relative_offset_local_header; - return 1; - -} /* end function store_info() */ - - - - - -#ifndef SFX -/*******************************/ -/* Function find_compr_idx() */ -/*******************************/ - -unsigned find_compr_idx(compr_methodnum) - unsigned compr_methodnum; -{ - unsigned i; - - for (i = 0; i < NUM_METHODS; i++) { - if (ComprIDs[i] == compr_methodnum) break; - } - return i; -} -#endif /* !SFX */ - - - - - -/******************************************/ -/* Function extract_or_test_entrylist() */ -/******************************************/ - -static int extract_or_test_entrylist(__G__ numchunk, - pfilnum, pnum_bad_pwd, pold_extra_bytes, -#ifdef SET_DIR_ATTRIB - pnum_dirs, pdirlist, -#endif - error_in_archive) /* return PK-type error code */ - __GDEF - unsigned numchunk; - ulg *pfilnum; - ulg *pnum_bad_pwd; - zoff_t *pold_extra_bytes; -#ifdef SET_DIR_ATTRIB - unsigned *pnum_dirs; - direntry **pdirlist; -#endif - int error_in_archive; -{ - unsigned i; - int renamed, query; - int skip_entry; - zoff_t bufstart, inbuf_offset, request; - int error, errcode; - -/* possible values for local skip_entry flag: */ -#define SKIP_NO 0 /* do not skip this entry */ -#define SKIP_Y_EXISTING 1 /* skip this entry, do not overwrite file */ -#define SKIP_Y_NONEXIST 2 /* skip this entry, do not create new file */ - - /*----------------------------------------------------------------------- - Second loop: process files in current block, extracting or testing - each one. - -----------------------------------------------------------------------*/ - - for (i = 0; i < numchunk; ++i) { - (*pfilnum)++; /* *pfilnum = i + blknum*DIR_BLKSIZ + 1; */ - G.pInfo = &G.info[i]; -#ifdef NOVELL_BUG_FAILSAFE - G.dne = FALSE; /* assume file exists until stat() says otherwise */ -#endif - - /* if the target position is not within the current input buffer - * (either haven't yet read far enough, or (maybe) skipping back- - * ward), skip to the target position and reset readbuf(). */ - - /* seek_zipf(__G__ pInfo->offset); */ - request = G.pInfo->offset + G.extra_bytes; - inbuf_offset = request % INBUFSIZ; - bufstart = request - inbuf_offset; - - Trace((stderr, "\ndebug: request = %ld, inbuf_offset = %ld\n", - (long)request, (long)inbuf_offset)); - Trace((stderr, - "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", - (long)bufstart, (long)G.cur_zipfile_bufstart)); - if (request < 0) { - Info(slide, 0x401, ((char *)slide, LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - error_in_archive = PK_ERR; - if (*pfilnum == 1 && G.extra_bytes != 0L) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AttemptRecompensate))); - *pold_extra_bytes = G.extra_bytes; - G.extra_bytes = 0L; - request = G.pInfo->offset; /* could also check if != 0 */ - inbuf_offset = request % INBUFSIZ; - bufstart = request - inbuf_offset; - Trace((stderr, "debug: request = %ld, inbuf_offset = %ld\n", - (long)request, (long)inbuf_offset)); - Trace((stderr, - "debug: bufstart = %ld, cur_zipfile_bufstart = %ld\n", - (long)bufstart, (long)G.cur_zipfile_bufstart)); - /* try again */ - if (request < 0) { - Trace((stderr, - "debug: recompensated request still < 0\n")); - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; - continue; - } - } else { - error_in_archive = PK_BADERR; - continue; /* this one hosed; try next */ - } - } - - if (bufstart != G.cur_zipfile_bufstart) { - Trace((stderr, "debug: bufstart != cur_zipfile_bufstart\n")); -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = - zlseek(G.zipfd, bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, "lseek", (long)bufstart)); - error_in_archive = PK_BADERR; - continue; /* can still do next file */ - } - G.inptr = G.inbuf + (int)inbuf_offset; - G.incnt -= (int)inbuf_offset; - } else { - G.incnt += (int)(G.inptr-G.inbuf) - (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } - - /* should be in proper position now, so check for sig */ - if (readbuf(__G__ G.sig, 4) == 0) { /* bad offset */ - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, "EOF", (long)request)); - error_in_archive = PK_BADERR; - continue; /* but can still try next one */ - } - if (memcmp(G.sig, local_hdr_sig, 4)) { - Info(slide, 0x401, ((char *)slide, LoadFarString(OffsetMsg), - *pfilnum, LoadFarStringSmall(LocalHdrSig), (long)request)); - /* - GRRDUMP(G.sig, 4) - GRRDUMP(local_hdr_sig, 4) - */ - error_in_archive = PK_ERR; - if ((*pfilnum == 1 && G.extra_bytes != 0L) || - (G.extra_bytes == 0L && *pold_extra_bytes != 0L)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AttemptRecompensate))); - if (G.extra_bytes) { - *pold_extra_bytes = G.extra_bytes; - G.extra_bytes = 0L; - } else - G.extra_bytes = *pold_extra_bytes; /* third attempt */ - if (((error = seek_zipf(__G__ G.pInfo->offset)) != PK_OK) || - (readbuf(__G__ G.sig, 4) == 0)) { /* bad offset */ - if (error != PK_BADERR) - Info(slide, 0x401, ((char *)slide, - LoadFarString(OffsetMsg), *pfilnum, "EOF", - (long)request)); - error_in_archive = PK_BADERR; - continue; /* but can still try next one */ - } - if (memcmp(G.sig, local_hdr_sig, 4)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(OffsetMsg), *pfilnum, - LoadFarStringSmall(LocalHdrSig), (long)request)); - error_in_archive = PK_BADERR; - continue; - } - } else - continue; /* this one hosed; try next */ - } - if ((error = process_local_file_hdr(__G)) != PK_COOL) { - Info(slide, 0x421, ((char *)slide, LoadFarString(BadLocalHdr), - *pfilnum)); - error_in_archive = error; /* only PK_EOF defined */ - continue; /* can still try next one */ - } -#if (!defined(SFX) && defined(UNICODE_SUPPORT)) - if (((G.lrec.general_purpose_bit_flag & (1 << 11)) == (1 << 11)) - != (G.pInfo->GPFIsUTF8 != 0)) { - if (QCOND2) { -# ifdef SMALL_MEM - char *temp_cfilnam = slide + (7 * (WSIZE>>3)); - - zfstrcpy((char Far *)temp_cfilnam, G.pInfo->cfilname); -# define cFile_PrintBuf temp_cfilnam -# else -# define cFile_PrintBuf G.pInfo->cfilname -# endif - Info(slide, 0x421, ((char *)slide, - LoadFarStringSmall2(GP11FlagsDiffer), - *pfilnum, FnFilter1(cFile_PrintBuf), G.pInfo->GPFIsUTF8)); -# undef cFile_PrintBuf - } - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } -#endif /* !SFX && UNICODE_SUPPORT */ - if ((error = do_string(__G__ G.lrec.filename_length, DS_FN_L)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { - Info(slide, 0x401, ((char *)slide, LoadFarString(FilNamMsg), - FnFilter1(G.filename), "local")); - continue; /* go on to next one */ - } - } - if (G.extra_field != (uch *)NULL) { - free(G.extra_field); - G.extra_field = (uch *)NULL; - } - if ((error = - do_string(__G__ G.lrec.extra_field_length, EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtFieldMsg), - FnFilter1(G.filename), "local")); - continue; /* go on */ - } - } -#ifndef SFX - /* Filename consistency checks must come after reading in the local - * extra field, so that a UTF-8 entry name e.f. block has already - * been processed. - */ - if (G.pInfo->cfilname != (char Far *)NULL) { - if (zfstrcmp(G.pInfo->cfilname, G.filename) != 0) { -# ifdef SMALL_MEM - char *temp_cfilnam = slide + (7 * (WSIZE>>3)); - - zfstrcpy((char Far *)temp_cfilnam, G.pInfo->cfilname); -# define cFile_PrintBuf temp_cfilnam -# else -# define cFile_PrintBuf G.pInfo->cfilname -# endif - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall2(LvsCFNamMsg), - FnFilter2(cFile_PrintBuf), FnFilter1(G.filename))); -# undef cFile_PrintBuf - zfstrcpy(G.filename, G.pInfo->cfilname); - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } - zffree(G.pInfo->cfilname); - G.pInfo->cfilname = (char Far *)NULL; - } -#endif /* !SFX */ - /* Size consistency checks must come after reading in the local extra - * field, so that any Zip64 extension local e.f. block has already - * been processed. - */ - if (G.lrec.compression_method == STORED) { - zusz_t csiz_decrypted = G.lrec.csize; - - if (G.pInfo->encrypted) - csiz_decrypted -= 12; - if (G.lrec.ucsize != csiz_decrypted) { - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall2(WrnStorUCSizCSizDiff), - FnFilter1(G.filename), - FmZofft(G.lrec.ucsize, NULL, "u"), - FmZofft(csiz_decrypted, NULL, "u"))); - G.lrec.ucsize = csiz_decrypted; - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } - } - -#if CRYPT - if (G.pInfo->encrypted && - (error = decrypt(__G__ uO.pwdarg)) != PK_COOL) { - if (error == PK_WARN) { - if (!((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2))) - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipIncorrectPasswd), - FnFilter1(G.filename))); - ++(*pnum_bad_pwd); - } else { /* (error > PK_WARN) */ - if (error > error_in_archive) - error_in_archive = error; - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipCannotGetPasswd), - FnFilter1(G.filename))); - } - continue; /* go on to next file */ - } -#endif /* CRYPT */ - - /* - * just about to extract file: if extracting to disk, check if - * already exists, and if so, take appropriate action according to - * fflag/uflag/overwrite_all/etc. (we couldn't do this in upper - * loop because we don't store the possibly renamed filename[] in - * info[]) - */ -#ifdef DLL - if (!uO.tflag && !uO.cflag && !G.redirect_data) -#else - if (!uO.tflag && !uO.cflag) -#endif - { - renamed = FALSE; /* user hasn't renamed output file yet */ - -startover: - query = FALSE; - skip_entry = SKIP_NO; - /* for files from DOS FAT, check for use of backslash instead - * of slash as directory separator (bug in some zipper(s); so - * far, not a problem in HPFS, NTFS or VFAT systems) - */ -#ifndef SFX - if (G.pInfo->hostnum == FS_FAT_ && !MBSCHR(G.filename, '/')) { - char *p=G.filename; - - if (*p) do { - if (*p == '\\') { - if (!G.reported_backslash) { - Info(slide, 0x21, ((char *)slide, - LoadFarString(BackslashPathSep), G.zipfn)); - G.reported_backslash = TRUE; - if (!error_in_archive) - error_in_archive = PK_WARN; - } - *p = '/'; - } - } while (*PREINCSTR(p)); - } -#endif /* !SFX */ - - if (!renamed) { - /* remove absolute path specs */ - if (G.filename[0] == '/') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(AbsolutePathWarning), - FnFilter1(G.filename))); - if (!error_in_archive) - error_in_archive = PK_WARN; - do { - char *p = G.filename + 1; - do { - *(p-1) = *p; - } while (*p++ != '\0'); - } while (G.filename[0] == '/'); - } - } - - /* mapname can create dirs if not freshening or if renamed */ - error = mapname(__G__ renamed); - if ((errcode = error & ~MPN_MASK) != PK_OK && - error_in_archive < errcode) - error_in_archive = errcode; - if ((errcode = error & MPN_MASK) > MPN_INF_TRUNC) { - if (errcode == MPN_CREATED_DIR) { -#ifdef SET_DIR_ATTRIB - direntry *d_entry; - - error = defer_dir_attribs(__G__ &d_entry); - if (d_entry == (direntry *)NULL) { - /* There may be no dir_attribs info available, or - * we have encountered a mem allocation error. - * In case of an error, report it and set program - * error state to warning level. - */ - if (error) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(DirlistEntryNoMem))); - if (!error_in_archive) - error_in_archive = PK_WARN; - } - } else { - d_entry->next = (*pdirlist); - (*pdirlist) = d_entry; - ++(*pnum_dirs); - } -#endif /* SET_DIR_ATTRIB */ - } else if (errcode == MPN_VOL_LABEL) { -#ifdef DOS_OS2_W32 - Info(slide, 0x401, ((char *)slide, - LoadFarString(SkipVolumeLabel), - FnFilter1(G.filename), - uO.volflag? "hard disk " : "")); -#else - Info(slide, 1, ((char *)slide, - LoadFarString(SkipVolumeLabel), - FnFilter1(G.filename), "")); -#endif - } else if (errcode > MPN_INF_SKIP && - error_in_archive < PK_ERR) - error_in_archive = PK_ERR; - Trace((stderr, "mapname(%s) returns error code = %d\n", - FnFilter1(G.filename), error)); - continue; /* go on to next file */ - } - -#ifdef QDOS - QFilename(__G__ G.filename); -#endif - switch (check_for_newer(__G__ G.filename)) { - case DOES_NOT_EXIST: -#ifdef NOVELL_BUG_FAILSAFE - G.dne = TRUE; /* stat() says file DOES NOT EXIST */ -#endif - /* freshen (no new files): skip unless just renamed */ - if (uO.fflag && !renamed) - skip_entry = SKIP_Y_NONEXIST; - break; - case EXISTS_AND_OLDER: -#ifdef UNIXBACKUP - if (!uO.B_flag) -#endif - { - if (IS_OVERWRT_NONE) - /* never overwrite: skip file */ - skip_entry = SKIP_Y_EXISTING; - else if (!IS_OVERWRT_ALL) - query = TRUE; - } - break; - case EXISTS_AND_NEWER: /* (or equal) */ -#ifdef UNIXBACKUP - if ((!uO.B_flag && IS_OVERWRT_NONE) || -#else - if (IS_OVERWRT_NONE || -#endif - (uO.uflag && !renamed)) { - /* skip if update/freshen & orig name */ - skip_entry = SKIP_Y_EXISTING; - } else { -#ifdef UNIXBACKUP - if (!IS_OVERWRT_ALL && !uO.B_flag) -#else - if (!IS_OVERWRT_ALL) -#endif - query = TRUE; - } - break; - } -#ifdef VMS - /* 2008-07-24 SMS. - * On VMS, if the file name includes a version number, - * and "-V" ("retain VMS version numbers", V_flag) is in - * effect, then the VMS-specific code will handle any - * conflicts with an existing file, making this query - * redundant. (Implicit "y" response here.) - */ - if (query && uO.V_flag) { - /* Not discarding file versions. Look for one. */ - int cndx = strlen(G.filename) - 1; - - while ((cndx > 0) && (isdigit(G.filename[cndx]))) - cndx--; - if (G.filename[cndx] == ';') - /* File version found; skip the generic query, - * proceeding with its default response "y". - */ - query = FALSE; - } -#endif /* VMS */ - if (query) { -#ifdef WINDLL - switch (G.lpUserFunctions->replace != NULL ? - (*G.lpUserFunctions->replace)(G.filename, FILNAMSIZ) : - IDM_REPLACE_NONE) { - case IDM_REPLACE_RENAME: - _ISO_INTERN(G.filename); - renamed = TRUE; - goto startover; - case IDM_REPLACE_ALL: - G.overwrite_mode = OVERWRT_ALWAYS; - /* FALL THROUGH, extract */ - case IDM_REPLACE_YES: - break; - case IDM_REPLACE_NONE: - G.overwrite_mode = OVERWRT_NEVER; - /* FALL THROUGH, skip */ - case IDM_REPLACE_NO: - skip_entry = SKIP_Y_EXISTING; - break; - } -#else /* !WINDLL */ - extent fnlen; -reprompt: - Info(slide, 0x81, ((char *)slide, - LoadFarString(ReplaceQuery), - FnFilter1(G.filename))); - if (fgets(G.answerbuf, sizeof(G.answerbuf), stdin) - == (char *)NULL) { - Info(slide, 1, ((char *)slide, - LoadFarString(AssumeNone))); - *G.answerbuf = 'N'; - if (!error_in_archive) - error_in_archive = 1; /* not extracted: warning */ - } - switch (*G.answerbuf) { - case 'r': - case 'R': - do { - Info(slide, 0x81, ((char *)slide, - LoadFarString(NewNameQuery))); - fgets(G.filename, FILNAMSIZ, stdin); - /* usually get \n here: better check for it */ - fnlen = strlen(G.filename); - if (lastchar(G.filename, fnlen) == '\n') - G.filename[--fnlen] = '\0'; - } while (fnlen == 0); -#ifdef WIN32 /* WIN32 fgets( ... , stdin) returns OEM coded strings */ - _OEM_INTERN(G.filename); -#endif - renamed = TRUE; - goto startover; /* sorry for a goto */ - case 'A': /* dangerous option: force caps */ - G.overwrite_mode = OVERWRT_ALWAYS; - /* FALL THROUGH, extract */ - case 'y': - case 'Y': - break; - case 'N': - G.overwrite_mode = OVERWRT_NEVER; - /* FALL THROUGH, skip */ - case 'n': - /* skip file */ - skip_entry = SKIP_Y_EXISTING; - break; - case '\n': - case '\r': - /* Improve echo of '\n' and/or '\r' - (sizeof(G.answerbuf) == 10 (see globals.h), so - there is enough space for the provided text...) */ - strcpy(G.answerbuf, "{ENTER}"); - /* fall through ... */ - default: - /* usually get \n here: remove it for nice display - (fnlen can be re-used here, we are outside the - "enter new filename" loop) */ - fnlen = strlen(G.answerbuf); - if (lastchar(G.answerbuf, fnlen) == '\n') - G.answerbuf[--fnlen] = '\0'; - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidResponse), G.answerbuf)); - goto reprompt; /* yet another goto? */ - } /* end switch (*answerbuf) */ -#endif /* ?WINDLL */ - } /* end if (query) */ - if (skip_entry != SKIP_NO) { -#ifdef WINDLL - if (skip_entry == SKIP_Y_EXISTING) { - /* report skipping of an existing entry */ - Info(slide, 0, ((char *)slide, - ((IS_OVERWRT_NONE || !uO.uflag || renamed) ? - "Target file exists. Skipping %s\n" : - "Target file newer. Skipping %s\n"), - FnFilter1(G.filename))); - } -#endif /* WINDLL */ - continue; - } - } /* end if (extracting to disk) */ - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_START_EXTRACT, G.zipfn, - G.filename, NULL)) { - return IZ_CTRLC; /* cancel operation by user request */ - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif -#ifdef AMIGA - G.filenote_slot = i; -#endif - G.disk_full = 0; - if ((error = extract_or_test_member(__G)) != PK_COOL) { - if (error > error_in_archive) - error_in_archive = error; /* ...and keep going */ -#ifdef DLL - if (G.disk_full > 1 || error_in_archive == IZ_CTRLC) { -#else - if (G.disk_full > 1) { -#endif - return error_in_archive; /* (unless disk full) */ - } - } -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, - G.filename, (zvoid *)&G.lrec.ucsize)) { - return IZ_CTRLC; /* cancel operation by user request */ - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif - } /* end for-loop (i: files in current block) */ - - return error_in_archive; - -} /* end function extract_or_test_entrylist() */ - - - - - -/* wsize is used in extract_or_test_member() and UZbunzip2() */ -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define wsize G._wsize /* wsize is a variable */ -#else -# define wsize WSIZE /* wsize is a constant */ -#endif - -/***************************************/ -/* Function extract_or_test_member() */ -/***************************************/ - -static int extract_or_test_member(__G) /* return PK-type error code */ - __GDEF -{ - char *nul="[empty] ", *txt="[text] ", *bin="[binary]"; -#ifdef CMS_MVS - char *ebc="[ebcdic]"; -#endif - register int b; - int r, error=PK_COOL; - - -/*--------------------------------------------------------------------------- - Initialize variables, buffers, etc. - ---------------------------------------------------------------------------*/ - - G.bits_left = 0; - G.bitbuf = 0L; /* unreduce and unshrink only */ - G.zipeof = 0; - G.newfile = TRUE; - G.crc32val = CRCVAL_INITIAL; - -#ifdef SYMLINKS - /* If file is a (POSIX-compatible) symbolic link and we are extracting - * to disk, prepare to restore the link. */ - G.symlnk = (G.pInfo->symlink && - !uO.tflag && !uO.cflag && (G.lrec.ucsize > 0)); -#endif /* SYMLINKS */ - - if (uO.tflag) { - if (!uO.qflag) - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), "test", - FnFilter1(G.filename), "", "")); - } else { -#ifdef DLL - if (uO.cflag && !G.redirect_data) -#else - if (uO.cflag) -#endif - { -#if (defined(OS2) && defined(__IBMC__) && (__IBMC__ >= 200)) - G.outfile = freopen("", "wb", stdout); /* VAC++ ignores setmode */ -#else - G.outfile = stdout; -#endif -#ifdef DOS_FLX_NLM_OS2_W32 -#if (defined(__HIGHC__) && !defined(FLEXOS)) - setmode(G.outfile, _BINARY); -#else /* !(defined(__HIGHC__) && !defined(FLEXOS)) */ - setmode(fileno(G.outfile), O_BINARY); -#endif /* ?(defined(__HIGHC__) && !defined(FLEXOS)) */ -# define NEWLINE "\r\n" -#else /* !DOS_FLX_NLM_OS2_W32 */ -# define NEWLINE "\n" -#endif /* ?DOS_FLX_NLM_OS2_W32 */ -#ifdef VMS - /* VMS: required even for stdout! */ - if ((r = open_outfile(__G)) != 0) - switch (r) { - case OPENOUT_SKIPOK: - return PK_OK; - case OPENOUT_SKIPWARN: - return PK_WARN; - default: - return PK_DISK; - } - } else if ((r = open_outfile(__G)) != 0) - switch (r) { - case OPENOUT_SKIPOK: - return PK_OK; - case OPENOUT_SKIPWARN: - return PK_WARN; - default: - return PK_DISK; - } -#else /* !VMS */ - } else if (open_outfile(__G)) - return PK_DISK; -#endif /* ?VMS */ - } - -/*--------------------------------------------------------------------------- - Unpack the file. - ---------------------------------------------------------------------------*/ - - defer_leftover_input(__G); /* so NEXTBYTE bounds check will work */ - switch (G.lrec.compression_method) { - case STORED: - if (!uO.tflag && QCOND2) { -#ifdef SYMLINKS - if (G.symlnk) /* can also be deflated, but rarer... */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "link", FnFilter1(G.filename), "", "")); - else -#endif /* SYMLINKS */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "extract", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.lrec.ucsize == 0L? nul : (G.pInfo->textfile? txt : - bin)), uO.cflag? NEWLINE : "")); - } -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) { - wsize = G.redirect_size; redirSlide = G.redirect_buffer; - } else { - wsize = WSIZE; redirSlide = slide; - } -#endif - G.outptr = redirSlide; - G.outcnt = 0L; - while ((b = NEXTBYTE) != EOF) { - *G.outptr++ = (uch)b; - if (++G.outcnt == wsize) { - error = flush(__G__ redirSlide, G.outcnt, 0); - G.outptr = redirSlide; - G.outcnt = 0L; - if (error != PK_COOL || G.disk_full) break; - } - } - if (G.outcnt) { /* flush final (partial) buffer */ - r = flush(__G__ redirSlide, G.outcnt, 0); - if (error < r) error = r; - } - break; - -#ifndef SFX -#ifndef LZW_CLEAN - case SHRUNK: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - LoadFarStringSmall(Unshrink), FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = unshrink(__G)) != PK_COOL) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == PK_MEM3 ? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Unshrink), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == PK_MEM3 ? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Unshrink))); - } - error = r; - } - break; -#endif /* !LZW_CLEAN */ - -#ifndef COPYRIGHT_CLEAN - case REDUCED1: - case REDUCED2: - case REDUCED3: - case REDUCED4: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "unreduc", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = unreduce(__G)) != PK_COOL) { - /* unreduce() returns only PK_COOL, PK_DISK, or IZ_CTRLC */ - error = r; - } - break; -#endif /* !COPYRIGHT_CLEAN */ - - case IMPLODED: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "explod", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = explode(__G)) != 0) { - if (r == 5) { /* treat 5 specially */ - int warning = ((zusz_t)G.used_csize <= G.lrec.csize); - - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarString(LengthMsg), - "", warning ? "warning" : "error", - FmZofft(G.used_csize, NULL, NULL), - FmZofft(G.lrec.ucsize, NULL, "u"), - warning ? " " : "", - FmZofft(G.lrec.csize, NULL, "u"), - " [", FnFilter1(G.filename), "]")); - else - Info(slide, 0x401, ((char *)slide, - LoadFarString(LengthMsg), - "\n", warning ? "warning" : "error", - FmZofft(G.used_csize, NULL, NULL), - FmZofft(G.lrec.ucsize, NULL, "u"), - warning ? " " : "", - FmZofft(G.lrec.csize, NULL, "u"), - "", "", ".")); - error = warning ? PK_WARN : PK_ERR; - } else if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Explode), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Explode))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; -#endif /* !SFX */ - - case DEFLATED: -#ifdef USE_DEFLATE64 - case ENHDEFLATED: -#endif - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "inflat", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } -#ifndef USE_ZLIB /* zlib's function is called inflate(), too */ -# define UZinflate inflate -#endif - if ((r = UZinflate(__G__ - (G.lrec.compression_method == ENHDEFLATED))) - != 0) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; - -#ifdef USE_BZIP2 - case BZIPPED: - if (!uO.tflag && QCOND2) { - Info(slide, 0, ((char *)slide, LoadFarString(ExtractMsg), - "bunzipp", FnFilter1(G.filename), - (uO.aflag != 1 /* && G.pInfo->textfile==G.pInfo->textmode */)? - "" : (G.pInfo->textfile? txt : bin), uO.cflag? NEWLINE : "")); - } - if ((r = UZbunzip2(__G)) != 0) { - if (r < PK_DISK) { - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(BUnzip), - FnFilter1(G.filename))); - else - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(BUnzip))); - error = ((r == 3) ? PK_MEM3 : PK_ERR); - } else { - error = r; - } - } - break; -#endif /* USE_BZIP2 */ - - default: /* should never get to this point */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(FileUnknownCompMethod), FnFilter1(G.filename))); - /* close and delete file before return? */ - undefer_input(__G); - return PK_WARN; - - } /* end switch (compression method) */ - -/*--------------------------------------------------------------------------- - Close the file and set its date and time (not necessarily in that order), - and make sure the CRC checked out OK. Logical-AND the CRC for 64-bit - machines (redundant on 32-bit machines). - ---------------------------------------------------------------------------*/ - -#ifdef VMS /* VMS: required even for stdout! (final flush) */ - if (!uO.tflag) /* don't close NULL file */ - close_outfile(__G); -#else -#ifdef DLL - if (!uO.tflag && (!uO.cflag || G.redirect_data)) { - if (G.redirect_data) - FINISH_REDIRECT(); - else - close_outfile(__G); - } -#else - if (!uO.tflag && !uO.cflag) /* don't close NULL file or stdout */ - close_outfile(__G); -#endif -#endif /* VMS */ - - /* GRR: CONVERT close_outfile() TO NON-VOID: CHECK FOR ERRORS! */ - - - if (G.disk_full) { /* set by flush() */ - if (G.disk_full > 1) { -#if (defined(DELETE_IF_FULL) && defined(HAVE_UNLINK)) - /* delete the incomplete file if we can */ - if (unlink(G.filename) != 0) - Trace((stderr, "extract.c: could not delete %s\n", - FnFilter1(G.filename))); -#else - /* warn user about the incomplete file */ - Info(slide, 0x421, ((char *)slide, LoadFarString(FileTruncated), - FnFilter1(G.filename))); -#endif - error = PK_DISK; - } else { - error = PK_WARN; - } - } - - if (error > PK_WARN) {/* don't print redundant CRC error if error already */ - undefer_input(__G); - return error; - } - if (G.crc32val != G.lrec.crc32) { - /* if quiet enough, we haven't output the filename yet: do it */ - if ((uO.tflag && uO.qflag) || (!uO.tflag && !QCOND2)) - Info(slide, 0x401, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 0x401, ((char *)slide, LoadFarString(BadCRC), G.crc32val, - G.lrec.crc32)); -#if CRYPT - if (G.pInfo->encrypted) - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeBadPasswd))); -#endif - error = PK_ERR; - } else if (uO.tflag) { -#ifndef SFX - if (G.extra_field) { - if ((r = TestExtraField(__G__ G.extra_field, - G.lrec.extra_field_length)) > error) - error = r; - } else -#endif /* !SFX */ - if (!uO.qflag) - Info(slide, 0, ((char *)slide, " OK\n")); - } else { - if (QCOND2 && !error) /* GRR: is stdout reset to text mode yet? */ - Info(slide, 0, ((char *)slide, "\n")); - } - - undefer_input(__G); - return error; - -} /* end function extract_or_test_member() */ - - - - - -#ifndef SFX - -/*******************************/ -/* Function TestExtraField() */ -/*******************************/ - -static int TestExtraField(__G__ ef, ef_len) - __GDEF - uch *ef; - unsigned ef_len; -{ - ush ebID; - unsigned ebLen; - unsigned eb_cmpr_offs = 0; - int r; - - /* we know the regular compressed file data tested out OK, or else we - * wouldn't be here ==> print filename if any extra-field errors found - */ - while (ef_len >= EB_HEADSIZE) { - ebID = makeword(ef); - ebLen = (unsigned)makeword(ef+EB_LEN); - - if (ebLen > (ef_len - EB_HEADSIZE)) { - /* Discovered some extra field inconsistency! */ - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 1, ((char *)slide, LoadFarString(InconsistEFlength), - ebLen, (ef_len - EB_HEADSIZE))); - return PK_ERR; - } - - switch (ebID) { - case EF_OS2: - case EF_ACL: - case EF_MAC3: - case EF_BEOS: - case EF_ATHEOS: - switch (ebID) { - case EF_OS2: - case EF_ACL: - eb_cmpr_offs = EB_OS2_HLEN; - break; - case EF_MAC3: - if (ebLen >= EB_MAC3_HLEN && - (makeword(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) - & EB_M3_FL_UNCMPR) && - (makelong(ef+EB_HEADSIZE) == ebLen - EB_MAC3_HLEN)) - eb_cmpr_offs = 0; - else - eb_cmpr_offs = EB_MAC3_HLEN; - break; - case EF_BEOS: - case EF_ATHEOS: - if (ebLen >= EB_BEOS_HLEN && - (*(ef+(EB_HEADSIZE+EB_FLGS_OFFS)) & EB_BE_FL_UNCMPR) && - (makelong(ef+EB_HEADSIZE) == ebLen - EB_BEOS_HLEN)) - eb_cmpr_offs = 0; - else - eb_cmpr_offs = EB_BEOS_HLEN; - break; - } - if ((r = test_compr_eb(__G__ ef, ebLen, eb_cmpr_offs, NULL)) - != PK_OK) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - switch (r) { - case IZ_EF_TRUNC: - Info(slide, 1, ((char *)slide, - LoadFarString(TruncEAs), - ebLen-(eb_cmpr_offs+EB_CMPRHEADLEN), "\n")); - break; - case PK_ERR: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidComprDataEAs))); - break; - case PK_MEM3: - case PK_MEM4: - Info(slide, 1, ((char *)slide, - LoadFarString(NotEnoughMemEAs))); - break; - default: - if ((r & 0xff) != PK_ERR) - Info(slide, 1, ((char *)slide, - LoadFarString(UnknErrorEAs))); - else { - ush m = (ush)(r >> 8); - if (m == DEFLATED) /* GRR KLUDGE! */ - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - else - Info(slide, 1, ((char *)slide, - LoadFarString(UnknComprMethodEAs), m)); - } - break; - } - return r; - } - break; - - case EF_NTSD: - Trace((stderr, "ebID: %i / ebLen: %u\n", ebID, ebLen)); - r = ebLen < EB_NTSD_L_LEN ? IZ_EF_TRUNC : - ((ef[EB_HEADSIZE+EB_NTSD_VERSION] > EB_NTSD_MAX_VER) ? - (PK_WARN | 0x4000) : - test_compr_eb(__G__ ef, ebLen, EB_NTSD_L_LEN, TEST_NTSD)); - if (r != PK_OK) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - switch (r) { - case IZ_EF_TRUNC: - Info(slide, 1, ((char *)slide, - LoadFarString(TruncNTSD), - ebLen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n")); - break; -#if (defined(WIN32) && defined(NTSD_EAS)) - case PK_WARN: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidSecurityEAs))); - break; -#endif - case PK_ERR: - Info(slide, 1, ((char *)slide, - LoadFarString(InvalidComprDataEAs))); - break; - case PK_MEM3: - case PK_MEM4: - Info(slide, 1, ((char *)slide, - LoadFarString(NotEnoughMemEAs))); - break; - case (PK_WARN | 0x4000): - Info(slide, 1, ((char *)slide, - LoadFarString(UnsuppNTSDVersEAs), - (int)ef[EB_HEADSIZE+EB_NTSD_VERSION])); - r = PK_WARN; - break; - default: - if ((r & 0xff) != PK_ERR) - Info(slide, 1, ((char *)slide, - LoadFarString(UnknErrorEAs))); - else { - ush m = (ush)(r >> 8); - if (m == DEFLATED) /* GRR KLUDGE! */ - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - else - Info(slide, 1, ((char *)slide, - LoadFarString(UnknComprMethodEAs), m)); - } - break; - } - return r; - } - break; - case EF_PKVMS: - if (makelong(ef+EB_HEADSIZE) != - crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4), - (extent)(ebLen-4))) - Info(slide, 1, ((char *)slide, - LoadFarString(BadCRC_EAs))); - break; - case EF_PKW32: - case EF_PKUNIX: - case EF_ASIUNIX: - case EF_IZVMS: - case EF_IZUNIX: - case EF_VMCMS: - case EF_MVS: - case EF_SPARK: - case EF_TANDEM: - case EF_THEOS: - case EF_AV: - default: - break; - } - ef_len -= (ebLen + EB_HEADSIZE); - ef += (ebLen + EB_HEADSIZE); - } - - if (!uO.qflag) - Info(slide, 0, ((char *)slide, " OK\n")); - - return PK_COOL; - -} /* end function TestExtraField() */ - - - - - -/******************************/ -/* Function test_compr_eb() */ -/******************************/ - -#ifdef PROTO -static int test_compr_eb( - __GPRO__ - uch *eb, - unsigned eb_size, - unsigned compr_offset, - int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize)) -#else /* !PROTO */ -static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata) - __GDEF - uch *eb; - unsigned eb_size; - unsigned compr_offset; - int (*test_uc_ebdata)(); -#endif /* ?PROTO */ -{ - ulg eb_ucsize; - uch *eb_ucptr; - int r; - - if (compr_offset < 4) /* field is not compressed: */ - return PK_OK; /* do nothing and signal OK */ - - if ((eb_size < (EB_UCSIZE_P + 4)) || - ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L && - eb_size <= (compr_offset + EB_CMPRHEADLEN))) - return IZ_EF_TRUNC; /* no compressed data! */ - - if ( -#ifdef INT_16BIT - (((ulg)(extent)eb_ucsize) != eb_ucsize) || -#endif - (eb_ucptr = (uch *)malloc((extent)eb_ucsize)) == (uch *)NULL) - return PK_MEM4; - - r = memextract(__G__ eb_ucptr, eb_ucsize, - eb + (EB_HEADSIZE + compr_offset), - (ulg)(eb_size - compr_offset)); - - if (r == PK_OK && test_uc_ebdata != NULL) - r = (*test_uc_ebdata)(__G__ eb, eb_size, eb_ucptr, eb_ucsize); - - free(eb_ucptr); - return r; - -} /* end function test_compr_eb() */ - -#endif /* !SFX */ - - - - - -/***************************/ -/* Function memextract() */ -/***************************/ - -int memextract(__G__ tgt, tgtsize, src, srcsize) /* extract compressed */ - __GDEF /* extra field block; */ - uch *tgt; /* return PK-type error */ - ulg tgtsize; /* level */ - ZCONST uch *src; - ulg srcsize; -{ - zoff_t old_csize=G.csize; - uch *old_inptr=G.inptr; - int old_incnt=G.incnt; - int r, error=PK_OK; - ush method; - ulg extra_field_crc; - - - method = makeword(src); - extra_field_crc = makelong(src+2); - - /* compressed extra field exists completely in memory at this location: */ - G.inptr = (uch *)src + (2 + 4); /* method and extra_field_crc */ - G.incnt = (int)(G.csize = (long)(srcsize - (2 + 4))); - G.mem_mode = TRUE; - G.outbufptr = tgt; - G.outsize = tgtsize; - - switch (method) { - case STORED: - memcpy((char *)tgt, (char *)G.inptr, (extent)G.incnt); - G.outcnt = (ulg)G.csize; /* for CRC calculation */ - break; - case DEFLATED: -#ifdef USE_DEFLATE64 - case ENHDEFLATED: -#endif - G.outcnt = 0L; - if ((r = UZinflate(__G__ (method == ENHDEFLATED))) != 0) { - if (!uO.tflag) - Info(slide, 0x401, ((char *)slide, - LoadFarStringSmall(ErrUnzipNoFile), r == 3? - LoadFarString(NotEnoughMem) : - LoadFarString(InvalidComprData), - LoadFarStringSmall2(Inflate))); - error = (r == 3)? PK_MEM3 : PK_ERR; - } - if (G.outcnt == 0L) /* inflate's final FLUSH sets outcnt */ - break; - break; - default: - if (uO.tflag) - error = PK_ERR | ((int)method << 8); - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnsupportedExtraField), method)); - error = PK_ERR; /* GRR: should be passed on up via SetEAs() */ - } - break; - } - - G.inptr = old_inptr; - G.incnt = old_incnt; - G.csize = old_csize; - G.mem_mode = FALSE; - - if (!error) { - register ulg crcval = crc32(CRCVAL_INITIAL, tgt, (extent)G.outcnt); - - if (crcval != extra_field_crc) { - if (uO.tflag) - error = PK_ERR | (DEFLATED << 8); /* kludge for now */ - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(BadExtraFieldCRC), G.zipfn, crcval, - extra_field_crc)); - error = PK_ERR; - } - } - } - return error; - -} /* end function memextract() */ - - - - - -/*************************/ -/* Function memflush() */ -/*************************/ - -int memflush(__G__ rawbuf, size) - __GDEF - ZCONST uch *rawbuf; - ulg size; -{ - if (size > G.outsize) - /* Here, PK_DISK is a bit off-topic, but in the sense of marking - "overflow of output space", its use may be tolerated. */ - return PK_DISK; /* more data than output buffer can hold */ - - - - memcpy((char *)G.outbufptr, (char *)rawbuf, (extent)size); - G.outbufptr += (unsigned int)size; - G.outsize -= size; - G.outcnt += size; - - return 0; - -} /* end function memflush() */ - - - - - -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - -/************************************/ -/* Function extract_izvms_block() */ -/************************************/ - -/* - * Extracts block from p. If resulting length is less than needed, fill - * extra space with corresponding bytes from 'init'. - * Currently understands 3 formats of block compression: - * - Simple storing - * - Compression of zero bytes to zero bits - * - Deflation (see memextract()) - * The IZVMS block data is returned in malloc'd space. - */ -uch *extract_izvms_block(__G__ ebdata, size, retlen, init, needlen) - __GDEF - ZCONST uch *ebdata; - unsigned size; - unsigned *retlen; - ZCONST uch *init; - unsigned needlen; -{ - uch *ucdata; /* Pointer to block allocated */ - int cmptype; - unsigned usiz, csiz; - - cmptype = (makeword(ebdata+EB_IZVMS_FLGS) & EB_IZVMS_BCMASK); - csiz = size - EB_IZVMS_HLEN; - usiz = (cmptype == EB_IZVMS_BCSTOR ? - csiz : makeword(ebdata+EB_IZVMS_UCSIZ)); - - if (retlen) - *retlen = usiz; - - if ((ucdata = (uch *)malloc(MAX(needlen, usiz))) == NULL) - return NULL; - - if (init && (usiz < needlen)) - memcpy((char *)ucdata, (ZCONST char *)init, needlen); - - switch (cmptype) - { - case EB_IZVMS_BCSTOR: /* The simplest case */ - memcpy(ucdata, ebdata+EB_IZVMS_HLEN, usiz); - break; - case EB_IZVMS_BC00: - decompress_bits(ucdata, usiz, ebdata+EB_IZVMS_HLEN); - break; - case EB_IZVMS_BCDEFL: - memextract(__G__ ucdata, (ulg)usiz, - ebdata+EB_IZVMS_HLEN, (ulg)csiz); - break; - default: - free(ucdata); - ucdata = NULL; - } - return ucdata; - -} /* end of extract_izvms_block */ - - - - - -/********************************/ -/* Function decompress_bits() */ -/********************************/ -/* - * Simple uncompression routine. The compression uses bit stream. - * Compression scheme: - * - * if (byte!=0) - * putbit(1),putbyte(byte) - * else - * putbit(0) - */ -static void decompress_bits(outptr, needlen, bitptr) - uch *outptr; /* Pointer into output block */ - unsigned needlen; /* Size of uncompressed block */ - ZCONST uch *bitptr; /* Pointer into compressed data */ -{ - ulg bitbuf = 0; - int bitcnt = 0; - -#define _FILL { bitbuf |= (*bitptr++) << bitcnt;\ - bitcnt += 8; \ - } - - while (needlen--) - { - if (bitcnt <= 0) - _FILL; - - if (bitbuf & 1) - { - bitbuf >>= 1; - if ((bitcnt -= 1) < 8) - _FILL; - *outptr++ = (uch)bitbuf; - bitcnt -= 8; - bitbuf >>= 8; - } - else - { - *outptr++ = '\0'; - bitcnt -= 1; - bitbuf >>= 1; - } - } -} /* end function decompress_bits() */ - -#endif /* VMS || VMS_TEXT_CONV */ - - - - - -#ifdef SYMLINKS -/***********************************/ -/* Function set_deferred_symlink() */ -/***********************************/ - -static void set_deferred_symlink(__G__ slnk_entry) - __GDEF - slinkentry *slnk_entry; -{ - extent ucsize = slnk_entry->targetlen; - char *linkfname = slnk_entry->fname; - char *linktarget = (char *)malloc(ucsize+1); - - if (!linktarget) { - Info(slide, 0x201, ((char *)slide, - LoadFarString(SymLnkWarnNoMem), FnFilter1(linkfname))); - return; - } - linktarget[ucsize] = '\0'; - G.outfile = zfopen(linkfname, FOPR); /* open link placeholder for reading */ - /* Check that the following conditions are all fulfilled: - * a) the placeholder file exists, - * b) the placeholder file contains exactly "ucsize" bytes - * (read the expected placeholder content length + 1 extra byte, this - * should return the expected content length), - * c) the placeholder content matches the link target specification as - * stored in the symlink control structure. - */ - if (!G.outfile || - fread(linktarget, 1, ucsize+1, G.outfile) != ucsize || - strcmp(slnk_entry->target, linktarget)) - { - Info(slide, 0x201, ((char *)slide, - LoadFarString(SymLnkWarnInvalid), FnFilter1(linkfname))); - free(linktarget); - if (G.outfile) - fclose(G.outfile); - return; - } - fclose(G.outfile); /* close "data" file for good... */ - unlink(linkfname); /* ...and delete it */ - if (QCOND2) - Info(slide, 0, ((char *)slide, LoadFarString(SymLnkFinish), - FnFilter1(linkfname), FnFilter2(linktarget))); - if (symlink(linktarget, linkfname)) /* create the real link */ - perror("symlink error"); - free(linktarget); -#ifdef SET_SYMLINK_ATTRIBS - set_symlnk_attribs(__G__ slnk_entry); -#endif - return; /* can't set time on symlinks */ - -} /* end function set_deferred_symlink() */ -#endif /* SYMLINKS */ - - - - -/*************************/ -/* Function fnfilter() */ /* here instead of in list.c for SFX */ -/*************************/ - -char *fnfilter(raw, space, size) /* convert name to safely printable form */ - ZCONST char *raw; - uch *space; - extent size; -{ -#ifndef NATIVE /* ASCII: filter ANSI escape codes, etc. */ - ZCONST uch *r=(ZCONST uch *)raw; - uch *s=space; - uch *slim=NULL; - uch *se=NULL; - int have_overflow = FALSE; - - if (size > 0) { - slim = space + size -#ifdef _MBCS - - (MB_CUR_MAX - 1) -#endif - - 4; - } - while (*r) { - if (size > 0 && s >= slim && se == NULL) { - se = s; - } -#ifdef QDOS - if (qlflag & 2) { - if (*r == '/' || *r == '.') { - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - ++r; - *s++ = '_'; - continue; - } - } else -#endif -#ifdef HAVE_WORKING_ISPRINT -# ifndef UZ_FNFILTER_REPLACECHAR - /* A convenient choice for the replacement of unprintable char codes is - * the "single char wildcard", as this character is quite unlikely to - * appear in filenames by itself. The following default definition - * sets the replacement char to a question mark as the most common - * "single char wildcard"; this setting should be overridden in the - * appropiate system-specific configuration header when needed. - */ -# define UZ_FNFILTER_REPLACECHAR '?' -# endif - if (!isprint(*r)) { - if (*r < 32) { - /* ASCII control codes are escaped as "^{letter}". */ - if (se != NULL && (s > (space + (size-4)))) { - have_overflow = TRUE; - break; - } - *s++ = '^', *s++ = (uch)(64 + *r++); - } else { - /* Other unprintable codes are replaced by the - * placeholder character. */ - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - *s++ = UZ_FNFILTER_REPLACECHAR; - INCSTR(r); - } -#else /* !HAVE_WORKING_ISPRINT */ - if (*r < 32) { - /* ASCII control codes are escaped as "^{letter}". */ - if (se != NULL && (s > (space + (size-4)))) { - have_overflow = TRUE; - break; - } - *s++ = '^', *s++ = (uch)(64 + *r++); -#endif /* ?HAVE_WORKING_ISPRINT */ - } else { -#ifdef _MBCS - unsigned i = CLEN(r); - if (se != NULL && (s > (space + (size-i-2)))) { - have_overflow = TRUE; - break; - } - for (; i > 0; i--) - *s++ = *r++; -#else - if (se != NULL && (s > (space + (size-3)))) { - have_overflow = TRUE; - break; - } - *s++ = *r++; -#endif - } - } - if (have_overflow) { - strcpy((char *)se, "..."); - } else { - *s = '\0'; - } - -#ifdef WINDLL - INTERN_TO_ISO((char *)space, (char *)space); /* translate to ANSI */ -#else -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM((char *)space, (char *)space); -#endif /* (WIN32 && !_WIN32_WCE) */ -#endif /* ?WINDLL */ - - return (char *)space; - -#else /* NATIVE: EBCDIC or whatever */ - return (char *)raw; -#endif - -} /* end function fnfilter() */ - - - - -#ifdef SET_DIR_ATTRIB -/* must sort saved directories so can set perms from bottom up */ - -/************************/ -/* Function dircomp() */ -/************************/ - -static int Cdecl dircomp(a, b) /* used by qsort(); swiped from Zip */ - ZCONST zvoid *a, *b; -{ - /* order is significant: this sorts in reverse order (deepest first) */ - return strcmp((*(direntry **)b)->fn, (*(direntry **)a)->fn); - /* return namecmp((*(direntry **)b)->fn, (*(direntry **)a)->fn); */ -} - -#endif /* SET_DIR_ATTRIB */ - - -#ifdef USE_BZIP2 - -/**************************/ -/* Function UZbunzip2() */ -/**************************/ - -int UZbunzip2(__G) -__GDEF -/* decompress a bzipped entry using the libbz2 routines */ -{ - int retval = 0; /* return code: 0 = "no error" */ - int err=BZ_OK; - int repeated_buf_err; - bz_stream bstrm; - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - - bstrm.next_in = (char *)G.inptr; - bstrm.avail_in = G.incnt; - - { - /* local buffer for efficiency */ - /* $TODO Check for BZIP LIB version? */ - - bstrm.bzalloc = NULL; - bstrm.bzfree = NULL; - bstrm.opaque = NULL; - - Trace((stderr, "initializing bzlib()\n")); - err = BZ2_bzDecompressInit(&bstrm, 0, 0); - - if (err == BZ_MEM_ERROR) - return 3; - else if (err != BZ_OK) - Trace((stderr, "oops! (BZ2_bzDecompressInit() err = %d)\n", err)); - } - -#ifdef FUNZIP - while (err != BZ_STREAM_END) { -#else /* !FUNZIP */ - while (G.csize > 0) { - Trace((stderr, "first loop: G.csize = %ld\n", G.csize)); -#endif /* ?FUNZIP */ - while (bstrm.avail_out > 0) { - err = BZ2_bzDecompress(&bstrm); - - if (err == BZ_DATA_ERROR) { - retval = 2; goto uzbunzip_cleanup_exit; - } else if (err == BZ_MEM_ERROR) { - retval = 3; goto uzbunzip_cleanup_exit; - } else if (err != BZ_OK && err != BZ_STREAM_END) - Trace((stderr, "oops! (bzip(first loop) err = %d)\n", err)); - -#ifdef FUNZIP - if (err == BZ_STREAM_END) /* "END-of-entry-condition" ? */ -#else /* !FUNZIP */ - if (G.csize <= 0L) /* "END-of-entry-condition" ? */ -#endif /* ?FUNZIP */ - break; - - if (bstrm.avail_in == 0) { - if (fillinbuf(__G) == 0) { - /* no "END-condition" yet, but no more data */ - retval = 2; goto uzbunzip_cleanup_exit; - } - - bstrm.next_in = (char *)G.inptr; - bstrm.avail_in = G.incnt; - } - Trace((stderr, " avail_in = %u\n", bstrm.avail_in)); - } - /* flush slide[] */ - if ((retval = FLUSH(wsize - bstrm.avail_out)) != 0) - goto uzbunzip_cleanup_exit; - Trace((stderr, "inside loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - bstrm.avail_out), - (long)(bstrm.next_out-(char *)redirSlide))); - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - } - - /* no more input, so loop until we have all output */ - Trace((stderr, "beginning final loop: err = %d\n", err)); - repeated_buf_err = FALSE; - while (err != BZ_STREAM_END) { - err = BZ2_bzDecompress(&bstrm); - if (err == BZ_DATA_ERROR) { - retval = 2; goto uzbunzip_cleanup_exit; - } else if (err == BZ_MEM_ERROR) { - retval = 3; goto uzbunzip_cleanup_exit; - } else if (err != BZ_OK && err != BZ_STREAM_END) { - Trace((stderr, "oops! (bzip(final loop) err = %d)\n", err)); - DESTROYGLOBALS(); - EXIT(PK_MEM3); - } - /* final flush of slide[] */ - if ((retval = FLUSH(wsize - bstrm.avail_out)) != 0) - goto uzbunzip_cleanup_exit; - Trace((stderr, "final loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - bstrm.avail_out), - (long)(bstrm.next_out-(char *)redirSlide))); - bstrm.next_out = (char *)redirSlide; - bstrm.avail_out = wsize; - } -#ifdef LARGE_FILE_SUPPORT - Trace((stderr, "total in = %llu, total out = %llu\n", - (zusz_t)(bstrm.total_in_lo32) + ((zusz_t)(bstrm.total_in_hi32))<<32, - (zusz_t)(bstrm.total_out_lo32) + ((zusz_t)(bstrm.total_out_hi32))<<32)); -#else - Trace((stderr, "total in = %lu, total out = %lu\n", bstrm.total_in_lo32, - bstrm.total_out_lo32)); -#endif - - G.inptr = (uch *)bstrm.next_in; - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */ - -uzbunzip_cleanup_exit: - err = BZ2_bzDecompressEnd(&bstrm); - if (err != BZ_OK) - Trace((stderr, "oops! (BZ2_bzDecompressEnd() err = %d)\n", err)); - - return retval; -} /* end function UZbunzip2() */ -#endif /* USE_BZIP2 */ diff --git a/data/windows/unzipfx-catia/fileio.c b/data/windows/unzipfx-catia/fileio.c deleted file mode 100644 index ba0a1d0..0000000 --- a/data/windows/unzipfx-catia/fileio.c +++ /dev/null @@ -1,2855 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - fileio.c - - This file contains routines for doing direct but relatively generic input/ - output, file-related sorts of things, plus some miscellaneous stuff. Most - of the stuff has to do with opening, closing, reading and/or writing files. - - Contains: open_input_file() - open_outfile() (not: VMS, AOS/VS, CMSMVS, MACOS, TANDEM) - undefer_input() - defer_leftover_input() - readbuf() - readbyte() - fillinbuf() - seek_zipf() - flush() (non-VMS) - is_vms_varlen_txt() (non-VMS, VMS_TEXT_CONV only) - disk_error() (non-VMS) - UzpMessagePrnt() - UzpMessageNull() (DLL only) - UzpInput() - UzpMorePause() - UzpPassword() (non-WINDLL) - handler() - dos_to_unix_time() (non-VMS, non-VM/CMS, non-MVS) - check_for_newer() (non-VMS, non-OS/2, non-VM/CMS, non-MVS) - do_string() - makeword() - makelong() - makeint64() - fzofft() - str2iso() (CRYPT && NEED_STR2ISO, only) - str2oem() (CRYPT && NEED_STR2OEM, only) - memset() (ZMEM only) - memcpy() (ZMEM only) - zstrnicmp() (NO_STRNICMP only) - zstat() (REGULUS only) - plastchar() (_MBCS only) - uzmbclen() (_MBCS && NEED_UZMBCLEN, only) - uzmbschr() (_MBCS && NEED_UZMBSCHR, only) - uzmbsrchr() (_MBCS && NEED_UZMBSRCHR, only) - fLoadFarString() (SMALL_MEM only) - fLoadFarStringSmall() (SMALL_MEM only) - fLoadFarStringSmall2() (SMALL_MEM only) - zfstrcpy() (SMALL_MEM only) - zfstrcmp() (SMALL_MEM && !(SFX || FUNZIP) only) - - ---------------------------------------------------------------------------*/ - - -#define __FILEIO_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -# include -#endif -#include "crc32.h" -#include "crypt.h" -#include "ttyio.h" - -/* setup of codepage conversion for decryption passwords */ -#if CRYPT -# if (defined(CRYP_USES_ISO2OEM) && !defined(IZ_ISO2OEM_ARRAY)) -# define IZ_ISO2OEM_ARRAY /* pull in iso2oem[] table */ -# endif -# if (defined(CRYP_USES_OEM2ISO) && !defined(IZ_OEM2ISO_ARRAY)) -# define IZ_OEM2ISO_ARRAY /* pull in oem2iso[] table */ -# endif -#endif -#include "ebcdic.h" /* definition/initialization of ebcdic[] */ - - -/* - Note: Under Windows, the maximum size of the buffer that can be used - with any of the *printf calls is 16,384, so win_fprintf was used to - feed the fprintf clone no more than 16K chunks at a time. This should - be valid for anything up to 64K (and probably beyond, assuming your - buffers are that big). -*/ -#ifdef WINDLL -# define WriteError(buf,len,strm) \ - (win_fprintf(pG, strm, (extent)len, (char far *)buf) != (int)(len)) -#else /* !WINDLL */ -# ifdef USE_FWRITE -# define WriteError(buf,len,strm) \ - ((extent)fwrite((char *)(buf),1,(extent)(len),strm) != (extent)(len)) -# else -# define WriteError(buf,len,strm) \ - ((extent)write(fileno(strm),(char *)(buf),(extent)(len)) != (extent)(len)) -# endif -#endif /* ?WINDLL */ - -/* - 2005-09-16 SMS. - On VMS, when output is redirected to a file, as in a command like - "PIPE UNZIP -v > X.OUT", the output file is created with VFC record - format, and multiple calls to write() or fwrite() will produce multiple - records, even when there's no newline terminator in the buffer. - The result is unsightly output with spurious newlines. Using fprintf() - instead of write() here, and disabling a fflush(stdout) in UzpMessagePrnt() - below, together seem to solve the problem. - - According to the C RTL manual, "The write and decc$record_write - functions always generate at least one record." Also, "[T]he fwrite - function always generates at least records." So, - "fwrite(buf, len, 1, strm)" is much better ("1" record) than - "fwrite(buf, 1, len, strm)" ("len" (1-character) records, _really_ - ugly), but neither is better than write(). Similarly, "The fflush - function always generates a record if there is unwritten data in the - buffer." Apparently fprintf() buffers the stuff somewhere, and puts - out a record (only) when it sees a newline. -*/ -#ifdef VMS -# define WriteTxtErr(buf,len,strm) \ - ((extent)fprintf(strm, "%.*s", len, buf) != (extent)(len)) -#else -# define WriteTxtErr(buf,len,strm) WriteError(buf,len,strm) -#endif - -#if (defined(USE_DEFLATE64) && defined(__16BIT__)) -static int partflush OF((__GPRO__ uch *rawbuf, ulg size, int unshrink)); -#endif -#ifdef VMS_TEXT_CONV -static int is_vms_varlen_txt OF((__GPRO__ uch *ef_buf, unsigned ef_len)); -#endif -static int disk_error OF((__GPRO)); - - -/****************************/ -/* Strings used in fileio.c */ -/****************************/ - -static ZCONST char Far CannotOpenZipfile[] = - "error: cannot open zipfile [ %s ]\n %s\n"; - -#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) -#if (!defined(TANDEM)) -#if (defined(ATH_BEO_THS_UNX) || defined(DOS_FLX_NLM_OS2_W32)) - static ZCONST char Far CannotDeleteOldFile[] = - "error: cannot delete old %s\n %s\n"; -#ifdef UNIXBACKUP - static ZCONST char Far CannotRenameOldFile[] = - "error: cannot rename old %s\n %s\n"; - static ZCONST char Far BackupSuffix[] = "~"; -#endif -#endif /* ATH_BEO_THS_UNX || DOS_FLX_NLM_OS2_W32 */ -#ifdef NOVELL_BUG_FAILSAFE - static ZCONST char Far NovellBug[] = - "error: %s: stat() says does not exist, but fopen() found anyway\n"; -#endif - static ZCONST char Far CannotCreateFile[] = - "error: cannot create %s\n %s\n"; -#endif /* !TANDEM */ -#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ - -static ZCONST char Far ReadError[] = "error: zipfile read error\n"; -static ZCONST char Far FilenameTooLongTrunc[] = - "warning: filename too long--truncating.\n"; -#ifdef UNICODE_SUPPORT - static ZCONST char Far UFilenameTooLongTrunc[] = - "warning: Converted unicode filename too long--truncating.\n"; -#endif -static ZCONST char Far ExtraFieldTooLong[] = - "warning: extra field too long (%d). Ignoring...\n"; - -#ifdef WINDLL - static ZCONST char Far DiskFullQuery[] = - "%s: write error (disk full?).\n"; -#else - static ZCONST char Far DiskFullQuery[] = - "%s: write error (disk full?). Continue? (y/n/^C) "; - static ZCONST char Far ZipfileCorrupt[] = - "error: zipfile probably corrupt (%s)\n"; -# ifdef SYMLINKS - static ZCONST char Far FileIsSymLink[] = - "%s exists and is a symbolic link%s.\n"; -# endif -# ifdef MORE - static ZCONST char Far MorePrompt[] = "--More--(%lu)"; -# endif - static ZCONST char Far QuitPrompt[] = - "--- Press `Q' to quit, or any other key to continue ---"; - static ZCONST char Far HidePrompt[] = /* "\r \r"; */ - "\r \r"; -# if CRYPT -# ifdef MACOS - /* SPC: are names on MacOS REALLY so much longer than elsewhere ??? */ - static ZCONST char Far PasswPrompt[] = "[%s]\n %s password: "; -# else - static ZCONST char Far PasswPrompt[] = "[%s] %s password: "; -# endif - static ZCONST char Far PasswPrompt2[] = "Enter password: "; - static ZCONST char Far PasswRetry[] = "password incorrect--reenter: "; -# endif /* CRYPT */ -#endif /* !WINDLL */ - - - - - -/******************************/ -/* Function open_input_file() */ -/******************************/ - -int open_input_file(__G) /* return 1 if open failed */ - __GDEF -{ - /* - * open the zipfile for reading and in BINARY mode to prevent cr/lf - * translation, which would corrupt the bitstreams - */ - -#ifdef VMS - G.zipfd = open(G.zipfn, O_RDONLY, 0, OPNZIP_RMS_ARGS); -#else /* !VMS */ -#ifdef MACOS - G.zipfd = open(G.zipfn, 0); -#else /* !MACOS */ -#ifdef CMS_MVS - G.zipfd = vmmvs_open_infile(__G); -#else /* !CMS_MVS */ -#ifdef USE_STRM_INPUT - G.zipfd = fopen(G.zipfn, FOPR); -#else /* !USE_STRM_INPUT */ - G.zipfd = open(G.zipfn, O_RDONLY | O_BINARY); -#endif /* ?USE_STRM_INPUT */ -#endif /* ?CMS_MVS */ -#endif /* ?MACOS */ -#endif /* ?VMS */ - -#ifdef USE_STRM_INPUT - if (G.zipfd == NULL) -#else - /* if (G.zipfd < 0) */ /* no good for Windows CE port */ - if (G.zipfd == -1) -#endif - { - Info(slide, 0x401, ((char *)slide, LoadFarString(CannotOpenZipfile), - G.zipfn, strerror(errno))); - return 1; - } - return 0; - -} /* end function open_input_file() */ - - - - -#if (!defined(VMS) && !defined(AOS_VS) && !defined(CMS_MVS) && !defined(MACOS)) -#if (!defined(TANDEM)) - -/***************************/ -/* Function open_outfile() */ -/***************************/ - -int open_outfile(__G) /* return 1 if fail */ - __GDEF -{ -#ifdef DLL - if (G.redirect_data) - return (redirect_outfile(__G) == FALSE); -#endif -#ifdef QDOS - QFilename(__G__ G.filename); -#endif -#if (defined(DOS_FLX_NLM_OS2_W32) || defined(ATH_BEO_THS_UNX)) -#ifdef BORLAND_STAT_BUG - /* Borland 5.0's stat() barfs if the filename has no extension and the - * file doesn't exist. */ - if (access(G.filename, 0) == -1) { - FILE *tmp = fopen(G.filename, "wb+"); - - /* file doesn't exist, so create a dummy file to keep stat() from - * failing (will be over-written anyway) */ - fputc('0', tmp); /* just to have something in the file */ - fclose(tmp); - } -#endif /* BORLAND_STAT_BUG */ -#ifdef SYMLINKS - if (SSTAT(G.filename, &G.statbuf) == 0 || - lstat(G.filename, &G.statbuf) == 0) -#else - if (SSTAT(G.filename, &G.statbuf) == 0) -#endif /* ?SYMLINKS */ - { - Trace((stderr, "open_outfile: stat(%s) returns 0: file exists\n", - FnFilter1(G.filename))); -#ifdef UNIXBACKUP - if (uO.B_flag) { /* do backup */ - char *tname; - z_stat tmpstat; - int blen, flen, tlen; - - blen = strlen(BackupSuffix); - flen = strlen(G.filename); - tlen = flen + blen + 6; /* includes space for 5 digits */ - if (tlen >= FILNAMSIZ) { /* in case name is too long, truncate */ - tname = (char *)malloc(FILNAMSIZ); - if (tname == NULL) - return 1; /* in case we run out of space */ - tlen = FILNAMSIZ - 1 - blen; - strcpy(tname, G.filename); /* make backup name */ - tname[tlen] = '\0'; - if (flen > tlen) flen = tlen; - tlen = FILNAMSIZ; - } else { - tname = (char *)malloc(tlen); - if (tname == NULL) - return 1; /* in case we run out of space */ - strcpy(tname, G.filename); /* make backup name */ - } - strcpy(tname+flen, BackupSuffix); - - if (IS_OVERWRT_ALL) { - /* If there is a previous backup file, delete it, - * otherwise the following rename operation may fail. - */ - if (SSTAT(tname, &tmpstat) == 0) - unlink(tname); - } else { - /* Check if backupname exists, and, if it's true, try - * appending numbers of up to 5 digits (or the maximum - * "unsigned int" number on 16-bit systems) to the - * BackupSuffix, until an unused name is found. - */ - unsigned maxtail, i; - char *numtail = tname + flen + blen; - - /* take account of the "unsigned" limit on 16-bit systems: */ - maxtail = ( ((~0) >= 99999L) ? 99999 : (~0) ); - switch (tlen - flen - blen - 1) { - case 4: maxtail = 9999; break; - case 3: maxtail = 999; break; - case 2: maxtail = 99; break; - case 1: maxtail = 9; break; - case 0: maxtail = 0; break; - } - /* while filename exists */ - for (i = 0; (i < maxtail) && (SSTAT(tname, &tmpstat) == 0);) - sprintf(numtail,"%u", ++i); - } - - if (rename(G.filename, tname) != 0) { /* move file */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotRenameOldFile), - FnFilter1(G.filename), strerror(errno))); - free(tname); - return 1; - } - Trace((stderr, "open_outfile: %s now renamed into %s\n", - FnFilter1(G.filename), FnFilter2(tname))); - free(tname); - } else -#endif /* UNIXBACKUP */ - { -#ifdef DOS_FLX_OS2_W32 - if (!(G.statbuf.st_mode & S_IWRITE)) { - Trace((stderr, - "open_outfile: existing file %s is read-only\n", - FnFilter1(G.filename))); - chmod(G.filename, S_IREAD | S_IWRITE); - Trace((stderr, "open_outfile: %s now writable\n", - FnFilter1(G.filename))); - } -#endif /* DOS_FLX_OS2_W32 */ -#ifdef NLM - /* Give the file read/write permission (non-POSIX shortcut) */ - chmod(G.filename, 0); -#endif /* NLM */ - if (unlink(G.filename) != 0) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotDeleteOldFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } - Trace((stderr, "open_outfile: %s now deleted\n", - FnFilter1(G.filename))); - } - } -#endif /* DOS_FLX_NLM_OS2_W32 || ATH_BEO_THS_UNX */ -#ifdef RISCOS - if (SWI_OS_File_7(G.filename,0xDEADDEAD,0xDEADDEAD,G.lrec.ucsize)!=NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } -#endif /* RISCOS */ -#ifdef TOPS20 - char *tfilnam; - - if ((tfilnam = (char *)malloc(2*strlen(G.filename)+1)) == (char *)NULL) - return 1; - strcpy(tfilnam, G.filename); - upper(tfilnam); - enquote(tfilnam); - if ((G.outfile = fopen(tfilnam, FOPW)) == (FILE *)NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - tfilnam, strerror(errno))); - free(tfilnam); - return 1; - } - free(tfilnam); -#else /* !TOPS20 */ -#ifdef MTS - if (uO.aflag) - G.outfile = zfopen(G.filename, FOPWT); - else - G.outfile = zfopen(G.filename, FOPW); - if (G.outfile == (FILE *)NULL) { - Info(slide, 1, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } -#else /* !MTS */ -#ifdef DEBUG - Info(slide, 1, ((char *)slide, - "open_outfile: doing fopen(%s) for reading\n", FnFilter1(G.filename))); - if ((G.outfile = zfopen(G.filename, FOPR)) == (FILE *)NULL) - Info(slide, 1, ((char *)slide, - "open_outfile: fopen(%s) for reading failed: does not exist\n", - FnFilter1(G.filename))); - else { - Info(slide, 1, ((char *)slide, - "open_outfile: fopen(%s) for reading succeeded: file exists\n", - FnFilter1(G.filename))); - fclose(G.outfile); - } -#endif /* DEBUG */ -#ifdef NOVELL_BUG_FAILSAFE - if (G.dne && ((G.outfile = zfopen(G.filename, FOPR)) != (FILE *)NULL)) { - Info(slide, 0x401, ((char *)slide, LoadFarString(NovellBug), - FnFilter1(G.filename))); - fclose(G.outfile); - return 1; /* with "./" fix in checkdir(), should never reach here */ - } -#endif /* NOVELL_BUG_FAILSAFE */ - Trace((stderr, "open_outfile: doing fopen(%s) for writing\n", - FnFilter1(G.filename))); - { -#if defined(ATH_BE_UNX) || defined(AOS_VS) || defined(QDOS) || defined(TANDEM) - mode_t umask_sav = umask(0077); -#endif -#if defined(SYMLINKS) || defined(QLZIP) - /* These features require the ability to re-read extracted data from - the output files. Output files are created with Read&Write access. - */ - G.outfile = zfopen(G.filename, FOPWR); -#else - G.outfile = zfopen(G.filename, FOPW); -#endif -#if defined(ATH_BE_UNX) || defined(AOS_VS) || defined(QDOS) || defined(TANDEM) - umask(umask_sav); -#endif - } - if (G.outfile == (FILE *)NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(CannotCreateFile), - FnFilter1(G.filename), strerror(errno))); - return 1; - } - Trace((stderr, "open_outfile: fopen(%s) for writing succeeded\n", - FnFilter1(G.filename))); -#endif /* !MTS */ -#endif /* !TOPS20 */ - -#ifdef USE_FWRITE -#ifdef DOS_NLM_OS2_W32 - /* 16-bit MSC: buffer size must be strictly LESS than 32K (WSIZE): bogus */ - setbuf(G.outfile, (char *)NULL); /* make output unbuffered */ -#else /* !DOS_NLM_OS2_W32 */ -#ifndef RISCOS -#ifdef _IOFBF /* make output fully buffered (works just about like write()) */ - setvbuf(G.outfile, (char *)slide, _IOFBF, WSIZE); -#else - setbuf(G.outfile, (char *)slide); -#endif -#endif /* !RISCOS */ -#endif /* ?DOS_NLM_OS2_W32 */ -#endif /* USE_FWRITE */ -#ifdef OS2_W32 - /* preallocate the final file size to prevent file fragmentation */ - SetFileSize(G.outfile, G.lrec.ucsize); -#endif - return 0; - -} /* end function open_outfile() */ - -#endif /* !TANDEM */ -#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */ - - - - - -/* - * These functions allow NEXTBYTE to function without needing two bounds - * checks. Call defer_leftover_input() if you ever have filled G.inbuf - * by some means other than readbyte(), and you then want to start using - * NEXTBYTE. When going back to processing bytes without NEXTBYTE, call - * undefer_input(). For example, extract_or_test_member brackets its - * central section that does the decompression with these two functions. - * If you need to check the number of bytes remaining in the current - * file while using NEXTBYTE, check (G.csize + G.incnt), not G.csize. - */ - -/****************************/ -/* function undefer_input() */ -/****************************/ - -void undefer_input(__G) - __GDEF -{ - if (G.incnt > 0) - G.csize += G.incnt; - if (G.incnt_leftover > 0) { - /* We know that "(G.csize < MAXINT)" so we can cast G.csize to int: - * This condition was checked when G.incnt_leftover was set > 0 in - * defer_leftover_input(), and it is NOT allowed to touch G.csize - * before calling undefer_input() when (G.incnt_leftover > 0) - * (single exception: see read_byte()'s "G.csize <= 0" handling) !! - */ - G.incnt = G.incnt_leftover + (int)G.csize; - G.inptr = G.inptr_leftover - (int)G.csize; - G.incnt_leftover = 0; - } else if (G.incnt < 0) - G.incnt = 0; -} /* end function undefer_input() */ - - - - - -/***********************************/ -/* function defer_leftover_input() */ -/***********************************/ - -void defer_leftover_input(__G) - __GDEF -{ - if ((zoff_t)G.incnt > G.csize) { - /* (G.csize < MAXINT), we can safely cast it to int !! */ - if (G.csize < 0L) - G.csize = 0L; - G.inptr_leftover = G.inptr + (int)G.csize; - G.incnt_leftover = G.incnt - (int)G.csize; - G.incnt = (int)G.csize; - } else - G.incnt_leftover = 0; - G.csize -= G.incnt; -} /* end function defer_leftover_input() */ - - - - - -/**********************/ -/* Function readbuf() */ -/**********************/ - -unsigned readbuf(__G__ buf, size) /* return number of bytes read into buf */ - __GDEF - char *buf; - register unsigned size; -{ - register unsigned count; - unsigned n; - - n = size; - while (size) { - if (G.incnt <= 0) { - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) - return (n-size); - else if (G.incnt < 0) { - /* another hack, but no real harm copying same thing twice */ - (*G.message)((zvoid *)&G, - (uch *)LoadFarString(ReadError), /* CANNOT use slide */ - (ulg)strlen(LoadFarString(ReadError)), 0x401); - return 0; /* discarding some data; better than lock-up */ - } - /* buffer ALWAYS starts on a block boundary: */ - G.cur_zipfile_bufstart += INBUFSIZ; - G.inptr = G.inbuf; - } - count = MIN(size, (unsigned)G.incnt); - memcpy(buf, G.inptr, count); - buf += count; - G.inptr += count; - G.incnt -= count; - size -= count; - } - return n; - -} /* end function readbuf() */ - - - - - -/***********************/ -/* Function readbyte() */ -/***********************/ - -int readbyte(__G) /* refill inbuf and return a byte if available, else EOF */ - __GDEF -{ - if (G.mem_mode) - return EOF; - if (G.csize <= 0) { - G.csize--; /* for tests done after exploding */ - G.incnt = 0; - return EOF; - } - if (G.incnt <= 0) { - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) == 0) { - return EOF; - } else if (G.incnt < 0) { /* "fail" (abort, retry, ...) returns this */ - /* another hack, but no real harm copying same thing twice */ - (*G.message)((zvoid *)&G, - (uch *)LoadFarString(ReadError), - (ulg)strlen(LoadFarString(ReadError)), 0x401); - echon(); -#ifdef WINDLL - longjmp(dll_error_return, 1); -#else - DESTROYGLOBALS(); - EXIT(PK_BADERR); /* totally bailing; better than lock-up */ -#endif - } - G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on block bndry */ - G.inptr = G.inbuf; - defer_leftover_input(__G); /* decrements G.csize */ - } - -#if CRYPT - if (G.pInfo->encrypted) { - uch *p; - int n; - - /* This was previously set to decrypt one byte beyond G.csize, when - * incnt reached that far. GRR said, "but it's required: why?" This - * was a bug in fillinbuf() -- was it also a bug here? - */ - for (n = G.incnt, p = G.inptr; n--; p++) - zdecode(*p); - } -#endif /* CRYPT */ - - --G.incnt; - return *G.inptr++; - -} /* end function readbyte() */ - - - - - -#if defined(USE_ZLIB) || defined(USE_BZIP2) - -/************************/ -/* Function fillinbuf() */ -/************************/ - -int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */ - __GDEF -{ - if (G.mem_mode || - (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - return 0; - G.cur_zipfile_bufstart += INBUFSIZ; /* always starts on a block boundary */ - G.inptr = G.inbuf; - defer_leftover_input(__G); /* decrements G.csize */ - -#if CRYPT - if (G.pInfo->encrypted) { - uch *p; - int n; - - for (n = G.incnt, p = G.inptr; n--; p++) - zdecode(*p); - } -#endif /* CRYPT */ - - return G.incnt; - -} /* end function fillinbuf() */ - -#endif /* USE_ZLIB || USE_BZIP2 */ - - - - - -/************************/ -/* Function seek_zipf() */ -/************************/ - -int seek_zipf(__G__ abs_offset) - __GDEF - zoff_t abs_offset; -{ -/* - * Seek to the block boundary of the block which includes abs_offset, - * then read block into input buffer and set pointers appropriately. - * If block is already in the buffer, just set the pointers. This function - * is used by do_seekable (process.c), extract_or_test_entrylist (extract.c) - * and do_string (fileio.c). Also, a slightly modified version is embedded - * within extract_or_test_entrylist (extract.c). readbyte() and readbuf() - * (fileio.c) are compatible. NOTE THAT abs_offset is intended to be the - * "proper offset" (i.e., if there were no extra bytes prepended); - * cur_zipfile_bufstart contains the corrected offset. - * - * Since seek_zipf() is never used during decompression, it is safe to - * use the slide[] buffer for the error message. - * - * returns PK error codes: - * PK_BADERR if effective offset in zipfile is negative - * PK_EOF if seeking past end of zipfile - * PK_OK when seek was successful - */ - zoff_t request = abs_offset + G.extra_bytes; - zoff_t inbuf_offset = request % INBUFSIZ; - zoff_t bufstart = request - inbuf_offset; - - if (request < 0) { - Info(slide, 1, ((char *)slide, LoadFarStringSmall(SeekMsg), - G.zipfn, LoadFarString(ReportMsg))); - return(PK_BADERR); - } else if (bufstart != G.cur_zipfile_bufstart) { - Trace((stderr, - "fpos_zip: abs_offset = %s, G.extra_bytes = %s\n", - FmZofft(abs_offset, NULL, NULL), - FmZofft(G.extra_bytes, NULL, NULL))); -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, bufstart, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - Trace((stderr, - " request = %s, (abs+extra) = %s, inbuf_offset = %s\n", - FmZofft(request, NULL, NULL), - FmZofft((abs_offset+G.extra_bytes), NULL, NULL), - FmZofft(inbuf_offset, NULL, NULL))); - Trace((stderr, " bufstart = %s, cur_zipfile_bufstart = %s\n", - FmZofft(bufstart, NULL, NULL), - FmZofft(G.cur_zipfile_bufstart, NULL, NULL))); - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0) - return(PK_EOF); - G.incnt -= (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } else { - G.incnt += (G.inptr-G.inbuf) - (int)inbuf_offset; - G.inptr = G.inbuf + (int)inbuf_offset; - } - return(PK_OK); -} /* end function seek_zipf() */ - - - - - -#ifndef VMS /* for VMS use code in vms.c */ - -/********************/ -/* Function flush() */ /* returns PK error codes: */ -/********************/ /* if tflag => always 0; PK_DISK if write error */ - -int flush(__G__ rawbuf, size, unshrink) - __GDEF - uch *rawbuf; - ulg size; - int unshrink; -#if (defined(USE_DEFLATE64) && defined(__16BIT__)) -{ - int ret; - - /* On 16-bit systems (MSDOS, OS/2 1.x), the standard C library functions - * cannot handle writes of 64k blocks at once. For these systems, the - * blocks to flush are split into pieces of 32k or less. - */ - while (size > 0x8000L) { - ret = partflush(__G__ rawbuf, 0x8000L, unshrink); - if (ret != PK_OK) - return ret; - size -= 0x8000L; - rawbuf += (extent)0x8000; - } - return partflush(__G__ rawbuf, size, unshrink); -} /* end function flush() */ - - -/************************/ -/* Function partflush() */ /* returns PK error codes: */ -/************************/ /* if tflag => always 0; PK_DISK if write error */ - -static int partflush(__G__ rawbuf, size, unshrink) - __GDEF - uch *rawbuf; /* cannot be ZCONST, gets passed to (*G.message)() */ - ulg size; - int unshrink; -#endif /* USE_DEFLATE64 && __16BIT__ */ -{ - register uch *p; - register uch *q; - uch *transbuf; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - ulg transbufsiz; -#endif - /* static int didCRlast = FALSE; moved to globals.h */ - - -/*--------------------------------------------------------------------------- - Compute the CRC first; if testing or if disk is full, that's it. - ---------------------------------------------------------------------------*/ - - G.crc32val = crc32(G.crc32val, rawbuf, (extent)size); - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_IN_PROGRESS, G.zipfn, G.filename, NULL)) - return IZ_CTRLC; /* cancel operation by user request */ -#endif - - if (uO.tflag || size == 0L) /* testing or nothing to write: all done */ - return PK_OK; - - if (G.disk_full) - return PK_DISK; /* disk already full: ignore rest of file */ - -/*--------------------------------------------------------------------------- - Write the bytes rawbuf[0..size-1] to the output device, first converting - end-of-lines and ASCII/EBCDIC as needed. If SMALL_MEM or MED_MEM are NOT - defined, outbuf is assumed to be at least as large as rawbuf and is not - necessarily checked for overflow. - ---------------------------------------------------------------------------*/ - - if (!G.pInfo->textmode) { /* write raw binary data */ - /* GRR: note that for standard MS-DOS compilers, size argument to - * fwrite() can never be more than 65534, so WriteError macro will - * have to be rewritten if size can ever be that large. For now, - * never more than 32K. Also note that write() returns an int, which - * doesn't necessarily limit size to 32767 bytes if write() is used - * on 16-bit systems but does make it more of a pain; however, because - * at least MSC 5.1 has a lousy implementation of fwrite() (as does - * DEC Ultrix cc), write() is used anyway. - */ -#ifdef DLL - if (G.redirect_data) { -#ifdef NO_SLIDE_REDIR - if (writeToMemory(__G__ rawbuf, (extent)size)) return PK_ERR; -#else - writeToMemory(__G__ rawbuf, (extent)size); -#endif - } else -#endif - if (!uO.cflag && WriteError(rawbuf, size, G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, rawbuf, size, 0)) - return PK_OK; - } else { /* textmode: aflag is true */ - if (unshrink) { - /* rawbuf = outbuf */ - transbuf = G.outbuf2; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - transbufsiz = TRANSBUFSIZ; -#endif - } else { - /* rawbuf = slide */ - transbuf = G.outbuf; -#if (defined(SMALL_MEM) || defined(MED_MEM) || defined(VMS_TEXT_CONV)) - transbufsiz = OUTBUFSIZ; - Trace((stderr, "\ntransbufsiz = OUTBUFSIZ = %u\n", - (unsigned)OUTBUFSIZ)); -#endif - } - if (G.newfile) { -#ifdef VMS_TEXT_CONV - if (G.pInfo->hostnum == VMS_ && G.extra_field && - is_vms_varlen_txt(__G__ G.extra_field, - G.lrec.extra_field_length)) - G.VMS_line_state = 0; /* 0: ready to read line length */ - else - G.VMS_line_state = -1; /* -1: don't treat as VMS text */ -#endif - G.didCRlast = FALSE; /* no previous buffers written */ - G.newfile = FALSE; - } - -#ifdef VMS_TEXT_CONV - if (G.VMS_line_state >= 0) - { - p = rawbuf; - q = transbuf; - while ((extent)(p-rawbuf) < (extent)size) { - switch (G.VMS_line_state) { - - /* 0: ready to read line length */ - case 0: - G.VMS_line_length = 0; - if ((extent)(p-rawbuf) == (extent)size-1) { - /* last char */ - G.VMS_line_length = (unsigned)(*p++); - G.VMS_line_state = 1; - } else { - G.VMS_line_length = makeword(p); - p += 2; - G.VMS_line_state = 2; - } - G.VMS_line_pad = - ((G.VMS_line_length & 1) != 0); /* odd */ - break; - - /* 1: read one byte of length, need second */ - case 1: - G.VMS_line_length += ((unsigned)(*p++) << 8); - G.VMS_line_state = 2; - break; - - /* 2: ready to read VMS_line_length chars */ - case 2: - { - extent remaining = (extent)size+(rawbuf-p); - extent outroom; - - if (G.VMS_line_length < remaining) { - remaining = G.VMS_line_length; - G.VMS_line_state = 3; - } - - outroom = transbuf+(extent)transbufsiz-q; - if (remaining >= outroom) { - remaining -= outroom; - for (;outroom > 0; p++, outroom--) - *q++ = native(*p); -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, - (extent)(q-transbuf))) return PK_ERR; - } else -#endif - if (!uO.cflag && WriteError(transbuf, - (extent)(q-transbuf), G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - /* fall through to normal case */ - } - G.VMS_line_length -= remaining; - for (;remaining > 0; p++, remaining--) - *q++ = native(*p); - } - break; - - /* 3: ready to PutNativeEOL */ - case 3: - if (q > transbuf+(extent)transbufsiz-lenEOL) { -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, - (extent)(q-transbuf))) return PK_ERR; - } else -#endif - if (!uO.cflag && - WriteError(transbuf, (extent)(q-transbuf), - G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - } - PutNativeEOL - G.VMS_line_state = G.VMS_line_pad ? 4 : 0; - break; - - /* 4: ready to read pad byte */ - case 4: - ++p; - G.VMS_line_state = 0; - break; - } - } /* end while */ - - } else -#endif /* VMS_TEXT_CONV */ - - /*----------------------------------------------------------------------- - Algorithm: CR/LF => native; lone CR => native; lone LF => native. - This routine is only for non-raw-VMS, non-raw-VM/CMS files (i.e., - stream-oriented files, not record-oriented). - -----------------------------------------------------------------------*/ - - /* else not VMS text */ { - p = rawbuf; - if (*p == LF && G.didCRlast) - ++p; - G.didCRlast = FALSE; - for (q = transbuf; (extent)(p-rawbuf) < (extent)size; ++p) { - if (*p == CR) { /* lone CR or CR/LF: treat as EOL */ - PutNativeEOL - if ((extent)(p-rawbuf) == (extent)size-1) - /* last char in buffer */ - G.didCRlast = TRUE; - else if (p[1] == LF) /* get rid of accompanying LF */ - ++p; - } else if (*p == LF) /* lone LF */ - PutNativeEOL - else -#ifndef DOS_FLX_OS2_W32 - if (*p != CTRLZ) /* lose all ^Z's */ -#endif - *q++ = native(*p); - -#if (defined(SMALL_MEM) || defined(MED_MEM)) -# if (lenEOL == 1) /* don't check unshrink: both buffers small but equal */ - if (!unshrink) -# endif - /* check for danger of buffer overflow and flush */ - if (q > transbuf+(extent)transbufsiz-lenEOL) { - Trace((stderr, - "p - rawbuf = %u q-transbuf = %u size = %lu\n", - (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); - if (!uO.cflag && WriteError(transbuf, - (extent)(q-transbuf), G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, - transbuf, (ulg)(q-transbuf), 0)) - return PK_OK; - q = transbuf; - continue; - } -#endif /* SMALL_MEM || MED_MEM */ - } - } - - /*----------------------------------------------------------------------- - Done translating: write whatever we've got to file (or screen). - -----------------------------------------------------------------------*/ - - Trace((stderr, "p - rawbuf = %u q-transbuf = %u size = %lu\n", - (unsigned)(p-rawbuf), (unsigned)(q-transbuf), size)); - if (q > transbuf) { -#ifdef DLL - if (G.redirect_data) { - if (writeToMemory(__G__ transbuf, (extent)(q-transbuf))) - return PK_ERR; - } else -#endif - if (!uO.cflag && WriteError(transbuf, (extent)(q-transbuf), - G.outfile)) - return disk_error(__G); - else if (uO.cflag && (*G.message)((zvoid *)&G, transbuf, - (ulg)(q-transbuf), 0)) - return PK_OK; - } - } - - return PK_OK; - -} /* end function flush() [resp. partflush() for 16-bit Deflate64 support] */ - - - - - -#ifdef VMS_TEXT_CONV - -/********************************/ -/* Function is_vms_varlen_txt() */ -/********************************/ - -static int is_vms_varlen_txt(__G__ ef_buf, ef_len) - __GDEF - uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - uch *eb_data; - unsigned eb_datlen; -#define VMSREC_C_UNDEF 0 -#define VMSREC_C_VAR 2 - uch vms_rectype = VMSREC_C_UNDEF; - /* uch vms_fileorg = 0; */ /* currently, fileorg is not used... */ - -#define VMSPK_ITEMID 0 -#define VMSPK_ITEMLEN 2 -#define VMSPK_ITEMHEADSZ 4 - -#define VMSATR_C_RECATTR 4 -#define VMS_FABSIG 0x42414656 /* "VFAB" */ -/* offsets of interesting fields in VMS fabdef structure */ -#define VMSFAB_B_RFM 31 /* record format byte */ -#define VMSFAB_B_ORG 29 /* file organization byte */ - - if (ef_len == 0 || ef_buf == NULL) - return FALSE; - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "is_vms_varlen_txt: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_PKVMS: - /* The PKVMS e.f. raw data part consists of: - * a) 4 bytes CRC checksum - * b) list of uncompressed variable-length data items - * Each data item is introduced by a fixed header - * - 2 bytes data type ID - * - 2 bytes of data - * - bytes of actual attribute data - */ - - /* get pointer to start of data and its total length */ - eb_data = ef_buf+(EB_HEADSIZE+4); - eb_datlen = eb_len-4; - - /* test the CRC checksum */ - if (makelong(ef_buf+EB_HEADSIZE) != - crc32(CRCVAL_INITIAL, eb_data, (extent)eb_datlen)) - { - Info(slide, 1, ((char *)slide, - "[Warning: CRC error, discarding PKWARE extra field]\n")); - /* skip over the data analysis code */ - break; - } - - /* scan through the attribute data items */ - while (eb_datlen > 4) - { - unsigned fldsize = makeword(&eb_data[VMSPK_ITEMLEN]); - - /* check the item type word */ - switch (makeword(&eb_data[VMSPK_ITEMID])) { - case VMSATR_C_RECATTR: - /* we have found the (currently only) interesting - * data item */ - if (fldsize >= 1) { - vms_rectype = eb_data[VMSPK_ITEMHEADSZ] & 15; - /* vms_fileorg = eb_data[VMSPK_ITEMHEADSZ] >> 4; */ - } - break; - default: - break; - } - /* skip to next data item */ - eb_datlen -= fldsize + VMSPK_ITEMHEADSZ; - eb_data += fldsize + VMSPK_ITEMHEADSZ; - } - break; - - case EF_IZVMS: - if (makelong(ef_buf+EB_HEADSIZE) == VMS_FABSIG) { - if ((eb_data = extract_izvms_block(__G__ - ef_buf+EB_HEADSIZE, eb_len, - &eb_datlen, NULL, 0)) - != NULL) - { - if (eb_datlen >= VMSFAB_B_RFM+1) { - vms_rectype = eb_data[VMSFAB_B_RFM] & 15; - /* vms_fileorg = eb_data[VMSFAB_B_ORG] >> 4; */ - } - free(eb_data); - } - } - break; - - default: - break; - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return (vms_rectype == VMSREC_C_VAR); - -} /* end function is_vms_varlen_txtfile() */ - -#endif /* VMS_TEXT_CONV */ - - - - -/*************************/ -/* Function disk_error() */ -/*************************/ - -static int disk_error(__G) - __GDEF -{ - /* OK to use slide[] here because this file is finished regardless */ - Info(slide, 0x4a1, ((char *)slide, LoadFarString(DiskFullQuery), - FnFilter1(G.filename))); - -#ifndef WINDLL - fgets(G.answerbuf, sizeof(G.answerbuf), stdin); - if (*G.answerbuf == 'y') /* stop writing to this file */ - G.disk_full = 1; /* (outfile bad?), but new OK */ - else -#endif - G.disk_full = 2; /* no: exit program */ - - return PK_DISK; - -} /* end function disk_error() */ - -#endif /* !VMS */ - - - - - -/*****************************/ -/* Function UzpMessagePrnt() */ -/*****************************/ - -int UZ_EXP UzpMessagePrnt(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - ulg size; /* length of string (may include nulls) */ - int flag; /* flag bits */ -{ - /* IMPORTANT NOTE: - * The name of the first parameter of UzpMessagePrnt(), which passes - * the "Uz_Globs" address, >>> MUST <<< be identical to the string - * expansion of the __G__ macro in the REENTRANT case (see globals.h). - * This name identity is mandatory for the LoadFarString() macro - * (in the SMALL_MEM case) !!! - */ - int error; - uch *q=buf, *endbuf=buf+(unsigned)size; -#ifdef MORE - uch *p=buf; -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - int islinefeed = FALSE; -#endif -#endif - FILE *outfp; - - -/*--------------------------------------------------------------------------- - These tests are here to allow fine-tuning of UnZip's output messages, - but none of them will do anything without setting the appropriate bit - in the flag argument of every Info() statement which is to be turned - *off*. That is, all messages are currently turned on for all ports. - To turn off *all* messages, use the UzpMessageNull() function instead - of this one. - ---------------------------------------------------------------------------*/ - -#if (defined(OS2) && defined(DLL)) - if (MSG_NO_DLL2(flag)) /* if OS/2 DLL bit is set, do NOT print this msg */ - return 0; -#endif -#ifdef WINDLL - if (MSG_NO_WDLL(flag)) - return 0; -#endif -#ifdef WINDLL - if (MSG_NO_WGUI(flag)) - return 0; -#endif -/* -#ifdef ACORN_GUI - if (MSG_NO_AGUI(flag)) - return 0; -#endif - */ -#ifdef DLL /* don't display message if data is redirected */ - if (((Uz_Globs *)pG)->redirect_data && - !((Uz_Globs *)pG)->redirect_text) - return 0; -#endif - - if (MSG_STDERR(flag) && !((Uz_Globs *)pG)->UzO.tflag) - outfp = (FILE *)stderr; - else - outfp = (FILE *)stdout; - -#ifdef QUERY_TRNEWLN - /* some systems require termination of query prompts with '\n' to force - * immediate display */ - if (MSG_MNEWLN(flag)) { /* assumes writable buffer (e.g., slide[]) */ - *endbuf++ = '\n'; /* with room for one more char at end of buf */ - ++size; /* (safe assumption: only used for four */ - } /* short queries in extract.c and fileio.c) */ -#endif - - if (MSG_TNEWLN(flag)) { /* again assumes writable buffer: fragile... */ - if ((!size && !((Uz_Globs *)pG)->sol) || - (size && (endbuf[-1] != '\n'))) - { - *endbuf++ = '\n'; - ++size; - } - } - -#ifdef MORE -# ifdef SCREENSIZE - /* room for --More-- and one line of overlap: */ -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - SCREENSIZE(&((Uz_Globs *)pG)->height, &((Uz_Globs *)pG)->width); -# else - SCREENSIZE(&((Uz_Globs *)pG)->height, (int *)NULL); -# endif - ((Uz_Globs *)pG)->height -= 2; -# else - /* room for --More-- and one line of overlap: */ - ((Uz_Globs *)pG)->height = SCREENLINES - 2; -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - ((Uz_Globs *)pG)->width = SCREENWIDTH; -# endif -# endif -#endif /* MORE */ - - if (MSG_LNEWLN(flag) && !((Uz_Globs *)pG)->sol) { - /* not at start of line: want newline */ -#ifdef OS2DLL - if (!((Uz_Globs *)pG)->redirect_text) { -#endif - putc('\n', outfp); - fflush(outfp); -#ifdef MORE - if (((Uz_Globs *)pG)->M_flag) - { -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - ((Uz_Globs *)pG)->chars = 0; -#endif - ++((Uz_Globs *)pG)->numlines; - ++((Uz_Globs *)pG)->lines; - if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) - (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, - LoadFarString(MorePrompt), 1); - } -#endif /* MORE */ - if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && - !isatty(1) && isatty(2)) - { - /* error output from testing redirected: also send to stderr */ - putc('\n', stderr); - fflush(stderr); - } -#ifdef OS2DLL - } else - REDIRECTC('\n'); -#endif - ((Uz_Globs *)pG)->sol = TRUE; - } - - /* put zipfile name, filename and/or error/warning keywords here */ - -#ifdef MORE - if (((Uz_Globs *)pG)->M_flag -#ifdef OS2DLL - && !((Uz_Globs *)pG)->redirect_text -#endif - ) - { - while (p < endbuf) { - if (*p == '\n') { -#if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - islinefeed = TRUE; - } else if (SCREENLWRAP) { - if (*p == '\r') { - ((Uz_Globs *)pG)->chars = 0; - } else { -# ifdef TABSIZE - if (*p == '\t') - ((Uz_Globs *)pG)->chars += - (TABSIZE - (((Uz_Globs *)pG)->chars % TABSIZE)); - else -# endif - ++((Uz_Globs *)pG)->chars; - - if (((Uz_Globs *)pG)->chars >= ((Uz_Globs *)pG)->width) - islinefeed = TRUE; - } - } - if (islinefeed) { - islinefeed = FALSE; - ((Uz_Globs *)pG)->chars = 0; -#endif /* (SCREENWIDTH && SCREEN_LWRAP) */ - ++((Uz_Globs *)pG)->numlines; - ++((Uz_Globs *)pG)->lines; - if (((Uz_Globs *)pG)->lines >= ((Uz_Globs *)pG)->height) - { - if ((error = WriteTxtErr(q, p-q+1, outfp)) != 0) - return error; - fflush(outfp); - ((Uz_Globs *)pG)->sol = TRUE; - q = p + 1; - (*((Uz_Globs *)pG)->mpause)((zvoid *)pG, - LoadFarString(MorePrompt), 1); - } - } - INCSTR(p); - } /* end while */ - size = (ulg)(p - q); /* remaining text */ - } -#endif /* MORE */ - - if (size) { -#ifdef OS2DLL - if (!((Uz_Globs *)pG)->redirect_text) { -#endif - if ((error = WriteTxtErr(q, size, outfp)) != 0) - return error; -#ifndef VMS /* 2005-09-16 SMS. See note at "WriteTxtErr()", above. */ - fflush(outfp); -#endif - if (MSG_STDERR(flag) && ((Uz_Globs *)pG)->UzO.tflag && - !isatty(1) && isatty(2)) - { - /* error output from testing redirected: also send to stderr */ - if ((error = WriteTxtErr(q, size, stderr)) != 0) - return error; - fflush(stderr); - } -#ifdef OS2DLL - } else { /* GRR: this is ugly: hide with macro */ - if ((error = REDIRECTPRINT(q, size)) != 0) - return error; - } -#endif /* OS2DLL */ - ((Uz_Globs *)pG)->sol = (endbuf[-1] == '\n'); - } - return 0; - -} /* end function UzpMessagePrnt() */ - - - - - -#ifdef DLL - -/*****************************/ -/* Function UzpMessageNull() */ /* convenience routine for no output at all */ -/*****************************/ - -int UZ_EXP UzpMessageNull(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - ulg size; /* length of string (may include nulls) */ - int flag; /* flag bits */ -{ - return 0; - -} /* end function UzpMessageNull() */ - -#endif /* DLL */ - - - - - -/***********************/ -/* Function UzpInput() */ /* GRR: this is a placeholder for now */ -/***********************/ - -int UZ_EXP UzpInput(pG, buf, size, flag) - zvoid *pG; /* globals struct: always passed */ - uch *buf; /* preformatted string to be printed */ - int *size; /* (address of) size of buf and of returned string */ - int flag; /* flag bits (bit 0: no echo) */ -{ - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; buf = buf; flag = flag; - - *size = 0; - return 0; - -} /* end function UzpInput() */ - - - - - -#if (!defined(WINDLL) && !defined(MACOS)) - -/***************************/ -/* Function UzpMorePause() */ -/***************************/ - -void UZ_EXP UzpMorePause(pG, prompt, flag) - zvoid *pG; /* globals struct: always passed */ - ZCONST char *prompt; /* "--More--" prompt */ - int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */ -{ - uch c; - -/*--------------------------------------------------------------------------- - Print a prompt and wait for the user to press a key, then erase prompt - if possible. - ---------------------------------------------------------------------------*/ - - if (!((Uz_Globs *)pG)->sol) - fprintf(stderr, "\n"); - /* numlines may or may not be used: */ - fprintf(stderr, prompt, ((Uz_Globs *)pG)->numlines); - fflush(stderr); - if (flag & 1) { - do { - c = (uch)FGETCH(0); - } while ( -#ifdef THEOS - c != 17 && /* standard QUIT key */ -#endif - c != '\r' && c != '\n' && c != ' ' && c != 'q' && c != 'Q'); - } else - c = (uch)FGETCH(0); - - /* newline was not echoed, so cover up prompt line */ - fprintf(stderr, LoadFarString(HidePrompt)); - fflush(stderr); - - if ( -#ifdef THEOS - (c == 17) || /* standard QUIT key */ -#endif - (ToLower(c) == 'q')) { - DESTROYGLOBALS(); - EXIT(PK_COOL); - } - - ((Uz_Globs *)pG)->sol = TRUE; - -#ifdef MORE - /* space for another screen, enter for another line. */ - if ((flag & 1) && c == ' ') - ((Uz_Globs *)pG)->lines = 0; -#endif /* MORE */ - -} /* end function UzpMorePause() */ - -#endif /* !WINDLL && !MACOS */ - - - - -#ifndef WINDLL - -/**************************/ -/* Function UzpPassword() */ -/**************************/ - -int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn) - zvoid *pG; /* pointer to UnZip's internal global vars */ - int *rcnt; /* retry counter */ - char *pwbuf; /* buffer for password */ - int size; /* size of password buffer */ - ZCONST char *zfn; /* name of zip archive */ - ZCONST char *efn; /* name of archive entry being processed */ -{ -#if CRYPT - int r = IZ_PW_ENTERED; - char *m; - char *prompt; - -#ifndef REENTRANT - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; -#endif - - if (*rcnt == 0) { /* First call for current entry */ - *rcnt = 2; - if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) { - sprintf(prompt, LoadFarString(PasswPrompt), - FnFilter1(zfn), FnFilter2(efn)); - m = prompt; - } else - m = (char *)LoadFarString(PasswPrompt2); - } else { /* Retry call, previous password was wrong */ - (*rcnt)--; - prompt = NULL; - m = (char *)LoadFarString(PasswRetry); - } - - m = getp(__G__ m, pwbuf, size); - if (prompt != (char *)NULL) { - free(prompt); - } - if (m == (char *)NULL) { - r = IZ_PW_ERROR; - } - else if (*pwbuf == '\0') { - r = IZ_PW_CANCELALL; - } - return r; - -#else /* !CRYPT */ - /* tell picky compilers to shut up about "unused variable" warnings */ - pG = pG; rcnt = rcnt; pwbuf = pwbuf; size = size; zfn = zfn; efn = efn; - - return IZ_PW_ERROR; /* internal error; function should never get called */ -#endif /* ?CRYPT */ - -} /* end function UzpPassword() */ - - - - - -/**********************/ -/* Function handler() */ -/**********************/ - -void handler(signal) /* upon interrupt, turn on echo and exit cleanly */ - int signal; -{ - GETGLOBALS(); - -#if !(defined(SIGBUS) || defined(SIGSEGV)) /* add a newline if not at */ - (*G.message)((zvoid *)&G, slide, 0L, 0x41); /* start of line (to stderr; */ -#endif /* slide[] should be safe) */ - - echon(); - -#ifdef SIGBUS - if (signal == SIGBUS) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "bus error")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGBUS */ - -#ifdef SIGILL - if (signal == SIGILL) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "illegal instruction")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGILL */ - -#ifdef SIGSEGV - if (signal == SIGSEGV) { - Info(slide, 0x421, ((char *)slide, LoadFarString(ZipfileCorrupt), - "segmentation violation")); - DESTROYGLOBALS(); - EXIT(PK_BADERR); - } -#endif /* SIGSEGV */ - - /* probably ctrl-C */ - DESTROYGLOBALS(); -#if defined(AMIGA) && defined(__SASC) - _abort(); -#endif - EXIT(IZ_CTRLC); /* was EXIT(0), then EXIT(PK_ERR) */ -} - -#endif /* !WINDLL */ - - - - -#if (!defined(VMS) && !defined(CMS_MVS)) -#if (!defined(OS2) || defined(TIMESTAMP)) - -#if (!defined(HAVE_MKTIME) || defined(WIN32)) -/* also used in amiga/filedate.c and win32/win32.c */ -ZCONST ush ydays[] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -#endif - -/*******************************/ -/* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */ -/*******************************/ - -time_t dos_to_unix_time(dosdatetime) - ulg dosdatetime; -{ - time_t m_time; - -#ifdef HAVE_MKTIME - - ZCONST time_t now = time(NULL); - struct tm *tm; -# define YRBASE 1900 - - tm = localtime(&now); - tm->tm_isdst = -1; /* let mktime determine if DST is in effect */ - - /* dissect date */ - tm->tm_year = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); - tm->tm_mon = ((int)(dosdatetime >> 21) & 0x0f) - 1; - tm->tm_mday = ((int)(dosdatetime >> 16) & 0x1f); - - /* dissect time */ - tm->tm_hour = (int)((unsigned)dosdatetime >> 11) & 0x1f; - tm->tm_min = (int)((unsigned)dosdatetime >> 5) & 0x3f; - tm->tm_sec = (int)((unsigned)dosdatetime << 1) & 0x3e; - - m_time = mktime(tm); - NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ - TTrace((stderr, " final m_time = %lu\n", (ulg)m_time)); - -#else /* !HAVE_MKTIME */ - - int yr, mo, dy, hh, mm, ss; -#ifdef TOPS20 -# define YRBASE 1900 - struct tmx *tmx; - char temp[20]; -#else /* !TOPS20 */ -# define YRBASE 1970 - int leap; - unsigned days; - struct tm *tm; -#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) -#ifdef WIN32 - TIME_ZONE_INFORMATION tzinfo; - DWORD res; -#else /* ! WIN32 */ -#ifndef BSD4_4 /* GRR: change to !defined(MODERN) ? */ -#if (defined(BSD) || defined(MTS) || defined(__GO32__)) - struct timeb tbp; -#else /* !(BSD || MTS || __GO32__) */ -#ifdef DECLARE_TIMEZONE - extern time_t timezone; -#endif -#endif /* ?(BSD || MTS || __GO32__) */ -#endif /* !BSD4_4 */ -#endif /* ?WIN32 */ -#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ -#endif /* ?TOPS20 */ - - - /* dissect date */ - yr = ((int)(dosdatetime >> 25) & 0x7f) + (1980 - YRBASE); - mo = ((int)(dosdatetime >> 21) & 0x0f) - 1; - dy = ((int)(dosdatetime >> 16) & 0x1f) - 1; - - /* dissect time */ - hh = (int)((unsigned)dosdatetime >> 11) & 0x1f; - mm = (int)((unsigned)dosdatetime >> 5) & 0x3f; - ss = (int)((unsigned)dosdatetime & 0x1f) * 2; - -#ifdef TOPS20 - tmx = (struct tmx *)malloc(sizeof(struct tmx)); - sprintf (temp, "%02d/%02d/%02d %02d:%02d:%02d", mo+1, dy+1, yr, hh, mm, ss); - time_parse(temp, tmx, (char *)0); - m_time = time_make(tmx); - free(tmx); - -#else /* !TOPS20 */ - -/*--------------------------------------------------------------------------- - Calculate the number of seconds since the epoch, usually 1 January 1970. - ---------------------------------------------------------------------------*/ - - /* leap = # of leap yrs from YRBASE up to but not including current year */ - leap = ((yr + YRBASE - 1) / 4); /* leap year base factor */ - - /* calculate days from BASE to this year and add expired days this year */ - days = (yr * 365) + (leap - 492) + ydays[mo]; - - /* if year is a leap year and month is after February, add another day */ - if ((mo > 1) && ((yr+YRBASE)%4 == 0) && ((yr+YRBASE) != 2100)) - ++days; /* OK through 2199 */ - - /* convert date & time to seconds relative to 00:00:00, 01/01/YRBASE */ - m_time = (time_t)((unsigned long)(days + dy) * 86400L + - (unsigned long)hh * 3600L + - (unsigned long)(mm * 60 + ss)); - /* - 1; MS-DOS times always rounded up to nearest even second */ - TTrace((stderr, "dos_to_unix_time:\n")); - TTrace((stderr, " m_time before timezone = %lu\n", (ulg)m_time)); - -/*--------------------------------------------------------------------------- - Adjust for local standard timezone offset. - ---------------------------------------------------------------------------*/ - -#if (!defined(MACOS) && !defined(RISCOS) && !defined(QDOS) && !defined(TANDEM)) -#ifdef WIN32 - /* account for timezone differences */ - res = GetTimeZoneInformation(&tzinfo); - if (res != TIME_ZONE_ID_INVALID) - { - m_time += 60*(tzinfo.Bias); -#else /* !WIN32 */ -#if (defined(BSD) || defined(MTS) || defined(__GO32__)) -#ifdef BSD4_4 - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - if ((tm = localtime(&m_time)) != (struct tm *)NULL) - m_time -= tm->tm_gmtoff; /* sec. EAST of GMT: subtr. */ -#else /* !(BSD4_4 */ - ftime(&tbp); /* get `timezone' */ - m_time += tbp.timezone * 60L; /* seconds WEST of GMT: add */ -#endif /* ?(BSD4_4 || __EMX__) */ -#else /* !(BSD || MTS || __GO32__) */ - /* tzset was already called at start of process_zipfiles() */ - /* tzset(); */ /* set `timezone' variable */ -#ifndef __BEOS__ /* BeOS DR8 has no timezones... */ - m_time += timezone; /* seconds WEST of GMT: add */ -#endif -#endif /* ?(BSD || MTS || __GO32__) */ -#endif /* ?WIN32 */ - TTrace((stderr, " m_time after timezone = %lu\n", (ulg)m_time)); - -/*--------------------------------------------------------------------------- - Adjust for local daylight savings (summer) time. - ---------------------------------------------------------------------------*/ - -#ifndef BSD4_4 /* (DST already added to tm_gmtoff, so skip tm_isdst) */ - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - TIMET_TO_NATIVE(m_time) /* NOP unless MSC 7.0 or Macintosh */ - if (((tm = localtime((time_t *)&m_time)) != NULL) && tm->tm_isdst) -#ifdef WIN32 - m_time += 60L * tzinfo.DaylightBias; /* adjust with DST bias */ - else - m_time += 60L * tzinfo.StandardBias; /* add StdBias (normally 0) */ -#else - m_time -= 60L * 60L; /* adjust for daylight savings time */ -#endif - NATIVE_TO_TIMET(m_time) /* NOP unless MSC 7.0 or Macintosh */ - TTrace((stderr, " m_time after DST = %lu\n", (ulg)m_time)); -#endif /* !BSD4_4 */ -#ifdef WIN32 - } -#endif -#endif /* !MACOS && !RISCOS && !QDOS && !TANDEM */ -#endif /* ?TOPS20 */ - -#endif /* ?HAVE_MKTIME */ - - if ( (dosdatetime >= DOSTIME_2038_01_18) && - (m_time < (time_t)0x70000000L) ) - m_time = U_TIME_T_MAX; /* saturate in case of (unsigned) overflow */ - if (m_time < (time_t)0L) /* a converted DOS time cannot be negative */ - m_time = S_TIME_T_MAX; /* -> saturate at max signed time_t value */ - - return m_time; - -} /* end function dos_to_unix_time() */ - -#endif /* !OS2 || TIMESTAMP */ -#endif /* !VMS && !CMS_MVS */ - - - -#if (!defined(VMS) && !defined(OS2) && !defined(CMS_MVS)) - -/******************************/ -/* Function check_for_newer() */ /* used for overwriting/freshening/updating */ -/******************************/ - -int check_for_newer(__G__ filename) /* return 1 if existing file is newer */ - __GDEF /* or equal; 0 if older; -1 if doesn't */ - char *filename; /* exist yet */ -{ - time_t existing, archive; -#ifdef USE_EF_UT_TIME - iztimes z_utime; -#endif -#ifdef AOS_VS - long dyy, dmm, ddd, dhh, dmin, dss; - - - dyy = (lrec.last_mod_dos_datetime >> 25) + 1980; - dmm = (lrec.last_mod_dos_datetime >> 21) & 0x0f; - ddd = (lrec.last_mod_dos_datetime >> 16) & 0x1f; - dhh = (lrec.last_mod_dos_datetime >> 11) & 0x1f; - dmin = (lrec.last_mod_dos_datetime >> 5) & 0x3f; - dss = (lrec.last_mod_dos_datetime & 0x1f) * 2; - - /* under AOS/VS, file times can only be set at creation time, - * with the info in a special DG format. Make sure we can create - * it here - we delete it later & re-create it, whether or not - * it exists now. - */ - if (!zvs_create(filename, (((ulg)dgdate(dmm, ddd, dyy)) << 16) | - (dhh*1800L + dmin*30L + dss/2L), -1L, -1L, (char *) -1, -1, -1, -1)) - return DOES_NOT_EXIST; -#endif /* AOS_VS */ - - Trace((stderr, "check_for_newer: doing stat(%s)\n", FnFilter1(filename))); - if (SSTAT(filename, &G.statbuf)) { - Trace((stderr, - "check_for_newer: stat(%s) returns %d: file does not exist\n", - FnFilter1(filename), SSTAT(filename, &G.statbuf))); -#ifdef SYMLINKS - Trace((stderr, "check_for_newer: doing lstat(%s)\n", - FnFilter1(filename))); - /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ - if (lstat(filename, &G.statbuf) == 0) { - Trace((stderr, - "check_for_newer: lstat(%s) returns 0: symlink does exist\n", - FnFilter1(filename))); - if (QCOND2 && !IS_OVERWRT_ALL) - Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), - FnFilter1(filename), " with no real file")); - return EXISTS_AND_OLDER; /* symlink dates are meaningless */ - } -#endif /* SYMLINKS */ - return DOES_NOT_EXIST; - } - Trace((stderr, "check_for_newer: stat(%s) returns 0: file exists\n", - FnFilter1(filename))); - -#ifdef SYMLINKS - /* GRR OPTION: could instead do this test ONLY if G.symlnk is true */ - if (lstat(filename, &G.statbuf) == 0 && S_ISLNK(G.statbuf.st_mode)) { - Trace((stderr, "check_for_newer: %s is a symbolic link\n", - FnFilter1(filename))); - if (QCOND2 && !IS_OVERWRT_ALL) - Info(slide, 0, ((char *)slide, LoadFarString(FileIsSymLink), - FnFilter1(filename), "")); - return EXISTS_AND_OLDER; /* symlink dates are meaningless */ - } -#endif /* SYMLINKS */ - - NATIVE_TO_TIMET(G.statbuf.st_mtime) /* NOP unless MSC 7.0 or Macintosh */ - -#ifdef USE_EF_UT_TIME - /* The `Unix extra field mtime' should be used for comparison with the - * time stamp of the existing file >>>ONLY<<< when the EF info is also - * used to set the modification time of the extracted file. - */ - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.lrec.extra_field_length, 0, - G.lrec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME)) - { - TTrace((stderr, "check_for_newer: using Unix extra field mtime\n")); - existing = G.statbuf.st_mtime; - archive = z_utime.mtime; - } else { - /* round up existing filetime to nearest 2 seconds for comparison, - * but saturate in case of arithmetic overflow - */ - existing = ((G.statbuf.st_mtime & 1) && - (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? - G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; - archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - } -#else /* !USE_EF_UT_TIME */ - /* round up existing filetime to nearest 2 seconds for comparison, - * but saturate in case of arithmetic overflow - */ - existing = ((G.statbuf.st_mtime & 1) && - (G.statbuf.st_mtime + 1 > G.statbuf.st_mtime)) ? - G.statbuf.st_mtime + 1 : G.statbuf.st_mtime; - archive = dos_to_unix_time(G.lrec.last_mod_dos_datetime); -#endif /* ?USE_EF_UT_TIME */ - - TTrace((stderr, "check_for_newer: existing %lu, archive %lu, e-a %ld\n", - (ulg)existing, (ulg)archive, (long)(existing-archive))); - - return (existing >= archive); - -} /* end function check_for_newer() */ - -#endif /* !VMS && !OS2 && !CMS_MVS */ - - - - - -/************************/ -/* Function do_string() */ -/************************/ - -int do_string(__G__ length, option) /* return PK-type error code */ - __GDEF - unsigned int length; /* without prototype, ush converted to this */ - int option; -{ - unsigned comment_bytes_left; - unsigned int block_len; - int error=PK_OK; -#ifdef AMIGA - char tmp_fnote[2 * AMIGA_FILENOTELEN]; /* extra room for squozen chars */ -#endif - - -/*--------------------------------------------------------------------------- - This function processes arbitrary-length (well, usually) strings. Four - major options are allowed: SKIP, wherein the string is skipped (pretty - logical, eh?); DISPLAY, wherein the string is printed to standard output - after undergoing any necessary or unnecessary character conversions; - DS_FN, wherein the string is put into the filename[] array after under- - going appropriate conversions (including case-conversion, if that is - indicated: see the global variable pInfo->lcflag); and EXTRA_FIELD, - wherein the `string' is assumed to be an extra field and is copied to - the (freshly malloced) buffer G.extra_field. The third option should - be OK since filename is dimensioned at 1025, but we check anyway. - - The string, by the way, is assumed to start at the current file-pointer - position; its length is given by 'length'. So start off by checking the - length of the string: if zero, we're already done. - ---------------------------------------------------------------------------*/ - - if (!length) - return PK_COOL; - - switch (option) { - -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - /* - * Special case: See if the comment begins with an autorun command line. - * Save that and display (or skip) the remainder. - */ - - case CHECK_AUTORUN: - case CHECK_AUTORUN_Q: - comment_bytes_left = length; - if (length >= 10) - { - block_len = readbuf(__G__ (char *)G.outbuf, 10); - if (block_len == 0) - return PK_EOF; - comment_bytes_left -= block_len; - G.outbuf[block_len] = '\0'; - if (!strcmp((char *)G.outbuf, "$AUTORUN$>")) { - char *eol; - length -= 10; - block_len = readbuf(__G__ G.autorun_command, - MIN(length, sizeof(G.autorun_command)-1)); - if (block_len == 0) - return PK_EOF; - comment_bytes_left -= block_len; - G.autorun_command[block_len] = '\0'; - A_TO_N(G.autorun_command); - eol = strchr(G.autorun_command, '\n'); - if (!eol) - eol = G.autorun_command + strlen(G.autorun_command) - 1; - length -= eol + 1 - G.autorun_command; - while (eol >= G.autorun_command && isspace(*eol)) - *eol-- = '\0'; -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM(G.autorun_command, G.autorun_command); -#endif /* (WIN32 && !_WIN32_WCE) */ - } - } - if (option == CHECK_AUTORUN_Q) /* don't display the remainder */ - length = 0; - /* seek to beginning of remaining part of comment -- rewind if */ - /* displaying entire comment, or skip to end if discarding it */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr - G.inbuf) + comment_bytes_left - length); - if (!length) - break; - /* FALL THROUGH... */ -#endif /* SFX && CHEAP_SFX_AUTORUN */ - - /* - * First normal case: print string on standard output. First set loop - * variables, then loop through the comment in chunks of OUTBUFSIZ bytes, - * converting formats and printing as we go. The second half of the - * loop conditional was added because the file might be truncated, in - * which case comment_bytes_left will remain at some non-zero value for - * all time. outbuf and slide are used as scratch buffers because they - * are available (we should be either before or in between any file pro- - * cessing). - */ - - case DISPLAY: - case DISPL_8: - comment_bytes_left = length; - block_len = OUTBUFSIZ; /* for the while statement, first time */ - while (comment_bytes_left > 0 && block_len > 0) { - register uch *p = G.outbuf; - register uch *q = G.outbuf; - - if ((block_len = readbuf(__G__ (char *)G.outbuf, - MIN((unsigned)OUTBUFSIZ, comment_bytes_left))) == 0) - return PK_EOF; - comment_bytes_left -= block_len; - - /* this is why we allocated an extra byte for outbuf: terminate - * with zero (ASCIIZ) */ - G.outbuf[block_len] = '\0'; - - /* remove all ASCII carriage returns from comment before printing - * (since used before A_TO_N(), check for CR instead of '\r') - */ - while (*p) { - while (*p == CR) - ++p; - *q++ = *p++; - } - /* could check whether (p - outbuf) == block_len here */ - *q = '\0'; - - if (option == DISPL_8) { - /* translate the text coded in the entry's host-dependent - "extended ASCII" charset into the compiler's (system's) - internal text code page */ - Ext_ASCII_TO_Native((char *)G.outbuf, G.pInfo->hostnum, - G.pInfo->hostver, G.pInfo->HasUxAtt, - FALSE); -#ifdef WINDLL - /* translate to ANSI (RTL internal codepage may be OEM) */ - INTERN_TO_ISO((char *)G.outbuf, (char *)G.outbuf); -#else /* !WINDLL */ -#if (defined(WIN32) && !defined(_WIN32_WCE)) - /* Win9x console always uses OEM character coding, and - WinNT console is set to OEM charset by default, too */ - INTERN_TO_OEM((char *)G.outbuf, (char *)G.outbuf); -#endif /* (WIN32 && !_WIN32_WCE) */ -#endif /* ?WINDLL */ - } else { - A_TO_N(G.outbuf); /* translate string to native */ - } - -#ifdef WINDLL - /* ran out of local mem -- had to cheat */ - win_fprintf((zvoid *)&G, stdout, (extent)(q-G.outbuf), - (char *)G.outbuf); - win_fprintf((zvoid *)&G, stdout, 2, (char *)"\n\n"); -#else /* !WINDLL */ -#ifdef NOANSIFILT /* GRR: can ANSI be used with EBCDIC? */ - (*G.message)((zvoid *)&G, G.outbuf, (ulg)(q-G.outbuf), 0); -#else /* ASCII, filter out ANSI escape sequences and handle ^S (pause) */ - p = G.outbuf - 1; - q = slide; - while (*++p) { - int pause = FALSE; - - if (*p == 0x1B) { /* ASCII escape char */ - *q++ = '^'; - *q++ = '['; - } else if (*p == 0x13) { /* ASCII ^S (pause) */ - pause = TRUE; - if (p[1] == LF) /* ASCII LF */ - *q++ = *++p; - else if (p[1] == CR && p[2] == LF) { /* ASCII CR LF */ - *q++ = *++p; - *q++ = *++p; - } - } else - *q++ = *p; - if ((unsigned)(q-slide) > WSIZE-3 || pause) { /* flush */ - (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); - q = slide; - if (pause && G.extract_flag) /* don't pause for list/test */ - (*G.mpause)((zvoid *)&G, LoadFarString(QuitPrompt), 0); - } - } - (*G.message)((zvoid *)&G, slide, (ulg)(q-slide), 0); -#endif /* ?NOANSIFILT */ -#endif /* ?WINDLL */ - } - /* add '\n' if not at start of line */ - (*G.message)((zvoid *)&G, slide, 0L, 0x40); - break; - - /* - * Second case: read string into filename[] array. The filename should - * never ever be longer than FILNAMSIZ-1 (1024), but for now we'll check, - * just to be sure. - */ - - case DS_FN: - case DS_FN_L: -#ifdef UNICODE_SUPPORT - /* get the whole filename as need it for Unicode checksum */ - if (G.fnfull_bufsize <= length) { - extent fnbufsiz = FILNAMSIZ; - - if (fnbufsiz <= length) - fnbufsiz = length + 1; - if (G.filename_full) - free(G.filename_full); - G.filename_full = malloc(fnbufsiz); - if (G.filename_full == NULL) - return PK_MEM; - G.fnfull_bufsize = fnbufsiz; - } - if (readbuf(__G__ G.filename_full, length) == 0) - return PK_EOF; - G.filename_full[length] = '\0'; /* terminate w/zero: ASCIIZ */ - - /* if needed, chop off end so standard filename is a valid length */ - if (length >= FILNAMSIZ) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameTooLongTrunc))); - error = PK_WARN; - length = FILNAMSIZ - 1; - } - /* no excess size */ - block_len = 0; - strncpy(G.filename, G.filename_full, length); - G.filename[length] = '\0'; /* terminate w/zero: ASCIIZ */ -#else /* !UNICODE_SUPPORT */ - if (length >= FILNAMSIZ) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameTooLongTrunc))); - error = PK_WARN; - /* remember excess length in block_len */ - block_len = length - (FILNAMSIZ - 1); - length = FILNAMSIZ - 1; - } else - /* no excess size */ - block_len = 0; - if (readbuf(__G__ G.filename, length) == 0) - return PK_EOF; - G.filename[length] = '\0'; /* terminate w/zero: ASCIIZ */ -#endif /* ?UNICODE_SUPPORT */ - - /* translate the Zip entry filename coded in host-dependent "extended - ASCII" into the compiler's (system's) internal text code page */ - Ext_ASCII_TO_Native(G.filename, G.pInfo->hostnum, G.pInfo->hostver, - G.pInfo->HasUxAtt, (option == DS_FN_L)); - - if (G.pInfo->lcflag) /* replace with lowercase filename */ - STRLOWER(G.filename, G.filename); - - if (G.pInfo->vollabel && length > 8 && G.filename[8] == '.') { - char *p = G.filename+8; - while (*p++) - p[-1] = *p; /* disk label, and 8th char is dot: remove dot */ - } - - if (!block_len) /* no overflow, we're done here */ - break; - - /* - * We truncated the filename, so print what's left and then fall - * through to the SKIP routine. - */ - Info(slide, 0x401, ((char *)slide, "[ %s ]\n", FnFilter1(G.filename))); - length = block_len; /* SKIP the excess bytes... */ - /* FALL THROUGH... */ - - /* - * Third case: skip string, adjusting readbuf's internal variables - * as necessary (and possibly skipping to and reading a new block of - * data). - */ - - case SKIP: - /* cur_zipfile_bufstart already takes account of extra_bytes, so don't - * correct for it twice: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr-G.inbuf) + length); - break; - - /* - * Fourth case: assume we're at the start of an "extra field"; malloc - * storage for it and read data into the allocated space. - */ - - case EXTRA_FIELD: - if (G.extra_field != (uch *)NULL) - free(G.extra_field); - if ((G.extra_field = (uch *)malloc(length)) == (uch *)NULL) { - Info(slide, 0x401, ((char *)slide, LoadFarString(ExtraFieldTooLong), - length)); - /* cur_zipfile_bufstart already takes account of extra_bytes, - * so don't correct for it twice: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes + - (G.inptr-G.inbuf) + length); - } else { - if (readbuf(__G__ (char *)G.extra_field, length) == 0) - return PK_EOF; - /* Looks like here is where extra fields are read */ - getZip64Data(__G__ G.extra_field, length); -#ifdef UNICODE_SUPPORT - G.unipath_filename = NULL; - if (G.UzO.U_flag < 2) { - /* check if GPB11 (General Purpuse Bit 11) is set indicating - the standard path and comment are UTF-8 */ - if (G.pInfo->GPFIsUTF8) { - /* if GPB11 set then filename_full is untruncated UTF-8 */ - G.unipath_filename = G.filename_full; - } else { - /* Get the Unicode fields if exist */ - getUnicodeData(__G__ G.extra_field, length); - if (G.unipath_filename && strlen(G.unipath_filename) == 0) { - /* the standard filename field is UTF-8 */ - free(G.unipath_filename); - G.unipath_filename = G.filename_full; - } - } - if (G.unipath_filename) { -# ifdef UTF8_MAYBE_NATIVE - if (G.native_is_utf8 -# ifdef UNICODE_WCHAR - && (!G.unicode_escape_all) -# endif - ) { - strncpy(G.filename, G.unipath_filename, FILNAMSIZ - 1); - /* make sure filename is short enough */ - if (strlen(G.unipath_filename) >= FILNAMSIZ) { - G.filename[FILNAMSIZ - 1] = '\0'; - Info(slide, 0x401, ((char *)slide, - LoadFarString(UFilenameTooLongTrunc))); - error = PK_WARN; - } - } -# ifdef UNICODE_WCHAR - else -# endif -# endif /* UTF8_MAYBE_NATIVE */ -# ifdef UNICODE_WCHAR - { - char *fn; - - /* convert UTF-8 to local character set */ - fn = utf8_to_local_string(G.unipath_filename, - G.unicode_escape_all); - /* make sure filename is short enough */ - if (strlen(fn) >= FILNAMSIZ) { - fn[FILNAMSIZ - 1] = '\0'; - Info(slide, 0x401, ((char *)slide, - LoadFarString(UFilenameTooLongTrunc))); - error = PK_WARN; - } - /* replace filename with converted UTF-8 */ - strcpy(G.filename, fn); - free(fn); - } -# endif /* UNICODE_WCHAR */ - if (G.unipath_filename != G.filename_full) - free(G.unipath_filename); - G.unipath_filename = NULL; - } - } -#endif /* UNICODE_SUPPORT */ - } - break; - -#ifdef AMIGA - /* - * Fifth case, for the Amiga only: take the comment that would ordinarily - * be skipped over, and turn it into a 79 character string that will be - * attached to the file as a "filenote" after it is extracted. - */ - - case FILENOTE: - if ((block_len = readbuf(__G__ tmp_fnote, (unsigned) - MIN(length, 2 * AMIGA_FILENOTELEN - 1))) == 0) - return PK_EOF; - if ((length -= block_len) > 0) /* treat remainder as in case SKIP: */ - seek_zipf(__G__ G.cur_zipfile_bufstart - G.extra_bytes - + (G.inptr - G.inbuf) + length); - /* convert multi-line text into single line with no ctl-chars: */ - tmp_fnote[block_len] = '\0'; - while ((short int) --block_len >= 0) - if ((unsigned) tmp_fnote[block_len] < ' ') - if (tmp_fnote[block_len+1] == ' ') /* no excess */ - strcpy(tmp_fnote+block_len, tmp_fnote+block_len+1); - else - tmp_fnote[block_len] = ' '; - tmp_fnote[AMIGA_FILENOTELEN - 1] = '\0'; - if (G.filenotes[G.filenote_slot]) - free(G.filenotes[G.filenote_slot]); /* should not happen */ - G.filenotes[G.filenote_slot] = NULL; - if (tmp_fnote[0]) { - if (!(G.filenotes[G.filenote_slot] = malloc(strlen(tmp_fnote)+1))) - return PK_MEM; - strcpy(G.filenotes[G.filenote_slot], tmp_fnote); - } - break; -#endif /* AMIGA */ - - } /* end switch (option) */ - - return error; - -} /* end function do_string() */ - - - - - -/***********************/ -/* Function makeword() */ -/***********************/ - -ush makeword(b) - ZCONST uch *b; -{ - /* - * Convert Intel style 'short' integer to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (ush)((b[1] << 8) | b[0]); -} - - - - - -/***********************/ -/* Function makelong() */ -/***********************/ - -ulg makelong(sig) - ZCONST uch *sig; -{ - /* - * Convert intel style 'long' variable to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (ulg)((((unsigned)sig[1]) << 8) - + ((unsigned)sig[0])); -} - - - - - -/************************/ -/* Function makeint64() */ -/************************/ - -zusz_t makeint64(sig) - ZCONST uch *sig; -{ -#ifdef LARGE_FILE_SUPPORT - /* - * Convert intel style 'int64' variable to non-Intel non-16-bit - * host format. This routine also takes care of byte-ordering. - */ - return (((zusz_t)sig[7]) << 56) - + (((zusz_t)sig[6]) << 48) - + (((zusz_t)sig[4]) << 32) - + (zusz_t)((((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (((unsigned)sig[1]) << 8) - + (sig[0])); - -#else /* !LARGE_FILE_SUPPORT */ - - if ((sig[7] | sig[6] | sig[5] | sig[4]) != 0) - return (zusz_t)0xffffffffL; - else - return (zusz_t)((((ulg)sig[3]) << 24) - + (((ulg)sig[2]) << 16) - + (((unsigned)sig[1]) << 8) - + (sig[0])); - -#endif /* ?LARGE_FILE_SUPPORT */ -} - - - - - -/*********************/ -/* Function fzofft() */ -/*********************/ - -/* Format a zoff_t value in a cylindrical buffer set. */ -char *fzofft(__G__ val, pre, post) - __GDEF - zoff_t val; - ZCONST char *pre; - ZCONST char *post; -{ - /* Storage cylinder. (now in globals.h) */ - /*static char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];*/ - /*static int fzofft_index = 0;*/ - - /* Temporary format string storage. */ - char fmt[16]; - - /* Assemble the format string. */ - fmt[0] = '%'; - fmt[1] = '\0'; /* Start after initial "%". */ - if (pre == FZOFFT_HEX_WID) /* Special hex width. */ - { - strcat(fmt, FZOFFT_HEX_WID_VALUE); - } - else if (pre == FZOFFT_HEX_DOT_WID) /* Special hex ".width". */ - { - strcat(fmt, "."); - strcat(fmt, FZOFFT_HEX_WID_VALUE); - } - else if (pre != NULL) /* Caller's prefix (width). */ - { - strcat(fmt, pre); - } - - strcat(fmt, FZOFFT_FMT); /* Long or long-long or whatever. */ - - if (post == NULL) - strcat(fmt, "d"); /* Default radix = decimal. */ - else - strcat(fmt, post); /* Caller's radix. */ - - /* Advance the cylinder. */ - G.fzofft_index = (G.fzofft_index + 1) % FZOFFT_NUM; - - /* Write into the current chamber. */ - sprintf(G.fzofft_buf[G.fzofft_index], fmt, val); - - /* Return a pointer to this chamber. */ - return G.fzofft_buf[G.fzofft_index]; -} - - - - -#if CRYPT - -#ifdef NEED_STR2ISO -/**********************/ -/* Function str2iso() */ -/**********************/ - -char *str2iso(dst, src) - char *dst; /* destination buffer */ - register ZCONST char *src; /* source string */ -{ -#ifdef INTERN_TO_ISO - INTERN_TO_ISO(src, dst); -#else - register uch c; - register char *dstp = dst; - - do { - c = (uch)foreign(*src++); - *dstp++ = (char)ASCII2ISO(c); - } while (c != '\0'); -#endif - - return dst; -} -#endif /* NEED_STR2ISO */ - - -#ifdef NEED_STR2OEM -/**********************/ -/* Function str2oem() */ -/**********************/ - -char *str2oem(dst, src) - char *dst; /* destination buffer */ - register ZCONST char *src; /* source string */ -{ -#ifdef INTERN_TO_OEM - INTERN_TO_OEM(src, dst); -#else - register uch c; - register char *dstp = dst; - - do { - c = (uch)foreign(*src++); - *dstp++ = (char)ASCII2OEM(c); - } while (c != '\0'); -#endif - - return dst; -} -#endif /* NEED_STR2OEM */ - -#endif /* CRYPT */ - - -#ifdef ZMEM /* memset/memcmp/memcpy for systems without either them or */ - /* bzero/bcmp/bcopy */ - /* (no known systems as of 960211) */ - -/*********************/ -/* Function memset() */ -/*********************/ - -zvoid *memset(buf, init, len) - register zvoid *buf; /* buffer location */ - register int init; /* initializer character */ - register unsigned int len; /* length of the buffer */ -{ - zvoid *start; - - start = buf; - while (len--) - *((char *)buf++) = (char)init; - return start; -} - - - -/*********************/ -/* Function memcmp() */ -/*********************/ - -int memcmp(b1, b2, len) - register ZCONST zvoid *b1; - register ZCONST zvoid *b2; - register unsigned int len; -{ - register int c; - - if (len > 0) do { - if ((c = (int)(*((ZCONST unsigned char *)b1)++) - - (int)(*((ZCONST unsigned char *)b2)++)) != 0) - return c; - } while (--len > 0) - return 0; -} - - - -/*********************/ -/* Function memcpy() */ -/*********************/ - -zvoid *memcpy(dst, src, len) - register zvoid *dst; - register ZCONST zvoid *src; - register unsigned int len; -{ - zvoid *start; - - start = dst; - while (len-- > 0) - *((char *)dst)++ = *((ZCONST char *)src)++; - return start; -} - -#endif /* ZMEM */ - - - - -#ifdef NO_STRNICMP - -/************************/ -/* Function zstrnicmp() */ -/************************/ - -int zstrnicmp(s1, s2, n) - register ZCONST char *s1, *s2; - register unsigned n; -{ - for (; n > 0; --n, ++s1, ++s2) { - - if (ToLower(*s1) != ToLower(*s2)) - /* test includes early termination of one string */ - return ((uch)ToLower(*s1) < (uch)ToLower(*s2))? -1 : 1; - - if (*s1 == '\0') /* both strings terminate early */ - return 0; - } - return 0; -} - -#endif /* NO_STRNICMP */ - - - - -#ifdef REGULUS /* returns the inode number on success(!)...argh argh argh */ -# undef stat - -/********************/ -/* Function zstat() */ -/********************/ - -int zstat(p, s) - ZCONST char *p; - struct stat *s; -{ - return (stat((char *)p,s) >= 0? 0 : (-1)); -} - -#endif /* REGULUS */ - - - - -#ifdef _MBCS - -/* DBCS support for Info-ZIP's zip (mainly for japanese (-: ) - * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) - * This code is public domain! Date: 1998/12/20 - */ - -/************************/ -/* Function plastchar() */ -/************************/ - -char *plastchar(ptr, len) - ZCONST char *ptr; - extent len; -{ - unsigned clen; - ZCONST char *oldptr = ptr; - while(*ptr != '\0' && len > 0){ - oldptr = ptr; - clen = CLEN(ptr); - ptr += clen; - len -= clen; - } - return (char *)oldptr; -} - - -#ifdef NEED_UZMBCLEN -/***********************/ -/* Function uzmbclen() */ -/***********************/ - -extent uzmbclen(ptr) - ZCONST unsigned char *ptr; -{ - int mbl; - - mbl = mblen((ZCONST char *)ptr, MB_CUR_MAX); - /* For use in code scanning through MBCS strings, we need a strictly - positive "MB char bytes count". For our scanning purpose, it is not - not relevant whether the MB character is valid or not. And, the NUL - char '\0' has a byte count of 1, but mblen() returns 0. So, we make - sure that the uzmbclen() return value is not less than 1. - */ - return (extent)(mbl > 0 ? mbl : 1); -} -#endif /* NEED_UZMBCLEN */ - - -#ifdef NEED_UZMBSCHR -/***********************/ -/* Function uzmbschr() */ -/***********************/ - -unsigned char *uzmbschr(str, c) - ZCONST unsigned char *str; - unsigned int c; -{ - while(*str != '\0'){ - if (*str == c) {return (unsigned char *)str;} - INCSTR(str); - } - return NULL; -} -#endif /* NEED_UZMBSCHR */ - - -#ifdef NEED_UZMBSRCHR -/************************/ -/* Function uzmbsrchr() */ -/************************/ - -unsigned char *uzmbsrchr(str, c) - ZCONST unsigned char *str; - unsigned int c; -{ - unsigned char *match = NULL; - while(*str != '\0'){ - if (*str == c) {match = (unsigned char *)str;} - INCSTR(str); - } - return match; -} -#endif /* NEED_UZMBSRCHR */ -#endif /* _MBCS */ - - - - - -#ifdef SMALL_MEM - -/*******************************/ -/* Function fLoadFarString() */ /* (and friends...) */ -/*******************************/ - -char *fLoadFarString(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchBigBuffer, sz); - return G.rgchBigBuffer; -} - -char *fLoadFarStringSmall(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchSmallBuffer, sz); - return G.rgchSmallBuffer; -} - -char *fLoadFarStringSmall2(__GPRO__ const char Far *sz) -{ - (void)zfstrcpy(G.rgchSmallBuffer2, sz); - return G.rgchSmallBuffer2; -} - - - - -#if (!defined(_MSC_VER) || (_MSC_VER < 600)) -/*************************/ -/* Function zfstrcpy() */ /* portable clone of _fstrcpy() */ -/*************************/ - -char Far * Far zfstrcpy(char Far *s1, const char Far *s2) -{ - char Far *p = s1; - - while ((*s1++ = *s2++) != '\0'); - return p; -} - -#if (!(defined(SFX) || defined(FUNZIP))) -/*************************/ -/* Function zfstrcmp() */ /* portable clone of _fstrcmp() */ -/*************************/ - -int Far zfstrcmp(const char Far *s1, const char Far *s2) -{ - int ret; - - while ((ret = (int)(uch)*s1 - (int)(uch)*s2) == 0 - && *s2 != '\0') { - ++s2; ++s1; - } - return ret; -} -#endif /* !(SFX || FUNZIP) */ -#endif /* !_MSC_VER || (_MSC_VER < 600) */ - -#endif /* SMALL_MEM */ diff --git a/data/windows/unzipfx-catia/globals.c b/data/windows/unzipfx-catia/globals.c deleted file mode 100644 index fa8cca5..0000000 --- a/data/windows/unzipfx-catia/globals.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2003-May-08 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - globals.c - - Routines to allocate and initialize globals, with or without threads. - - Contents: registerGlobalPointer() - deregisterGlobalPointer() - getGlobalPointer() - globalsCtor() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifndef FUNZIP -/* initialization of sigs is completed at runtime so unzip(sfx) executable - * won't look like a zipfile - */ -char central_hdr_sig[4] = {0, 0, 0x01, 0x02}; -char local_hdr_sig[4] = {0, 0, 0x03, 0x04}; -char end_central_sig[4] = {0, 0, 0x05, 0x06}; -char end_central64_sig[4] = {0, 0, 0x06, 0x06}; -char end_centloc64_sig[4] = {0, 0, 0x06, 0x07}; -/* extern char extd_local_sig[4] = {0, 0, 0x07, 0x08}; NOT USED YET */ - -ZCONST char *fnames[2] = {"*", NULL}; /* default filenames vector */ -#endif - - -#ifndef REENTRANT - Uz_Globs G; -#else /* REENTRANT */ - -# ifndef USETHREADID - Uz_Globs *GG; -# else /* USETHREADID */ -# define THREADID_ENTRIES 0x40 - - int lastScan; - Uz_Globs *threadPtrTable[THREADID_ENTRIES]; - ulg threadIdTable [THREADID_ENTRIES] = { - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* Make sure there are */ - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, /* THREADID_ENTRIES 0s */ - 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 - }; - - static ZCONST char Far TooManyThreads[] = - "error: more than %d simultaneous threads.\n\ - Some threads are probably not calling DESTROYTHREAD()\n"; - static ZCONST char Far EntryNotFound[] = - "error: couldn't find global pointer in table.\n\ - Maybe somebody accidentally called DESTROYTHREAD() twice.\n"; - static ZCONST char Far GlobalPointerMismatch[] = - "error: global pointer in table does not match pointer passed as\ - parameter\n"; - -static void registerGlobalPointer OF((__GPRO)); - - - -static void registerGlobalPointer(__G) - __GDEF -{ - int scan=0; - ulg tid = GetThreadId(); - - while (threadIdTable[scan] && scan < THREADID_ENTRIES) - scan++; - - if (scan == THREADID_ENTRIES) { - ZCONST char *tooMany = LoadFarString(TooManyThreads); - Info(slide, 0x421, ((char *)slide, tooMany, THREADID_ENTRIES)); - free(pG); - EXIT(PK_MEM); /* essentially memory error before we've started */ - } - - threadIdTable [scan] = tid; - threadPtrTable[scan] = pG; - lastScan = scan; -} - - - -void deregisterGlobalPointer(__G) - __GDEF -{ - int scan=0; - ulg tid = GetThreadId(); - - - while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) - scan++; - -/*--------------------------------------------------------------------------- - There are two things we can do if we can't find the entry: ignore it or - scream. The most likely reason for it not to be here is the user calling - this routine twice. Since this could cause BIG problems if any globals - are accessed after the first call, we'd better scream. - ---------------------------------------------------------------------------*/ - - if (scan == THREADID_ENTRIES || threadPtrTable[scan] != pG) { - ZCONST char *noEntry; - if (scan == THREADID_ENTRIES) - noEntry = LoadFarString(EntryNotFound); - else - noEntry = LoadFarString(GlobalPointerMismatch); - Info(slide, 0x421, ((char *)slide, noEntry)); - EXIT(PK_WARN); /* programming error, but after we're all done */ - } - - threadIdTable [scan] = 0; - lastScan = scan; - free(threadPtrTable[scan]); -} - - - -Uz_Globs *getGlobalPointer() -{ - int scan=0; - ulg tid = GetThreadId(); - - while (threadIdTable[scan] != tid && scan < THREADID_ENTRIES) - scan++; - -/*--------------------------------------------------------------------------- - There are two things we can do if we can't find the entry: ignore it or - scream. The most likely reason for it not to be here is the user calling - this routine twice. Since this could cause BIG problems if any globals - are accessed after the first call, we'd better scream. - ---------------------------------------------------------------------------*/ - - if (scan == THREADID_ENTRIES) { - ZCONST char *noEntry = LoadFarString(EntryNotFound); - fprintf(stderr, noEntry); /* can't use Info w/o a global pointer */ - EXIT(PK_ERR); /* programming error while still working */ - } - - return threadPtrTable[scan]; -} - -# endif /* ?USETHREADID */ -#endif /* ?REENTRANT */ - - - -Uz_Globs *globalsCtor() -{ -#ifdef REENTRANT - Uz_Globs *pG = (Uz_Globs *)malloc(sizeof(Uz_Globs)); - - if (!pG) - return (Uz_Globs *)NULL; -#endif /* REENTRANT */ - - /* for REENTRANT version, G is defined as (*pG) */ - - memzero(&G, sizeof(Uz_Globs)); - -#ifndef FUNZIP -#ifdef CMS_MVS - uO.aflag=1; - uO.C_flag=1; -#endif -#ifdef TANDEM - uO.aflag=1; /* default to '-a' auto create Text Files as type 101 */ -#endif -#ifdef VMS -# if (!defined(NO_TIMESTAMPS)) - uO.D_flag=1; /* default to '-D', no restoration of dir timestamps */ -# endif -#endif - - uO.lflag=(-1); - G.wildzipfn = ""; - G.pfnames = (char **)fnames; - G.pxnames = (char **)&fnames[1]; - G.pInfo = G.info; - G.sol = TRUE; /* at start of line */ - - G.message = UzpMessagePrnt; - G.input = UzpInput; /* not used by anyone at the moment... */ -#if defined(WINDLL) || defined(MACOS) - G.mpause = NULL; /* has scrollbars: no need for pausing */ -#else - G.mpause = UzpMorePause; -#endif - G.decr_passwd = UzpPassword; -#endif /* !FUNZIP */ - -#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) -#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) - G.echofd = -1; -#endif /* !(MACOS || ATARI || VMS) */ -#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ - -#ifdef SYSTEM_SPECIFIC_CTOR - SYSTEM_SPECIFIC_CTOR(__G); -#endif - -#ifdef REENTRANT -#ifdef USETHREADID - registerGlobalPointer(__G); -#else - GG = &G; -#endif /* ?USETHREADID */ -#endif /* REENTRANT */ - - return &G; -} diff --git a/data/windows/unzipfx-catia/globals.h b/data/windows/unzipfx-catia/globals.h deleted file mode 100644 index 11b7215..0000000 --- a/data/windows/unzipfx-catia/globals.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - globals.h - - There is usually no need to include this file since unzip.h includes it. - - This header file is used by all of the UnZip source files. It contains - a struct definition that is used to "house" all of the global variables. - This is done to allow for multithreaded environments (OS/2, NT, Win95, - Unix) to call UnZip through an API without a semaphore. REENTRANT should - be defined for all platforms that require this. - - GLOBAL CONSTRUCTOR AND DESTRUCTOR (API WRITERS READ THIS!!!) - ------------------------------------------------------------ - - No, it's not C++, but it's as close as we can get with K&R. - - The main() of each process that uses these globals must include the - CONSTRUCTGLOBALS; statement. This will malloc enough memory for the - structure and initialize any variables that require it. This must - also be done by any API function that jumps into the middle of the - code. - - The DESTROYGLOBALS(); statement should be inserted before EVERY "EXIT(n)". - Naturally, it also needs to be put before any API returns as well. - In fact, it's much more important in API functions since the process - will NOT end, and therefore the memory WON'T automatically be freed - by the operating system. - - USING VARIABLES FROM THE STRUCTURE - ---------------------------------- - - All global variables must now be prefixed with `G.' which is either a - global struct (in which case it should be the only global variable) or - a macro for the value of a local pointer variable that is passed from - function to function. Yes, this is a pain. But it's the only way to - allow full reentrancy. - - ADDING VARIABLES TO THE STRUCTURE - --------------------------------- - - If you make the inclusion of any variables conditional, be sure to only - check macros that are GUARANTEED to be included in every module. - For instance, newzip and pwdarg are needed only if CRYPT is TRUE, - but this is defined after unzip.h has been read. If you are not careful, - some modules will expect your variable to be part of this struct while - others won't. This will cause BIG problems. (Inexplicable crashes at - strange times, car fires, etc.) When in doubt, always include it! - - Note also that UnZipSFX needs a few variables that UnZip doesn't. However, - it also includes some object files from UnZip. If we were to conditionally - include the extra variables that UnZipSFX needs, the object files from - UnZip would not mesh with the UnZipSFX object files. Result: we just - include the UnZipSFX variables every time. (It's only an extra 4 bytes - so who cares!) - - ADDING FUNCTIONS - ---------------- - - To support this new global struct, all functions must now conditionally - pass the globals pointer (pG) to each other. This is supported by 5 macros: - __GPRO, __GPRO__, __G, __G__ and __GDEF. A function that needs no other - parameters would look like this: - - int extract_or_test_files(__G) - __GDEF - { - ... stuff ... - } - - A function with other parameters would look like: - - int memextract(__G__ tgt, tgtsize, src, srcsize) - __GDEF - uch *tgt, *src; - ulg tgtsize, srcsize; - { - ... stuff ... - } - - In the Function Prototypes section of unzpriv.h, you should use __GPRO and - __GPRO__ instead: - - int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); - int process_zipfiles OF((__GPRO)); - - Note that there is NO comma after __G__ or __GPRO__ and no semi-colon after - __GDEF. I wish there was another way but I don't think there is. - - - TESTING THE CODE - ----------------- - - Whether your platform requires reentrancy or not, you should always try - building with REENTRANT defined if any functions have been added. It is - pretty easy to forget a __G__ or a __GDEF and this mistake will only show - up if REENTRANT is defined. All platforms should run with REENTRANT - defined. Platforms that can't take advantage of it will just be paying - a performance penalty needlessly. - - SIGNAL MADNESS - -------------- - - This whole pointer passing scheme falls apart when it comes to SIGNALs. - I handle this situation 2 ways right now. If you define USETHREADID, - UnZip will include a 64-entry table. Each entry can hold a global - pointer and thread ID for one thread. This should allow up to 64 - threads to access UnZip simultaneously. Calling DESTROYGLOBALS() - will free the global struct and zero the table entry. If somebody - forgets to call DESTROYGLOBALS(), this table will eventually fill up - and UnZip will exit with an error message. A good way to test your - code to make sure you didn't forget a DESTROYGLOBALS() is to change - THREADID_ENTRIES to 3 or 4 in globals.c, making the table real small. - Then make a small test program that calls your API a dozen times. - - Those platforms that don't have threads still need to be able to compile - with REENTRANT defined to test and see if new code is correctly written - to work either way. For these platforms, I simply keep a global pointer - called GG that points to the Globals structure. Good enough for testing. - - I believe that NT has thread level storage. This could probably be used - to store a global pointer for the sake of the signal handler more cleanly - than my table approach. - - ---------------------------------------------------------------------------*/ - -#ifndef __globals_h -#define __globals_h - -#ifdef USE_ZLIB -# include "zlib.h" -# ifdef zlib_version /* This name is used internally in unzip */ -# undef zlib_version /* and must not be defined as a macro. */ -# endif -#endif - -#ifdef USE_BZIP2 -# include "bzlib.h" -#endif - - -/*************/ -/* Globals */ -/*************/ - -typedef struct Globals { -#ifdef DLL - zvoid *callerglobs; /* pointer to structure of pass-through global vars */ -#endif - - /* command options of general use */ - UzpOpts UzO; /* command options of general use */ - -#ifndef FUNZIP - /* command options specific to the high level command line interface */ -#ifdef MORE - int M_flag; /* -M: built-in "more" function */ -#endif - - /* internal flags and general globals */ -#ifdef MORE - int height; /* check for SIGWINCH, etc., eventually... */ - int lines; /* count of lines displayed on current screen */ -# if (defined(SCREENWIDTH) && defined(SCREENLWRAP)) - int width; - int chars; /* count of screen characters in current line */ -# endif -#endif /* MORE */ -#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) - int tz_is_valid; /* indicates that timezone info can be used */ -#endif - int noargs; /* did true command line have *any* arguments? */ - unsigned filespecs; /* number of real file specifications to be matched */ - unsigned xfilespecs; /* number of excluded filespecs to be matched */ - int process_all_files; - int overwrite_mode; /* 0 - query, 1 - always, 2 - never */ - int create_dirs; /* used by main(), mapname(), checkdir() */ - int extract_flag; - int newzip; /* reset in extract.c; used in crypt.c */ - zoff_t real_ecrec_offset; - zoff_t expect_ecrec_offset; - zoff_t csize; /* used by decompr. (NEXTBYTE): must be signed */ - zoff_t used_csize; /* used by extract_or_test_member(), explode() */ - -#ifdef DLL - int fValidate; /* true if only validating an archive */ - int filenotfound; - int redirect_data; /* redirect data to memory buffer */ - int redirect_text; /* redirect text output to buffer */ -# ifndef NO_SLIDE_REDIR - int redirect_slide; /* redirect decompression area to mem buffer */ -# if (defined(USE_DEFLATE64) && defined(INT_16BIT)) - ulg _wsize; /* size of sliding window exceeds "unsigned" range */ -# else - unsigned _wsize; /* sliding window size can be hold in unsigned */ -# endif -# endif - ulg redirect_size; /* size of redirected output buffer */ - uch *redirect_buffer; /* pointer to head of allocated buffer */ - uch *redirect_pointer; /* pointer past end of written data */ -# ifndef NO_SLIDE_REDIR - uch *redirect_sldptr; /* head of decompression slide buffer */ -# endif -# ifdef OS2DLL - cbList(processExternally); /* call-back list */ -# endif -#endif /* DLL */ - - char **pfnames; - char **pxnames; - char sig[4]; - char answerbuf[10]; - min_info info[DIR_BLKSIZ]; - min_info *pInfo; -#endif /* !FUNZIP */ - union work area; /* see unzpriv.h for definition of work */ - -#if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) - ZCONST ulg near *crc_32_tab; -#else - ZCONST ulg Far *crc_32_tab; -#endif - ulg crc32val; /* CRC shift reg. (was static in funzip) */ - -#ifdef FUNZIP - FILE *in; /* file descriptor of compressed stream */ -#endif - uch *inbuf; /* input buffer (any size is OK) */ - uch *inptr; /* pointer into input buffer */ - int incnt; - -#ifndef FUNZIP - ulg bitbuf; - int bits_left; /* unreduce and unshrink only */ - int zipeof; - char *argv0; /* used for NT and EXE_EXTENSION */ - char *wildzipfn; - char *zipfn; /* GRR: WINDLL: must nuke any malloc'd zipfn... */ -#ifdef USE_STRM_INPUT - FILE *zipfd; /* zipfile file descriptor */ -#else - int zipfd; /* zipfile file handle */ -#endif - zoff_t ziplen; - zoff_t cur_zipfile_bufstart; /* extract_or_test, readbuf, ReadByte */ - zoff_t extra_bytes; /* used in unzip.c, misc.c */ - uch *extra_field; /* Unix, VMS, Mac, OS/2, Acorn, ... */ - uch *hold; - - local_file_hdr lrec; /* used in unzip.c, extract.c */ - cdir_file_hdr crec; /* used in unzip.c, extract.c, misc.c */ - ecdir_rec ecrec; /* used in unzip.c, extract.c */ - z_stat statbuf; /* used by main, mapname, check_for_newer */ - - int mem_mode; - uch *outbufptr; /* extract.c static */ - ulg outsize; /* extract.c static */ - int reported_backslash; /* extract.c static */ - int disk_full; - int newfile; - - int didCRlast; /* fileio static */ - ulg numlines; /* fileio static: number of lines printed */ - int sol; /* fileio static: at start of line */ - int no_ecrec; /* process static */ -#ifdef SYMLINKS - int symlnk; - slinkentry *slink_head; /* pointer to head of symlinks list */ - slinkentry *slink_last; /* pointer to last entry in symlinks list */ -#endif -#ifdef NOVELL_BUG_FAILSAFE - int dne; /* true if stat() says file doesn't exist */ -#endif - - FILE *outfile; - uch *outbuf; - uch *realbuf; - -#ifndef VMS /* if SMALL_MEM, outbuf2 is initialized in */ - uch *outbuf2; /* process_zipfiles() (never changes); */ -#endif /* else malloc'd ONLY if unshrink and -a */ -#endif /* !FUNZIP */ - uch *outptr; - ulg outcnt; /* number of chars stored in outbuf */ -#ifndef FUNZIP - char filename[FILNAMSIZ]; /* also used by NT for temporary SFX path */ -#ifdef UNICODE_SUPPORT - char *filename_full; /* the full path so Unicode checks work */ - extent fnfull_bufsize; /* size of allocated filename buffer */ - int unicode_escape_all; - int unicode_mismatch; -#ifdef UTF8_MAYBE_NATIVE - int native_is_utf8; /* bool, TRUE => native charset == UTF-8 */ -#endif - - int unipath_version; /* version of Unicode field */ - ulg unipath_checksum; /* Unicode field checksum */ - char *unipath_filename; /* UTF-8 path */ -#endif /* UNICODE_SUPPORT */ - -#ifdef CMS_MVS - char *tempfn; /* temp file used; erase on close */ -#endif - - char *key; /* crypt static: decryption password or NULL */ - int nopwd; /* crypt static */ -#endif /* !FUNZIP */ - z_uint4 keys[3]; /* crypt static: keys defining pseudo-random sequence */ - -#if (!defined(DOS_FLX_H68_NLM_OS2_W32) && !defined(AMIGA) && !defined(RISCOS)) -#if (!defined(MACOS) && !defined(ATARI) && !defined(VMS)) - int echofd; /* ttyio static: file descriptor whose echo is off */ -#endif /* !(MACOS || ATARI || VMS) */ -#endif /* !(DOS_FLX_H68_NLM_OS2_W32 || AMIGA || RISCOS) */ - - unsigned hufts; /* track memory usage */ - -#ifdef USE_ZLIB - int inflInit; /* inflate static: zlib inflate() initialized */ - z_stream dstrm; /* inflate global: decompression stream */ -#else - struct huft *fixed_tl; /* inflate static */ - struct huft *fixed_td; /* inflate static */ - unsigned fixed_bl, fixed_bd; /* inflate static */ -#ifdef USE_DEFLATE64 - struct huft *fixed_tl64; /* inflate static */ - struct huft *fixed_td64; /* inflate static */ - unsigned fixed_bl64, fixed_bd64; /* inflate static */ - struct huft *fixed_tl32; /* inflate static */ - struct huft *fixed_td32; /* inflate static */ - unsigned fixed_bl32, fixed_bd32; /* inflate static */ - ZCONST ush *cplens; /* inflate static */ - ZCONST uch *cplext; /* inflate static */ - ZCONST uch *cpdext; /* inflate static */ -#endif - unsigned wp; /* inflate static: current position in slide */ - ulg bb; /* inflate static: bit buffer */ - unsigned bk; /* inflate static: bits count in bit buffer */ -#endif /* ?USE_ZLIB */ - -#ifndef FUNZIP - /* cylindric buffer space for formatting zoff_t values (fileio static) */ - char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN]; - int fzofft_index; - -#ifdef SMALL_MEM - char rgchBigBuffer[512]; - char rgchSmallBuffer[96]; - char rgchSmallBuffer2[160]; /* boosted to 160 for local3[] in unzip.c */ -#endif - - MsgFn *message; - InputFn *input; - PauseFn *mpause; - PasswdFn *decr_passwd; - StatCBFn *statreportcb; -#ifdef WINDLL - LPUSERFUNCTIONS lpUserFunctions; -#endif - - int incnt_leftover; /* so improved NEXTBYTE does not waste input */ - uch *inptr_leftover; - -#ifdef VMS_TEXT_CONV - unsigned VMS_line_length; /* so native VMS variable-length text files */ - int VMS_line_state; /* are readable on other platforms */ - int VMS_line_pad; -#endif - -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - char autorun_command[FILNAMSIZ]; -#endif -#endif /* !FUNZIP */ - -#ifdef SYSTEM_SPECIFIC_GLOBALS - SYSTEM_SPECIFIC_GLOBALS -#endif - -} Uz_Globs; /* end of struct Globals */ - - -/***************************************************************************/ - - -#define CRC_32_TAB G.crc_32_tab - - -Uz_Globs *globalsCtor OF((void)); - -/* pseudo constant sigs; they are initialized at runtime so unzip executable - * won't look like a zipfile - */ -extern char local_hdr_sig[4]; -extern char central_hdr_sig[4]; -extern char end_central_sig[4]; -extern char end_central32_sig[4]; -extern char end_central64_sig[4]; -extern char end_centloc64_sig[4]; -/* extern char extd_local_sig[4]; NOT USED YET */ - -#ifdef REENTRANT -# define G (*(Uz_Globs *)pG) -# define __G pG -# define __G__ pG, -# define __GPRO Uz_Globs *pG -# define __GPRO__ Uz_Globs *pG, -# define __GDEF Uz_Globs *pG; -# ifdef USETHREADID - extern int lastScan; - void deregisterGlobalPointer OF((__GPRO)); - Uz_Globs *getGlobalPointer OF((void)); -# define GETGLOBALS() Uz_Globs *pG = getGlobalPointer() -# define DESTROYGLOBALS() do {free_G_buffers(pG); \ - deregisterGlobalPointer(pG);} while (0) -# else - extern Uz_Globs *GG; -# define GETGLOBALS() Uz_Globs *pG = GG -# define DESTROYGLOBALS() do {free_G_buffers(pG); free(pG);} while (0) -# endif /* ?USETHREADID */ -# define CONSTRUCTGLOBALS() Uz_Globs *pG = globalsCtor() -#else /* !REENTRANT */ - extern Uz_Globs G; -# define __G -# define __G__ -# define __GPRO void -# define __GPRO__ -# define __GDEF -# define GETGLOBALS() -# define CONSTRUCTGLOBALS() globalsCtor() -# define DESTROYGLOBALS() -#endif /* ?REENTRANT */ - -#define uO G.UzO - -#endif /* __globals_h */ diff --git a/data/windows/unzipfx-catia/inflate.c b/data/windows/unzipfx-catia/inflate.c deleted file mode 100644 index f2f6864..0000000 --- a/data/windows/unzipfx-catia/inflate.c +++ /dev/null @@ -1,1775 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* inflate.c -- by Mark Adler - version c17e, 30 Mar 2007 */ - - -/* Copyright history: - - Starting with UnZip 5.41 of 16-April-2000, this source file - is covered by the Info-Zip LICENSE cited above. - - Prior versions of this source file, found in UnZip source packages - up to UnZip 5.40, were put in the public domain. - The original copyright note by Mark Adler was: - "You can do whatever you like with this source file, - though I would prefer that if you modify it and - redistribute it that you include comments to that effect - with your name and the date. Thank you." - - History: - vers date who what - ---- --------- -------------- ------------------------------------ - a ~~ Feb 92 M. Adler used full (large, one-step) lookup table - b1 21 Mar 92 M. Adler first version with partial lookup tables - b2 21 Mar 92 M. Adler fixed bug in fixed-code blocks - b3 22 Mar 92 M. Adler sped up match copies, cleaned up some - b4 25 Mar 92 M. Adler added prototypes; removed window[] (now - is the responsibility of unzip.h--also - changed name to slide[]), so needs diffs - for unzip.c and unzip.h (this allows - compiling in the small model on MSDOS); - fixed cast of q in huft_build(); - b5 26 Mar 92 M. Adler got rid of unintended macro recursion. - b6 27 Mar 92 M. Adler got rid of nextbyte() routine. fixed - bug in inflate_fixed(). - c1 30 Mar 92 M. Adler removed lbits, dbits environment variables. - changed BMAX to 16 for explode. Removed - OUTB usage, and replaced it with flush()-- - this was a 20% speed improvement! Added - an explode.c (to replace unimplod.c) that - uses the huft routines here. Removed - register union. - c2 4 Apr 92 M. Adler fixed bug for file sizes a multiple of 32k. - c3 10 Apr 92 M. Adler reduced memory of code tables made by - huft_build significantly (factor of two to - three). - c4 15 Apr 92 M. Adler added NOMEMCPY do kill use of memcpy(). - worked around a Turbo C optimization bug. - c5 21 Apr 92 M. Adler added the WSIZE #define to allow reducing - the 32K window size for specialized - applications. - c6 31 May 92 M. Adler added some typecasts to eliminate warnings - c7 27 Jun 92 G. Roelofs added some more typecasts (444: MSC bug). - c8 5 Oct 92 J-l. Gailly added ifdef'd code to deal with PKZIP bug. - c9 9 Oct 92 M. Adler removed a memory error message (~line 416). - c10 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch, - removed old inflate, renamed inflate_entry - to inflate, added Mark's fix to a comment. - c10.5 14 Dec 92 M. Adler fix up error messages for incomplete trees. - c11 2 Jan 93 M. Adler fixed bug in detection of incomplete - tables, and removed assumption that EOB is - the longest code (bad assumption). - c12 3 Jan 93 M. Adler make tables for fixed blocks only once. - c13 5 Jan 93 M. Adler allow all zero length codes (pkzip 2.04c - outputs one zero length code for an empty - distance tree). - c14 12 Mar 93 M. Adler made inflate.c standalone with the - introduction of inflate.h. - c14b 16 Jul 93 G. Roelofs added (unsigned) typecast to w at 470. - c14c 19 Jul 93 J. Bush changed v[N_MAX], l[288], ll[28x+3x] arrays - to static for Amiga. - c14d 13 Aug 93 J-l. Gailly de-complicatified Mark's c[*p++]++ thing. - c14e 8 Oct 93 G. Roelofs changed memset() to memzero(). - c14f 22 Oct 93 G. Roelofs renamed quietflg to qflag; made Trace() - conditional; added inflate_free(). - c14g 28 Oct 93 G. Roelofs changed l/(lx+1) macro to pointer (Cray bug) - c14h 7 Dec 93 C. Ghisler huft_build() optimizations. - c14i 9 Jan 94 A. Verheijen set fixed_t{d,l} to NULL after freeing; - G. Roelofs check NEXTBYTE macro for EOF. - c14j 23 Jan 94 G. Roelofs removed Ghisler "optimizations"; ifdef'd - EOF check. - c14k 27 Feb 94 G. Roelofs added some typecasts to avoid warnings. - c14l 9 Apr 94 G. Roelofs fixed split comments on preprocessor lines - to avoid bug in Encore compiler. - c14m 7 Jul 94 P. Kienitz modified to allow assembler version of - inflate_codes() (define ASM_INFLATECODES) - c14n 22 Jul 94 G. Roelofs changed fprintf to macro for DLL versions - c14o 23 Aug 94 C. Spieler added a newline to a debug statement; - G. Roelofs added another typecast to avoid MSC warning - c14p 4 Oct 94 G. Roelofs added (voidp *) cast to free() argument - c14q 30 Oct 94 G. Roelofs changed fprintf macro to MESSAGE() - c14r 1 Nov 94 G. Roelofs fixed possible redefinition of CHECK_EOF - c14s 7 May 95 S. Maxwell OS/2 DLL globals stuff incorporated; - P. Kienitz "fixed" ASM_INFLATECODES macro/prototype - c14t 18 Aug 95 G. Roelofs added UZinflate() to use zlib functions; - changed voidp to zvoid; moved huft_build() - and huft_free() to end of file - c14u 1 Oct 95 G. Roelofs moved G into definition of MESSAGE macro - c14v 8 Nov 95 P. Kienitz changed ASM_INFLATECODES to use a regular - call with __G__ instead of a macro - c15 3 Aug 96 M. Adler fixed bomb-bug on random input data (Adobe) - c15b 24 Aug 96 M. Adler more fixes for random input data - c15c 28 Mar 97 G. Roelofs changed USE_ZLIB fatal exit code from - PK_MEM2 to PK_MEM3 - c16 20 Apr 97 J. Altman added memzero(v[]) in huft_build() - c16b 29 Mar 98 C. Spieler modified DLL code for slide redirection - c16c 04 Apr 99 C. Spieler fixed memory leaks when processing gets - stopped because of input data errors - c16d 05 Jul 99 C. Spieler take care of FLUSH() return values and - stop processing in case of errors - c17 31 Dec 00 C. Spieler added preliminary support for Deflate64 - c17a 04 Feb 01 C. Spieler complete integration of Deflate64 support - c17b 16 Feb 02 C. Spieler changed type of "extra bits" arrays and - corresponding huft_build() parameter e from - ush into uch, to save space - c17c 9 Mar 02 C. Spieler fixed NEEDBITS() "read beyond EOF" problem - with CHECK_EOF enabled - c17d 23 Jul 05 C. Spieler fixed memory leaks in inflate_dynamic() - when processing invalid compressed literal/ - distance table data - c17e 30 Mar 07 C. Spieler in inflate_dynamic(), initialize tl and td - to prevent freeing unallocated huft tables - when processing invalid compressed data and - hitting premature EOF, do not reuse td as - temp work ptr during tables decoding - */ - - -/* - Inflate deflated (PKZIP's method 8 compressed) data. The compression - method searches for as much of the current string of bytes (up to a - length of 258) in the previous 32K bytes. If it doesn't find any - matches (of at least length 3), it codes the next byte. Otherwise, it - codes the length of the matched string and its distance backwards from - the current position. There is a single Huffman code that codes both - single bytes (called "literals") and match lengths. A second Huffman - code codes the distance information, which follows a length code. Each - length or distance code actually represents a base value and a number - of "extra" (sometimes zero) bits to get to add to the base value. At - the end of each deflated block is a special end-of-block (EOB) literal/ - length code. The decoding process is basically: get a literal/length - code; if EOB then done; if a literal, emit the decoded byte; if a - length then get the distance and emit the referred-to bytes from the - sliding window of previously emitted data. - - There are (currently) three kinds of inflate blocks: stored, fixed, and - dynamic. The compressor outputs a chunk of data at a time and decides - which method to use on a chunk-by-chunk basis. A chunk might typically - be 32K to 64K, uncompressed. If the chunk is uncompressible, then the - "stored" method is used. In this case, the bytes are simply stored as - is, eight bits per byte, with none of the above coding. The bytes are - preceded by a count, since there is no longer an EOB code. - - If the data are compressible, then either the fixed or dynamic methods - are used. In the dynamic method, the compressed data are preceded by - an encoding of the literal/length and distance Huffman codes that are - to be used to decode this block. The representation is itself Huffman - coded, and so is preceded by a description of that code. These code - descriptions take up a little space, and so for small blocks, there is - a predefined set of codes, called the fixed codes. The fixed method is - used if the block ends up smaller that way (usually for quite small - chunks); otherwise the dynamic method is used. In the latter case, the - codes are customized to the probabilities in the current block and so - can code it much better than the pre-determined fixed codes can. - - The Huffman codes themselves are decoded using a multi-level table - lookup, in order to maximize the speed of decoding plus the speed of - building the decoding tables. See the comments below that precede the - lbits and dbits tuning parameters. - - GRR: return values(?) - 0 OK - 1 incomplete table - 2 bad input - 3 not enough memory - the following return codes are passed through from FLUSH() errors - 50 (PK_DISK) "overflow of output space" - 80 (IZ_CTRLC) "canceled by user's request" - */ - - -/* - Notes beyond the 1.93a appnote.txt: - - 1. Distance pointers never point before the beginning of the output - stream. - 2. Distance pointers can point back across blocks, up to 32k away. - 3. There is an implied maximum of 7 bits for the bit length table and - 15 bits for the actual data. - 4. If only one code exists, then it is encoded using one bit. (Zero - would be more efficient, but perhaps a little confusing.) If two - codes exist, they are coded using one bit each (0 and 1). - 5. There is no way of sending zero distance codes--a dummy must be - sent if there are none. (History: a pre 2.0 version of PKZIP would - store blocks with no distance codes, but this was discovered to be - too harsh a criterion.) Valid only for 1.93a. 2.04c does allow - zero distance codes, which is sent as one code of zero bits in - length. - 6. There are up to 286 literal/length codes. Code 256 represents the - end-of-block. Note however that the static length tree defines - 288 codes just to fill out the Huffman codes. Codes 286 and 287 - cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. - However, static trees define 32 codes (all 5 bits) to fill out the - Huffman codes, but the last two had better not show up in the data. - 7. Unzip can check dynamic Huffman blocks for complete code sets. - The exception is that a single code would not be complete (see #4). - 8. The five bits following the block type is really the number of - literal codes sent minus 257. - 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits - (1+6+6). Therefore, to output three times the length, you output - three codes (1+1+1), whereas to output four times the same length, - you only need two codes (1+3). Hmm. - 10. In the tree reconstruction algorithm, Code = Code + Increment - only if BitLength(i) is not zero. (Pretty obvious.) - 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) - 12. Note: length code 284 can represent 227-258, but length code 285 - really is 258. The last length deserves its own, short code - since it gets used a lot in very redundant files. The length - 258 is special since 258 - 3 (the min match length) is 255. - 13. The literal/length and distance code bit lengths are read as a - single stream of lengths. It is possible (and advantageous) for - a repeat code (16, 17, or 18) to go across the boundary between - the two sets of lengths. - 14. The Deflate64 (PKZIP method 9) variant of the compression algorithm - differs from "classic" deflate in the following 3 aspect: - a) The size of the sliding history window is expanded to 64 kByte. - b) The previously unused distance codes #30 and #31 code distances - from 32769 to 49152 and 49153 to 65536. Both codes take 14 bits - of extra data to determine the exact position in their 16 kByte - range. - c) The last lit/length code #285 gets a different meaning. Instead - of coding a fixed maximum match length of 258, it is used as a - "generic" match length code, capable of coding any length from - 3 (min match length + 0) to 65538 (min match length + 65535). - This means that the length code #285 takes 16 bits (!) of uncoded - extra data, added to a fixed min length of 3. - Changes a) and b) would have been transparent for valid deflated - data, but change c) requires to switch decoder configurations between - Deflate and Deflate64 modes. - */ - - -#define PKZIP_BUG_WORKAROUND /* PKZIP 1.93a problem--live with it */ - -/* - inflate.h must supply the uch slide[WSIZE] array, the zvoid typedef - (void if (void *) is accepted, else char) and the NEXTBYTE, - FLUSH() and memzero macros. If the window size is not 32K, it - should also define WSIZE. If INFMOD is defined, it can include - compiled functions to support the NEXTBYTE and/or FLUSH() macros. - There are defaults for NEXTBYTE and FLUSH() below for use as - examples of what those functions need to do. Normally, you would - also want FLUSH() to compute a crc on the data. inflate.h also - needs to provide these typedefs: - - typedef unsigned char uch; - typedef unsigned short ush; - typedef unsigned long ulg; - - This module uses the external functions malloc() and free() (and - probably memset() or bzero() in the memzero() macro). Their - prototypes are normally found in and . - */ - -#define __INFLATE_C /* identifies this source module */ - -/* #define DEBUG */ -#define INFMOD /* tell inflate.h to include code to be compiled */ -#include "inflate.h" - - -/* marker for "unused" huft code, and corresponding check macro */ -#define INVALID_CODE 99 -#define IS_INVALID_CODE(c) ((c) == INVALID_CODE) - -#ifndef WSIZE /* default is 32K resp. 64K */ -# ifdef USE_DEFLATE64 -# define WSIZE 65536L /* window size--must be a power of two, and */ -# else /* at least 64K for PKZip's deflate64 method */ -# define WSIZE 0x8000 /* window size--must be a power of two, and */ -# endif /* at least 32K for zip's deflate method */ -#endif - -/* some buffer counters must be capable of holding 64k for Deflate64 */ -#if (defined(USE_DEFLATE64) && defined(INT_16BIT)) -# define UINT_D64 ulg -#else -# define UINT_D64 unsigned -#endif - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define wsize G._wsize /* wsize is a variable */ -#else -# define wsize WSIZE /* wsize is a constant */ -#endif - - -#ifndef NEXTBYTE /* default is to simply get a byte from stdin */ -# define NEXTBYTE getchar() -#endif - -#ifndef MESSAGE /* only used twice, for fixed strings--NOT general-purpose */ -# define MESSAGE(str,len,flag) fprintf(stderr,(char *)(str)) -#endif - -#ifndef FLUSH /* default is to simply write the buffer to stdout */ -# define FLUSH(n) \ - (((extent)fwrite(redirSlide, 1, (extent)(n), stdout) == (extent)(n)) ? \ - 0 : PKDISK) -#endif -/* Warning: the fwrite above might not work on 16-bit compilers, since - 0x8000 might be interpreted as -32,768 by the library function. When - support for Deflate64 is enabled, the window size is 64K and the - simple fwrite statement is definitely broken for 16-bit compilers. */ - -#ifndef Trace -# ifdef DEBUG -# define Trace(x) fprintf x -# else -# define Trace(x) -# endif -#endif - - -/*---------------------------------------------------------------------------*/ -#ifdef USE_ZLIB - -/* Beginning with zlib version 1.2.0, a new inflate callback interface is - provided that allows tighter integration of the zlib inflate service - into unzip's extraction framework. - The advantages are: - - uses the windows buffer supplied by the unzip code; this saves one - copy process between zlib's internal decompression buffer and unzip's - post-decompression output buffer and improves performance. - - does not pull in unused checksum code (adler32). - The preprocessor flag NO_ZLIBCALLBCK can be set to force usage of the - old zlib 1.1.x interface, for testing purpose. - */ -#ifdef USE_ZLIB_INFLATCB -# undef USE_ZLIB_INFLATCB -#endif -#if (defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1200 && !defined(NO_ZLIBCALLBCK)) -# define USE_ZLIB_INFLATCB 1 -#else -# define USE_ZLIB_INFLATCB 0 -#endif - -/* Check for incompatible combinations of zlib and Deflate64 support. */ -#if defined(USE_DEFLATE64) -# if !USE_ZLIB_INFLATCB - #error Deflate64 is incompatible with traditional (pre-1.2.x) zlib interface! -# else - /* The Deflate64 callback function in the framework of zlib 1.2.x requires - the inclusion of the unsupported infback9 header file: - */ -# include "infback9.h" -# endif -#endif /* USE_DEFLATE64 */ - - -#if USE_ZLIB_INFLATCB - -static unsigned zlib_inCB OF((void FAR *pG, unsigned char FAR * FAR * pInbuf)); -static int zlib_outCB OF((void FAR *pG, unsigned char FAR *outbuf, - unsigned outcnt)); - -static unsigned zlib_inCB(pG, pInbuf) - void FAR *pG; - unsigned char FAR * FAR * pInbuf; -{ - *pInbuf = G.inbuf; - return fillinbuf(__G); -} - -static int zlib_outCB(pG, outbuf, outcnt) - void FAR *pG; - unsigned char FAR *outbuf; - unsigned outcnt; -{ -#ifdef FUNZIP - return flush(__G__ (ulg)(outcnt)); -#else - return ((G.mem_mode) ? memflush(__G__ outbuf, (ulg)(outcnt)) - : flush(__G__ outbuf, (ulg)(outcnt), 0)); -#endif -} -#endif /* USE_ZLIB_INFLATCB */ - - -/* - GRR: return values for both original inflate() and UZinflate() - 0 OK - 1 incomplete table(?) - 2 bad input - 3 not enough memory - */ - -/**************************/ -/* Function UZinflate() */ -/**************************/ - -int UZinflate(__G__ is_defl64) - __GDEF - int is_defl64; -/* decompress an inflated entry using the zlib routines */ -{ - int retval = 0; /* return code: 0 = "no error" */ - int err=Z_OK; -#if USE_ZLIB_INFLATCB - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - if (!G.inflInit) { - /* local buffer for efficiency */ - ZCONST char *zlib_RtVersion = zlibVersion(); - - /* only need to test this stuff once */ - if ((zlib_RtVersion[0] != ZLIB_VERSION[0]) || - (zlib_RtVersion[2] != ZLIB_VERSION[2])) { - Info(slide, 0x21, ((char *)slide, - "error: incompatible zlib version (expected %s, found %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - return 3; - } else if (strcmp(zlib_RtVersion, ZLIB_VERSION) != 0) - Info(slide, 0x21, ((char *)slide, - "warning: different zlib version (expected %s, using %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - - G.dstrm.zalloc = (alloc_func)Z_NULL; - G.dstrm.zfree = (free_func)Z_NULL; - - G.inflInit = 1; - } - -#ifdef USE_DEFLATE64 - if (is_defl64) - { - Trace((stderr, "initializing inflate9()\n")); - err = inflateBack9Init(&G.dstrm, redirSlide); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) { - Trace((stderr, "oops! (inflateBack9Init() err = %d)\n", err)); - return 2; - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - err = inflateBack9(&G.dstrm, zlib_inCB, &G, zlib_outCB, &G); - if (err != Z_STREAM_END) { - if (err == Z_DATA_ERROR || err == Z_STREAM_ERROR) { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - retval = 2; - } else if (err == Z_MEM_ERROR) { - retval = 3; - } else if (err == Z_BUF_ERROR) { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - if (G.dstrm.next_in == Z_NULL) { - /* input failure */ - Trace((stderr, " inflateBack9() input failure\n")); - retval = 2; - } else { - /* output write failure */ - retval = (G.disk_full != 0 ? PK_DISK : IZ_CTRLC); - } - } else { - Trace((stderr, "oops! (inflateBack9() err = %d)\n", err)); - retval = 2; - } - } - if (G.dstrm.next_in != NULL) { - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = G.dstrm.avail_in; - } - - err = inflateBack9End(&G.dstrm); - if (err != Z_OK) { - Trace((stderr, "oops! (inflateBack9End() err = %d)\n", err)); - if (retval == 0) - retval = 2; - } - } - else -#endif /* USE_DEFLATE64 */ - { - /* For the callback interface, inflate initialization has to - be called before each decompression call. - */ - { - unsigned i; - int windowBits; - /* windowBits = log2(wsize) */ - for (i = (unsigned)wsize, windowBits = 0; - !(i & 1); i >>= 1, ++windowBits); - if ((unsigned)windowBits > (unsigned)15) - windowBits = 15; - else if (windowBits < 8) - windowBits = 8; - - Trace((stderr, "initializing inflate()\n")); - err = inflateBackInit(&G.dstrm, windowBits, redirSlide); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) { - Trace((stderr, "oops! (inflateBackInit() err = %d)\n", err)); - return 2; - } - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - err = inflateBack(&G.dstrm, zlib_inCB, &G, zlib_outCB, &G); - if (err != Z_STREAM_END) { - if (err == Z_DATA_ERROR || err == Z_STREAM_ERROR) { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - retval = 2; - } else if (err == Z_MEM_ERROR) { - retval = 3; - } else if (err == Z_BUF_ERROR) { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - if (G.dstrm.next_in == Z_NULL) { - /* input failure */ - Trace((stderr, " inflateBack() input failure\n")); - retval = 2; - } else { - /* output write failure */ - retval = (G.disk_full != 0 ? PK_DISK : IZ_CTRLC); - } - } else { - Trace((stderr, "oops! (inflateBack() err = %d)\n", err)); - retval = 2; - } - } - if (G.dstrm.next_in != NULL) { - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = G.dstrm.avail_in; - } - - err = inflateBackEnd(&G.dstrm); - if (err != Z_OK) { - Trace((stderr, "oops! (inflateBackEnd() err = %d)\n", err)); - if (retval == 0) - retval = 2; - } - } - -#else /* !USE_ZLIB_INFLATCB */ - int repeated_buf_err; - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; -#endif - - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - - if (!G.inflInit) { - unsigned i; - int windowBits; - /* local buffer for efficiency */ - ZCONST char *zlib_RtVersion = zlibVersion(); - - /* only need to test this stuff once */ - if (zlib_RtVersion[0] != ZLIB_VERSION[0]) { - Info(slide, 0x21, ((char *)slide, - "error: incompatible zlib version (expected %s, found %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - return 3; - } else if (strcmp(zlib_RtVersion, ZLIB_VERSION) != 0) - Info(slide, 0x21, ((char *)slide, - "warning: different zlib version (expected %s, using %s)\n", - ZLIB_VERSION, zlib_RtVersion)); - - /* windowBits = log2(wsize) */ - for (i = (unsigned)wsize, windowBits = 0; - !(i & 1); i >>= 1, ++windowBits); - if ((unsigned)windowBits > (unsigned)15) - windowBits = 15; - else if (windowBits < 8) - windowBits = 8; - - G.dstrm.zalloc = (alloc_func)Z_NULL; - G.dstrm.zfree = (free_func)Z_NULL; - - Trace((stderr, "initializing inflate()\n")); - err = inflateInit2(&G.dstrm, -windowBits); - - if (err == Z_MEM_ERROR) - return 3; - else if (err != Z_OK) - Trace((stderr, "oops! (inflateInit2() err = %d)\n", err)); - G.inflInit = 1; - } - -#ifdef FUNZIP - while (err != Z_STREAM_END) { -#else /* !FUNZIP */ - while (G.csize > 0) { - Trace((stderr, "first loop: G.csize = %ld\n", G.csize)); -#endif /* ?FUNZIP */ - while (G.dstrm.avail_out > 0) { - err = inflate(&G.dstrm, Z_PARTIAL_FLUSH); - - if (err == Z_DATA_ERROR) { - retval = 2; goto uzinflate_cleanup_exit; - } else if (err == Z_MEM_ERROR) { - retval = 3; goto uzinflate_cleanup_exit; - } else if (err != Z_OK && err != Z_STREAM_END) - Trace((stderr, "oops! (inflate(first loop) err = %d)\n", err)); - -#ifdef FUNZIP - if (err == Z_STREAM_END) /* "END-of-entry-condition" ? */ -#else /* !FUNZIP */ - if (G.csize <= 0L) /* "END-of-entry-condition" ? */ -#endif /* ?FUNZIP */ - break; - - if (G.dstrm.avail_in == 0) { - if (fillinbuf(__G) == 0) { - /* no "END-condition" yet, but no more data */ - retval = 2; goto uzinflate_cleanup_exit; - } - - G.dstrm.next_in = G.inptr; - G.dstrm.avail_in = G.incnt; - } - Trace((stderr, " avail_in = %u\n", G.dstrm.avail_in)); - } - /* flush slide[] */ - if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) - goto uzinflate_cleanup_exit; - Trace((stderr, "inside loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - G.dstrm.avail_out), - (long)(G.dstrm.next_out-(Bytef *)redirSlide))); - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - } - - /* no more input, so loop until we have all output */ - Trace((stderr, "beginning final loop: err = %d\n", err)); - repeated_buf_err = FALSE; - while (err != Z_STREAM_END) { - err = inflate(&G.dstrm, Z_PARTIAL_FLUSH); - if (err == Z_DATA_ERROR) { - retval = 2; goto uzinflate_cleanup_exit; - } else if (err == Z_MEM_ERROR) { - retval = 3; goto uzinflate_cleanup_exit; - } else if (err == Z_BUF_ERROR) { /* DEBUG */ -#ifdef FUNZIP - Trace((stderr, - "zlib inflate() did not detect stream end\n")); -#else - Trace((stderr, - "zlib inflate() did not detect stream end (%s, %s)\n", - G.zipfn, G.filename)); -#endif - if ((!repeated_buf_err) && (G.dstrm.avail_in == 0)) { - /* when detecting this problem for the first time, - try to provide one fake byte beyond "EOF"... */ - G.dstrm.next_in = ""; - G.dstrm.avail_in = 1; - repeated_buf_err = TRUE; - } else - break; - } else if (err != Z_OK && err != Z_STREAM_END) { - Trace((stderr, "oops! (inflate(final loop) err = %d)\n", err)); - DESTROYGLOBALS(); - EXIT(PK_MEM3); - } - /* final flush of slide[] */ - if ((retval = FLUSH(wsize - G.dstrm.avail_out)) != 0) - goto uzinflate_cleanup_exit; - Trace((stderr, "final loop: flushing %ld bytes (ptr diff = %ld)\n", - (long)(wsize - G.dstrm.avail_out), - (long)(G.dstrm.next_out-(Bytef *)redirSlide))); - G.dstrm.next_out = redirSlide; - G.dstrm.avail_out = wsize; - } - Trace((stderr, "total in = %lu, total out = %lu\n", G.dstrm.total_in, - G.dstrm.total_out)); - - G.inptr = (uch *)G.dstrm.next_in; - G.incnt = (G.inbuf + INBUFSIZ) - G.inptr; /* reset for other routines */ - -uzinflate_cleanup_exit: - err = inflateReset(&G.dstrm); - if (err != Z_OK) - Trace((stderr, "oops! (inflateReset() err = %d)\n", err)); - -#endif /* ?USE_ZLIB_INFLATCB */ - return retval; -} - - -/*---------------------------------------------------------------------------*/ -#else /* !USE_ZLIB */ - - -/* Function prototypes */ -#ifndef OF -# ifdef __STDC__ -# define OF(a) a -# else -# define OF(a) () -# endif -#endif /* !OF */ -int inflate_codes OF((__GPRO__ struct huft *tl, struct huft *td, - unsigned bl, unsigned bd)); -static int inflate_stored OF((__GPRO)); -static int inflate_fixed OF((__GPRO)); -static int inflate_dynamic OF((__GPRO)); -static int inflate_block OF((__GPRO__ int *e)); - - -/* The inflate algorithm uses a sliding 32K byte window on the uncompressed - stream to find repeated byte strings. This is implemented here as a - circular buffer. The index is updated simply by incrementing and then - and'ing with 0x7fff (32K-1). */ -/* It is left to other modules to supply the 32K area. It is assumed - to be usable as if it were declared "uch slide[32768];" or as just - "uch *slide;" and then malloc'ed in the latter case. The definition - must be in unzip.h, included above. */ - - -/* unsigned wp; moved to globals.h */ /* current position in slide */ - -/* Tables for deflate from PKZIP's appnote.txt. */ -/* - Order of the bit length code lengths */ -static ZCONST unsigned border[] = { - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - -/* - Copy lengths for literal codes 257..285 */ -#ifdef USE_DEFLATE64 -static ZCONST ush cplens64[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 3, 0, 0}; - /* For Deflate64, the code 285 is defined differently. */ -#else -# define cplens32 cplens -#endif -static ZCONST ush cplens32[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* note: see note #13 above about the 258 in this list. */ -/* - Extra bits for literal codes 257..285 */ -#ifdef USE_DEFLATE64 -static ZCONST uch cplext64[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 16, INVALID_CODE, INVALID_CODE}; -#else -# define cplext32 cplext -#endif -static ZCONST uch cplext32[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, INVALID_CODE, INVALID_CODE}; - -/* - Copy offsets for distance codes 0..29 (0..31 for Deflate64) */ -static ZCONST ush cpdist[] = { - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, -#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) - 8193, 12289, 16385, 24577, 32769, 49153}; -#else - 8193, 12289, 16385, 24577}; -#endif - -/* - Extra bits for distance codes 0..29 (0..31 for Deflate64) */ -#ifdef USE_DEFLATE64 -static ZCONST uch cpdext64[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, - 12, 12, 13, 13, 14, 14}; -#else -# define cpdext32 cpdext -#endif -static ZCONST uch cpdext32[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, - 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, -#ifdef PKZIP_BUG_WORKAROUND - 12, 12, 13, 13, INVALID_CODE, INVALID_CODE}; -#else - 12, 12, 13, 13}; -#endif - -#ifdef PKZIP_BUG_WORKAROUND -# define MAXLITLENS 288 -#else -# define MAXLITLENS 286 -#endif -#if (defined(USE_DEFLATE64) || defined(PKZIP_BUG_WORKAROUND)) -# define MAXDISTS 32 -#else -# define MAXDISTS 30 -#endif - - -/* moved to consts.h (included in unzip.c), resp. funzip.c */ -#if 0 -/* And'ing with mask_bits[n] masks the lower n bits */ -ZCONST unsigned near mask_bits[17] = { - 0x0000, - 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; -#endif /* 0 */ - - -/* Macros for inflate() bit peeking and grabbing. - The usage is: - - NEEDBITS(j) - x = b & mask_bits[j]; - DUMPBITS(j) - - where NEEDBITS makes sure that b has at least j bits in it, and - DUMPBITS removes the bits from b. The macros use the variable k - for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the beginning of a - routine that uses these macros from a global bit buffer and count. - - In order to not ask for more bits than there are in the compressed - stream, the Huffman tables are constructed to only ask for just - enough bits to make up the end-of-block code (value 256). Then no - bytes need to be "returned" to the buffer at the end of the last - block. See the huft_build() routine. - - Actually, the precautions mentioned above are not sufficient to - prevent fetches of bits beyound the end of the last block in every - case. When the last code fetched before the end-of-block code was - a very short distance code (shorter than "distance-prefetch-bits" - - "end-of-block code bits"), this last distance code fetch already - exausts the available data. To prevent failure of extraction in this - case, the "read beyond EOF" check delays the raise of the "invalid - data" error until an actual overflow of "used data" is detected. - This error condition is only fulfilled when the "number of available - bits" counter k is found to be negative in the NEEDBITS() macro. - - An alternate fix for that problem adjusts the size of the distance code - base table so that it does not exceed the length of the end-of-block code - plus the minimum length of a distance code. This alternate fix can be - enabled by defining the preprocessor symbol FIX_PAST_EOB_BY_TABLEADJUST. - */ - -/* These have been moved to globals.h */ -#if 0 -ulg bb; /* bit buffer */ -unsigned bk; /* bits in bit buffer */ -#endif - -#ifndef CHECK_EOF -# define CHECK_EOF /* default as of 5.13/5.2 */ -#endif - -#ifndef CHECK_EOF -# define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<=0)break;retval=1;goto cleanup_and_exit;}\ - b|=((ulg)c)<>=(n);k-=(n);} - - -/* - Huffman code decoding is performed using a multi-level table lookup. - The fastest way to decode is to simply build a lookup table whose - size is determined by the longest code. However, the time it takes - to build this table can also be a factor if the data being decoded - are not very long. The most common codes are necessarily the - shortest codes, so those codes dominate the decoding time, and hence - the speed. The idea is you can have a shorter table that decodes the - shorter, more probable codes, and then point to subsidiary tables for - the longer codes. The time it costs to decode the longer codes is - then traded against the time it takes to make longer tables. - - This results of this trade are in the variables lbits and dbits - below. lbits is the number of bits the first level table for literal/ - length codes can decode in one step, and dbits is the same thing for - the distance codes. Subsequent tables are also less than or equal to - those sizes. These values may be adjusted either when all of the - codes are shorter than that, in which case the longest code length in - bits is used, or when the shortest code is *longer* than the requested - table size, in which case the length of the shortest code in bits is - used. - - There are two different values for the two tables, since they code a - different number of possibilities each. The literal/length table - codes 286 possible values, or in a flat code, a little over eight - bits. The distance table codes 30 possible values, or a little less - than five bits, flat. The optimum values for speed end up being - about one bit more than those, so lbits is 8+1 and dbits is 5+1. - The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. - */ - - -/* bits in base literal/length lookup table */ -static ZCONST unsigned lbits = 9; -/* bits in base distance lookup table */ -static ZCONST unsigned dbits = 6; - - -#ifndef ASM_INFLATECODES - -int inflate_codes(__G__ tl, td, bl, bd) - __GDEF -struct huft *tl, *td; /* literal/length and distance decoder tables */ -unsigned bl, bd; /* number of bits decoded by tl[] and td[] */ -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ -{ - register unsigned e; /* table entry flag/number of extra bits */ - unsigned d; /* index for copy */ - UINT_D64 n; /* length for copy (deflate64: might be 64k+2) */ - UINT_D64 w; /* current window position (deflate64: up to 64k) */ - struct huft *t; /* pointer to table entry */ - unsigned ml, md; /* masks for bl and bd bits */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local copies of globals */ - b = G.bb; /* initialize bit buffer */ - k = G.bk; - w = G.wp; /* initialize window position */ - - - /* inflate the coded data */ - ml = mask_bits[bl]; /* precompute masks for speed */ - md = mask_bits[bd]; - while (1) /* do until end of block */ - { - NEEDBITS(bl) - t = tl + ((unsigned)b & ml); - while (1) { - DUMPBITS(t->b) - - if ((e = t->e) == 32) /* then it's a literal */ - { - redirSlide[w++] = (uch)t->v.n; - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - break; - } - - if (e < 31) /* then it's a length */ - { - /* get length of block to copy */ - NEEDBITS(e) - n = t->v.n + ((unsigned)b & mask_bits[e]); - DUMPBITS(e) - - /* decode distance of block to copy */ - NEEDBITS(bd) - t = td + ((unsigned)b & md); - while (1) { - DUMPBITS(t->b) - if ((e = t->e) < 32) - break; - if (IS_INVALID_CODE(e)) - return 1; - e &= 31; - NEEDBITS(e) - t = t->v.t + ((unsigned)b & mask_bits[e]); - } - NEEDBITS(e) - d = (unsigned)w - t->v.n - ((unsigned)b & mask_bits[e]); - DUMPBITS(e) - - /* do the copy */ - do { -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) { - /* &= w/ wsize unnecessary & wrong if redirect */ - if ((UINT_D64)d >= wsize) - return 1; /* invalid compressed data */ - e = (unsigned)(wsize - (d > (unsigned)w ? (UINT_D64)d : w)); - } - else -#endif - e = (unsigned)(wsize - - ((d &= (unsigned)(wsize-1)) > (unsigned)w ? - (UINT_D64)d : w)); - if ((UINT_D64)e > n) e = (unsigned)n; - n -= e; -#ifndef NOMEMCPY - if ((unsigned)w - d >= e) - /* (this test assumes unsigned comparison) */ - { - memcpy(redirSlide + (unsigned)w, redirSlide + d, e); - w += e; - d += e; - } - else /* do it slowly to avoid memcpy() overlap */ -#endif /* !NOMEMCPY */ - do { - redirSlide[w++] = redirSlide[d++]; - } while (--e); - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - } while (n); - break; - } - - if (e == 31) /* it's the EOB signal */ - { - /* sorry for this goto, but we have to exit two loops at once */ - goto cleanup_decode; - } - - if (IS_INVALID_CODE(e)) - return 1; - - e &= 31; - NEEDBITS(e) - t = t->v.t + ((unsigned)b & mask_bits[e]); - } - } -cleanup_decode: - - /* restore the globals from the locals */ - G.wp = (unsigned)w; /* restore global window pointer */ - G.bb = b; /* restore global bit buffer */ - G.bk = k; - - -cleanup_and_exit: - /* done */ - return retval; -} - -#endif /* ASM_INFLATECODES */ - - - -static int inflate_stored(__G) - __GDEF -/* "decompress" an inflated type 0 (stored) block. */ -{ - UINT_D64 w; /* current window position (deflate64: up to 64k!) */ - unsigned n; /* number of bytes in block */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local copies of globals */ - Trace((stderr, "\nstored block")); - b = G.bb; /* initialize bit buffer */ - k = G.bk; - w = G.wp; /* initialize window position */ - - - /* go to byte boundary */ - n = k & 7; - DUMPBITS(n); - - - /* get the length and its complement */ - NEEDBITS(16) - n = ((unsigned)b & 0xffff); - DUMPBITS(16) - NEEDBITS(16) - if (n != (unsigned)((~b) & 0xffff)) - return 1; /* error in compressed data */ - DUMPBITS(16) - - - /* read and output the compressed data */ - while (n--) - { - NEEDBITS(8) - redirSlide[w++] = (uch)b; - if (w == wsize) - { - if ((retval = FLUSH(w)) != 0) goto cleanup_and_exit; - w = 0; - } - DUMPBITS(8) - } - - - /* restore the globals from the locals */ - G.wp = (unsigned)w; /* restore global window pointer */ - G.bb = b; /* restore global bit buffer */ - G.bk = k; - -cleanup_and_exit: - return retval; -} - - -/* Globals for literal tables (built once) */ -/* Moved to globals.h */ -#if 0 -struct huft *fixed_tl = (struct huft *)NULL; -struct huft *fixed_td; -int fixed_bl, fixed_bd; -#endif - -static int inflate_fixed(__G) - __GDEF -/* decompress an inflated type 1 (fixed Huffman codes) block. We should - either replace this with a custom decoder, or at least precompute the - Huffman tables. */ -{ - /* if first time, set up tables for fixed blocks */ - Trace((stderr, "\nliteral block")); - if (G.fixed_tl == (struct huft *)NULL) - { - int i; /* temporary variable */ - unsigned l[288]; /* length list for huft_build */ - - /* literal table */ - for (i = 0; i < 144; i++) - l[i] = 8; - for (; i < 256; i++) - l[i] = 9; - for (; i < 280; i++) - l[i] = 7; - for (; i < 288; i++) /* make a complete, but wrong code set */ - l[i] = 8; - G.fixed_bl = 7; -#ifdef USE_DEFLATE64 - if ((i = huft_build(__G__ l, 288, 257, G.cplens, G.cplext, - &G.fixed_tl, &G.fixed_bl)) != 0) -#else - if ((i = huft_build(__G__ l, 288, 257, cplens, cplext, - &G.fixed_tl, &G.fixed_bl)) != 0) -#endif - { - G.fixed_tl = (struct huft *)NULL; - return i; - } - - /* distance table */ - for (i = 0; i < MAXDISTS; i++) /* make an incomplete code set */ - l[i] = 5; - G.fixed_bd = 5; -#ifdef USE_DEFLATE64 - if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, G.cpdext, - &G.fixed_td, &G.fixed_bd)) > 1) -#else - if ((i = huft_build(__G__ l, MAXDISTS, 0, cpdist, cpdext, - &G.fixed_td, &G.fixed_bd)) > 1) -#endif - { - huft_free(G.fixed_tl); - G.fixed_td = G.fixed_tl = (struct huft *)NULL; - return i; - } - } - - /* decompress until an end-of-block code */ - return inflate_codes(__G__ G.fixed_tl, G.fixed_td, - G.fixed_bl, G.fixed_bd); -} - - - -static int inflate_dynamic(__G) - __GDEF -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ -{ - unsigned i; /* temporary variables */ - unsigned j; - unsigned l; /* last length */ - unsigned m; /* mask for bit lengths table */ - unsigned n; /* number of lengths to get */ - struct huft *tl = (struct huft *)NULL; /* literal/length code table */ - struct huft *td = (struct huft *)NULL; /* distance code table */ - struct huft *th; /* temp huft table pointer used in tables decoding */ - unsigned bl; /* lookup bits for tl */ - unsigned bd; /* lookup bits for td */ - unsigned nb; /* number of bit length codes */ - unsigned nl; /* number of literal/length codes */ - unsigned nd; /* number of distance codes */ - unsigned ll[MAXLITLENS+MAXDISTS]; /* lit./length and distance code lengths */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local bit buffer */ - Trace((stderr, "\ndynamic block")); - b = G.bb; - k = G.bk; - - - /* read in table lengths */ - NEEDBITS(5) - nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ - DUMPBITS(5) - NEEDBITS(5) - nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ - DUMPBITS(5) - NEEDBITS(4) - nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ - DUMPBITS(4) - if (nl > MAXLITLENS || nd > MAXDISTS) - return 1; /* bad lengths */ - - - /* read in bit-length-code lengths */ - for (j = 0; j < nb; j++) - { - NEEDBITS(3) - ll[border[j]] = (unsigned)b & 7; - DUMPBITS(3) - } - for (; j < 19; j++) - ll[border[j]] = 0; - - - /* build decoding table for trees--single level, 7 bit lookup */ - bl = 7; - retval = huft_build(__G__ ll, 19, 19, NULL, NULL, &tl, &bl); - if (bl == 0) /* no bit lengths */ - retval = 1; - if (retval) - { - if (retval == 1) - huft_free(tl); - return retval; /* incomplete code set */ - } - - - /* read in literal and distance code lengths */ - n = nl + nd; - m = mask_bits[bl]; - i = l = 0; - while (i < n) - { - NEEDBITS(bl) - j = (th = tl + ((unsigned)b & m))->b; - DUMPBITS(j) - j = th->v.n; - if (j < 16) /* length of code in bits (0..15) */ - ll[i++] = l = j; /* save last length in l */ - else if (j == 16) /* repeat last length 3 to 6 times */ - { - NEEDBITS(2) - j = 3 + ((unsigned)b & 3); - DUMPBITS(2) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = l; - } - else if (j == 17) /* 3 to 10 zero length codes */ - { - NEEDBITS(3) - j = 3 + ((unsigned)b & 7); - DUMPBITS(3) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = 0; - l = 0; - } - else /* j == 18: 11 to 138 zero length codes */ - { - NEEDBITS(7) - j = 11 + ((unsigned)b & 0x7f); - DUMPBITS(7) - if ((unsigned)i + j > n) { - huft_free(tl); - return 1; - } - while (j--) - ll[i++] = 0; - l = 0; - } - } - - - /* free decoding table for trees */ - huft_free(tl); - - - /* restore the global bit buffer */ - G.bb = b; - G.bk = k; - - - /* build the decoding tables for literal/length and distance codes */ - bl = lbits; -#ifdef USE_DEFLATE64 - retval = huft_build(__G__ ll, nl, 257, G.cplens, G.cplext, &tl, &bl); -#else - retval = huft_build(__G__ ll, nl, 257, cplens, cplext, &tl, &bl); -#endif - if (bl == 0) /* no literals or lengths */ - retval = 1; - if (retval) - { - if (retval == 1) { - if (!uO.qflag) - MESSAGE((uch *)"(incomplete l-tree) ", 21L, 1); - huft_free(tl); - } - return retval; /* incomplete code set */ - } -#ifdef FIX_PAST_EOB_BY_TABLEADJUST - /* Adjust the requested distance base table size so that a distance code - fetch never tries to get bits behind an immediatly following end-of-block - code. */ - bd = (dbits <= bl+1 ? dbits : bl+1); -#else - bd = dbits; -#endif -#ifdef USE_DEFLATE64 - retval = huft_build(__G__ ll + nl, nd, 0, cpdist, G.cpdext, &td, &bd); -#else - retval = huft_build(__G__ ll + nl, nd, 0, cpdist, cpdext, &td, &bd); -#endif -#ifdef PKZIP_BUG_WORKAROUND - if (retval == 1) - retval = 0; -#endif - if (bd == 0 && nl > 257) /* lengths but no distances */ - retval = 1; - if (retval) - { - if (retval == 1) { - if (!uO.qflag) - MESSAGE((uch *)"(incomplete d-tree) ", 21L, 1); - huft_free(td); - } - huft_free(tl); - return retval; - } - - /* decompress until an end-of-block code */ - retval = inflate_codes(__G__ tl, td, bl, bd); - -cleanup_and_exit: - /* free the decoding tables, return */ - if (tl != (struct huft *)NULL) - huft_free(tl); - if (td != (struct huft *)NULL) - huft_free(td); - return retval; -} - - - -static int inflate_block(__G__ e) - __GDEF - int *e; /* last block flag */ -/* decompress an inflated block */ -{ - unsigned t; /* block type */ - register ulg b; /* bit buffer */ - register unsigned k; /* number of bits in bit buffer */ - int retval = 0; /* error code returned: initialized to "no error" */ - - - /* make local bit buffer */ - b = G.bb; - k = G.bk; - - - /* read in last block bit */ - NEEDBITS(1) - *e = (int)b & 1; - DUMPBITS(1) - - - /* read in block type */ - NEEDBITS(2) - t = (unsigned)b & 3; - DUMPBITS(2) - - - /* restore the global bit buffer */ - G.bb = b; - G.bk = k; - - - /* inflate that block type */ - if (t == 2) - return inflate_dynamic(__G); - if (t == 0) - return inflate_stored(__G); - if (t == 1) - return inflate_fixed(__G); - - - /* bad block type */ - retval = 2; - -cleanup_and_exit: - return retval; -} - - - -int inflate(__G__ is_defl64) - __GDEF - int is_defl64; -/* decompress an inflated entry */ -{ - int e; /* last block flag */ - int r; /* result code */ -#ifdef DEBUG - unsigned h = 0; /* maximum struct huft's malloc'ed */ -#endif - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) - if (G.redirect_slide) - wsize = G.redirect_size, redirSlide = G.redirect_buffer; - else - wsize = WSIZE, redirSlide = slide; /* how they're #defined if !DLL */ -#endif - - /* initialize window, bit buffer */ - G.wp = 0; - G.bk = 0; - G.bb = 0; - -#ifdef USE_DEFLATE64 - if (is_defl64) { - G.cplens = cplens64; - G.cplext = cplext64; - G.cpdext = cpdext64; - G.fixed_tl = G.fixed_tl64; - G.fixed_bl = G.fixed_bl64; - G.fixed_td = G.fixed_td64; - G.fixed_bd = G.fixed_bd64; - } else { - G.cplens = cplens32; - G.cplext = cplext32; - G.cpdext = cpdext32; - G.fixed_tl = G.fixed_tl32; - G.fixed_bl = G.fixed_bl32; - G.fixed_td = G.fixed_td32; - G.fixed_bd = G.fixed_bd32; - } -#else /* !USE_DEFLATE64 */ - if (is_defl64) { - /* This should not happen unless UnZip is built from object files - * compiled with inconsistent option setting. Handle this by - * returning with "bad input" error code. - */ - Trace((stderr, "\nThis inflate() cannot handle Deflate64!\n")); - return 2; - } -#endif /* ?USE_DEFLATE64 */ - - /* decompress until the last block */ - do { -#ifdef DEBUG - G.hufts = 0; -#endif - if ((r = inflate_block(__G__ &e)) != 0) - return r; -#ifdef DEBUG - if (G.hufts > h) - h = G.hufts; -#endif - } while (!e); - - Trace((stderr, "\n%u bytes in Huffman tables (%u/entry)\n", - h * (unsigned)sizeof(struct huft), (unsigned)sizeof(struct huft))); - -#ifdef USE_DEFLATE64 - if (is_defl64) { - G.fixed_tl64 = G.fixed_tl; - G.fixed_bl64 = G.fixed_bl; - G.fixed_td64 = G.fixed_td; - G.fixed_bd64 = G.fixed_bd; - } else { - G.fixed_tl32 = G.fixed_tl; - G.fixed_bl32 = G.fixed_bl; - G.fixed_td32 = G.fixed_td; - G.fixed_bd32 = G.fixed_bd; - } -#endif - - /* flush out redirSlide and return (success, unless final FLUSH failed) */ - return (FLUSH(G.wp)); -} - - - -int inflate_free(__G) - __GDEF -{ - if (G.fixed_tl != (struct huft *)NULL) - { - huft_free(G.fixed_td); - huft_free(G.fixed_tl); - G.fixed_td = G.fixed_tl = (struct huft *)NULL; - } - return 0; -} - -#endif /* ?USE_ZLIB */ - - -/* - * GRR: moved huft_build() and huft_free() down here; used by explode() - * and fUnZip regardless of whether USE_ZLIB defined or not - */ - - -/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ -#define BMAX 16 /* maximum bit length of any code (16 for explode) */ -#define N_MAX 288 /* maximum number of codes in any set */ - - -int huft_build(__G__ b, n, s, d, e, t, m) - __GDEF - ZCONST unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ - unsigned n; /* number of codes (assumed <= N_MAX) */ - unsigned s; /* number of simple-valued codes (0..s-1) */ - ZCONST ush *d; /* list of base values for non-simple codes */ - ZCONST uch *e; /* list of extra bits for non-simple codes */ - struct huft **t; /* result: starting table */ - unsigned *m; /* maximum lookup bits, returns actual */ -/* Given a list of code lengths and a maximum table size, make a set of - tables to decode that set of codes. Return zero on success, one if - the given code set is incomplete (the tables are still built in this - case), two if the input is invalid (all zero length codes or an - oversubscribed set of lengths), and three if not enough memory. - The code with value 256 is special, and the tables are constructed - so that no bits beyond that code are fetched when that code is - decoded. */ -{ - unsigned a; /* counter for codes of length k */ - unsigned c[BMAX+1]; /* bit length count table */ - unsigned el; /* length of EOB code (value 256) */ - unsigned f; /* i repeats in table every f entries */ - int g; /* maximum code length */ - int h; /* table level */ - register unsigned i; /* counter, current code */ - register unsigned j; /* counter */ - register int k; /* number of bits in current code */ - int lx[BMAX+1]; /* memory for l[-1..BMAX-1] */ - int *l = lx+1; /* stack of bits per table */ - register unsigned *p; /* pointer into c[], b[], or v[] */ - register struct huft *q; /* points to current table */ - struct huft r; /* table entry for structure assignment */ - struct huft *u[BMAX]; /* table stack */ - unsigned v[N_MAX]; /* values in order of bit length */ - register int w; /* bits before this table == (l * h) */ - unsigned x[BMAX+1]; /* bit offsets, then code stack */ - unsigned *xp; /* pointer into x */ - int y; /* number of dummy codes added */ - unsigned z; /* number of entries in current table */ - - - /* Generate counts for each bit length */ - el = n > 256 ? b[256] : BMAX; /* set length of EOB code, if any */ - memzero((char *)c, sizeof(c)); - p = (unsigned *)b; i = n; - do { - c[*p]++; p++; /* assume all entries <= BMAX */ - } while (--i); - if (c[0] == n) /* null input--all zero length codes */ - { - *t = (struct huft *)NULL; - *m = 0; - return 0; - } - - - /* Find minimum and maximum length, bound *m by those */ - for (j = 1; j <= BMAX; j++) - if (c[j]) - break; - k = j; /* minimum code length */ - if (*m < j) - *m = j; - for (i = BMAX; i; i--) - if (c[i]) - break; - g = i; /* maximum code length */ - if (*m > i) - *m = i; - - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= c[j]) < 0) - return 2; /* bad input: more codes than bits */ - if ((y -= c[i]) < 0) - return 2; - c[i] += y; - - - /* Generate starting offsets into the value table for each length */ - x[1] = j = 0; - p = c + 1; xp = x + 2; - while (--i) { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - - /* Make a table of values in order of bit lengths */ - memzero((char *)v, sizeof(v)); - p = (unsigned *)b; i = 0; - do { - if ((j = *p++) != 0) - v[x[j]++] = i; - } while (++i < n); - n = x[g]; /* set n to length of v */ - - - /* Generate the Huffman codes and for each, make the table entries */ - x[0] = i = 0; /* first Huffman code is zero */ - p = v; /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = l[-1] = 0; /* no bits decoded yet */ - u[0] = (struct huft *)NULL; /* just to keep compilers happy */ - q = (struct huft *)NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = c[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l[h]) - { - w += l[h++]; /* add bits already decoded */ - - /* compute minimum size table less than or equal to *m bits */ - z = (z = g - w) > *m ? *m : z; /* upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = c + k; - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - if ((unsigned)w + j > el && (unsigned)w < el) - j = el - w; /* make EOB code end at table */ - z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ - - /* allocate and link in new table */ - if ((q = (struct huft *)malloc((z + 1)*sizeof(struct huft))) == - (struct huft *)NULL) - { - if (h) - huft_free(u[0]); - return 3; /* not enough memory */ - } -#ifdef DEBUG - G.hufts += z + 1; /* track memory usage */ -#endif - *t = q + 1; /* link to list for huft_free() */ - *(t = &(q->v.t)) = (struct huft *)NULL; - u[h] = ++q; /* table starts after link */ - - /* connect to last table, if there is one */ - if (h) - { - x[h] = i; /* save pattern for backing up */ - r.b = (uch)l[h-1]; /* bits to dump before this table */ - r.e = (uch)(32 + j); /* bits in this table */ - r.v.t = q; /* pointer to this table */ - j = (i & ((1 << w) - 1)) >> (w - l[h-1]); - u[h-1][j] = r; /* connect to last table */ - } - } - - /* set up table entry in r */ - r.b = (uch)(k - w); - if (p >= v + n) - r.e = INVALID_CODE; /* out of values--invalid code */ - else if (*p < s) - { - r.e = (uch)(*p < 256 ? 32 : 31); /* 256 is end-of-block code */ - r.v.n = (ush)*p++; /* simple code is just the value */ - } - else - { - r.e = e[*p - s]; /* non-simple--look up in lists */ - r.v.n = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - while ((i & ((1 << w) - 1)) != x[h]) - w -= l[--h]; /* don't need to update q */ - } - } - - - /* return actual size of base table */ - *m = l[0]; - - - /* Return true (1) if we were given an incomplete table */ - return y != 0 && g != 1; -} - - - -int huft_free(t) -struct huft *t; /* table to free */ -/* Free the malloc'ed tables built by huft_build(), which makes a linked - list of the tables it made, with the links in a dummy first entry of - each table. */ -{ - register struct huft *p, *q; - - - /* Go through linked list, freeing from the malloced (t[-1]) address. */ - p = t; - while (p != (struct huft *)NULL) - { - q = (--p)->v.t; - free((zvoid *)p); - p = q; - } - return 0; -} diff --git a/data/windows/unzipfx-catia/inflate.h b/data/windows/unzipfx-catia/inflate.h deleted file mode 100644 index 9ce48af..0000000 --- a/data/windows/unzipfx-catia/inflate.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* inflate.h for UnZip -- by Mark Adler - version c14f, 23 November 1995 */ - - -/* Copyright history: - - Starting with UnZip 5.41 of 16-April-2000, this source file - is covered by the Info-Zip LICENSE cited above. - - Prior versions of this source file, found in UnZip source packages - up to UnZip 5.40, were put in the public domain. - The original copyright note by Mark Adler was: - "You can do whatever you like with this source file, - though I would prefer that if you modify it and - redistribute it that you include comments to that effect - with your name and the date. Thank you." - - History: - vers date who what - ---- --------- -------------- ------------------------------------ - c14 12 Mar 93 M. Adler made inflate.c standalone with the - introduction of inflate.h. - c14d 28 Aug 93 G. Roelofs replaced flush/FlushOutput with new version - c14e 29 Sep 93 G. Roelofs moved everything into unzip.h; added crypt.h - c14f 23 Nov 95 G. Roelofs added UNZIP_INTERNAL to accommodate newly - split unzip.h - */ - -#define UNZIP_INTERNAL -#include "unzip.h" /* provides slide[], typedefs and macros */ -#ifdef FUNZIP -# include "crypt.h" /* provides NEXTBYTE macro for crypt version of funzip */ -#endif diff --git a/data/windows/unzipfx-catia/match.c b/data/windows/unzipfx-catia/match.c deleted file mode 100644 index f634409..0000000 --- a/data/windows/unzipfx-catia/match.c +++ /dev/null @@ -1,442 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - match.c - - The match() routine recursively compares a string to a "pattern" (regular - expression), returning TRUE if a match is found or FALSE if not. This - version is specifically for use with unzip.c: as did the previous match() - routines from SEA and J. Kercheval, it leaves the case (upper, lower, or - mixed) of the string alone, but converts any uppercase characters in the - pattern to lowercase if indicated by the global var pInfo->lcflag (which - is to say, string is assumed to have been converted to lowercase already, - if such was necessary). - - GRR: reversed order of text, pattern in matche() (now same as match()); - added ignore_case/ic flags, Case() macro. - - PaulK: replaced matche() with recmatch() from Zip, modified to have an - ignore_case argument; replaced test frame with simpler one. - - --------------------------------------------------------------------------- - - Copyright on recmatch() from Zip's util.c (although recmatch() was almost - certainly written by Mark Adler...ask me how I can tell :-) ): - - Copyright (C) 1990-1992 Mark Adler, Richard B. Wales, Jean-loup Gailly, - Kai Uwe Rommel and Igor Mandrichenko. - - Permission is granted to any individual or institution to use, copy, - or redistribute this software so long as all of the original files are - included unmodified, that it is not sold for profit, and that this copy- - right notice is retained. - - --------------------------------------------------------------------------- - - Match the pattern (wildcard) against the string (fixed): - - match(string, pattern, ignore_case, sepc); - - returns TRUE if string matches pattern, FALSE otherwise. In the pattern: - - `*' matches any sequence of characters (zero or more) - `?' matches any single character - [SET] matches any character in the specified set, - [!SET] or [^SET] matches any character not in the specified set. - - A set is composed of characters or ranges; a range looks like ``character - hyphen character'' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of - characters allowed in the [..] pattern construct. Other characters are - allowed (i.e., 8-bit characters) if your system will support them. - - To suppress the special syntactic significance of any of ``[]*?!^-\'', in- - side or outside a [..] construct, and match the character exactly, precede - it with a ``\'' (backslash). - - Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is - defined. See the DOSWILD section below for an explanation. Note also - that with VMSWILD defined, '%' is used instead of '?', and sets (ranges) - are delimited by () instead of []. - - ---------------------------------------------------------------------------*/ - - -#define __MATCH_C /* identifies this source module */ - -/* define ToLower() in here (for Unix, define ToLower to be macro (using - * isupper()); otherwise just use tolower() */ -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifndef THEOS /* the Theos port defines its own variant of match() */ - -#if 0 /* this is not useful until it matches Amiga names insensitively */ -#ifdef AMIGA /* some other platforms might also want to use this */ -# define ANSI_CHARSET /* MOVE INTO UNZIP.H EVENTUALLY */ -#endif -#endif /* 0 */ - -#ifdef ANSI_CHARSET -# ifdef ToLower -# undef ToLower -# endif - /* uppercase letters are values 41 thru 5A, C0 thru D6, and D8 thru DE */ -# define IsUpper(c) (c>=0xC0 ? c<=0xDE && c!=0xD7 : c>=0x41 && c<=0x5A) -# define ToLower(c) (IsUpper((uch) c) ? (unsigned) c | 0x20 : (unsigned) c) -#endif -#define Case(x) (ic? ToLower(x) : (x)) - -#ifdef VMSWILD -# define WILDCHAR '%' -# define BEG_RANGE '(' -# define END_RANGE ')' -#else -# define WILDCHAR '?' -# define BEG_RANGE '[' -# define END_RANGE ']' -#endif - -#if 0 /* GRR: add this to unzip.h someday... */ -#if !(defined(MSDOS) && defined(DOSWILD)) -#ifdef WILD_STOP_AT_DIR -#define match(s,p,ic,sc) (recmatch((ZCONST uch *)p,(ZCONST uch *)s,ic,sc) == 1) -#else -#define match(s,p,ic) (recmatch((ZCONST uch *)p,(ZCONST uch *)s,ic) == 1) -#endif -int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, - int ignore_case __WDLPRO)); -#endif -#endif /* 0 */ -static int recmatch OF((ZCONST uch *pattern, ZCONST uch *string, - int ignore_case __WDLPRO)); -static char *isshexp OF((ZCONST char *p)); -static int namecmp OF((ZCONST char *s1, ZCONST char *s2)); - - -/* match() is a shell to recmatch() to return only Boolean values. */ - -int match(string, pattern, ignore_case __WDL) - ZCONST char *string, *pattern; - int ignore_case; - __WDLDEF -{ -#if (defined(MSDOS) && defined(DOSWILD)) - char *dospattern; - int j = strlen(pattern); - -/*--------------------------------------------------------------------------- - Optional MS-DOS preprocessing section: compare last three chars of the - wildcard to "*.*" and translate to "*" if found; else compare the last - two characters to "*." and, if found, scan the non-wild string for dots. - If in the latter case a dot is found, return failure; else translate the - "*." to "*". In either case, continue with the normal (Unix-like) match - procedure after translation. (If not enough memory, default to normal - match.) This causes "a*.*" and "a*." to behave as MS-DOS users expect. - ---------------------------------------------------------------------------*/ - - if ((dospattern = (char *)malloc(j+1)) != NULL) { - strcpy(dospattern, pattern); - if (!strcmp(dospattern+j-3, "*.*")) { - dospattern[j-2] = '\0'; /* nuke the ".*" */ - } else if (!strcmp(dospattern+j-2, "*.")) { - char *p = MBSCHR(string, '.'); - - if (p) { /* found a dot: match fails */ - free(dospattern); - return 0; - } - dospattern[j-1] = '\0'; /* nuke the end "." */ - } - j = recmatch((uch *)dospattern, (uch *)string, ignore_case __WDL); - free(dospattern); - return j == 1; - } else -#endif /* MSDOS && DOSWILD */ - return recmatch((uch *)pattern, (uch *)string, ignore_case __WDL) == 1; -} - - - -static int recmatch(p, s, ic __WDL) - ZCONST uch *p; /* sh pattern to match */ - ZCONST uch *s; /* string to which to match it */ - int ic; /* true for case insensitivity */ - __WDLDEF /* directory sepchar for WildStopAtDir mode, or 0 */ -/* Recursively compare the sh pattern p with the string s and return 1 if - * they match, and 0 or 2 if they don't or if there is a syntax error in the - * pattern. This routine recurses on itself no more deeply than the number - * of characters in the pattern. */ -{ - unsigned int c; /* pattern char or start of range in [-] loop */ - - /* Get first character, the pattern for new recmatch calls follows */ - c = *p; INCSTR(p); - - /* If that was the end of the pattern, match if string empty too */ - if (c == 0) - return *s == 0; - - /* '?' (or '%') matches any character (but not an empty string). */ - if (c == WILDCHAR) -#ifdef WILD_STOP_AT_DIR - /* If uO.W_flag is non-zero, it won't match '/' */ - return (*s && (!sepc || *s != (uch)sepc)) - ? recmatch(p, s + CLEN(s), ic, sepc) : 0; -#else - return *s ? recmatch(p, s + CLEN(s), ic) : 0; -#endif - - /* '*' matches any number of characters, including zero */ -#ifdef AMIGA - if (c == '#' && *p == '?') /* "#?" is Amiga-ese for "*" */ - c = '*', p++; -#endif /* AMIGA */ - if (c == '*') { -#ifdef WILD_STOP_AT_DIR - if (sepc) { - /* check for single "*" or double "**" */ -# ifdef AMIGA - if ((c = p[0]) == '#' && p[1] == '?') /* "#?" is Amiga-ese for "*" */ - c = '*', p++; - if (c != '*') { -# else /* !AMIGA */ - if (*p != '*') { -# endif /* ?AMIGA */ - /* single "*": this doesn't match the dirsep character */ - for (; *s && *s != (uch)sepc; INCSTR(s)) - if ((c = recmatch(p, s, ic, sepc)) != 0) - return (int)c; - /* end of pattern: matched if at end of string, else continue */ - if (*p == '\0') - return (*s == 0); - /* continue to match if at sepc in pattern, else give up */ - return (*p == (uch)sepc || (*p == '\\' && p[1] == (uch)sepc)) - ? recmatch(p, s, ic, sepc) : 2; - } - /* "**": this matches slashes */ - ++p; /* move p behind the second '*' */ - /* and continue with the non-W_flag code variant */ - } -#endif /* WILD_STOP_AT_DIR */ - if (*p == 0) - return 1; - if (isshexp((ZCONST char *)p) == NULL) { - /* Optimization for rest of pattern being a literal string: - * If there are no other shell expression chars in the rest - * of the pattern behind the multi-char wildcard, then just - * compare the literal string tail. - */ - ZCONST uch *srest; - - srest = s + (strlen((ZCONST char *)s) - strlen((ZCONST char *)p)); - if (srest - s < 0) - /* remaining literal string from pattern is longer than rest - * of test string, there can't be a match - */ - return 0; - else - /* compare the remaining literal pattern string with the last - * bytes of the test string to check for a match - */ -#ifdef _MBCS - { - ZCONST uch *q = s; - - /* MBCS-aware code must not scan backwards into a string from - * the end. - * So, we have to move forward by character from our well-known - * character position s in the test string until we have - * advanced to the srest position. - */ - while (q < srest) - INCSTR(q); - /* In case the byte *srest is a trailing byte of a multibyte - * character in the test string s, we have actually advanced - * past the position (srest). - * For this case, the match has failed! - */ - if (q != srest) - return 0; - return ((ic - ? namecmp((ZCONST char *)p, (ZCONST char *)q) - : strcmp((ZCONST char *)p, (ZCONST char *)q) - ) == 0); - } -#else /* !_MBCS */ - return ((ic - ? namecmp((ZCONST char *)p, (ZCONST char *)srest) - : strcmp((ZCONST char *)p, (ZCONST char *)srest) - ) == 0); -#endif /* ?_MBCS */ - } else { - /* pattern contains more wildcards, continue with recursion... */ - for (; *s; INCSTR(s)) - if ((c = recmatch(p, s, ic __WDL)) != 0) - return (int)c; - return 2; /* 2 means give up--match will return false */ - } - } - - /* Parse and process the list of characters and ranges in brackets */ - if (c == BEG_RANGE) { - int e; /* flag true if next char to be taken literally */ - ZCONST uch *q; /* pointer to end of [-] group */ - int r; /* flag true to match anything but the range */ - - if (*s == 0) /* need a character to match */ - return 0; - p += (r = (*p == '!' || *p == '^')); /* see if reverse */ - for (q = p, e = 0; *q; INCSTR(q)) /* find closing bracket */ - if (e) - e = 0; - else - if (*q == '\\') /* GRR: change to ^ for MS-DOS, OS/2? */ - e = 1; - else if (*q == END_RANGE) - break; - if (*q != END_RANGE) /* nothing matches if bad syntax */ - return 0; - for (c = 0, e = (*p == '-'); p < q; INCSTR(p)) { - /* go through the list */ - if (!e && *p == '\\') /* set escape flag if \ */ - e = 1; - else if (!e && *p == '-') /* set start of range if - */ - c = *(p-1); - else { - unsigned int cc = Case(*s); - - if (*(p+1) != '-') - for (c = c ? c : *p; c <= *p; c++) /* compare range */ - if ((unsigned)Case(c) == cc) /* typecast for MSC bug */ - return r ? 0 : recmatch(q + 1, s + 1, ic __WDL); - c = e = 0; /* clear range, escape flags */ - } - } - return r ? recmatch(q + CLEN(q), s + CLEN(s), ic __WDL) : 0; - /* bracket match failed */ - } - - /* if escape ('\\'), just compare next character */ - if (c == '\\' && (c = *p++) == 0) /* if \ at end, then syntax error */ - return 0; - - /* just a character--compare it */ -#ifdef QDOS - return QMatch(Case((uch)c), Case(*s)) ? - recmatch(p, s + CLEN(s), ic __WDL) : 0; -#else - return Case((uch)c) == Case(*s) ? - recmatch(p, s + CLEN(s), ic __WDL) : 0; -#endif - -} /* end function recmatch() */ - - - -static char *isshexp(p) -ZCONST char *p; -/* If p is a sh expression, a pointer to the first special character is - returned. Otherwise, NULL is returned. */ -{ - for (; *p; INCSTR(p)) - if (*p == '\\' && *(p+1)) - p++; - else if (*p == WILDCHAR || *p == '*' || *p == BEG_RANGE) - return (char *)p; - return NULL; -} /* end function isshexp() */ - - - -static int namecmp(s1, s2) - ZCONST char *s1, *s2; -{ - int d; - - for (;;) { - d = (int)ToLower((uch)*s1) - - (int)ToLower((uch)*s2); - - if (d || *s1 == 0 || *s2 == 0) - return d; - - s1++; - s2++; - } -} /* end function namecmp() */ - -#endif /* !THEOS */ - - - - -int iswild(p) /* originally only used for stat()-bug workaround in */ - ZCONST char *p; /* VAX C, Turbo/Borland C, Watcom C, Atari MiNT libs; */ -{ /* now used in process_zipfiles() as well */ - for (; *p; INCSTR(p)) - if (*p == '\\' && *(p+1)) - ++p; -#ifdef THEOS - else if (*p == '?' || *p == '*' || *p=='#'|| *p == '@') -#else /* !THEOS */ -#ifdef VMS - else if (*p == '%' || *p == '*') -#else /* !VMS */ -#ifdef AMIGA - else if (*p == '?' || *p == '*' || (*p=='#' && p[1]=='?') || *p == '[') -#else /* !AMIGA */ - else if (*p == '?' || *p == '*' || *p == '[') -#endif /* ?AMIGA */ -#endif /* ?VMS */ -#endif /* ?THEOS */ -#ifdef QDOS - return (int)p; -#else - return TRUE; -#endif - - return FALSE; - -} /* end function iswild() */ - - - - - -#ifdef TEST_MATCH - -#define put(s) {fputs(s,stdout); fflush(stdout);} -#ifdef main -# undef main -#endif - -int main(int argc, char **argv) -{ - char pat[256], str[256]; - - for (;;) { - put("Pattern (return to exit): "); - gets(pat); - if (!pat[0]) - break; - for (;;) { - put("String (return for new pattern): "); - gets(str); - if (!str[0]) - break; - printf("Case sensitive: %s insensitive: %s\n", - match(str, pat, 0) ? "YES" : "NO", - match(str, pat, 1) ? "YES" : "NO"); - } - } - EXIT(0); -} - -#endif /* TEST_MATCH */ diff --git a/data/windows/unzipfx-catia/process.c b/data/windows/unzipfx-catia/process.c deleted file mode 100644 index c62c5f0..0000000 --- a/data/windows/unzipfx-catia/process.c +++ /dev/null @@ -1,3092 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - process.c - - This file contains the top-level routines for processing multiple zipfiles. - - Contains: process_zipfiles() - free_G_buffers() - do_seekable() - file_size() - rec_find() - find_ecrec64() - find_ecrec() - process_zip_cmmnt() - process_cdir_file_hdr() - get_cdir_ent() - process_local_file_hdr() - getZip64Data() - ef_scan_for_izux() - getRISCOSexfield() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif -#if defined(DYNALLOC_CRCTAB) || defined(UNICODE_SUPPORT) -# include "crc32.h" -#endif - -#include "unzipfx/appDetails.h" - -static int do_seekable OF((__GPRO__ int lastchance)); -#ifdef DO_SAFECHECK_2GB -# ifdef USE_STRM_INPUT -static zoff_t file_size OF((FILE *file)); -# else -static zoff_t file_size OF((int fh)); -# endif -#endif /* DO_SAFECHECK_2GB */ -static int rec_find OF((__GPRO__ zoff_t, char *, int)); -static int find_ecrec64 OF((__GPRO__ zoff_t searchlen)); -static int find_ecrec OF((__GPRO__ zoff_t searchlen)); -static int process_zip_cmmnt OF((__GPRO)); -static int get_cdir_ent OF((__GPRO)); -#ifdef IZ_HAVE_UXUIDGID -static int read_ux3_value OF((ZCONST uch *dbuf, unsigned uidgid_sz, - ulg *p_uidgid)); -#endif /* IZ_HAVE_UXUIDGID */ - - -static ZCONST char Far CannotAllocateBuffers[] = - "error: cannot allocate unzip buffers\n"; - -#ifdef SFX - static ZCONST char Far CannotFindMyself[] = - "unzipsfx: cannot find myself! [%s]\n"; -# ifdef CHEAP_SFX_AUTORUN - static ZCONST char Far AutorunPrompt[] = - "\nAuto-run command: %s\nExecute this command? [y/n] "; - static ZCONST char Far NotAutoRunning[] = - "Not executing auto-run command."; -# endif - -#else /* !SFX */ - /* process_zipfiles() strings */ -# if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) - static ZCONST char Far WarnInvalidTZ[] = - "Warning: TZ environment variable not found, cannot use UTC times!!\n"; -# endif -# if !(defined(UNIX) || defined(AMIGA)) - static ZCONST char Far CannotFindWildcardMatch[] = - "%s: cannot find any matches for wildcard specification \"%s\".\n"; -# endif /* !(UNIX || AMIGA) */ - static ZCONST char Far FilesProcessOK[] = - "%d archive%s successfully processed.\n"; - static ZCONST char Far ArchiveWarning[] = - "%d archive%s had warnings but no fatal errors.\n"; - static ZCONST char Far ArchiveFatalError[] = - "%d archive%s had fatal errors.\n"; - static ZCONST char Far FileHadNoZipfileDir[] = - "%d file%s had no zipfile directory.\n"; - static ZCONST char Far ZipfileWasDir[] = "1 \"zipfile\" was a directory.\n"; - static ZCONST char Far ManyZipfilesWereDir[] = - "%d \"zipfiles\" were directories.\n"; - static ZCONST char Far NoZipfileFound[] = "No zipfiles found.\n"; - - /* do_seekable() strings */ -# ifdef UNIX - static ZCONST char Far CannotFindZipfileDirMsg[] = - "%s: cannot find zipfile directory in one of %s or\n\ - %s%s.zip, and cannot find %s, period.\n"; - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find or open %s, %s.zip or %s.\n"; -# else /* !UNIX */ - static ZCONST char Far CannotFindZipfileDirMsg[] = - "%s: cannot find zipfile directory in %s,\n\ - %sand cannot find %s, period.\n"; -# ifdef VMS - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find %s (%s).\n"; -# else /* !VMS */ - static ZCONST char Far CannotFindEitherZipfile[] = - "%s: cannot find either %s or %s.\n"; -# endif /* ?VMS */ -# endif /* ?UNIX */ - extern ZCONST char Far Zipnfo[]; /* in unzip.c */ -#ifndef WINDLL - static ZCONST char Far Unzip[] = "unzip"; -#else - static ZCONST char Far Unzip[] = "UnZip DLL"; -#endif -#ifdef DO_SAFECHECK_2GB - static ZCONST char Far ZipfileTooBig[] = - "Trying to read large file (> 2 GiB) without large file support\n"; -#endif /* DO_SAFECHECK_2GB */ - static ZCONST char Far MaybeExe[] = - "note: %s may be a plain executable, not an archive\n"; - static ZCONST char Far CentDirNotInZipMsg[] = "\n\ - [%s]:\n\ - Zipfile is disk %lu of a multi-disk archive, and this is not the disk on\n\ - which the central zipfile directory begins (disk %lu).\n"; - static ZCONST char Far EndCentDirBogus[] = - "\nwarning [%s]: end-of-central-directory record claims this\n\ - is disk %lu but that the central directory starts on disk %lu; this is a\n\ - contradiction. Attempting to process anyway.\n"; -# ifdef NO_MULTIPART - static ZCONST char Far NoMultiDiskArcSupport[] = - "\nerror [%s]: zipfile is part of multi-disk archive\n\ - (sorry, not yet supported).\n"; - static ZCONST char Far MaybePakBug[] = "warning [%s]:\ - zipfile claims to be 2nd disk of a 2-part archive;\n\ - attempting to process anyway. If no further errors occur, this archive\n\ - was probably created by PAK v2.51 or earlier. This bug was reported to\n\ - NoGate in March 1991 and was supposed to have been fixed by mid-1991; as\n\ - of mid-1992 it still hadn't been. (If further errors do occur, archive\n\ - was probably created by PKZIP 2.04c or later; UnZip does not yet support\n\ - multi-part archives.)\n"; -# else - static ZCONST char Far MaybePakBug[] = "warning [%s]:\ - zipfile claims to be last disk of a multi-part archive;\n\ - attempting to process anyway, assuming all parts have been concatenated\n\ - together in order. Expect \"errors\" and warnings...true multi-part support\ -\n doesn't exist yet (coming soon).\n"; -# endif - static ZCONST char Far ExtraBytesAtStart[] = - "warning [%s]: %s extra byte%s at beginning or within zipfile\n\ - (attempting to process anyway)\n"; -#endif /* ?SFX */ - -#if ((!defined(WINDLL) && !defined(SFX)) || !defined(NO_ZIPINFO)) - static ZCONST char Far LogInitline[] = "Archive: %s\n"; -#endif - -static ZCONST char Far MissingBytes[] = - "error [%s]: missing %s bytes in zipfile\n\ - (attempting to process anyway)\n"; -static ZCONST char Far NullCentDirOffset[] = - "error [%s]: NULL central directory offset\n\ - (attempting to process anyway)\n"; -static ZCONST char Far ZipfileEmpty[] = "warning [%s]: zipfile is empty\n"; -static ZCONST char Far CentDirStartNotFound[] = - "error [%s]: start of central directory not found;\n\ - zipfile corrupt.\n%s"; -static ZCONST char Far Cent64EndSigSearchErr[] = - "fatal error: read failure while seeking for End-of-centdir-64 signature.\n\ - This zipfile is corrupt.\n"; -static ZCONST char Far Cent64EndSigSearchOff[] = - "error: End-of-centdir-64 signature not where expected (prepended bytes?)\n\ - (attempting to process anyway)\n"; -#ifndef SFX - static ZCONST char Far CentDirTooLong[] = - "error [%s]: reported length of central directory is\n\ - %s bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1\n\ - zipfile?). Compensating...\n"; - static ZCONST char Far CentDirEndSigNotFound[] = "\ - End-of-central-directory signature not found. Either this file is not\n\ - a zipfile, or it constitutes one disk of a multi-part archive. In the\n\ - latter case the central directory and zipfile comment will be found on\n\ - the last disk(s) of this archive.\n"; -#else /* SFX */ - static ZCONST char Far CentDirEndSigNotFound[] = - " End-of-central-directory signature not found.\n"; -#endif /* ?SFX */ -#ifdef TIMESTAMP - static ZCONST char Far ZipTimeStampFailed[] = - "warning: cannot set time for %s\n"; - static ZCONST char Far ZipTimeStampSuccess[] = - "Updated time stamp for %s.\n"; -#endif -static ZCONST char Far ZipfileCommTrunc1[] = - "\ncaution: zipfile comment truncated\n"; -#ifndef NO_ZIPINFO - static ZCONST char Far NoZipfileComment[] = - "There is no zipfile comment.\n"; - static ZCONST char Far ZipfileCommentDesc[] = - "The zipfile comment is %u bytes long and contains the following text:\n"; - static ZCONST char Far ZipfileCommBegin[] = - "======================== zipfile comment begins\ - ==========================\n"; - static ZCONST char Far ZipfileCommEnd[] = - "========================= zipfile comment ends\ - ===========================\n"; - static ZCONST char Far ZipfileCommTrunc2[] = - "\n The zipfile comment is truncated.\n"; -#endif /* !NO_ZIPINFO */ -#ifdef UNICODE_SUPPORT - static ZCONST char Far UnicodeVersionError[] = - "\nwarning: Unicode Path version > 1\n"; - static ZCONST char Far UnicodeMismatchError[] = - "\nwarning: Unicode Path checksum invalid\n"; -#endif - - - - -/*******************************/ -/* Function process_zipfiles() */ -/*******************************/ - -int process_zipfiles(__G) /* return PK-type error code */ - __GDEF -{ -#ifndef SFX - char *lastzipfn = (char *)NULL; - int NumWinFiles, NumLoseFiles, NumWarnFiles; - int NumMissDirs, NumMissFiles; -#endif - int error=0, error_in_archive=0; - - -/*--------------------------------------------------------------------------- - Start by allocating buffers and (re)constructing the various PK signature - strings. - ---------------------------------------------------------------------------*/ - - G.inbuf = (uch *)malloc(INBUFSIZ + 4); /* 4 extra for hold[] (below) */ - G.outbuf = (uch *)malloc(OUTBUFSIZ + 1); /* 1 extra for string term. */ - - if ((G.inbuf == (uch *)NULL) || (G.outbuf == (uch *)NULL)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotAllocateBuffers))); - return(PK_MEM); - } - G.hold = G.inbuf + INBUFSIZ; /* to check for boundary-spanning sigs */ -#ifndef VMS /* VMS uses its own buffer scheme for textmode flush(). */ -#ifdef SMALL_MEM - G.outbuf2 = G.outbuf+RAWBUFSIZ; /* never changes */ -#endif -#endif /* !VMS */ - -#if 0 /* CRC_32_TAB has been NULLified by CONSTRUCTGLOBALS !!!! */ - /* allocate the CRC table later when we know we can read zipfile data */ - CRC_32_TAB = NULL; -#endif /* 0 */ - - /* finish up initialization of magic signature strings */ - local_hdr_sig[0] /* = extd_local_sig[0] */ = /* ASCII 'P', */ - central_hdr_sig[0] = end_central_sig[0] = /* not EBCDIC */ - end_centloc64_sig[0] = end_central64_sig[0] = 0x50; - - local_hdr_sig[1] /* = extd_local_sig[1] */ = /* ASCII 'K', */ - central_hdr_sig[1] = end_central_sig[1] = /* not EBCDIC */ - end_centloc64_sig[1] = end_central64_sig[1] = 0x4B; - -/*--------------------------------------------------------------------------- - Make sure timezone info is set correctly; localtime() returns GMT on some - OSes (e.g., Solaris 2.x) if this isn't done first. The ifdefs around - tzset() were initially copied from dos_to_unix_time() in fileio.c. They - may still be too strict; any listed OS that supplies tzset(), regardless - of whether the function does anything, should be removed from the ifdefs. - ---------------------------------------------------------------------------*/ - -#if (defined(WIN32) && defined(USE_EF_UT_TIME)) - /* For the Win32 environment, we may have to "prepare" the environment - prior to the tzset() call, to work around tzset() implementation bugs. - */ - iz_w32_prepareTZenv(); -#endif - -#if (defined(IZ_CHECK_TZ) && defined(USE_EF_UT_TIME)) -# ifndef VALID_TIMEZONE -# define VALID_TIMEZONE(tmp) \ - (((tmp = getenv("TZ")) != NULL) && (*tmp != '\0')) -# endif - { - char *p; - G.tz_is_valid = VALID_TIMEZONE(p); -# ifndef SFX - if (!G.tz_is_valid) { - Info(slide, 0x401, ((char *)slide, LoadFarString(WarnInvalidTZ))); - error_in_archive = error = PK_WARN; - } -# endif /* !SFX */ - } -#endif /* IZ_CHECK_TZ && USE_EF_UT_TIME */ - -/* For systems that do not have tzset() but supply this function using another - name (_tzset() or something similar), an appropiate "#define tzset ..." - should be added to the system specifc configuration section. */ -#if (!defined(T20_VMS) && !defined(MACOS) && !defined(RISCOS) && !defined(QDOS)) -#if (!defined(BSD) && !defined(MTS) && !defined(CMS_MVS) && !defined(TANDEM)) - tzset(); -#endif -#endif - -/* Initialize UnZip's built-in pseudo hard-coded "ISO <--> OEM" translation, - depending on the detected codepage setup. */ -#ifdef NEED_ISO_OEM_INIT - prepare_ISO_OEM_translat(__G); -#endif - -/*--------------------------------------------------------------------------- - Initialize the internal flag holding the mode of processing "overwrite - existing file" cases. We do not use the calling interface flags directly - because the overwrite mode may be changed by user interaction while - processing archive files. Such a change should not affect the option - settings as passed through the DLL calling interface. - In case of conflicting options, the 'safer' flag uO.overwrite_none takes - precedence. - ---------------------------------------------------------------------------*/ - G.overwrite_mode = (uO.overwrite_none ? OVERWRT_NEVER : - (uO.overwrite_all ? OVERWRT_ALWAYS : OVERWRT_QUERY)); - -/*--------------------------------------------------------------------------- - Match (possible) wildcard zipfile specification with existing files and - attempt to process each. If no hits, try again after appending ".zip" - suffix. If still no luck, give up. - ---------------------------------------------------------------------------*/ - -#ifdef SFX - if ((error = do_seekable(__G__ 0)) == PK_NOZIP) { -#ifdef EXE_EXTENSION - int len=strlen(G.argv0); - - /* append .exe if appropriate; also .sfx? */ - if ( (G.zipfn = (char *)malloc(len+sizeof(EXE_EXTENSION))) != - (char *)NULL ) { - strcpy(G.zipfn, G.argv0); - strcpy(G.zipfn+len, EXE_EXTENSION); - error = do_seekable(__G__ 0); - free(G.zipfn); - G.zipfn = G.argv0; /* for "cannot find myself" message only */ - } -#endif /* EXE_EXTENSION */ -#ifdef WIN32 - G.zipfn = G.argv0; /* for "cannot find myself" message only */ -#endif - } - if (error) { - if (error == IZ_DIR) - error_in_archive = PK_NOZIP; - else - error_in_archive = error; - if (error == PK_NOZIP) - Info(slide, 1, ((char *)slide, LoadFarString(CannotFindMyself), - G.zipfn)); - } -#ifdef CHEAP_SFX_AUTORUN - if (G.autorun_command[0] && !uO.qflag) { /* NO autorun without prompt! */ - Info(slide, 0x81, ((char *)slide, LoadFarString(AutorunPrompt), - FnFilter1(G.autorun_command))); - if (fgets(G.answerbuf, 9, stdin) != (char *)NULL - && toupper(*G.answerbuf) == 'Y') - system(G.autorun_command); - else - Info(slide, 1, ((char *)slide, LoadFarString(NotAutoRunning))); - } -#endif /* CHEAP_SFX_AUTORUN */ - - int sfx_app_ret = sfx_app_autorun_now(); - -#else /* !SFX */ - NumWinFiles = NumLoseFiles = NumWarnFiles = 0; - NumMissDirs = NumMissFiles = 0; - - while ((G.zipfn = do_wild(__G__ G.wildzipfn)) != (char *)NULL) { - Trace((stderr, "do_wild( %s ) returns %s\n", G.wildzipfn, G.zipfn)); - - lastzipfn = G.zipfn; - - /* print a blank line between the output of different zipfiles */ - if (!uO.qflag && error != PK_NOZIP && error != IZ_DIR -#ifdef TIMESTAMP - && (!uO.T_flag || uO.zipinfo_mode) -#endif - && (NumWinFiles+NumLoseFiles+NumWarnFiles+NumMissFiles) > 0) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - - if ((error = do_seekable(__G__ 0)) == PK_WARN) - ++NumWarnFiles; - else if (error == IZ_DIR) - ++NumMissDirs; - else if (error == PK_NOZIP) - ++NumMissFiles; - else if (error != PK_OK) - ++NumLoseFiles; - else - ++NumWinFiles; - - Trace((stderr, "do_seekable(0) returns %d\n", error)); - if (error != IZ_DIR && error > error_in_archive) - error_in_archive = error; -#ifdef WINDLL - if (error == IZ_CTRLC) { - free_G_buffers(__G); - return error; - } -#endif - - } /* end while-loop (wildcard zipfiles) */ - - if ((NumWinFiles + NumWarnFiles + NumLoseFiles) == 0 && - (NumMissDirs + NumMissFiles) == 1 && lastzipfn != (char *)NULL) - { -#if (!defined(UNIX) && !defined(AMIGA)) /* filenames with wildcard characters */ - if (iswild(G.wildzipfn)) { - if (iswild(lastzipfn)) { - NumMissDirs = NumMissFiles = 0; - error_in_archive = PK_COOL; - if (uO.qflag < 3) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindWildcardMatch), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn)); - } - } else -#endif - { -#ifndef VMS - /* 2004-11-24 SMS. - * VMS has already tried a default file type of ".zip" in - * do_wild(), so adding ZSUFX here only causes confusion by - * corrupting some valid (though nonexistent) file names. - * Complaining below about "fred;4.zip" is unlikely to be - * helpful to the victim. - */ - /* 2005-08-14 Chr. Spieler - * Although we already "know" the failure result, we call - * do_seekable() again with the same zipfile name (and the - * lastchance flag set), just to trigger the error report... - */ -#if defined(UNIX) || defined(QDOS) - char *p = -#endif - strcpy(lastzipfn + strlen(lastzipfn), ZSUFX); -#endif /* !VMS */ - - G.zipfn = lastzipfn; - - NumMissDirs = NumMissFiles = 0; - error_in_archive = PK_COOL; - -#if defined(UNIX) || defined(QDOS) - /* only Unix has case-sensitive filesystems */ - /* Well FlexOS (sometimes) also has them, but support is per media */ - /* and a pig to code for, so treat as case insensitive for now */ - /* we do this under QDOS to check for .zip as well as _zip */ - if ((error = do_seekable(__G__ 0)) == PK_NOZIP || error == IZ_DIR) { - if (error == IZ_DIR) - ++NumMissDirs; - strcpy(p, ALT_ZSUFX); - error = do_seekable(__G__ 1); - } -#else - error = do_seekable(__G__ 1); -#endif - Trace((stderr, "do_seekable(1) returns %d\n", error)); - switch (error) { - case PK_WARN: - ++NumWarnFiles; - break; - case IZ_DIR: - ++NumMissDirs; - error = PK_NOZIP; - break; - case PK_NOZIP: - /* increment again => bug: - "1 file had no zipfile directory." */ - /* ++NumMissFiles */ ; - break; - default: - if (error) - ++NumLoseFiles; - else - ++NumWinFiles; - break; - } - - if (error > error_in_archive) - error_in_archive = error; -#ifdef WINDLL - if (error == IZ_CTRLC) { - free_G_buffers(__G); - return error; - } -#endif - } - } -#endif /* ?SFX */ - -/*--------------------------------------------------------------------------- - Print summary of all zipfiles, assuming zipfile spec was a wildcard (no - need for a summary if just one zipfile). - ---------------------------------------------------------------------------*/ - -#ifndef SFX - if (iswild(G.wildzipfn) && uO.qflag < 3 -#ifdef TIMESTAMP - && !(uO.T_flag && !uO.zipinfo_mode && uO.qflag > 1) -#endif - ) - { - if ((NumMissFiles + NumLoseFiles + NumWarnFiles > 0 || NumWinFiles != 1) -#ifdef TIMESTAMP - && !(uO.T_flag && !uO.zipinfo_mode && uO.qflag) -#endif - && !(uO.tflag && uO.qflag > 1)) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0x401); - if ((NumWinFiles > 1) || - (NumWinFiles == 1 && - NumMissDirs + NumMissFiles + NumLoseFiles + NumWarnFiles > 0)) - Info(slide, 0x401, ((char *)slide, LoadFarString(FilesProcessOK), - NumWinFiles, (NumWinFiles == 1)? " was" : "s were")); - if (NumWarnFiles > 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveWarning), - NumWarnFiles, (NumWarnFiles == 1)? "" : "s")); - if (NumLoseFiles > 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(ArchiveFatalError), - NumLoseFiles, (NumLoseFiles == 1)? "" : "s")); - if (NumMissFiles > 0) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FileHadNoZipfileDir), NumMissFiles, - (NumMissFiles == 1)? "" : "s")); - if (NumMissDirs == 1) - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileWasDir))); - else if (NumMissDirs > 0) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ManyZipfilesWereDir), NumMissDirs)); - if (NumWinFiles + NumLoseFiles + NumWarnFiles == 0) - Info(slide, 0x401, ((char *)slide, LoadFarString(NoZipfileFound))); - } -#endif /* !SFX */ - - /* free allocated memory */ - free_G_buffers(__G); - - return sfx_app_ret; - -} /* end function process_zipfiles() */ - - - - - -/*****************************/ -/* Function free_G_buffers() */ -/*****************************/ - -void free_G_buffers(__G) /* releases all memory allocated in global vars */ - __GDEF -{ -#ifndef SFX - unsigned i; -#endif - -#ifdef SYSTEM_SPECIFIC_DTOR - SYSTEM_SPECIFIC_DTOR(__G); -#endif - - inflate_free(__G); - checkdir(__G__ (char *)NULL, END); - -#ifdef DYNALLOC_CRCTAB - if (CRC_32_TAB) { - free_crc_table(); - CRC_32_TAB = NULL; - } -#endif - - if (G.key != (char *)NULL) { - free(G.key); - G.key = (char *)NULL; - } - - if (G.extra_field != (uch *)NULL) { - free(G.extra_field); - G.extra_field = (uch *)NULL; - } - -#if (!defined(VMS) && !defined(SMALL_MEM)) - /* VMS uses its own buffer scheme for textmode flush() */ - if (G.outbuf2) { - free(G.outbuf2); /* malloc'd ONLY if unshrink and -a */ - G.outbuf2 = (uch *)NULL; - } -#endif - - if (G.outbuf) - free(G.outbuf); - if (G.inbuf) - free(G.inbuf); - G.inbuf = G.outbuf = (uch *)NULL; - -#ifdef UNICODE_SUPPORT - if (G.filename_full) { - free(G.filename_full); - G.filename_full = (char *)NULL; - G.fnfull_bufsize = 0; - } -#endif /* UNICODE_SUPPORT */ - -#ifndef SFX - for (i = 0; i < DIR_BLKSIZ; i++) { - if (G.info[i].cfilname != (char Far *)NULL) { - zffree(G.info[i].cfilname); - G.info[i].cfilname = (char Far *)NULL; - } - } -#endif - -#ifdef MALLOC_WORK - if (G.area.Slide) { - free(G.area.Slide); - G.area.Slide = (uch *)NULL; - } -#endif - -} /* end function free_G_buffers() */ - - - - - -/**************************/ -/* Function do_seekable() */ -/**************************/ - -static int do_seekable(__G__ lastchance) /* return PK-type error code */ - __GDEF - int lastchance; -{ -#ifndef SFX - /* static int no_ecrec = FALSE; SKM: moved to globals.h */ - int maybe_exe=FALSE; - int too_weird_to_continue=FALSE; -#ifdef TIMESTAMP - time_t uxstamp; - ulg nmember = 0L; -#endif -#endif - int error=0, error_in_archive; - - -/*--------------------------------------------------------------------------- - Open the zipfile for reading in BINARY mode to prevent CR/LF translation, - which would corrupt the bit streams. - ---------------------------------------------------------------------------*/ - - if (SSTAT(G.zipfn, &G.statbuf) || -#ifdef THEOS - (error = S_ISLIB(G.statbuf.st_mode)) != 0 || -#endif - (error = S_ISDIR(G.statbuf.st_mode)) != 0) - { -#ifndef SFX - if (lastchance && (uO.qflag < 3)) { -#if defined(UNIX) || defined(QDOS) - if (G.no_ecrec) - Info(slide, 1, ((char *)slide, - LoadFarString(CannotFindZipfileDirMsg), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, uO.zipinfo_mode? " " : "", G.wildzipfn, - G.zipfn)); - else - Info(slide, 1, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, G.wildzipfn, G.zipfn)); -#else /* !(UNIX || QDOS) */ - if (G.no_ecrec) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindZipfileDirMsg), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, uO.zipinfo_mode? " " : "", G.zipfn)); - else -#ifdef VMS - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, - (*G.zipfn ? G.zipfn : vms_msg_text()))); -#else /* !VMS */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(CannotFindEitherZipfile), - LoadFarStringSmall((uO.zipinfo_mode ? Zipnfo : Unzip)), - G.wildzipfn, G.zipfn)); -#endif /* ?VMS */ -#endif /* ?(UNIX || QDOS) */ - } -#endif /* !SFX */ - return error? IZ_DIR : PK_NOZIP; - } - G.ziplen = G.statbuf.st_size; - -#ifndef SFX -#if defined(UNIX) || defined(DOS_OS2_W32) || defined(THEOS) - if (G.statbuf.st_mode & S_IEXEC) /* no extension on Unix exes: might */ - maybe_exe = TRUE; /* find unzip, not unzip.zip; etc. */ -#endif -#endif /* !SFX */ - -#ifdef VMS - if (check_format(__G)) /* check for variable-length format */ - return PK_ERR; -#endif - - if (open_input_file(__G)) /* this should never happen, given */ - return PK_NOZIP; /* the stat() test above, but... */ - -#ifdef DO_SAFECHECK_2GB - /* Need more care: Do not trust the size returned by stat() but - determine it by reading beyond the end of the file. */ - G.ziplen = file_size(G.zipfd); - - if (G.ziplen == EOF) { - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileTooBig))); - /* - printf( -" We need a better error message for: 64-bit file, 32-bit program.\n"); - */ - CLOSE_INFILE(); - return IZ_ERRBF; - } -#endif /* DO_SAFECHECK_2GB */ - -/*--------------------------------------------------------------------------- - Find and process the end-of-central-directory header. UnZip need only - check last 65557 bytes of zipfile: comment may be up to 65535, end-of- - central-directory record is 18 bytes, and signature itself is 4 bytes; - add some to allow for appended garbage. Since ZipInfo is often used as - a debugging tool, search the whole zipfile if zipinfo_mode is true. - ---------------------------------------------------------------------------*/ - - G.cur_zipfile_bufstart = 0; - G.inptr = G.inbuf; - -#if ((!defined(WINDLL) && !defined(SFX)) || !defined(NO_ZIPINFO)) -# if (!defined(WINDLL) && !defined(SFX)) - if ( (!uO.zipinfo_mode && !uO.qflag -# ifdef TIMESTAMP - && !uO.T_flag -# endif - ) -# ifndef NO_ZIPINFO - || (uO.zipinfo_mode && uO.hflag) -# endif - ) -# else /* not (!WINDLL && !SFX) ==> !NO_ZIPINFO !! */ - if (uO.zipinfo_mode && uO.hflag) -# endif /* if..else..: (!WINDLL && !SFX) */ -# ifdef WIN32 /* Win32 console may require codepage conversion for G.zipfn */ - Info(slide, 0, ((char *)slide, LoadFarString(LogInitline), - FnFilter1(G.zipfn))); -# else - Info(slide, 0, ((char *)slide, LoadFarString(LogInitline), G.zipfn)); -# endif -#endif /* (!WINDLL && !SFX) || !NO_ZIPINFO */ - - if ( (error_in_archive = find_ecrec(__G__ -#ifndef NO_ZIPINFO - uO.zipinfo_mode ? G.ziplen : -#endif - MIN(G.ziplen, 66000L))) - > PK_WARN ) - { - CLOSE_INFILE(); - -#ifdef SFX - ++lastchance; /* avoid picky compiler warnings */ - return error_in_archive; -#else - if (maybe_exe) - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybeExe), - G.zipfn)); - if (lastchance) - return error_in_archive; - else { - G.no_ecrec = TRUE; /* assume we found wrong file: e.g., */ - return PK_NOZIP; /* unzip instead of unzip.zip */ - } -#endif /* ?SFX */ - } - - if ((uO.zflag > 0) && !uO.zipinfo_mode) { /* unzip: zflag = comment ONLY */ - CLOSE_INFILE(); - return error_in_archive; - } - -/*--------------------------------------------------------------------------- - Test the end-of-central-directory info for incompatibilities (multi-disk - archives) or inconsistencies (missing or extra bytes in zipfile). - ---------------------------------------------------------------------------*/ - -#ifdef NO_MULTIPART - error = !uO.zipinfo_mode && (G.ecrec.number_this_disk == 1) && - (G.ecrec.num_disk_start_cdir == 1); -#else - error = !uO.zipinfo_mode && (G.ecrec.number_this_disk != 0); -#endif - -#ifndef SFX - if (uO.zipinfo_mode && - G.ecrec.number_this_disk != G.ecrec.num_disk_start_cdir) - { - if (G.ecrec.number_this_disk > G.ecrec.num_disk_start_cdir) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirNotInZipMsg), G.zipfn, - (ulg)G.ecrec.number_this_disk, - (ulg)G.ecrec.num_disk_start_cdir)); - error_in_archive = PK_FIND; - too_weird_to_continue = TRUE; - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(EndCentDirBogus), G.zipfn, - (ulg)G.ecrec.number_this_disk, - (ulg)G.ecrec.num_disk_start_cdir)); - error_in_archive = PK_WARN; - } -#ifdef NO_MULTIPART /* concatenation of multiple parts works in some cases */ - } else if (!uO.zipinfo_mode && !error && G.ecrec.number_this_disk != 0) { - Info(slide, 0x401, ((char *)slide, LoadFarString(NoMultiDiskArcSupport), - G.zipfn)); - error_in_archive = PK_FIND; - too_weird_to_continue = TRUE; -#endif - } - - if (!too_weird_to_continue) { /* (relatively) normal zipfile: go for it */ - if (error) { - Info(slide, 0x401, ((char *)slide, LoadFarString(MaybePakBug), - G.zipfn)); - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - if ((G.extra_bytes = G.real_ecrec_offset-G.expect_ecrec_offset) < - (zoff_t)0) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(MissingBytes), - G.zipfn, FmZofft((-G.extra_bytes), NULL, NULL))); - error_in_archive = PK_ERR; - } else if (G.extra_bytes > 0) { - if ((G.ecrec.offset_start_central_directory == 0) && - (G.ecrec.size_central_directory != 0)) /* zip 1.5 -go bug */ - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(NullCentDirOffset), G.zipfn)); - G.ecrec.offset_start_central_directory = G.extra_bytes; - G.extra_bytes = 0; - error_in_archive = PK_ERR; - } -#ifndef SFX - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExtraBytesAtStart), G.zipfn, - FmZofft(G.extra_bytes, NULL, NULL), - (G.extra_bytes == 1)? "":"s")); - error_in_archive = PK_WARN; - } -#endif /* !SFX */ - } - - /*----------------------------------------------------------------------- - Check for empty zipfile and exit now if so. - -----------------------------------------------------------------------*/ - - if (G.expect_ecrec_offset==0L && G.ecrec.size_central_directory==0) { - if (uO.zipinfo_mode) - Info(slide, 0, ((char *)slide, "%sEmpty zipfile.\n", - uO.lflag>9? "\n " : "")); - else - Info(slide, 0x401, ((char *)slide, LoadFarString(ZipfileEmpty), - G.zipfn)); - CLOSE_INFILE(); - return (error_in_archive > PK_WARN)? error_in_archive : PK_WARN; - } - - /*----------------------------------------------------------------------- - Compensate for missing or extra bytes, and seek to where the start - of central directory should be. If header not found, uncompensate - and try again (necessary for at least some Atari archives created - with STZip, as well as archives created by J.H. Holm's ZIPSPLIT 1.1). - -----------------------------------------------------------------------*/ - - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if (error == PK_BADERR) { - CLOSE_INFILE(); - return PK_BADERR; - } -#ifdef OLD_SEEK_TEST - if (error != PK_OK || readbuf(__G__ G.sig, 4) == 0) { - CLOSE_INFILE(); - return PK_ERR; /* file may be locked, or possibly disk error(?) */ - } - if (memcmp(G.sig, central_hdr_sig, 4)) -#else - if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || - memcmp(G.sig, central_hdr_sig, 4)) -#endif - { -#ifndef SFX - zoff_t tmp = G.extra_bytes; -#endif - - G.extra_bytes = 0; - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if ((error != PK_OK) || (readbuf(__G__ G.sig, 4) == 0) || - memcmp(G.sig, central_hdr_sig, 4)) - { - if (error != PK_BADERR) - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirStartNotFound), G.zipfn, - LoadFarStringSmall(ReportMsg))); - CLOSE_INFILE(); - return (error != PK_OK ? error : PK_BADERR); - } -#ifndef SFX - Info(slide, 0x401, ((char *)slide, LoadFarString(CentDirTooLong), - G.zipfn, FmZofft((-tmp), NULL, NULL))); -#endif - error_in_archive = PK_ERR; - } - - /*----------------------------------------------------------------------- - Seek to the start of the central directory one last time, since we - have just read the first entry's signature bytes; then list, extract - or test member files as instructed, and close the zipfile. - -----------------------------------------------------------------------*/ - - error = seek_zipf(__G__ G.ecrec.offset_start_central_directory); - if (error != PK_OK) { - CLOSE_INFILE(); - return error; - } - - Trace((stderr, "about to extract/list files (error = %d)\n", - error_in_archive)); - -#ifdef DLL - /* G.fValidate is used only to look at an archive to see if - it appears to be a valid archive. There is no interest - in what the archive contains, nor in validating that the - entries in the archive are in good condition. This is - currently used only in the Windows DLLs for purposes of - checking archives within an archive to determine whether - or not to display the inner archives. - */ - if (!G.fValidate) -#endif - { -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) - error = zipinfo(__G); /* ZIPINFO 'EM */ - else -#endif -#ifndef SFX -#ifdef TIMESTAMP - if (uO.T_flag) - error = get_time_stamp(__G__ &uxstamp, &nmember); - else -#endif - if (uO.vflag && !uO.tflag && !uO.cflag) - error = list_files(__G); /* LIST 'EM */ - else -#endif /* !SFX */ - error = extract_or_test_files(__G); /* EXTRACT OR TEST 'EM */ - - Trace((stderr, "done with extract/list files (error = %d)\n", - error)); - } - - if (error > error_in_archive) /* don't overwrite stronger error */ - error_in_archive = error; /* with (for example) a warning */ -#ifndef SFX - } /* end if (!too_weird_to_continue) */ -#endif - - CLOSE_INFILE(); - -#ifdef TIMESTAMP - if (uO.T_flag && !uO.zipinfo_mode && (nmember > 0L)) { -# ifdef WIN32 - if (stamp_file(__G__ G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ -# else - if (stamp_file(G.zipfn, uxstamp)) { /* TIME-STAMP 'EM */ -# endif - if (uO.qflag < 3) - Info(slide, 0x201, ((char *)slide, - LoadFarString(ZipTimeStampFailed), G.zipfn)); - if (error_in_archive < PK_WARN) - error_in_archive = PK_WARN; - } else { - if (!uO.qflag) - Info(slide, 0, ((char *)slide, - LoadFarString(ZipTimeStampSuccess), G.zipfn)); - } - } -#endif - return error_in_archive; - -} /* end function do_seekable() */ - - - - -#ifdef DO_SAFECHECK_2GB -/************************/ -/* Function file_size() */ -/************************/ -/* File size determination which does not mislead for large files in a - small-file program. Probably should be somewhere else. - The file has to be opened previously -*/ -#ifdef USE_STRM_INPUT -static zoff_t file_size(file) - FILE *file; -{ - int sts; - size_t siz; -#else /* !USE_STRM_INPUT */ -static zoff_t file_size(fh) - int fh; -{ - int siz; -#endif /* ?USE_STRM_INPUT */ - zoff_t ofs; - char waste[4]; - -#ifdef USE_STRM_INPUT - /* Seek to actual EOF. */ - sts = zfseeko(file, 0, SEEK_END); - if (sts != 0) { - /* fseeko() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Get apparent offset at EOF. */ - ofs = zftello(file); - if (ofs < 0) { - /* Offset negative (overflow). File too big. */ - ofs = EOF; - } else { - /* Seek to apparent EOF offset. - Won't be at actual EOF if offset was truncated. - */ - sts = zfseeko(file, ofs, SEEK_SET); - if (sts != 0) { - /* fseeko() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Read a byte at apparent EOF. Should set EOF flag. */ - siz = fread(waste, 1, 1, file); - if (feof(file) == 0) { - /* Not at EOF, but should be. File too big. */ - ofs = EOF; - } - } - } - } -#else /* !USE_STRM_INPUT */ - /* Seek to actual EOF. */ - ofs = zlseek(fh, 0, SEEK_END); - if (ofs == (zoff_t) -1) { - /* zlseek() failed. (Unlikely.) */ - ofs = EOF; - } else if (ofs < 0) { - /* Offset negative (overflow). File too big. */ - ofs = EOF; - } else { - /* Seek to apparent EOF offset. - Won't be at actual EOF if offset was truncated. - */ - ofs = zlseek(fh, ofs, SEEK_SET); - if (ofs == (zoff_t) -1) { - /* zlseek() failed. (Unlikely.) */ - ofs = EOF; - } else { - /* Read a byte at apparent EOF. Should set EOF flag. */ - siz = read(fh, waste, 1); - if (siz != 0) { - /* Not at EOF, but should be. File too big. */ - ofs = EOF; - } - } - } -#endif /* ?USE_STRM_INPUT */ - return ofs; -} /* end function file_size() */ -#endif /* DO_SAFECHECK_2GB */ - - - - -/***********************/ -/* Function rec_find() */ -/***********************/ - -static int rec_find(__G__ searchlen, signature, rec_size) - /* return 0 when rec found, 1 when not found, 2 in case of read error */ - __GDEF - zoff_t searchlen; - char* signature; - int rec_size; -{ - int i, numblks, found=FALSE; - zoff_t tail_len; - -/*--------------------------------------------------------------------------- - Zipfile is longer than INBUFSIZ: may need to loop. Start with short - block at end of zipfile (if not TOO short). - ---------------------------------------------------------------------------*/ - - if ((tail_len = G.ziplen % INBUFSIZ) > rec_size) { -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, G.ziplen-tail_len, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, G.ziplen-tail_len, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd, (char *)G.inbuf, - (unsigned int)tail_len)) != (int)tail_len) - return 2; /* it's expedient... */ - - /* 'P' must be at least (rec_size+4) bytes from end of zipfile */ - for (G.inptr = G.inbuf+(int)tail_len-(rec_size+4); - G.inptr >= G.inbuf; - --G.inptr) { - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, signature, 4) ) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - } - /* sig may span block boundary: */ - memcpy((char *)G.hold, (char *)G.inbuf, 3); - } else - G.cur_zipfile_bufstart = G.ziplen - tail_len; - -/*----------------------------------------------------------------------- - Loop through blocks of zipfile data, starting at the end and going - toward the beginning. In general, need not check whole zipfile for - signature, but may want to do so if testing. - -----------------------------------------------------------------------*/ - - numblks = (int)((searchlen - tail_len + (INBUFSIZ-1)) / INBUFSIZ); - /* ==amount= ==done== ==rounding== =blksiz= */ - - for (i = 1; !found && (i <= numblks); ++i) { - G.cur_zipfile_bufstart -= INBUFSIZ; -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET); -#else /* !USE_STRM_INPUT */ - zlseek(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd,(char *)G.inbuf,INBUFSIZ)) - != INBUFSIZ) - return 2; /* read error is fatal failure */ - - for (G.inptr = G.inbuf+INBUFSIZ-1; G.inptr >= G.inbuf; --G.inptr) - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, signature, 4) ) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - /* sig may span block boundary: */ - memcpy((char *)G.hold, (char *)G.inbuf, 3); - } - return (found ? 0 : 1); -} /* end function rec_find() */ - - - - -#if 0 -/********************************/ -/* Function check_ecrec_zip64() */ -/********************************/ - -static int check_ecrec_zip64(__G) - __GDEF -{ - return G.ecrec.offset_start_central_directory == 0xFFFFFFFFL - || G.ecrec.size_central_directory == 0xFFFFFFFFL - || G.ecrec.total_entries_central_dir == 0xFFFF - || G.ecrec.num_entries_centrl_dir_ths_disk == 0xFFFF - || G.ecrec.num_disk_start_cdir == 0xFFFF - || G.ecrec.number_this_disk == 0xFFFF; -} /* end function check_ecrec_zip64() */ -#endif /* never */ - - - -/***************************/ -/* Function find_ecrec64() */ -/***************************/ - -static int find_ecrec64(__G__ searchlen) /* return PK-class error */ - __GDEF - zoff_t searchlen; -{ - ec_byte_rec64 byterec; /* buf for ecrec64 */ - ec_byte_loc64 byterecL; /* buf for ecrec64 locator */ - zoff_t ecloc64_start_offset; /* start offset of ecrec64 locator */ - zusz_t ecrec64_start_offset; /* start offset of ecrec64 */ - zuvl_t ecrec64_start_disk; /* start disk of ecrec64 */ - zuvl_t ecloc64_total_disks; /* total disks */ - zuvl_t ecrec64_disk_cdstart; /* disk number of central dir start */ - zucn_t ecrec64_this_entries; /* entries on disk with ecrec64 */ - zucn_t ecrec64_tot_entries; /* total number of entries */ - zusz_t ecrec64_cdirsize; /* length of central dir */ - zusz_t ecrec64_offs_cdstart; /* offset of central dir start */ - - /* First, find the ecrec64 locator. By definition, this must be before - ecrec with nothing in between. We back up the size of the ecrec64 - locator and check. */ - - ecloc64_start_offset = G.real_ecrec_offset - (ECLOC64_SIZE+4); - if (ecloc64_start_offset < 0) - /* Seeking would go past beginning, so probably empty archive */ - return PK_COOL; - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecloc64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecloc64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterecL, ECLOC64_SIZE+4)) - != (ECLOC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterecL, end_centloc64_sig, 4) ) { - /* not found */ - return PK_COOL; - } - - /* Read the locator. */ - ecrec64_start_disk = (zuvl_t)makelong(&byterecL[NUM_DISK_START_EOCDR64]); - ecrec64_start_offset = (zusz_t)makeint64(&byterecL[OFFSET_START_EOCDR64]); - ecloc64_total_disks = (zuvl_t)makelong(&byterecL[NUM_THIS_DISK_LOC64]); - - /* Check for consistency */ -#ifdef TEST - fprintf(stdout,"\nnumber of disks (ECR) %u, (ECLOC64) %lu\n", - G.ecrec.number_this_disk, ecloc64_total_disks); fflush(stdout); -#endif - if ((G.ecrec.number_this_disk != 0xFFFF) && - (G.ecrec.number_this_disk != ecloc64_total_disks - 1)) { - /* Note: For some unknown reason, the developers at PKWARE decided to - store the "zip64 total disks" value as a counter starting from 1, - whereas all other "split/span volume" related fields use 0-based - volume numbers. Sigh... */ - /* When the total number of disks as found in the traditional ecrec - is not 0xFFFF, the disk numbers in ecrec and ecloc64 must match. - When this is not the case, the found ecrec64 locator cannot be valid. - -> This is not a Zip64 archive. - */ - Trace((stderr, - "\ninvalid ECLOC64, differing disk# (ECR %u, ECL64 %lu)\n", - G.ecrec.number_this_disk, ecloc64_total_disks - 1)); - return PK_COOL; - } - - /* If found locator, look for ecrec64 where the locator says it is. */ - - /* For now assume that ecrec64 is on the same disk as ecloc64 and ecrec, - which is usually the case and is how Zip writes it. To do this right, - however, we should allow the ecrec64 to be on another disk since - the AppNote allows it and the ecrec64 can be large, especially if - Version 2 is used (AppNote uses 8 bytes for the size of this record). */ - - /* FIX BELOW IF ADD SUPPORT FOR MULTIPLE DISKS */ - - if (ecrec64_start_offset > (zusz_t)ecloc64_start_offset) { - /* ecrec64 has to be before ecrec64 locator */ - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4)) - != (ECREC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterec, end_central64_sig, 4) ) { - /* Zip64 EOCD Record not found */ - /* Since we already have seen the Zip64 EOCD Locator, it's - possible we got here because there are bytes prepended - to the archive, like the sfx prefix. */ - - /* Make a guess as to where the Zip64 EOCD Record might be */ - ecrec64_start_offset = ecloc64_start_offset - ECREC64_SIZE - 4; - -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, ecrec64_start_offset, SEEK_SET); - G.cur_zipfile_bufstart = zftello(G.zipfd); -#else /* !USE_STRM_INPUT */ - G.cur_zipfile_bufstart = zlseek(G.zipfd, ecrec64_start_offset, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - - if ((G.incnt = read(G.zipfd, (char *)byterec, ECREC64_SIZE+4)) - != (ECREC64_SIZE+4)) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (memcmp((char *)byterec, end_central64_sig, 4) ) { - /* Zip64 EOCD Record not found */ - /* Probably something not so easy to handle so exit */ - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchErr))); - return PK_ERR; - } - - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(Cent64EndSigSearchOff))); - } - - /* Check consistency of found ecrec64 with ecloc64 (and ecrec): */ - if ( (zuvl_t)makelong(&byterec[NUMBER_THIS_DSK_REC64]) - != ecrec64_start_disk ) - /* found ecrec64 does not match ecloc64 info -> no Zip64 archive */ - return PK_COOL; - /* Read all relevant ecrec64 fields and compare them to the corresponding - ecrec fields unless those are set to "all-ones". - */ - ecrec64_disk_cdstart = - (zuvl_t)makelong(&byterec[NUM_DISK_START_CEN_DIR64]); - if ( (G.ecrec.num_disk_start_cdir != 0xFFFF) && - (G.ecrec.num_disk_start_cdir != ecrec64_disk_cdstart) ) - return PK_COOL; - ecrec64_this_entries - = makeint64(&byterec[NUM_ENTRIES_CEN_DIR_THS_DISK64]); - if ( (G.ecrec.num_entries_centrl_dir_ths_disk != 0xFFFF) && - (G.ecrec.num_entries_centrl_dir_ths_disk != ecrec64_this_entries) ) - return PK_COOL; - ecrec64_tot_entries - = makeint64(&byterec[TOTAL_ENTRIES_CENTRAL_DIR64]); - if ( (G.ecrec.total_entries_central_dir != 0xFFFF) && - (G.ecrec.total_entries_central_dir != ecrec64_tot_entries) ) - return PK_COOL; - ecrec64_cdirsize - = makeint64(&byterec[SIZE_CENTRAL_DIRECTORY64]); - if ( (G.ecrec.size_central_directory != 0xFFFFFFFFL) && - (G.ecrec.size_central_directory != ecrec64_cdirsize) ) - return PK_COOL; - ecrec64_offs_cdstart - = makeint64(&byterec[OFFSET_START_CENTRAL_DIRECT64]); - if ( (G.ecrec.offset_start_central_directory != 0xFFFFFFFFL) && - (G.ecrec.offset_start_central_directory != ecrec64_offs_cdstart) ) - return PK_COOL; - - /* Now, we are (almost) sure that we have a Zip64 archive. */ - G.ecrec.have_ecr64 = 1; - - /* Update the "end-of-central-dir offset" for later checks. */ - G.real_ecrec_offset = ecrec64_start_offset; - - /* Update all ecdir_rec data that are flagged to be invalid - in Zip64 mode. Set the ecrec64-mandatory flag when such a - case is found. */ - if (G.ecrec.number_this_disk == 0xFFFF) { - G.ecrec.number_this_disk = ecrec64_start_disk; - if (ecrec64_start_disk != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.num_disk_start_cdir == 0xFFFF) { - G.ecrec.num_disk_start_cdir = ecrec64_disk_cdstart; - if (ecrec64_disk_cdstart != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.num_entries_centrl_dir_ths_disk == 0xFFFF) { - G.ecrec.num_entries_centrl_dir_ths_disk = ecrec64_this_entries; - if (ecrec64_this_entries != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.total_entries_central_dir == 0xFFFF) { - G.ecrec.total_entries_central_dir = ecrec64_tot_entries; - if (ecrec64_tot_entries != 0xFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.size_central_directory == 0xFFFFFFFFL) { - G.ecrec.size_central_directory = ecrec64_cdirsize; - if (ecrec64_cdirsize != 0xFFFFFFFF) G.ecrec.is_zip64_archive = TRUE; - } - if (G.ecrec.offset_start_central_directory == 0xFFFFFFFFL) { - G.ecrec.offset_start_central_directory = ecrec64_offs_cdstart; - if (ecrec64_offs_cdstart != 0xFFFFFFFF) G.ecrec.is_zip64_archive = TRUE; - } - - return PK_COOL; -} /* end function find_ecrec64() */ - - - -/*************************/ -/* Function find_ecrec() */ -/*************************/ - -static int find_ecrec(__G__ searchlen) /* return PK-class error */ - __GDEF - zoff_t searchlen; -{ - int found = FALSE; - int error_in_archive; - int result; - ec_byte_rec byterec; - -/*--------------------------------------------------------------------------- - Treat case of short zipfile separately. - ---------------------------------------------------------------------------*/ - - if (G.ziplen <= INBUFSIZ) { -#ifdef USE_STRM_INPUT - zfseeko(G.zipfd, 0L, SEEK_SET); -#else /* !USE_STRM_INPUT */ - zlseek(G.zipfd, 0L, SEEK_SET); -#endif /* ?USE_STRM_INPUT */ - if ((G.incnt = read(G.zipfd,(char *)G.inbuf,(unsigned int)G.ziplen)) - == (int)G.ziplen) - - /* 'P' must be at least (ECREC_SIZE+4) bytes from end of zipfile */ - for (G.inptr = G.inbuf+(int)G.ziplen-(ECREC_SIZE+4); - G.inptr >= G.inbuf; - --G.inptr) { - if ( (*G.inptr == (uch)0x50) && /* ASCII 'P' */ - !memcmp((char *)G.inptr, end_central_sig, 4)) { - G.incnt -= (int)(G.inptr - G.inbuf); - found = TRUE; - break; - } - } - -/*--------------------------------------------------------------------------- - Zipfile is longer than INBUFSIZ: - - MB - this next block of code moved to rec_find so that same code can be - used to look for zip64 ec record. No need to include code above since - a zip64 ec record will only be looked for if it is a BIG file. - ---------------------------------------------------------------------------*/ - - } else { - found = - (rec_find(__G__ searchlen, end_central_sig, ECREC_SIZE) == 0 - ? TRUE : FALSE); - } /* end if (ziplen > INBUFSIZ) */ - -/*--------------------------------------------------------------------------- - Searched through whole region where signature should be without finding - it. Print informational message and die a horrible death. - ---------------------------------------------------------------------------*/ - - if (!found) { - if (uO.qflag || uO.zipinfo_mode) - Info(slide, 0x401, ((char *)slide, "[%s]\n", G.zipfn)); - Info(slide, 0x401, ((char *)slide, - LoadFarString(CentDirEndSigNotFound))); - return PK_ERR; /* failed */ - } - -/*--------------------------------------------------------------------------- - Found the signature, so get the end-central data before returning. Do - any necessary machine-type conversions (byte ordering, structure padding - compensation) by reading data into character array and copying to struct. - ---------------------------------------------------------------------------*/ - - G.real_ecrec_offset = G.cur_zipfile_bufstart + (G.inptr-G.inbuf); -#ifdef TEST - printf("\n found end-of-central-dir signature at offset %s (%sh)\n", - FmZofft(G.real_ecrec_offset, NULL, NULL), - FmZofft(G.real_ecrec_offset, FZOFFT_HEX_DOT_WID, "X")); - printf(" from beginning of file; offset %d (%.4Xh) within block\n", - G.inptr-G.inbuf, G.inptr-G.inbuf); -#endif - - if (readbuf(__G__ (char *)byterec, ECREC_SIZE+4) == 0) - return PK_EOF; - - G.ecrec.number_this_disk = - makeword(&byterec[NUMBER_THIS_DISK]); - G.ecrec.num_disk_start_cdir = - makeword(&byterec[NUM_DISK_WITH_START_CEN_DIR]); - G.ecrec.num_entries_centrl_dir_ths_disk = - makeword(&byterec[NUM_ENTRIES_CEN_DIR_THS_DISK]); - G.ecrec.total_entries_central_dir = - makeword(&byterec[TOTAL_ENTRIES_CENTRAL_DIR]); - G.ecrec.size_central_directory = - makelong(&byterec[SIZE_CENTRAL_DIRECTORY]); - G.ecrec.offset_start_central_directory = - makelong(&byterec[OFFSET_START_CENTRAL_DIRECTORY]); - G.ecrec.zipfile_comment_length = - makeword(&byterec[ZIPFILE_COMMENT_LENGTH]); - - /* Now, we have to read the archive comment, BEFORE the file pointer - is moved away backwards to seek for a Zip64 ECLOC64 structure. - */ - if ( (error_in_archive = process_zip_cmmnt(__G)) > PK_WARN ) - return error_in_archive; - - /* Next: Check for existence of Zip64 end-of-cent-dir locator - ECLOC64. This structure must reside on the same volume as the - classic ECREC, at exactly (ECLOC64_SIZE+4) bytes in front - of the ECREC. - The ECLOC64 structure directs to the longer ECREC64 structure - A ECREC64 will ALWAYS exist for a proper Zip64 archive, as - the "Version Needed To Extract" field is required to be set - to 4.5 or higher whenever any Zip64 features are used anywhere - in the archive, so just check for that to see if this is a - Zip64 archive. - */ - result = find_ecrec64(__G__ searchlen+76); - /* 76 bytes for zip64ec & zip64 locator */ - if (result != PK_COOL) { - if (error_in_archive < result) - error_in_archive = result; - return error_in_archive; - } - - G.expect_ecrec_offset = G.ecrec.offset_start_central_directory + - G.ecrec.size_central_directory; - -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) { - /* In ZipInfo mode, additional info about the data found in the - end-of-central-directory areas is printed out. - */ - zi_end_central(__G); - } -#endif - - return error_in_archive; - -} /* end function find_ecrec() */ - - - - - -/********************************/ -/* Function process_zip_cmmnt() */ -/********************************/ - -static int process_zip_cmmnt(__G) /* return PK-type error code */ - __GDEF -{ - int error = PK_COOL; - - -/*--------------------------------------------------------------------------- - Get the zipfile comment (up to 64KB long), if any, and print it out. - ---------------------------------------------------------------------------*/ - -#ifdef WINDLL - /* for comment button: */ - if ((!G.fValidate) && (G.lpUserFunctions != NULL)) - G.lpUserFunctions->cchComment = G.ecrec.zipfile_comment_length; -#endif /* WINDLL */ - -#ifndef NO_ZIPINFO - /* ZipInfo, verbose format */ - if (uO.zipinfo_mode && uO.lflag > 9) { - /*------------------------------------------------------------------- - Get the zipfile comment, if any, and print it out. - (Comment may be up to 64KB long. May the fleas of a thousand - camels infest the arm-pits of anyone who actually takes advantage - of this fact.) - -------------------------------------------------------------------*/ - - if (!G.ecrec.zipfile_comment_length) - Info(slide, 0, ((char *)slide, LoadFarString(NoZipfileComment))); - else { - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommentDesc), - G.ecrec.zipfile_comment_length)); - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommBegin))); - if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) - error = PK_WARN; - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileCommEnd))); - if (error) - Info(slide, 0, ((char *)slide, - LoadFarString(ZipfileCommTrunc2))); - } /* endif (comment exists) */ - - /* ZipInfo, non-verbose mode: print zipfile comment only if requested */ - } else if (G.ecrec.zipfile_comment_length && - (uO.zflag > 0) && uO.zipinfo_mode) { - if (do_string(__G__ G.ecrec.zipfile_comment_length, DISPLAY)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } else -#endif /* !NO_ZIPINFO */ - if ( G.ecrec.zipfile_comment_length && - (uO.zflag > 0 -#ifndef WINDLL - || (uO.zflag == 0 -# ifndef NO_ZIPINFO - && !uO.zipinfo_mode -# endif -# ifdef TIMESTAMP - && !uO.T_flag -# endif - && !uO.qflag) -#endif /* !WINDLL */ - ) ) - { - if (do_string(__G__ G.ecrec.zipfile_comment_length, -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) -# ifndef NO_ZIPINFO - (oU.zipinfo_mode ? DISPLAY : CHECK_AUTORUN) -# else - CHECK_AUTORUN -# endif -#else - DISPLAY -#endif - )) - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) - else if (G.ecrec.zipfile_comment_length) { - if (do_string(__G__ G.ecrec.zipfile_comment_length, CHECK_AUTORUN_Q)) - { - Info(slide, 0x401, ((char *)slide, - LoadFarString(ZipfileCommTrunc1))); - error = PK_WARN; - } - } -#endif - return error; - -} /* end function process_zip_cmmnt() */ - - - - - -/************************************/ -/* Function process_cdir_file_hdr() */ -/************************************/ - -int process_cdir_file_hdr(__G) /* return PK-type error code */ - __GDEF -{ - int error; - - -/*--------------------------------------------------------------------------- - Get central directory info, save host and method numbers, and set flag - for lowercase conversion of filename, depending on the OS from which the - file is coming. - ---------------------------------------------------------------------------*/ - - if ((error = get_cdir_ent(__G)) != 0) - return error; - - G.pInfo->hostver = G.crec.version_made_by[0]; - G.pInfo->hostnum = MIN(G.crec.version_made_by[1], NUM_HOSTS); -/* extnum = MIN(crec.version_needed_to_extract[1], NUM_HOSTS); */ - - G.pInfo->lcflag = 0; - if (uO.L_flag == 1) /* name conversion for monocase systems */ - switch (G.pInfo->hostnum) { - case FS_FAT_: /* PKZIP and zip -k store in uppercase */ - case CPM_: /* like MS-DOS, right? */ - case VM_CMS_: /* all caps? */ - case MVS_: /* all caps? */ - case TANDEM_: - case TOPS20_: - case VMS_: /* our Zip uses lowercase, but ASi's doesn't */ - /* case Z_SYSTEM_: ? */ - /* case QDOS_: ? */ - G.pInfo->lcflag = 1; /* convert filename to lowercase */ - break; - - default: /* AMIGA_, FS_HPFS_, FS_NTFS_, MAC_, UNIX_, ATARI_, */ - break; /* FS_VFAT_, ATHEOS_, BEOS_ (Z_SYSTEM_), THEOS_: */ - /* no conversion */ - } - else if (uO.L_flag > 1) /* let -LL force lower case for all names */ - G.pInfo->lcflag = 1; - - /* do Amigas (AMIGA_) also have volume labels? */ - if (IS_VOLID(G.crec.external_file_attributes) && - (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ || - G.pInfo->hostnum == FS_NTFS_ || G.pInfo->hostnum == ATARI_)) - { - G.pInfo->vollabel = TRUE; - G.pInfo->lcflag = 0; /* preserve case of volume labels */ - } else - G.pInfo->vollabel = FALSE; - - /* this flag is needed to detect archives made by "PKZIP for Unix" when - deciding which kind of codepage conversion has to be applied to - strings (see do_string() function in fileio.c) */ - G.pInfo->HasUxAtt = (G.crec.external_file_attributes & 0xffff0000L) != 0L; - -#ifdef UNICODE_SUPPORT - /* remember the state of GPB11 (General Purpuse Bit 11) which indicates - that the standard path and comment are UTF-8. */ - G.pInfo->GPFIsUTF8 - = (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11); -#endif - - return PK_COOL; - -} /* end function process_cdir_file_hdr() */ - - - - - -/***************************/ -/* Function get_cdir_ent() */ -/***************************/ - -static int get_cdir_ent(__G) /* return PK-type error code */ - __GDEF -{ - cdir_byte_hdr byterec; - - -/*--------------------------------------------------------------------------- - Read the next central directory entry and do any necessary machine-type - conversions (byte ordering, structure padding compensation--do so by - copying the data from the array into which it was read (byterec) to the - usable struct (crec)). - ---------------------------------------------------------------------------*/ - - if (readbuf(__G__ (char *)byterec, CREC_SIZE) == 0) - return PK_EOF; - - G.crec.version_made_by[0] = byterec[C_VERSION_MADE_BY_0]; - G.crec.version_made_by[1] = byterec[C_VERSION_MADE_BY_1]; - G.crec.version_needed_to_extract[0] = - byterec[C_VERSION_NEEDED_TO_EXTRACT_0]; - G.crec.version_needed_to_extract[1] = - byterec[C_VERSION_NEEDED_TO_EXTRACT_1]; - - G.crec.general_purpose_bit_flag = - makeword(&byterec[C_GENERAL_PURPOSE_BIT_FLAG]); - G.crec.compression_method = - makeword(&byterec[C_COMPRESSION_METHOD]); - G.crec.last_mod_dos_datetime = - makelong(&byterec[C_LAST_MOD_DOS_DATETIME]); - G.crec.crc32 = - makelong(&byterec[C_CRC32]); - G.crec.csize = - makelong(&byterec[C_COMPRESSED_SIZE]); - G.crec.ucsize = - makelong(&byterec[C_UNCOMPRESSED_SIZE]); - G.crec.filename_length = - makeword(&byterec[C_FILENAME_LENGTH]); - G.crec.extra_field_length = - makeword(&byterec[C_EXTRA_FIELD_LENGTH]); - G.crec.file_comment_length = - makeword(&byterec[C_FILE_COMMENT_LENGTH]); - G.crec.disk_number_start = - makeword(&byterec[C_DISK_NUMBER_START]); - G.crec.internal_file_attributes = - makeword(&byterec[C_INTERNAL_FILE_ATTRIBUTES]); - G.crec.external_file_attributes = - makelong(&byterec[C_EXTERNAL_FILE_ATTRIBUTES]); /* LONG, not word! */ - G.crec.relative_offset_local_header = - makelong(&byterec[C_RELATIVE_OFFSET_LOCAL_HEADER]); - - return PK_COOL; - -} /* end function get_cdir_ent() */ - - - - - -/*************************************/ -/* Function process_local_file_hdr() */ -/*************************************/ - -int process_local_file_hdr(__G) /* return PK-type error code */ - __GDEF -{ - local_byte_hdr byterec; - - -/*--------------------------------------------------------------------------- - Read the next local file header and do any necessary machine-type con- - versions (byte ordering, structure padding compensation--do so by copy- - ing the data from the array into which it was read (byterec) to the - usable struct (lrec)). - ---------------------------------------------------------------------------*/ - - if (readbuf(__G__ (char *)byterec, LREC_SIZE) == 0) - return PK_EOF; - - G.lrec.version_needed_to_extract[0] = - byterec[L_VERSION_NEEDED_TO_EXTRACT_0]; - G.lrec.version_needed_to_extract[1] = - byterec[L_VERSION_NEEDED_TO_EXTRACT_1]; - - G.lrec.general_purpose_bit_flag = - makeword(&byterec[L_GENERAL_PURPOSE_BIT_FLAG]); - G.lrec.compression_method = makeword(&byterec[L_COMPRESSION_METHOD]); - G.lrec.last_mod_dos_datetime = makelong(&byterec[L_LAST_MOD_DOS_DATETIME]); - G.lrec.crc32 = makelong(&byterec[L_CRC32]); - G.lrec.csize = makelong(&byterec[L_COMPRESSED_SIZE]); - G.lrec.ucsize = makelong(&byterec[L_UNCOMPRESSED_SIZE]); - G.lrec.filename_length = makeword(&byterec[L_FILENAME_LENGTH]); - G.lrec.extra_field_length = makeword(&byterec[L_EXTRA_FIELD_LENGTH]); - - if ((G.lrec.general_purpose_bit_flag & 8) != 0) { - /* can't trust local header, use central directory: */ - G.lrec.crc32 = G.pInfo->crc; - G.lrec.csize = G.pInfo->compr_size; - G.lrec.ucsize = G.pInfo->uncompr_size; - } - - G.csize = G.lrec.csize; - - return PK_COOL; - -} /* end function process_local_file_hdr() */ - - -/*******************************/ -/* Function getZip64Data() */ -/*******************************/ - -int getZip64Data(__G__ ef_buf, ef_len) - __GDEF - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for zip64 information, ie 8-byte - versions of compressed file size, uncompressed file size, relative offset - and a 4-byte version of disk start number. - Sets both local header and central header fields. Not terribly clever, - but it means that this procedure is only called in one place. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL) - return PK_COOL; - - Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getZip64Data: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - if (eb_id == EF_PKSZ64) { - - int offset = EB_HEADSIZE; - - if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){ - G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf); - offset += sizeof(G.crec.ucsize); - } - if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){ - G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf); - offset += sizeof(G.crec.csize); - } - if (G.crec.relative_offset_local_header == 0xffffffff){ - G.crec.relative_offset_local_header = makeint64(offset + ef_buf); - offset += sizeof(G.crec.relative_offset_local_header); - } - if (G.crec.disk_number_start == 0xffff){ - G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf); - offset += sizeof(G.crec.disk_number_start); - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return PK_COOL; -} /* end function getZip64Data() */ - - -#ifdef UNICODE_SUPPORT - -/*******************************/ -/* Function getUnicodeData() */ -/*******************************/ - -int getUnicodeData(__G__ ef_buf, ef_len) - __GDEF - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for Unicode information, ie UTF-8 - path extra fields. - - On return, G.unipath_filename = - NULL, if no Unicode path extra field or error - "", if the standard path is UTF-8 (free when done) - null-terminated UTF-8 path (free when done) - Return PK_COOL if no error. - ---------------------------------------------------------------------------*/ - - G.unipath_filename = NULL; - - if (ef_len == 0 || ef_buf == NULL) - return PK_COOL; - - Trace((stderr,"\ngetUnicodeData: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getUnicodeData: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - if (eb_id == EF_UNIPATH) { - - int offset = EB_HEADSIZE; - ush ULen = eb_len - 5; - ulg chksum = CRCVAL_INITIAL; - - /* version */ - G.unipath_version = (uch) *(offset + ef_buf); - offset += 1; - if (G.unipath_version > 1) { - /* can do only version 1 */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnicodeVersionError))); - return PK_ERR; - } - - /* filename CRC */ - G.unipath_checksum = makelong(offset + ef_buf); - offset += 4; - - /* - * Compute 32-bit crc - */ - - chksum = crc32(chksum, (uch *)(G.filename_full), - strlen(G.filename_full)); - - /* If the checksums's don't match then likely filename has been - * modified and the Unicode Path is no longer valid. - */ - if (chksum != G.unipath_checksum) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(UnicodeMismatchError))); - if (G.unicode_mismatch == 1) { - /* warn and continue */ - } else if (G.unicode_mismatch == 2) { - /* ignore and continue */ - } else if (G.unicode_mismatch == 0) { - } - return PK_ERR; - } - - /* UTF-8 Path */ - if ((G.unipath_filename = malloc(ULen + 1)) == NULL) { - return PK_ERR; - } - if (ULen == 0) { - /* standard path is UTF-8 so use that */ - G.unipath_filename[0] = '\0'; - } else { - /* UTF-8 path */ - strncpy(G.unipath_filename, - (ZCONST char *)(offset + ef_buf), ULen); - G.unipath_filename[ULen] = '\0'; - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return PK_COOL; -} /* end function getUnicodeData() */ - - - - -#ifdef UNICODE_WCHAR - /*--------------------------------------------- - * Unicode conversion functions - * - * Based on functions provided by Paul Kienitz - * - *--------------------------------------------- - */ - -/* - NOTES APPLICABLE TO ALL STRING FUNCTIONS: - - All of the x_to_y functions take parameters for an output buffer and - its available length, and return an int. The value returned is the - length of the string that the input produces, which may be larger than - the provided buffer length. If the returned value is less than the - buffer length, then the contents of the buffer will be null-terminated; - otherwise, it will not be terminated and may be invalid, possibly - stopping in the middle of a multibyte sequence. - - In all cases you may pass NULL as the buffer and/or 0 as the length, if - you just want to learn how much space the string is going to require. - - The functions will return -1 if the input is invalid UTF-8 or cannot be - encoded as UTF-8. -*/ - -static int utf8_char_bytes OF((ZCONST char *utf8)); -static ulg ucs4_char_from_utf8 OF((ZCONST char **utf8)); -static int utf8_to_ucs4_string OF((ZCONST char *utf8, ulg *ucs4buf, - int buflen)); - -/* utility functions for managing UTF-8 and UCS-4 strings */ - - -/* utf8_char_bytes - * - * Returns the number of bytes used by the first character in a UTF-8 - * string, or -1 if the UTF-8 is invalid or null. - */ -static int utf8_char_bytes(utf8) - ZCONST char *utf8; -{ - int t, r; - unsigned lead; - - if (!utf8) - return -1; /* no input */ - lead = (unsigned char) *utf8; - if (lead < 0x80) - r = 1; /* an ascii-7 character */ - else if (lead < 0xC0) - return -1; /* error: trailing byte without lead byte */ - else if (lead < 0xE0) - r = 2; /* an 11 bit character */ - else if (lead < 0xF0) - r = 3; /* a 16 bit character */ - else if (lead < 0xF8) - r = 4; /* a 21 bit character (the most currently used) */ - else if (lead < 0xFC) - r = 5; /* a 26 bit character (shouldn't happen) */ - else if (lead < 0xFE) - r = 6; /* a 31 bit character (shouldn't happen) */ - else - return -1; /* error: invalid lead byte */ - for (t = 1; t < r; t++) - if ((unsigned char) utf8[t] < 0x80 || (unsigned char) utf8[t] >= 0xC0) - return -1; /* error: not enough valid trailing bytes */ - return r; -} - - -/* ucs4_char_from_utf8 - * - * Given a reference to a pointer into a UTF-8 string, returns the next - * UCS-4 character and advances the pointer to the next character sequence. - * Returns ~0 (= -1 in twos-complement notation) and does not advance the - * pointer when input is ill-formed. - */ -static ulg ucs4_char_from_utf8(utf8) - ZCONST char **utf8; -{ - ulg ret; - int t, bytes; - - if (!utf8) - return ~0L; /* no input */ - bytes = utf8_char_bytes(*utf8); - if (bytes <= 0) - return ~0L; /* invalid input */ - if (bytes == 1) - ret = **utf8; /* ascii-7 */ - else - ret = **utf8 & (0x7F >> bytes); /* lead byte of a multibyte sequence */ - (*utf8)++; - for (t = 1; t < bytes; t++) /* consume trailing bytes */ - ret = (ret << 6) | (*((*utf8)++) & 0x3F); - return (zwchar) ret; -} - - -#if 0 /* currently unused */ -/* utf8_from_ucs4_char - Convert UCS char to UTF-8 - * - * Returns the number of bytes put into utf8buf to represent ch, from 1 to 6, - * or -1 if ch is too large to represent. utf8buf must have room for 6 bytes. - */ -static int utf8_from_ucs4_char(utf8buf, ch) - char *utf8buf; - ulg ch; -{ - int trailing = 0; - int leadmask = 0x80; - int leadbits = 0x3F; - int tch = ch; - int ret; - - if (ch > 0x7FFFFFFFL) - return -1; /* UTF-8 can represent 31 bits */ - if (ch < 0x7F) - { - *utf8buf++ = (char) ch; /* ascii-7 */ - return 1; - } - do { - trailing++; - leadmask = (leadmask >> 1) | 0x80; - leadbits >>= 1; - tch >>= 6; - } while (tch & ~leadbits); - ret = trailing + 1; - /* produce lead byte */ - *utf8buf++ = (char) (leadmask | (ch >> (6 * trailing))); - while (--trailing >= 0) - /* produce trailing bytes */ - *utf8buf++ = (char) (0x80 | ((ch >> (6 * trailing)) & 0x3F)); - return ret; -} -#endif /* unused */ - - -/*===================================================================*/ - -/* utf8_to_ucs4_string - convert UTF-8 string to UCS string - * - * Return UCS count. Now returns int so can return -1. - */ -static int utf8_to_ucs4_string(utf8, ucs4buf, buflen) - ZCONST char *utf8; - ulg *ucs4buf; - int buflen; -{ - int count = 0; - - for (;;) - { - ulg ch = ucs4_char_from_utf8(&utf8); - if (ch == ~0L) - return -1; - else - { - if (ucs4buf && count < buflen) - ucs4buf[count] = ch; - if (ch == 0) - return count; - count++; - } - } -} - - -#if 0 /* currently unused */ -/* ucs4_string_to_utf8 - * - * - */ -static int ucs4_string_to_utf8(ucs4, utf8buf, buflen) - ZCONST ulg *ucs4; - char *utf8buf; - int buflen; -{ - char mb[6]; - int count = 0; - - if (!ucs4) - return -1; - for (;;) - { - int mbl = utf8_from_ucs4_char(mb, *ucs4++); - int c; - if (mbl <= 0) - return -1; - /* We could optimize this a bit by passing utf8buf + count */ - /* directly to utf8_from_ucs4_char when buflen >= count + 6... */ - c = buflen - count; - if (mbl < c) - c = mbl; - if (utf8buf && count < buflen) - strncpy(utf8buf + count, mb, c); - if (mbl == 1 && !mb[0]) - return count; /* terminating nul */ - count += mbl; - } -} - - -/* utf8_chars - * - * Wrapper: counts the actual unicode characters in a UTF-8 string. - */ -static int utf8_chars(utf8) - ZCONST char *utf8; -{ - return utf8_to_ucs4_string(utf8, NULL, 0); -} -#endif /* unused */ - -/* --------------------------------------------------- */ -/* Unicode Support - * - * These functions common for all Unicode ports. - * - * These functions should allocate and return strings that can be - * freed with free(). - * - * 8/27/05 EG - * - * Use zwchar for wide char which is unsigned long - * in zip.h and 32 bits. This avoids problems with - * different sizes of wchar_t. - */ - -#if 0 /* currently unused */ -/* is_ascii_string - * Checks if a string is all ascii - */ -int is_ascii_string(mbstring) - ZCONST char *mbstring; -{ - char *p; - uch c; - - for (p = mbstring; c = (uch)*p; p++) { - if (c > 0x7F) { - return 0; - } - } - return 1; -} - -/* local to UTF-8 */ -char *local_to_utf8_string(local_string) - ZCONST char *local_string; -{ - return wide_to_utf8_string(local_to_wide_string(local_string)); -} -# endif /* unused */ - -/* wide_to_escape_string - provides a string that represents a wide char not in local char set - - An initial try at an algorithm. Suggestions welcome. - - According to the standard, Unicode character points are restricted to - the number range from 0 to 0x10FFFF, respective 21 bits. - For a hexadecimal notation, 2 octets are sufficient for the mostly - used characters from the "Basic Multilingual Plane", all other - Unicode characters can be represented by 3 octets (= 6 hex digits). - The Unicode standard suggests to write Unicode character points - as 4 resp. 6 hex digits, preprended by "U+". - (e.g.: U+10FFFF for the highest character point, or U+0030 for the ASCII - digit "0") - - However, for the purpose of escaping non-ASCII chars in an ASCII character - stream, the "U" is not a very good escape initializer. Therefore, we - use the following convention within our Info-ZIP code: - - If not an ASCII char probably need 2 bytes at least. So if - a 2-byte wide encode it as 4 hex digits with a leading #U. If - needs 3 bytes then prefix the string with #L. So - #U1234 - is a 2-byte wide character with bytes 0x12 and 0x34 while - #L123456 - is a 3-byte wide character with bytes 0x12, 0x34, 0x56. - On Windows, wide that need two wide characters need to be converted - to a single number. - */ - - /* set this to the max bytes an escape can be */ -#define MAX_ESCAPE_BYTES 8 - -char *wide_to_escape_string(wide_char) - zwchar wide_char; -{ - int i; - zwchar w = wide_char; - uch b[sizeof(zwchar)]; - char d[3]; - char e[11]; - int len; - char *r; - - /* fill byte array with zeros */ - memzero(b, sizeof(zwchar)); - /* get bytes in right to left order */ - for (len = 0; w; len++) { - b[len] = (char)(w % 0x100); - w /= 0x100; - } - strcpy(e, "#"); - /* either 2 bytes or 3 bytes */ - if (len <= 2) { - len = 2; - strcat(e, "U"); - } else { - strcat(e, "L"); - } - for (i = len - 1; i >= 0; i--) { - sprintf(d, "%02x", b[i]); - strcat(e, d); - } - if ((r = malloc(strlen(e) + 1)) == NULL) { - return NULL; - } - strcpy(r, e); - return r; -} - -#if 0 /* currently unused */ -/* returns the wide character represented by the escape string */ -zwchar escape_string_to_wide(escape_string) - ZCONST char *escape_string; -{ - int i; - zwchar w; - char c; - int len; - ZCONST char *e = escape_string; - - if (e == NULL) { - return 0; - } - if (e[0] != '#') { - /* no leading # */ - return 0; - } - len = strlen(e); - /* either #U1234 or #L123456 format */ - if (len != 6 && len != 8) { - return 0; - } - w = 0; - if (e[1] == 'L') { - if (len != 8) { - return 0; - } - /* 3 bytes */ - for (i = 2; i < 8; i++) { - c = e[i]; - if (c < '0' || c > '9') { - return 0; - } - w = w * 0x10 + (zwchar)(c - '0'); - } - } else if (e[1] == 'U') { - /* 2 bytes */ - for (i = 2; i < 6; i++) { - c = e[i]; - if (c < '0' || c > '9') { - return 0; - } - w = w * 0x10 + (zwchar)(c - '0'); - } - } - return w; -} -#endif /* unused */ - -#ifndef WIN32 /* WIN32 supplies a special variant of this function */ -/* convert wide character string to multi-byte character string */ -char *wide_to_local_string(wide_string, escape_all) - ZCONST zwchar *wide_string; - int escape_all; -{ - int i; - wchar_t wc; - int b; - int state_dependent; - int wsize = 0; - int max_bytes = MB_CUR_MAX; - char buf[9]; - char *buffer = NULL; - char *local_string = NULL; - - for (wsize = 0; wide_string[wsize]; wsize++) ; - - if (max_bytes < MAX_ESCAPE_BYTES) - max_bytes = MAX_ESCAPE_BYTES; - - if ((buffer = (char *)malloc(wsize * max_bytes + 1)) == NULL) { - return NULL; - } - - /* convert it */ - buffer[0] = '\0'; - /* set initial state if state-dependent encoding */ - wc = (wchar_t)'a'; - b = wctomb(NULL, wc); - if (b == 0) - state_dependent = 0; - else - state_dependent = 1; - for (i = 0; i < wsize; i++) { - if (sizeof(wchar_t) < 4 && wide_string[i] > 0xFFFF) { - /* wchar_t probably 2 bytes */ - /* could do surrogates if state_dependent and wctomb can do */ - wc = zwchar_to_wchar_t_default_char; - } else { - wc = (wchar_t)wide_string[i]; - } - b = wctomb(buf, wc); - if (escape_all) { - if (b == 1 && (uch)buf[0] <= 0x7f) { - /* ASCII */ - strncat(buffer, buf, b); - } else { - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } else if (b > 0) { - /* multi-byte char */ - strncat(buffer, buf, b); - } else { - /* no MB for this wide */ - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } - if ((local_string = (char *)malloc(strlen(buffer) + 1)) != NULL) { - strcpy(local_string, buffer); - } - free(buffer); - - return local_string; -} -#endif /* !WIN32 */ - -#if 0 /* currently unused */ -/* convert local string to display character set string */ -char *local_to_display_string(local_string) - ZCONST char *local_string; -{ - char *display_string; - - /* For Windows, OEM string should never be bigger than ANSI string, says - CharToOem description. - For all other ports, just make a copy of local_string. - */ - if ((display_string = (char *)malloc(strlen(local_string) + 1)) == NULL) { - return NULL; - } - - strcpy(display_string, local_string); - -#ifdef EBCDIC - { - char *ebc; - - if ((ebc = malloc(strlen(display_string) + 1)) == NULL) { - return NULL; - } - strtoebc(ebc, display_string); - free(display_string); - display_string = ebc; - } -#endif - - return display_string; -} -#endif /* unused */ - -/* UTF-8 to local */ -char *utf8_to_local_string(utf8_string, escape_all) - ZCONST char *utf8_string; - int escape_all; -{ - zwchar *wide = utf8_to_wide_string(utf8_string); - char *loc = wide_to_local_string(wide, escape_all); - free(wide); - return loc; -} - -#if 0 /* currently unused */ -/* convert multi-byte character string to wide character string */ -zwchar *local_to_wide_string(local_string) - ZCONST char *local_string; -{ - int wsize; - wchar_t *wc_string; - zwchar *wide_string; - - /* for now try to convert as string - fails if a bad char in string */ - wsize = mbstowcs(NULL, local_string, strlen(local_string) + 1); - if (wsize == (size_t)-1) { - /* could not convert */ - return NULL; - } - - /* convert it */ - if ((wc_string = (wchar_t *)malloc((wsize + 1) * sizeof(wchar_t))) == NULL) { - return NULL; - } - wsize = mbstowcs(wc_string, local_string, strlen(local_string) + 1); - wc_string[wsize] = (wchar_t) 0; - - /* in case wchar_t is not zwchar */ - if ((wide_string = (zwchar *)malloc((wsize + 1) * sizeof(zwchar))) == NULL) { - return NULL; - } - for (wsize = 0; wide_string[wsize] = (zwchar)wc_string[wsize]; wsize++) ; - wide_string[wsize] = (zwchar) 0; - free(wc_string); - - return wide_string; -} - - -/* convert wide string to UTF-8 */ -char *wide_to_utf8_string(wide_string) - ZCONST zwchar *wide_string; -{ - int mbcount; - char *utf8_string; - - /* get size of utf8 string */ - mbcount = ucs4_string_to_utf8(wide_string, NULL, 0); - if (mbcount == -1) - return NULL; - if ((utf8_string = (char *) malloc(mbcount + 1)) == NULL) { - return NULL; - } - mbcount = ucs4_string_to_utf8(wide_string, utf8_string, mbcount + 1); - if (mbcount == -1) - return NULL; - - return utf8_string; -} -#endif /* unused */ - -/* convert UTF-8 string to wide string */ -zwchar *utf8_to_wide_string(utf8_string) - ZCONST char *utf8_string; -{ - int wcount; - zwchar *wide_string; - - wcount = utf8_to_ucs4_string(utf8_string, NULL, 0); - if (wcount == -1) - return NULL; - if ((wide_string = (zwchar *) malloc((wcount + 1) * sizeof(zwchar))) - == NULL) { - return NULL; - } - wcount = utf8_to_ucs4_string(utf8_string, wide_string, wcount + 1); - - return wide_string; -} - -#endif /* UNICODE_WCHAR */ -#endif /* UNICODE_SUPPORT */ - - - - - -#ifdef USE_EF_UT_TIME - -#ifdef IZ_HAVE_UXUIDGID -static int read_ux3_value(dbuf, uidgid_sz, p_uidgid) - ZCONST uch *dbuf; /* buffer a uid or gid value */ - unsigned uidgid_sz; /* size of uid/gid value */ - ulg *p_uidgid; /* return storage: uid or gid value */ -{ - zusz_t uidgid64; - - switch (uidgid_sz) { - case 2: - *p_uidgid = (ulg)makeword(dbuf); - break; - case 4: - *p_uidgid = (ulg)makelong(dbuf); - break; - case 8: - uidgid64 = makeint64(dbuf); -#ifndef LARGE_FILE_SUPPORT - if (uidgid64 == (zusz_t)0xffffffffL) - return FALSE; -#endif - *p_uidgid = (ulg)uidgid64; - if ((zusz_t)(*p_uidgid) != uidgid64) - return FALSE; - break; - } - return TRUE; -} -#endif /* IZ_HAVE_UXUIDGID */ - - -/*******************************/ -/* Function ef_scan_for_izux() */ -/*******************************/ - -unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime, - z_utim, z_uidgid) - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ - int ef_is_c; /* flag indicating "is central extra field" */ - ulg dos_mdatetime; /* last_mod_file_date_time in DOS format */ - iztimes *z_utim; /* return storage: atime, mtime, ctime */ - ulg *z_uidgid; /* return storage: uid and gid */ -{ - unsigned flags = 0; - unsigned eb_id; - unsigned eb_len; - int have_new_type_eb = 0; - long i_time; /* buffer for Unix style 32-bit integer time value */ -#ifdef TIME_T_TYPE_DOUBLE - int ut_in_archive_sgn = 0; -#else - int ut_zip_unzip_compatible = FALSE; -#endif - -/*--------------------------------------------------------------------------- - This function scans the extra field for EF_TIME, EF_IZUNIX2, EF_IZUNIX, or - EF_PKUNIX blocks containing Unix-style time_t (GMT) values for the entry's - access, creation, and modification time. - If a valid block is found, the time stamps are copied to the iztimes - structure (provided the z_utim pointer is not NULL). - If a IZUNIX2 block is found or the IZUNIX block contains UID/GID fields, - and the z_uidgid array pointer is valid (!= NULL), the owner info is - transfered as well. - The presence of an EF_TIME or EF_IZUNIX2 block results in ignoring all - data from probably present obsolete EF_IZUNIX blocks. - If multiple blocks of the same type are found, only the information from - the last block is used. - The return value is a combination of the EF_TIME Flags field with an - additional flag bit indicating the presence of valid UID/GID info, - or 0 in case of failure. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL || (z_utim == 0 && z_uidgid == NULL)) - return 0; - - TTrace((stderr,"\nef_scan_for_izux: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - TTrace((stderr, - "ef_scan_for_izux: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_TIME: - flags &= ~0x0ff; /* ignore previous IZUNIX or EF_TIME fields */ - have_new_type_eb = 1; - if ( eb_len >= EB_UT_MINLEN && z_utim != NULL) { - unsigned eb_idx = EB_UT_TIME1; - TTrace((stderr,"ef_scan_for_izux: found TIME extra field\n")); - flags |= (ef_buf[EB_HEADSIZE+EB_UT_FLAGS] & 0x0ff); - if ((flags & EB_UT_FL_MTIME)) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - eb_idx += 4; - TTrace((stderr," UT e.f. modification time = %ld\n", - i_time)); - -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (dos_mdatetime == DOSTIME_MINIMUM) { - ut_in_archive_sgn = -1; - z_utim->mtime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (dos_mdatetime >= DOSTIME_2038_01_18) { - ut_in_archive_sgn = 1; - z_utim->mtime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - ut_in_archive_sgn = 0; - /* cannot determine sign of mtime; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UT modtime range error; ignore e.f.!\n")); - break; /* stop scanning this field */ - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_in_archive_sgn = 0; - z_utim->mtime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - ut_zip_unzip_compatible = - ((time_t)0x80000000L < (time_t)0L) - ? (dos_mdatetime == DOSTIME_MINIMUM) - : (dos_mdatetime >= DOSTIME_2038_01_18); - if (!ut_zip_unzip_compatible) { - /* UnZip interprets mtime differently than Zip; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UT modtime range error; ignore e.f.!\n")); - break; /* stop scanning this field */ - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_zip_unzip_compatible = FALSE; - } - z_utim->mtime = (time_t)i_time; -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_MTIME; - TTrace((stderr," UT e.f. truncated; no modtime\n")); - } - } - if (ef_is_c) { - break; /* central version of TIME field ends here */ - } - - if (flags & EB_UT_FL_ATIME) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - eb_idx += 4; - TTrace((stderr," UT e.f. access time = %ld\n", - i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->atime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->atime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UT access time range error: skip time!\n")); - } - } else { - z_utim->atime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible) { - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UT access time range error: skip time!\n")); - } else { - z_utim->atime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_ATIME; - } - } - if (flags & EB_UT_FL_CTIME) { - if ((eb_idx+4) <= eb_len) { - i_time = (long)makelong((EB_HEADSIZE+eb_idx) + ef_buf); - TTrace((stderr," UT e.f. creation time = %ld\n", - i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->ctime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->ctime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_CTIME; - TTrace((stderr, - " UT creation time range error: skip time!\n")); - } - } else { - z_utim->ctime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible) { - flags &= ~EB_UT_FL_CTIME; - TTrace((stderr, - " UT creation time range error: skip time!\n")); - } else { - z_utim->ctime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } else { - flags &= ~EB_UT_FL_CTIME; - } - } - } - break; - - case EF_IZUNIX2: - if (have_new_type_eb == 0) { - flags &= ~0x0ff; /* ignore any previous IZUNIX field */ - have_new_type_eb = 1; - } -#ifdef IZ_HAVE_UXUIDGID - if (have_new_type_eb > 1) - break; /* IZUNIX3 overrides IZUNIX2 e.f. block ! */ - if (eb_len == EB_UX2_MINLEN && z_uidgid != NULL) { - z_uidgid[0] = (ulg)makeword((EB_HEADSIZE+EB_UX2_UID) + ef_buf); - z_uidgid[1] = (ulg)makeword((EB_HEADSIZE+EB_UX2_GID) + ef_buf); - flags |= EB_UX2_VALID; /* signal success */ - } -#endif - break; - - case EF_IZUNIX3: - /* new 3rd generation Unix ef */ - have_new_type_eb = 2; - - /* - Version 1 byte version of this extra field, currently 1 - UIDSize 1 byte Size of UID field - UID Variable UID for this entry - GIDSize 1 byte Size of GID field - GID Variable GID for this entry - */ - -#ifdef IZ_HAVE_UXUIDGID - if (eb_len >= EB_UX3_MINLEN - && z_uidgid != NULL - && (*((EB_HEADSIZE + 0) + ef_buf) == 1) - /* only know about version 1 */ - { - uch uid_size; - uch gid_size; - - uid_size = *((EB_HEADSIZE + 1) + ef_buf); - gid_size = *((EB_HEADSIZE + uid_size + 2) + ef_buf); - - flags &= ~0x0ff; /* ignore any previous UNIX field */ - - if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf, - uid_size, z_uidgid[0]) - && - read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf, - gid_size, z_uidgid[1]) ) - { - flags |= EB_UX2_VALID; /* signal success */ - } - } -#endif /* IZ_HAVE_UXUIDGID */ - break; - - case EF_IZUNIX: - case EF_PKUNIX: /* PKUNIX e.f. layout is identical to IZUNIX */ - if (eb_len >= EB_UX_MINLEN) { - TTrace((stderr,"ef_scan_for_izux: found %s extra field\n", - (eb_id == EF_IZUNIX ? "IZUNIX" : "PKUNIX"))); - if (have_new_type_eb > 0) { - break; /* Ignore IZUNIX extra field block ! */ - } - if (z_utim != NULL) { - flags |= (EB_UT_FL_MTIME | EB_UT_FL_ATIME); - i_time = (long)makelong((EB_HEADSIZE+EB_UX_MTIME)+ef_buf); - TTrace((stderr," Unix EF modtime = %ld\n", i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (dos_mdatetime == DOSTIME_MINIMUM) { - ut_in_archive_sgn = -1; - z_utim->mtime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (dos_mdatetime >= DOSTIME_2038_01_18) { - ut_in_archive_sgn = 1; - z_utim->mtime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else { - ut_in_archive_sgn = 0; - /* cannot determine sign of mtime; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UX modtime range error: ignore e.f.!\n")); - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_in_archive_sgn = 0; - z_utim->mtime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - ut_zip_unzip_compatible = - ((time_t)0x80000000L < (time_t)0L) - ? (dos_mdatetime == DOSTIME_MINIMUM) - : (dos_mdatetime >= DOSTIME_2038_01_18); - if (!ut_zip_unzip_compatible) { - /* UnZip interpretes mtime differently than Zip; - without modtime: ignore complete UT field */ - flags &= ~0x0ff; /* no time_t times available */ - TTrace((stderr, - " UX modtime range error: ignore e.f.!\n")); - } - } else { - /* cannot determine, safe assumption is FALSE */ - ut_zip_unzip_compatible = FALSE; - } - z_utim->mtime = (time_t)i_time; -#endif /* ?TIME_T_TYPE_DOUBLE */ - i_time = (long)makelong((EB_HEADSIZE+EB_UX_ATIME)+ef_buf); - TTrace((stderr," Unix EF actime = %ld\n", i_time)); -#ifdef TIME_T_TYPE_DOUBLE - if ((ulg)(i_time) & (ulg)(0x80000000L)) { - if (ut_in_archive_sgn == -1) - z_utim->atime = - (time_t)((long)i_time | (~(long)0x7fffffffL)); - } else if (ut_in_archive_sgn == 1) { - z_utim->atime = - (time_t)((ulg)i_time & (ulg)0xffffffffL); - } else if (flags & 0x0ff) { - /* sign of 32-bit time is unknown -> ignore it */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UX access time range error: skip time!\n")); - } - } else { - z_utim->atime = (time_t)i_time; - } -#else /* !TIME_T_TYPE_DOUBLE */ - if (((ulg)(i_time) & (ulg)(0x80000000L)) && - !ut_zip_unzip_compatible && (flags & 0x0ff)) { - /* atime not in range of UnZip's time_t */ - flags &= ~EB_UT_FL_ATIME; - TTrace((stderr, - " UX access time range error: skip time!\n")); - } else { - z_utim->atime = (time_t)i_time; - } -#endif /* ?TIME_T_TYPE_DOUBLE */ - } -#ifdef IZ_HAVE_UXUIDGID - if (eb_len >= EB_UX_FULLSIZE && z_uidgid != NULL) { - z_uidgid[0] = makeword((EB_HEADSIZE+EB_UX_UID) + ef_buf); - z_uidgid[1] = makeword((EB_HEADSIZE+EB_UX_GID) + ef_buf); - flags |= EB_UX2_VALID; - } -#endif /* IZ_HAVE_UXUIDGID */ - } - break; - - default: - break; - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return flags; -} - -#endif /* USE_EF_UT_TIME */ - - -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - -#define SPARKID_2 0x30435241 /* = "ARC0" */ - -/*******************************/ -/* Function getRISCOSexfield() */ -/*******************************/ - -zvoid *getRISCOSexfield(ef_buf, ef_len) - ZCONST uch *ef_buf; /* buffer containing extra field */ - unsigned ef_len; /* total length of extra field */ -{ - unsigned eb_id; - unsigned eb_len; - -/*--------------------------------------------------------------------------- - This function scans the extra field for a Acorn SPARK filetype ef-block. - If a valid block is found, the function returns a pointer to the start - of the SPARK_EF block in the extra field buffer. Otherwise, a NULL - pointer is returned. - ---------------------------------------------------------------------------*/ - - if (ef_len == 0 || ef_buf == NULL) - return NULL; - - Trace((stderr,"\ngetRISCOSexfield: scanning extra field of length %u\n", - ef_len)); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(EB_ID + ef_buf); - eb_len = makeword(EB_LEN + ef_buf); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "getRISCOSexfield: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - if (eb_id == EF_SPARK && (eb_len == 24 || eb_len == 20)) { - if (makelong(EB_HEADSIZE + ef_buf) == SPARKID_2) { - /* Return a pointer to the valid SPARK filetype ef block */ - return (zvoid *)ef_buf; - } - } - - /* Skip this extra field block */ - ef_buf += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return NULL; -} - -#endif /* (RISCOS || ACORN_FTYPE_NFS) */ diff --git a/data/windows/unzipfx-catia/ttyio.c b/data/windows/unzipfx-catia/ttyio.c deleted file mode 100644 index a1a13b1..0000000 --- a/data/windows/unzipfx-catia/ttyio.c +++ /dev/null @@ -1,705 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ttyio.c - - This file contains routines for doing console input/output, including code - for non-echoing input. It is used by the encryption/decryption code but - does not contain any restricted code itself. This file is shared between - Info-ZIP's Zip and UnZip. - - Contains: echo() (VMS only) - Echon() (Unix only) - Echoff() (Unix only) - screensize() (Unix only) - zgetch() (Unix, VMS, and non-Unix/VMS versions) - getp() ("PC," Unix/Atari/Be, VMS/VMCMS/MVS) - - ---------------------------------------------------------------------------*/ - -#define __TTYIO_C /* identifies this source module */ - -#include "zip.h" -#include "crypt.h" - -#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) -/* Non-echo console/keyboard input is needed for (en/de)cryption's password - * entry, and for UnZip(SFX)'s MORE and Pause features. - * (The corresponding #endif is found at the end of this module.) - */ - -#include "ttyio.h" - -#ifndef PUTC -# define PUTC putc -#endif - -#ifdef ZIP -# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -# undef GLOBAL -# endif -# define GLOBAL(g) g -#else -# define GLOBAL(g) G.g -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__)) /* why yes, we do */ -# define HAVE_TERMIOS_H -#endif - -#ifdef _POSIX_VERSION -# ifndef USE_POSIX_TERMIOS -# define USE_POSIX_TERMIOS /* use POSIX style termio (termios) */ -# endif -# ifndef HAVE_TERMIOS_H -# define HAVE_TERMIOS_H /* POSIX termios.h */ -# endif -#endif /* _POSIX_VERSION */ - -#ifdef UNZIP /* Zip handles this with the unix/configure script */ -# ifndef _POSIX_VERSION -# if (defined(SYSV) || defined(CRAY)) && !defined(__MINT__) -# ifndef USE_SYSV_TERMIO -# define USE_SYSV_TERMIO -# endif -# ifdef COHERENT -# ifndef HAVE_TERMIO_H -# define HAVE_TERMIO_H -# endif -# ifdef HAVE_SYS_TERMIO_H -# undef HAVE_SYS_TERMIO_H -# endif -# else /* !COHERENT */ -# ifdef HAVE_TERMIO_H -# undef HAVE_TERMIO_H -# endif -# ifndef HAVE_SYS_TERMIO_H -# define HAVE_SYS_TERMIO_H -# endif -# endif /* ?COHERENT */ -# endif /* (SYSV || CRAY) && !__MINT__ */ -# endif /* !_POSIX_VERSION */ -# if !(defined(BSD4_4) || defined(SYSV) || defined(__convexc__)) -# ifndef NO_FCNTL_H -# define NO_FCNTL_H -# endif -# endif /* !(BSD4_4 || SYSV || __convexc__) */ -#endif /* UNZIP */ - -#ifdef HAVE_TERMIOS_H -# ifndef USE_POSIX_TERMIOS -# define USE_POSIX_TERMIOS -# endif -#endif - -#if (defined(HAVE_TERMIO_H) || defined(HAVE_SYS_TERMIO_H)) -# ifndef USE_SYSV_TERMIO -# define USE_SYSV_TERMIO -# endif -#endif - -#if (defined(UNZIP) && !defined(FUNZIP) && defined(UNIX) && defined(MORE)) -# include -# define GOT_IOCTL_H - /* int ioctl OF((int, int, zvoid *)); GRR: may need for some systems */ -#endif - -#ifndef HAVE_WORKING_GETCH - /* include system support for switching of console echo */ -# ifdef VMS -# include -# include -# include - /* Workaround for broken header files of older DECC distributions - * that are incompatible with the /NAMES=AS_IS qualifier. */ -# define sys$assign SYS$ASSIGN -# define sys$dassgn SYS$DASSGN -# define sys$qiow SYS$QIOW -# include -# include -# else /* !VMS */ -# ifdef HAVE_TERMIOS_H -# include -# define sgttyb termios -# define sg_flags c_lflag -# define GTTY(f, s) tcgetattr(f, (zvoid *) s) -# define STTY(f, s) tcsetattr(f, TCSAFLUSH, (zvoid *) s) -# else /* !HAVE_TERMIOS_H */ -# ifdef USE_SYSV_TERMIO /* Amdahl, Cray, all SysV? */ -# ifdef HAVE_TERMIO_H -# include -# endif -# ifdef HAVE_SYS_TERMIO_H -# include -# endif -# ifdef NEED_PTEM -# include -# include -# endif -# define sgttyb termio -# define sg_flags c_lflag -# define GTTY(f,s) ioctl(f,TCGETA,(zvoid *)s) -# define STTY(f,s) ioctl(f,TCSETAW,(zvoid *)s) -# else /* !USE_SYSV_TERMIO */ -# ifndef CMS_MVS -# if (!defined(MINIX) && !defined(GOT_IOCTL_H)) -# include -# endif -# include -# define GTTY gtty -# define STTY stty -# ifdef UNZIP - /* - * XXX : Are these declarations needed at all ???? - */ - /* - * GRR: let's find out... Hmmm, appears not... - int gtty OF((int, struct sgttyb *)); - int stty OF((int, struct sgttyb *)); - */ -# endif -# endif /* !CMS_MVS */ -# endif /* ?USE_SYSV_TERMIO */ -# endif /* ?HAVE_TERMIOS_H */ -# ifndef NO_FCNTL_H -# ifndef UNZIP -# include -# endif -# else - char *ttyname OF((int)); -# endif -# endif /* ?VMS */ -#endif /* !HAVE_WORKING_GETCH */ - - - -#ifndef HAVE_WORKING_GETCH -#ifdef VMS - -static struct dsc$descriptor_s DevDesc = - {11, DSC$K_DTYPE_T, DSC$K_CLASS_S, "SYS$COMMAND"}; - /* {dsc$w_length, dsc$b_dtype, dsc$b_class, dsc$a_pointer}; */ - -/* - * Turn keyboard echoing on or off (VMS). Loosely based on VMSmunch.c - * and hence on Joe Meadows' file.c code. - */ -int echo(opt) - int opt; -{ - /* - * For VMS v5.x: - * IO$_SENSEMODE/SETMODE info: Programming, Vol. 7A, System Programming, - * I/O User's: Part I, sec. 8.4.1.1, 8.4.3, 8.4.5, 8.6 - * sys$assign(), sys$qio() info: Programming, Vol. 4B, System Services, - * System Services Reference Manual, pp. sys-23, sys-379 - * fixed-length descriptor info: Programming, Vol. 3, System Services, - * Intro to System Routines, sec. 2.9.2 - * Greg Roelofs, 15 Aug 91 - */ - - short DevChan, iosb[4]; - long status; - unsigned long ttmode[2]; /* space for 8 bytes */ - - - /* assign a channel to standard input */ - status = sys$assign(&DevDesc, &DevChan, 0, 0); - if (!(status & 1)) - return status; - - /* use sys$qio and the IO$_SENSEMODE function to determine the current - * tty status (for password reading, could use IO$_READVBLK function - * instead, but echo on/off will be more general) - */ - status = sys$qiow(0, DevChan, IO$_SENSEMODE, &iosb, 0, 0, - ttmode, 8, 0, 0, 0, 0); - if (!(status & 1)) - return status; - status = iosb[0]; - if (!(status & 1)) - return status; - - /* modify mode buffer to be either NOECHO or ECHO - * (depending on function argument opt) - */ - if (opt == 0) /* off */ - ttmode[1] |= TT$M_NOECHO; /* set NOECHO bit */ - else - ttmode[1] &= ~((unsigned long) TT$M_NOECHO); /* clear NOECHO bit */ - - /* use the IO$_SETMODE function to change the tty status */ - status = sys$qiow(0, DevChan, IO$_SETMODE, &iosb, 0, 0, - ttmode, 8, 0, 0, 0, 0); - if (!(status & 1)) - return status; - status = iosb[0]; - if (!(status & 1)) - return status; - - /* deassign the sys$input channel by way of clean-up */ - status = sys$dassgn(DevChan); - if (!(status & 1)) - return status; - - return SS$_NORMAL; /* we be happy */ - -} /* end function echo() */ - - -/* - * Read a single character from keyboard in non-echoing mode (VMS). - * (returns EOF in case of errors) - */ -int tt_getch() -{ - short DevChan, iosb[4]; - long status; - char kbbuf[16]; /* input buffer with - some - excess length */ - - /* assign a channel to standard input */ - status = sys$assign(&DevDesc, &DevChan, 0, 0); - if (!(status & 1)) - return EOF; - - /* read a single character from SYS$COMMAND (no-echo) and - * wait for completion - */ - status = sys$qiow(0,DevChan, - IO$_READVBLK|IO$M_NOECHO|IO$M_NOFILTR, - &iosb, 0, 0, - &kbbuf, 1, 0, 0, 0, 0); - if ((status&1) == 1) - status = iosb[0]; - - /* deassign the sys$input channel by way of clean-up - * (for this step, we do not need to check the completion status) - */ - sys$dassgn(DevChan); - - /* return the first char read, or EOF in case the read request failed */ - return (int)(((status&1) == 1) ? (uch)kbbuf[0] : EOF); - -} /* end function tt_getch() */ - - -#else /* !VMS: basically Unix */ - - -/* For VM/CMS and MVS, non-echo terminal input is not (yet?) supported. */ -#ifndef CMS_MVS - -#ifdef ZIP /* moved to globals.h for UnZip */ - static int echofd=(-1); /* file descriptor whose echo is off */ -#endif - -/* - * Turn echo off for file descriptor f. Assumes that f is a tty device. - */ -void Echoff(__G__ f) - __GDEF - int f; /* file descriptor for which to turn echo off */ -{ - struct sgttyb sg; /* tty device structure */ - - GLOBAL(echofd) = f; - GTTY(f, &sg); /* get settings */ - sg.sg_flags &= ~ECHO; /* turn echo off */ - STTY(f, &sg); -} - -/* - * Turn echo back on for file descriptor echofd. - */ -void Echon(__G) - __GDEF -{ - struct sgttyb sg; /* tty device structure */ - - if (GLOBAL(echofd) != -1) { - GTTY(GLOBAL(echofd), &sg); /* get settings */ - sg.sg_flags |= ECHO; /* turn echo on */ - STTY(GLOBAL(echofd), &sg); - GLOBAL(echofd) = -1; - } -} - -#endif /* !CMS_MVS */ -#endif /* ?VMS */ - - -#if (defined(UNZIP) && !defined(FUNZIP)) - -#ifdef ATH_BEO_UNX -#ifdef MORE - -/* - * Get the number of lines on the output terminal. SCO Unix apparently - * defines TIOCGWINSZ but doesn't support it (!M_UNIX). - * - * GRR: will need to know width of terminal someday, too, to account for - * line-wrapping. - */ - -#if (defined(TIOCGWINSZ) && !defined(M_UNIX)) - -int screensize(tt_rows, tt_cols) - int *tt_rows; - int *tt_cols; -{ - struct winsize wsz; -#ifdef DEBUG_WINSZ - static int firsttime = TRUE; -#endif - - /* see termio(4) under, e.g., SunOS */ - if (ioctl(1, TIOCGWINSZ, &wsz) == 0) { -#ifdef DEBUG_WINSZ - if (firsttime) { - firsttime = FALSE; - fprintf(stderr, "ttyio.c screensize(): ws_row = %d\n", - wsz.ws_row); - fprintf(stderr, "ttyio.c screensize(): ws_col = %d\n", - wsz.ws_col); - } -#endif - /* number of rows */ - if (tt_rows != NULL) - *tt_rows = (int)((wsz.ws_row > 0) ? wsz.ws_row : 24); - /* number of columns */ - if (tt_cols != NULL) - *tt_cols = (int)((wsz.ws_col > 0) ? wsz.ws_col : 80); - return 0; /* signal success */ - } else { /* this happens when piping to more(1), for example */ -#ifdef DEBUG_WINSZ - if (firsttime) { - firsttime = FALSE; - fprintf(stderr, - "ttyio.c screensize(): ioctl(TIOCGWINSZ) failed\n")); - } -#endif - /* VT-100 assumed to be minimal hardware */ - if (tt_rows != NULL) - *tt_rows = 24; - if (tt_cols != NULL) - *tt_cols = 80; - return 1; /* signal failure */ - } -} - -#else /* !TIOCGWINSZ: service not available, fall back to semi-bogus method */ - -int screensize(tt_rows, tt_cols) - int *tt_rows; - int *tt_cols; -{ - char *envptr, *getenv(); - int n; - int errstat = 0; - - /* GRR: this is overly simplistic, but don't have access to stty/gtty - * system anymore - */ - if (tt_rows != NULL) { - envptr = getenv("LINES"); - if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { - /* VT-100 assumed to be minimal hardware */ - *tt_rows = 24; - errstat = 1; /* signal failure */ - } else { - *tt_rows = n; - } - } - if (tt_cols != NULL) { - envptr = getenv("COLUMNS"); - if (envptr == (char *)NULL || (n = atoi(envptr)) < 5) { - *tt_cols = 80; - errstat = 1; /* signal failure */ - } else { - *tt_cols = n; - } - } - return errstat; -} - -#endif /* ?(TIOCGWINSZ && !M_UNIX) */ -#endif /* MORE */ - - -/* - * Get a character from the given file descriptor without echo or newline. - */ -int zgetch(__G__ f) - __GDEF - int f; /* file descriptor from which to read */ -{ -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - char oldmin, oldtim; -#endif - char c; - struct sgttyb sg; /* tty device structure */ - - GTTY(f, &sg); /* get settings */ -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - oldmin = sg.c_cc[VMIN]; /* save old values */ - oldtim = sg.c_cc[VTIME]; - sg.c_cc[VMIN] = 1; /* need only one char to return read() */ - sg.c_cc[VTIME] = 0; /* no timeout */ - sg.sg_flags &= ~ICANON; /* canonical mode off */ -#else - sg.sg_flags |= CBREAK; /* cbreak mode on */ -#endif - sg.sg_flags &= ~ECHO; /* turn echo off, too */ - STTY(f, &sg); /* set cbreak mode */ - GLOBAL(echofd) = f; /* in case ^C hit (not perfect: still CBREAK) */ - - read(f, &c, 1); /* read our character */ - -#if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS)) - sg.c_cc[VMIN] = oldmin; /* restore old values */ - sg.c_cc[VTIME] = oldtim; - sg.sg_flags |= ICANON; /* canonical mode on */ -#else - sg.sg_flags &= ~CBREAK; /* cbreak mode off */ -#endif - sg.sg_flags |= ECHO; /* turn echo on */ - STTY(f, &sg); /* restore canonical mode */ - GLOBAL(echofd) = -1; - - return (int)(uch)c; -} - - -#else /* !ATH_BEO_UNX */ -#ifndef VMS /* VMS supplies its own variant of getch() */ - - -int zgetch(__G__ f) - __GDEF - int f; /* file descriptor from which to read (must be open already) */ -{ - char c, c2; - -/*--------------------------------------------------------------------------- - Get a character from the given file descriptor without echo; can't fake - CBREAK mode (i.e., newline required), but can get rid of all chars up to - and including newline. - ---------------------------------------------------------------------------*/ - - echoff(f); - read(f, &c, 1); - if (c != '\n') - do { - read(f, &c2, 1); /* throw away all other chars up thru newline */ - } while (c2 != '\n'); - echon(); - return (int)c; -} - -#endif /* !VMS */ -#endif /* ?ATH_BEO_UNX */ - -#endif /* UNZIP && !FUNZIP */ -#endif /* !HAVE_WORKING_GETCH */ - - -#if CRYPT /* getp() is only used with full encryption */ - -/* - * Simple compile-time check for source compatibility between - * zcrypt and ttyio: - */ -#if (!defined(CR_MAJORVER) || (CR_MAJORVER < 2) || (CR_MINORVER < 7)) - error: This Info-ZIP tool requires zcrypt 2.7 or later. -#endif - -/* - * Get a password of length n-1 or less into *p using the prompt *m. - * The entered password is not echoed. - */ - -#ifdef HAVE_WORKING_GETCH -/* - * For the AMIGA, getch() is defined as Agetch(), which is in - * amiga/filedate.c; SAS/C 6.x provides a getch(), but since Agetch() - * uses the infrastructure that is already in place in filedate.c, it is - * smaller. With this function, echoff() and echon() are not needed. - * - * For the MAC, a non-echo macgetch() function is defined in the MacOS - * specific sources which uses the event handling mechanism of the - * desktop window manager to get a character from the keyboard. - * - * For the other systems in this section, a non-echo getch() function - * is either contained the C runtime library (conio package), or getch() - * is defined as an alias for a similar system specific RTL function. - */ - -#ifndef WINDLL /* WINDLL does not support a console interface */ -#ifndef QDOS /* QDOS supplies a variant of this function */ - -/* This is the getp() function for all systems (with TTY type user interface) - * that supply a working `non-echo' getch() function for "raw" console input. - */ -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - - /* get password */ - w = ""; - do { - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* display prompt and flush */ - fflush(stderr); - i = 0; - do { /* read line, keeping first n characters */ - if ((c = (char)getch()) == '\r') - c = '\n'; /* until user hits CR */ - if (c == 8 || c == 127) { - if (i > 0) i--; /* the `backspace' and `del' keys works */ - } - else if (i < n) - p[i++] = c; /* truncate past n */ - } while (c != '\n'); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* !QDOS */ -#endif /* !WINDLL */ - - -#else /* !HAVE_WORKING_GETCH */ - - -#if (defined(ATH_BEO_UNX) || defined(__MINT__)) - -#ifndef _PATH_TTY -# ifdef __MINT__ -# define _PATH_TTY ttyname(2) -# else -# define _PATH_TTY "/dev/tty" -# endif -#endif - -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - int f; /* file descriptor for tty device */ - -#ifdef PASSWD_FROM_STDIN - /* Read from stdin. This is unsafe if the password is stored on disk. */ - f = 0; -#else - /* turn off echo on tty */ - - if ((f = open(_PATH_TTY, 0)) == -1) - return NULL; -#endif - /* get password */ - w = ""; - do { - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* prompt */ - fflush(stderr); - i = 0; - echoff(f); - do { /* read line, keeping n */ - read(f, &c, 1); - if (i < n) - p[i++] = c; - } while (c != '\n'); - echon(); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ - -#ifndef PASSWD_FROM_STDIN - close(f); -#endif - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* ATH_BEO_UNX || __MINT__ */ - - - -#if (defined(VMS) || defined(CMS_MVS)) - -char *getp(__G__ m, p, n) - __GDEF - ZCONST char *m; /* prompt for password */ - char *p; /* return value: line input */ - int n; /* bytes available in p[] */ -{ - char c; /* one-byte buffer for read() to use */ - int i; /* number of characters input */ - char *w; /* warning on retry */ - FILE *f; /* file structure for SYS$COMMAND device */ - -#ifdef PASSWD_FROM_STDIN - f = stdin; -#else - if ((f = fopen(ctermid(NULL), "r")) == NULL) - return NULL; -#endif - - /* get password */ - fflush(stdout); - w = ""; - do { - if (*w) /* bug: VMS apparently adds \n to NULL fputs */ - fputs(w, stderr); /* warning if back again */ - fputs(m, stderr); /* prompt */ - fflush(stderr); - i = 0; - echoff(f); - do { /* read line, keeping n */ - if ((c = (char)getc(f)) == '\r') - c = '\n'; - if (i < n) - p[i++] = c; - } while (c != '\n'); - echon(); - PUTC('\n', stderr); fflush(stderr); - w = "(line too long--try again)\n"; - } while (p[i-1] != '\n'); - p[i-1] = 0; /* terminate at newline */ -#ifndef PASSWD_FROM_STDIN - fclose(f); -#endif - - return p; /* return pointer to password */ - -} /* end function getp() */ - -#endif /* VMS || CMS_MVS */ -#endif /* ?HAVE_WORKING_GETCH */ -#endif /* CRYPT */ -#endif /* CRYPT || (UNZIP && !FUNZIP) */ diff --git a/data/windows/unzipfx-catia/ttyio.h b/data/windows/unzipfx-catia/ttyio.h deleted file mode 100644 index 43f004f..0000000 --- a/data/windows/unzipfx-catia/ttyio.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - Copyright (c) 1990-2004 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - ttyio.h - */ - -#ifndef __ttyio_h /* don't include more than once */ -#define __ttyio_h - -#ifndef __crypt_h -# include "crypt.h" /* ensure that encryption header file has been seen */ -#endif - -#if (CRYPT || (defined(UNZIP) && !defined(FUNZIP))) -/* - * Non-echo keyboard/console input support is needed and enabled. - */ - -#ifndef __G /* UnZip only, for now (DLL stuff) */ -# define __G -# define __G__ -# define __GDEF -# define __GPRO void -# define __GPRO__ -#endif - -#ifndef ZCONST /* UnZip only (until have configure script like Zip) */ -# define ZCONST const -#endif - -#if (defined(MSDOS) || defined(OS2) || defined(WIN32)) -# ifndef DOS_OS2_W32 -# define DOS_OS2_W32 -# endif -#endif - -#if (defined(DOS_OS2_W32) || defined(__human68k__)) -# ifndef DOS_H68_OS2_W32 -# define DOS_H68_OS2_W32 -# endif -#endif - -#if (defined(DOS_OS2_W32) || defined(FLEXOS)) -# ifndef DOS_FLX_OS2_W32 -# define DOS_FLX_OS2_W32 -# endif -#endif - -#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) -# ifndef DOS_FLX_H68_OS2_W32 -# define DOS_FLX_H68_OS2_W32 -# endif -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) -# ifndef ATH_BEO_UNX -# define ATH_BEO_UNX -# endif -#endif - -#if (defined(VM_CMS) || defined(MVS)) -# ifndef CMS_MVS -# define CMS_MVS -# endif -#endif - - -/* Function prototypes */ - -/* The following systems supply a `non-echo' character input function "getch()" - * (or an alias) and do not need the echoff() / echon() function pair. - */ -#ifdef AMIGA -# define echoff(f) -# define echon() -# define getch() Agetch() -# define HAVE_WORKING_GETCH -#endif /* AMIGA */ - -#ifdef ATARI -# define echoff(f) -# define echon() -# include -# define getch() (Cnecin() & 0x000000ff) -# define HAVE_WORKING_GETCH -#endif - -#ifdef MACOS -# define echoff(f) -# define echon() -# define getch() macgetch() -# define HAVE_WORKING_GETCH -#endif - -#ifdef NLM -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -#ifdef QDOS -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -#ifdef RISCOS -# define echoff(f) -# define echon() -# define getch() SWI_OS_ReadC() -# define HAVE_WORKING_GETCH -#endif - -#ifdef DOS_H68_OS2_W32 -# define echoff(f) -# define echon() -# ifdef WIN32 -# ifndef getch -# define getch() getch_win32() -# endif -# else /* !WIN32 */ -# ifdef __EMX__ -# ifndef getch -# define getch() _read_kbd(0, 1, 0) -# endif -# else /* !__EMX__ */ -# ifdef __GO32__ -# include -# define getch() getkey() -# else /* !__GO32__ */ -# include -# endif /* ?__GO32__ */ -# endif /* ?__EMX__ */ -# endif /* ?WIN32 */ -# define HAVE_WORKING_GETCH -#endif /* DOS_H68_OS2_W32 */ - -#ifdef FLEXOS -# define echoff(f) -# define echon() -# define getch() getchar() /* not correct, but may not be on a console */ -# define HAVE_WORKING_GETCH -#endif - -/* For VM/CMS and MVS, we do not (yet) have any support to switch terminal - * input echo on and off. The following "fake" definitions allow inclusion - * of crypt support and UnZip's "pause prompting" features, but without - * any echo suppression. - */ -#ifdef CMS_MVS -# define echoff(f) -# define echon() -#endif - -#ifdef TANDEM -# define echoff(f) -# define echon() -# define getch() zgetch() /* defined in TANDEMC */ -# define HAVE_WORKING_GETCH -#endif - -/* The THEOS C runtime library supplies the function conmask() to toggle - * terminal input echo on (conmask("e")) and off (conmask("n")). But, - * since THEOS C RTL also contains a working non-echo getch() function, - * the echo toggles are not needed. - */ -#ifdef THEOS -# define echoff(f) -# define echon() -# define HAVE_WORKING_GETCH -#endif - -/* VMS has a single echo() function in ttyio.c to toggle terminal - * input echo on and off. - */ -#ifdef VMS -# define echoff(f) echo(0) -# define echon() echo(1) -# define getch() tt_getch() -# define FGETCH(f) tt_getch() - int echo OF((int)); - int tt_getch OF((void)); -#endif - -/* For all other systems, ttyio.c supplies the two functions Echoff() and - * Echon() for suppressing and (re)enabling console input echo. - */ -#ifndef echoff -# define echoff(f) Echoff(__G__ f) -# define echon() Echon(__G) - void Echoff OF((__GPRO__ int f)); - void Echon OF((__GPRO)); -#endif - -/* this stuff is used by MORE and also now by the ctrl-S code; fileio.c only */ -#if (defined(UNZIP) && !defined(FUNZIP)) -# ifdef HAVE_WORKING_GETCH -# define FGETCH(f) getch() -# endif -# ifndef FGETCH - /* default for all systems where no getch()-like function is available */ - int zgetch OF((__GPRO__ int f)); -# define FGETCH(f) zgetch(__G__ f) -# endif -#endif /* UNZIP && !FUNZIP */ - -#if (CRYPT && !defined(WINDLL)) - char *getp OF((__GPRO__ ZCONST char *m, char *p, int n)); -#endif - -#else /* !(CRYPT || (UNZIP && !FUNZIP)) */ - -/* - * No need for non-echo keyboard/console input; provide dummy definitions. - */ -#define echoff(f) -#define echon() - -#endif /* ?(CRYPT || (UNZIP && !FUNZIP)) */ - -#endif /* !__ttyio_h */ diff --git a/data/windows/unzipfx-catia/ubz2err.c b/data/windows/unzipfx-catia/ubz2err.c deleted file mode 100644 index f384489..0000000 --- a/data/windows/unzipfx-catia/ubz2err.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ubz2err.c - - This file contains the "fatal error" callback routine required by the - "minimal" (silent, non-stdio) setup of the bzip2 compression library. - - The fatal bzip2 error bail-out routine is provided in a separate code - module, so that it can be easily overridden when the UnZip package is - used as a static link library. One example is the WinDLL static library - usage for building a monolythic binary of the Windows application "WiZ" - that supports bzip2 both in compression and decompression operations. - - Contains: bz_internal_error() (USE_BZIP2 only) - - ---------------------------------------------------------------------------*/ - - -#define __UBZ2ERR_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" -#ifdef WINDLL -# ifdef POCKET_UNZIP -# include "wince/intrface.h" -# else -# include "windll/windll.h" -# endif -#endif - -#ifdef USE_BZIP2 - -/**********************************/ -/* Function bz_internal_error() */ -/**********************************/ - -/* Call-back function for the bzip2 decompression code (compiled with - * BZ_NO_STDIO), required to handle fatal internal bug-type errors of - * the bzip2 library. - */ -void bz_internal_error(bzerrcode) - int bzerrcode; -{ - GETGLOBALS(); - - Info(slide, 0x421, ((char *)slide, - "error: internal fatal libbzip2 error number %d\n", bzerrcode)); -#ifdef WINDLL - longjmp(dll_error_return, 1); -#else - DESTROYGLOBALS(); - EXIT(PK_BADERR); -#endif -} /* end function bz_internal_error() */ - -#endif /* USE_BZIP2 */ diff --git a/data/windows/unzipfx-catia/unix/unix.c b/data/windows/unzipfx-catia/unix/unix.c deleted file mode 100644 index efa97fc..0000000 --- a/data/windows/unzipfx-catia/unix/unix.c +++ /dev/null @@ -1,1876 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unix.c - - Unix-specific routines for use with Info-ZIP's UnZip 5.41 and later. - - Contains: readdir() - do_wild() <-- generic enough to put in fileio.c? - mapattr() - mapname() - checkdir() - mkdir() - close_outfile() - defer_dir_attribs() - set_direc_attribs() - stamp_file() - version() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - -#ifdef SCO_XENIX -# define SYSNDIR -#else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */ -# if defined(__convexc__) || defined(SYSV) || defined(CRAY) || defined(BSD4_4) -# define DIRENT -# endif -#endif -#if defined(_AIX) || defined(__mpexl) -# define DIRENT -#endif -#ifdef COHERENT -# if defined(_I386) || (defined(__COHERENT__) && (__COHERENT__ >= 0x420)) -# define DIRENT -# endif -#endif - -#ifdef _POSIX_VERSION -# ifndef DIRENT -# define DIRENT -# endif -#endif - -#ifdef DIRENT -# include -#else -# ifdef SYSV -# ifdef SYSNDIR -# include -# else -# include -# endif -# else /* !SYSV */ -# ifndef NO_SYSDIR -# include -# endif -# endif /* ?SYSV */ -# ifndef dirent -# define dirent direct -# endif -#endif /* ?DIRENT */ - -#ifdef SET_DIR_ATTRIB -typedef struct uxdirattr { /* struct for holding unix style directory */ - struct uxdirattr *next; /* info until can be sorted and set at end */ - char *fn; /* filename of directory */ - union { - iztimes t3; /* mtime, atime, ctime */ - ztimbuf t2; /* modtime, actime */ - } u; - unsigned perms; /* same as min_info.file_attr */ - int have_uidgid; /* flag */ - ulg uidgid[2]; - char fnbuf[1]; /* buffer stub for directory name */ -} uxdirattr; -#define UxAtt(d) ((uxdirattr *)d) /* typecast shortcut */ -#endif /* SET_DIR_ATTRIB */ - -#ifdef ACORN_FTYPE_NFS -/* Acorn bits for NFS filetyping */ -typedef struct { - uch ID[2]; - uch size[2]; - uch ID_2[4]; - uch loadaddr[4]; - uch execaddr[4]; - uch attr[4]; -} RO_extra_block; - -#endif /* ACORN_FTYPE_NFS */ - -/* static int created_dir; */ /* used in mapname(), checkdir() */ -/* static int renamed_fullpath; */ /* ditto */ - -static unsigned filtattr OF((__GPRO__ unsigned perms)); - - -/*****************************/ -/* Strings used multiple */ -/* times in unix.c */ -/*****************************/ - -#ifndef MTS -/* messages of code for setting file/directory attributes */ -static ZCONST char CannotSetItemUidGid[] = - "warning: cannot set UID %lu and/or GID %lu for %s\n %s\n"; -static ZCONST char CannotSetUidGid[] = - " (warning) cannot set UID %lu and/or GID %lu\n %s"; -static ZCONST char CannotSetItemTimestamps[] = - "warning: cannot set modif./access times for %s\n %s\n"; -static ZCONST char CannotSetTimestamps[] = - " (warning) cannot set modif./access times\n %s"; -#endif /* !MTS */ - - -#ifndef SFX -#ifdef NO_DIR /* for AT&T 3B1 */ - -#define opendir(path) fopen(path,"r") -#define closedir(dir) fclose(dir) -typedef FILE DIR; -typedef struct zdir { - FILE *dirhandle; - struct dirent *entry; -} DIR -DIR *opendir OF((ZCONST char *dirspec)); -void closedir OF((DIR *dirp)); -struct dirent *readdir OF((DIR *dirp)); - -DIR *opendir(dirspec) - ZCONST char *dirspec; -{ - DIR *dirp; - - if ((dirp = malloc(sizeof(DIR)) != NULL) { - if ((dirp->dirhandle = fopen(dirspec, "r")) == NULL) { - free(dirp); - dirp = NULL; - } - } - return dirp; -} - -void closedir(dirp) - DIR *dirp; -{ - fclose(dirp->dirhandle); - free(dirp); -} - -/* - * Apparently originally by Rich Salz. - * Cleaned up and modified by James W. Birdsall. - */ -struct dirent *readdir(dirp) - DIR *dirp; -{ - - if (dirp == NULL) - return NULL; - - for (;;) - if (fread(&(dirp->entry), sizeof (struct dirent), 1, - dirp->dirhandle) == 0) - return (struct dirent *)NULL; - else if ((dirp->entry).d_ino) - return &(dirp->entry); - -} /* end function readdir() */ - -#endif /* NO_DIR */ - - -/**********************/ -/* Function do_wild() */ /* for porting: dir separator; match(ignore_case) */ -/**********************/ - -char *do_wild(__G__ wildspec) - __GDEF - ZCONST char *wildspec; /* only used first time on a given dir */ -{ -/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in unxcfg.h: - static DIR *wild_dir = (DIR *)NULL; - static ZCONST char *wildname; - static char *dirname, matchname[FILNAMSIZ]; - static int notfirstcall=FALSE, have_dirname, dirnamelen; -*/ - struct dirent *file; - - /* Even when we're just returning wildspec, we *always* do so in - * matchname[]--calling routine is allowed to append four characters - * to the returned string, and wildspec may be a pointer to argv[]. - */ - if (!G.notfirstcall) { /* first call: must initialize everything */ - G.notfirstcall = TRUE; - - if (!iswild(wildspec)) { - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - G.have_dirname = FALSE; - G.wild_dir = NULL; - return G.matchname; - } - - /* break the wildspec into a directory part and a wildcard filename */ - if ((G.wildname = (ZCONST char *)strrchr(wildspec, '/')) == NULL) { - G.dirname = "."; - G.dirnamelen = 1; - G.have_dirname = FALSE; - G.wildname = wildspec; - } else { - ++G.wildname; /* point at character after '/' */ - G.dirnamelen = G.wildname - wildspec; - if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == (char *)NULL) { - Info(slide, 0x201, ((char *)slide, - "warning: cannot allocate wildcard buffers\n")); - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; /* but maybe filespec was not a wildcard */ - } - strncpy(G.dirname, wildspec, G.dirnamelen); - G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ - G.have_dirname = TRUE; - } - - if ((G.wild_dir = (zvoid *)opendir(G.dirname)) != (zvoid *)NULL) { - while ((file = readdir((DIR *)G.wild_dir)) != - (struct dirent *)NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - if (file->d_name[0] == '.' && G.wildname[0] != '.') - continue; /* Unix: '*' and '?' do not match leading dot */ - if (match(file->d_name, G.wildname, 0 WISEP) &&/*0=case sens.*/ - /* skip "." and ".." directory entries */ - strcmp(file->d_name, ".") && strcmp(file->d_name, "..")) { - Trace((stderr, "do_wild: match() succeeds\n")); - if (G.have_dirname) { - strcpy(G.matchname, G.dirname); - strcpy(G.matchname+G.dirnamelen, file->d_name); - } else - strcpy(G.matchname, file->d_name); - return G.matchname; - } - } - /* if we get to here directory is exhausted, so close it */ - closedir((DIR *)G.wild_dir); - G.wild_dir = (zvoid *)NULL; - } - Trace((stderr, "do_wild: opendir(%s) returns NULL\n", - FnFilter1(G.dirname))); - - /* return the raw wildspec in case that works (e.g., directory not - * searchable, but filespec was not wild and file is readable) */ - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; - } - - /* last time through, might have failed opendir but returned raw wildspec */ - if ((DIR *)G.wild_dir == (DIR *)NULL) { - G.notfirstcall = FALSE; /* nothing left--reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - } - - /* If we've gotten this far, we've read and matched at least one entry - * successfully (in a previous call), so dirname has been copied into - * matchname already. - */ - while ((file = readdir((DIR *)G.wild_dir)) != (struct dirent *)NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - if (file->d_name[0] == '.' && G.wildname[0] != '.') - continue; /* Unix: '*' and '?' do not match leading dot */ - if (match(file->d_name, G.wildname, 0 WISEP)) { /* 0 == case sens. */ - Trace((stderr, "do_wild: match() succeeds\n")); - if (G.have_dirname) { - /* strcpy(G.matchname, G.dirname); */ - strcpy(G.matchname+G.dirnamelen, file->d_name); - } else - strcpy(G.matchname, file->d_name); - return G.matchname; - } - } - - closedir((DIR *)G.wild_dir); /* at least one entry read; nothing left */ - G.wild_dir = (zvoid *)NULL; - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - -} /* end function do_wild() */ - -#endif /* !SFX */ - - - - -#ifndef S_ISUID -# define S_ISUID 0004000 /* set user id on execution */ -#endif -#ifndef S_ISGID -# define S_ISGID 0002000 /* set group id on execution */ -#endif -#ifndef S_ISVTX -# define S_ISVTX 0001000 /* save swapped text even after use */ -#endif - -/************************/ -/* Function filtattr() */ -/************************/ -/* This is used to clear or keep the SUID and SGID bits on file permissions. - * It's possible that a file in an archive could have one of these bits set - * and, unknown to the person unzipping, could allow others to execute the - * file as the user or group. The new option -K bypasses this check. - */ - -static unsigned filtattr(__G__ perms) - __GDEF - unsigned perms; -{ - /* keep setuid/setgid/tacky perms? */ - if (!uO.K_flag) - perms &= ~(S_ISUID | S_ISGID | S_ISVTX); - - return (0xffff & perms); -} /* end function filtattr() */ - - - - - -/**********************/ -/* Function mapattr() */ -/**********************/ - -int mapattr(__G) - __GDEF -{ - int r; - ulg tmp = G.crec.external_file_attributes; - - G.pInfo->file_attr = 0; - /* initialized to 0 for check in "default" branch below... */ - - switch (G.pInfo->hostnum) { - case AMIGA_: - tmp = (unsigned)(tmp>>17 & 7); /* Amiga RWE bits */ - G.pInfo->file_attr = (unsigned)(tmp<<6 | tmp<<3 | tmp); - break; - case THEOS_: - tmp &= 0xF1FFFFFFL; - if ((tmp & 0xF0000000L) != 0x40000000L) - tmp &= 0x01FFFFFFL; /* not a dir, mask all ftype bits */ - else - tmp &= 0x41FFFFFFL; /* leave directory bit as set */ - /* fall through! */ - case UNIX_: - case VMS_: - case ACORN_: - case ATARI_: - case ATHEOS_: - case BEOS_: - case QDOS_: - case TANDEM_: - r = FALSE; - G.pInfo->file_attr = (unsigned)(tmp >> 16); - if (G.pInfo->file_attr == 0 && G.extra_field) { - /* Some (non-Info-ZIP) implementations of Zip for Unix and - * VMS (and probably others ??) leave 0 in the upper 16-bit - * part of the external_file_attributes field. Instead, they - * store file permission attributes in some extra field. - * As a work-around, we search for the presence of one of - * these extra fields and fall back to the MSDOS compatible - * part of external_file_attributes if one of the known - * e.f. types has been detected. - * Later, we might implement extraction of the permission - * bits from the VMS extra field. But for now, the work-around - * should be sufficient to provide "readable" extracted files. - * (For ASI Unix e.f., an experimental remap of the e.f. - * mode value IS already provided!) - */ - ush ebID; - unsigned ebLen; - uch *ef = G.extra_field; - unsigned ef_len = G.crec.extra_field_length; - - while (!r && ef_len >= EB_HEADSIZE) { - ebID = makeword(ef); - ebLen = (unsigned)makeword(ef+EB_LEN); - if (ebLen > (ef_len - EB_HEADSIZE)) - /* discoverd some e.f. inconsistency! */ - break; - switch (ebID) { - case EF_ASIUNIX: - if (ebLen >= (EB_ASI_MODE+2)) { - G.pInfo->file_attr = - (unsigned)makeword(ef+(EB_HEADSIZE+EB_ASI_MODE)); - /* force stop of loop: */ - ef_len = (ebLen + EB_HEADSIZE); - break; - } - /* else: fall through! */ - case EF_PKVMS: - /* "found nondecypherable e.f. with perm. attr" */ - r = TRUE; - default: - break; - } - ef_len -= (ebLen + EB_HEADSIZE); - ef += (ebLen + EB_HEADSIZE); - } - } - if (!r) { -#ifdef SYMLINKS - /* Check if the file is a (POSIX-compatible) symbolic link. - * We restrict symlink support to those "made-by" hosts that - * are known to support symbolic links. - */ - G.pInfo->symlink = S_ISLNK(G.pInfo->file_attr) && - SYMLINK_HOST(G.pInfo->hostnum); -#endif - return 0; - } - /* fall through! */ - /* all remaining cases: expand MSDOS read-only bit into write perms */ - case FS_FAT_: - /* PKWARE's PKZip for Unix marks entries as FS_FAT_, but stores the - * Unix attributes in the upper 16 bits of the external attributes - * field, just like Info-ZIP's Zip for Unix. We try to use that - * value, after a check for consistency with the MSDOS attribute - * bits (see below). - */ - G.pInfo->file_attr = (unsigned)(tmp >> 16); - /* fall through! */ - case FS_HPFS_: - case FS_NTFS_: - case MAC_: - case TOPS20_: - default: - /* Ensure that DOS subdir bit is set when the entry's name ends - * in a '/'. Some third-party Zip programs fail to set the subdir - * bit for directory entries. - */ - if ((tmp & 0x10) == 0) { - extent fnlen = strlen(G.filename); - if (fnlen > 0 && G.filename[fnlen-1] == '/') - tmp |= 0x10; - } - /* read-only bit --> write perms; subdir bit --> dir exec bit */ - tmp = !(tmp & 1) << 1 | (tmp & 0x10) >> 4; - if ((G.pInfo->file_attr & 0700) == (unsigned)(0400 | tmp<<6)) { - /* keep previous G.pInfo->file_attr setting, when its "owner" - * part appears to be consistent with DOS attribute flags! - */ -#ifdef SYMLINKS - /* Entries "made by FS_FAT_" could have been zipped on a - * system that supports POSIX-style symbolic links. - */ - G.pInfo->symlink = S_ISLNK(G.pInfo->file_attr) && - (G.pInfo->hostnum == FS_FAT_); -#endif - return 0; - } - G.pInfo->file_attr = (unsigned)(0444 | tmp<<6 | tmp<<3 | tmp); - break; - } /* end switch (host-OS-created-by) */ - - /* for originating systems with no concept of "group," "other," "system": */ - umask( (int)(tmp=umask(0)) ); /* apply mask to expanded r/w(/x) perms */ - G.pInfo->file_attr &= ~tmp; - - return 0; - -} /* end function mapattr() */ - - - - - -/************************/ -/* Function mapname() */ -/************************/ - -int mapname(__G__ renamed) - __GDEF - int renamed; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - caution (truncated filename) - * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) - * MPN_ERR_SKIP - error -> skip entry - * MPN_ERR_TOOLONG - error -> path is too long - * MPN_NOMEM - error (memory allocation failed) -> skip entry - * [also MPN_VOL_LABEL, MPN_CREATED_DIR] - */ -{ - char pathcomp[FILNAMSIZ]; /* path-component buffer */ - char *pp, *cp=(char *)NULL; /* character pointers */ - char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ -#ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ - RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ -#endif - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ - int error = MPN_OK; - register unsigned workch; /* hold the character being tested */ - - -/*--------------------------------------------------------------------------- - Initialize various pointers and counters and stuff. - ---------------------------------------------------------------------------*/ - - if (G.pInfo->vollabel) - return MPN_VOL_LABEL; /* can't set disk volume labels in Unix */ - - /* can create path as long as not just freshening, or if user told us */ - G.create_dirs = (!uO.fflag || renamed); - - G.created_dir = FALSE; /* not yet */ - - /* user gave full pathname: don't prepend rootpath */ - G.renamed_fullpath = (renamed && (*G.filename == '/')); - - if (checkdir(__G__ (char *)NULL, INIT) == MPN_NOMEM) - return MPN_NOMEM; /* initialize path buffer, unless no memory */ - - *pathcomp = '\0'; /* initialize translation buffer */ - pp = pathcomp; /* point to translation buffer */ - if (uO.jflag) /* junking directories */ - cp = (char *)strrchr(G.filename, '/'); - if (cp == (char *)NULL) /* no '/' or not junking dirs */ - cp = G.filename; /* point to internal zipfile-member pathname */ - else - ++cp; /* point to start of last component of path */ - -/*--------------------------------------------------------------------------- - Begin main loop through characters in filename. - ---------------------------------------------------------------------------*/ - - while ((workch = (uch)*cp++) != 0) { - - switch (workch) { - case '/': /* can assume -j flag not given */ - *pp = '\0'; - if (strcmp(pathcomp, ".") == 0) { - /* don't bother appending "./" to the path */ - *pathcomp = '\0'; - } else if (!uO.ddotflag && strcmp(pathcomp, "..") == 0) { - /* "../" dir traversal detected, skip over it */ - *pathcomp = '\0'; - killed_ddot = TRUE; /* set "show message" flag */ - } - /* when path component is not empty, append it now */ - if (*pathcomp != '\0' && - ((error = checkdir(__G__ pathcomp, APPEND_DIR)) - & MPN_MASK) > MPN_INF_TRUNC) - return error; - pp = pathcomp; /* reset conversion buffer for next piece */ - lastsemi = (char *)NULL; /* leave direct. semi-colons alone */ - break; - -#ifdef __CYGWIN__ /* Cygwin runs on Win32, apply FAT/NTFS filename rules */ - case ':': /* drive spec not stored, so no colon allowed */ - case '\\': /* '\\' may come as normal filename char (not */ - case '<': /* dir sep char!) from unix-like file system */ - case '>': /* no redirection symbols allowed either */ - case '|': /* no pipe signs allowed */ - case '"': /* no double quotes allowed */ - case '?': /* no wildcards allowed */ - case '*': - *pp++ = '_'; /* these rules apply equally to FAT and NTFS */ - break; -#endif - - case ';': /* VMS version (or DEC-20 attrib?) */ - lastsemi = pp; - *pp++ = ';'; /* keep for now; remove VMS ";##" */ - break; /* later, if requested */ - -#ifdef ACORN_FTYPE_NFS - case ',': /* NFS filetype extension */ - lastcomma = pp; - *pp++ = ','; /* keep for now; may need to remove */ - break; /* later, if requested */ -#endif - -#ifdef MTS - case ' ': /* change spaces to underscore under */ - *pp++ = '_'; /* MTS; leave as spaces under Unix */ - break; -#endif - - default: - /* disable control character filter when requested, - * else allow 8-bit characters (e.g. UTF-8) in filenames: - */ - if (uO.cflxflag || - (isprint(workch) || (128 <= workch && workch <= 254))) - *pp++ = (char)workch; - } /* end switch */ - - } /* end while loop */ - - /* Show warning when stripping insecure "parent dir" path components */ - if (killed_ddot && QCOND2) { - Info(slide, 0, ((char *)slide, - "warning: skipped \"../\" path component(s) in %s\n", - FnFilter1(G.filename))); - if (!(error & ~MPN_MASK)) - error = (error & MPN_MASK) | PK_WARN; - } - -/*--------------------------------------------------------------------------- - Report if directory was created (and no file to create: filename ended - in '/'), check name to be sure it exists, and combine path and name be- - fore exiting. - ---------------------------------------------------------------------------*/ - - if (G.filename[strlen(G.filename) - 1] == '/') { - checkdir(__G__ G.filename, GETPATH); - if (G.created_dir) { - if (QCOND2) { - Info(slide, 0, ((char *)slide, " creating: %s\n", - FnFilter1(G.filename))); - } -#ifndef NO_CHMOD - /* Filter out security-relevant attributes bits. */ - G.pInfo->file_attr = filtattr(__G__ G.pInfo->file_attr); - /* When extracting non-UNIX directories or when extracting - * without UID/GID restoration or SGID preservation, any - * SGID flag inherited from the parent directory should be - * maintained to allow files extracted into this new folder - * to inherit the GID setting from the parent directory. - */ - if (G.pInfo->hostnum != UNIX_ || !(uO.X_flag || uO.K_flag)) { - /* preserve SGID bit when inherited from parent dir */ - if (!SSTAT(G.filename, &G.statbuf)) { - G.pInfo->file_attr |= G.statbuf.st_mode & S_ISGID; - } else { - perror("Could not read directory attributes"); - } - } - - /* set approx. dir perms (make sure can still read/write in dir) */ - if (chmod(G.filename, G.pInfo->file_attr | 0700)) - perror("chmod (directory attributes) error"); -#endif - /* set dir time (note trailing '/') */ - return (error & ~MPN_MASK) | MPN_CREATED_DIR; - } - /* dir existed already; don't look for data to extract */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; - } - - *pp = '\0'; /* done with pathcomp: terminate it */ - - /* if not saving them, remove VMS version numbers (appended ";###") */ - if (!uO.V_flag && lastsemi) { - pp = lastsemi + 1; - while (isdigit((uch)(*pp))) - ++pp; - if (*pp == '\0') /* only digits between ';' and end: nuke */ - *lastsemi = '\0'; - } - - /* On UNIX (and compatible systems), "." and ".." are reserved for - * directory navigation and cannot be used as regular file names. - * These reserved one-dot and two-dot names are mapped to "_" and "__". - */ - if (strcmp(pathcomp, ".") == 0) - *pathcomp = '_'; - else if (strcmp(pathcomp, "..") == 0) - strcpy(pathcomp, "__"); - -#ifdef ACORN_FTYPE_NFS - /* translate Acorn filetype information if asked to do so */ - if (uO.acorn_nfs_ext && - (ef_spark = (RO_extra_block *) - getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) - != (RO_extra_block *)NULL) - { - /* file *must* have a RISC OS extra field */ - long ft = (long)makelong(ef_spark->loadaddr); - /*32-bit*/ - if (lastcomma) { - pp = lastcomma + 1; - while (isxdigit((uch)(*pp))) ++pp; - if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ - } - if ((ft & 1<<31)==0) ft=0x000FFD00; - sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); - } -#endif /* ACORN_FTYPE_NFS */ - - if (*pathcomp == '\0') { - Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", - FnFilter1(G.filename))); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - - checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ - checkdir(__G__ G.filename, GETPATH); - - return error; - -} /* end function mapname() */ - - - - -#if 0 /*========== NOTES ==========*/ - - extract-to dir: a:path/ - buildpath: path1/path2/ ... (NULL-terminated) - pathcomp: filename - - mapname(): - loop over chars in zipfile member name - checkdir(path component, COMPONENT | CREATEDIR) --> map as required? - (d:/tmp/unzip/) (disk:[tmp.unzip.) - (d:/tmp/unzip/jj/) (disk:[tmp.unzip.jj.) - (d:/tmp/unzip/jj/temp/) (disk:[tmp.unzip.jj.temp.) - finally add filename itself and check for existence? (could use with rename) - (d:/tmp/unzip/jj/temp/msg.outdir) (disk:[tmp.unzip.jj.temp]msg.outdir) - checkdir(name, GETPATH) --> copy path to name and free space - -#endif /* 0 */ - - - - -/***********************/ -/* Function checkdir() */ -/***********************/ - -int checkdir(__G__ pathcomp, flag) - __GDEF - char *pathcomp; - int flag; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename - * MPN_INF_SKIP - path doesn't exist, not allowed to create - * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path - * exists and is not a directory, but is supposed to be - * MPN_ERR_TOOLONG - path is too long - * MPN_NOMEM - can't allocate memory for filename buffers - */ -{ - /* static int rootlen = 0; */ /* length of rootpath */ - /* static char *rootpath; */ /* user's "extract-to" directory */ - /* static char *buildpath; */ /* full path (so far) to extracted file */ - /* static char *end; */ /* pointer to end of buildpath ('\0') */ - -# define FN_MASK 7 -# define FUNCTION (flag & FN_MASK) - - - -/*--------------------------------------------------------------------------- - APPEND_DIR: append the path component to the path being built and check - for its existence. If doesn't exist and we are creating directories, do - so for this one; else signal success or error as appropriate. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_DIR) { - int too_long = FALSE; -#ifdef SHORT_NAMES - char *old_end = end; -#endif - - Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); - while ((*G.end = *pathcomp++) != '\0') - ++G.end; -#ifdef SHORT_NAMES /* path components restricted to 14 chars, typically */ - if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ - *(G.end = old_end + FILENAME_MAX) = '\0'; -#endif - - /* GRR: could do better check, see if overrunning buffer as we go: - * check end-buildpath after each append, set warning variable if - * within 20 of FILNAMSIZ; then if var set, do careful check when - * appending. Clear variable when begin new path. */ - - /* next check: need to append '/', at least one-char name, '\0' */ - if ((G.end-G.buildpath) > FILNAMSIZ-3) - too_long = TRUE; /* check if extracting dir? */ - if (SSTAT(G.buildpath, &G.statbuf)) { /* path doesn't exist */ - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpath); - return MPN_INF_SKIP; /* path doesn't exist: nothing to do */ - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpath))); - free(G.buildpath); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (mkdir(G.buildpath, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpath), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpath); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } else if (!S_ISDIR(G.statbuf.st_mode)) { - Info(slide, 1, ((char *)slide, - "checkdir error: %s exists but is not directory\n\ - unable to process %s.\n", - FnFilter2(G.buildpath), FnFilter1(G.filename))); - free(G.buildpath); - /* path existed but wasn't dir */ - return MPN_ERR_SKIP; - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", FnFilter1(G.buildpath))); - free(G.buildpath); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - *G.end++ = '/'; - *G.end = '\0'; - Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); - return MPN_OK; - - } /* end if (FUNCTION == APPEND_DIR) */ - -/*--------------------------------------------------------------------------- - GETPATH: copy full path to the string pointed at by pathcomp, and free - G.buildpath. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == GETPATH) { - strcpy(pathcomp, G.buildpath); - Trace((stderr, "getting and freeing path [%s]\n", - FnFilter1(pathcomp))); - free(G.buildpath); - G.buildpath = G.end = (char *)NULL; - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - APPEND_NAME: assume the path component is the filename; append it and - return without checking for existence. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_NAME) { -#ifdef SHORT_NAMES - char *old_end = end; -#endif - - Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); - while ((*G.end = *pathcomp++) != '\0') { - ++G.end; -#ifdef SHORT_NAMES /* truncate name at 14 characters, typically */ - if ((G.end-old_end) > FILENAME_MAX) /* GRR: proper constant? */ - *(G.end = old_end + FILENAME_MAX) = '\0'; -#endif - if ((G.end-G.buildpath) >= FILNAMSIZ) { - *--G.end = '\0'; - Info(slide, 0x201, ((char *)slide, - "checkdir warning: path too long; truncating\n\ - %s\n -> %s\n", - FnFilter1(G.filename), FnFilter2(G.buildpath))); - return MPN_INF_TRUNC; /* filename truncated */ - } - } - Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath))); - /* could check for existence here, prompt for new name... */ - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - INIT: allocate and initialize buffer space for the file currently being - extracted. If file was renamed with an absolute path, don't prepend the - extract-to path. - ---------------------------------------------------------------------------*/ - -/* GRR: for VMS and TOPS-20, add up to 13 to strlen */ - - if (FUNCTION == INIT) { - Trace((stderr, "initializing buildpath to ")); -#ifdef ACORN_FTYPE_NFS - if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpath = (char *)malloc(strlen(G.filename)+G.rootlen+1)) -#endif - == (char *)NULL) - return MPN_NOMEM; - if ((G.rootlen > 0) && !G.renamed_fullpath) { - strcpy(G.buildpath, G.rootpath); - G.end = G.buildpath + G.rootlen; - } else { - *G.buildpath = '\0'; - G.end = G.buildpath; - } - Trace((stderr, "[%s]\n", FnFilter1(G.buildpath))); - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - ROOT: if appropriate, store the path in rootpath and create it if - necessary; else assume it's a zipfile member and return. This path - segment gets used in extracting all members from every zipfile specified - on the command line. - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) || defined(SFX_EXDIR)) - if (FUNCTION == ROOT) { - Trace((stderr, "initializing root path to [%s]\n", - FnFilter1(pathcomp))); - if (pathcomp == (char *)NULL) { - G.rootlen = 0; - return MPN_OK; - } - if (G.rootlen > 0) /* rootpath was already set, nothing to do */ - return MPN_OK; - if ((G.rootlen = strlen(pathcomp)) > 0) { - char *tmproot; - - if ((tmproot = (char *)malloc(G.rootlen+2)) == (char *)NULL) { - G.rootlen = 0; - return MPN_NOMEM; - } - strcpy(tmproot, pathcomp); - if (tmproot[G.rootlen-1] == '/') { - tmproot[--G.rootlen] = '\0'; - } - if (G.rootlen > 0 && (SSTAT(tmproot, &G.statbuf) || - !S_ISDIR(G.statbuf.st_mode))) - { /* path does not exist */ - if (!G.create_dirs /* || iswild(tmproot) */ ) { - free(tmproot); - G.rootlen = 0; - /* skip (or treat as stored file) */ - return MPN_INF_SKIP; - } - /* create the directory (could add loop here scanning tmproot - * to create more than one level, but why really necessary?) */ - if (mkdir(tmproot, 0777) == -1) { - Info(slide, 1, ((char *)slide, - "checkdir: cannot create extraction directory: %s\n\ - %s\n", - FnFilter1(tmproot), strerror(errno))); - free(tmproot); - G.rootlen = 0; - /* path didn't exist, tried to create, and failed: */ - /* file exists, or 2+ subdir levels required */ - return MPN_ERR_SKIP; - } - } - tmproot[G.rootlen++] = '/'; - tmproot[G.rootlen] = '\0'; - if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { - free(tmproot); - G.rootlen = 0; - return MPN_NOMEM; - } - Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); - } - return MPN_OK; - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - END: free rootpath, immediately prior to program exit. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == END) { - Trace((stderr, "freeing rootpath\n")); - if (G.rootlen > 0) { - free(G.rootpath); - G.rootlen = 0; - } - return MPN_OK; - } - - return MPN_INVALID; /* should never reach */ - -} /* end function checkdir() */ - - - - - -#ifdef NO_MKDIR - -/********************/ -/* Function mkdir() */ -/********************/ - -int mkdir(path, mode) - ZCONST char *path; - int mode; /* ignored */ -/* - * returns: 0 - successful - * -1 - failed (errno not set, however) - */ -{ - char command[FILNAMSIZ+40]; /* buffer for system() call */ - - /* GRR 930416: added single quotes around path to avoid bug with - * creating directories with ampersands in name; not yet tested */ - sprintf(command, "IFS=\" \t\n\" /bin/mkdir '%s' 2>/dev/null", path); - if (system(command)) - return -1; - return 0; -} - -#endif /* NO_MKDIR */ - - - - -#if (!defined(MTS) || defined(SET_DIR_ATTRIB)) -static int get_extattribs OF((__GPRO__ iztimes *pzt, ulg z_uidgid[2])); - -static int get_extattribs(__G__ pzt, z_uidgid) - __GDEF - iztimes *pzt; - ulg z_uidgid[2]; -{ -/*--------------------------------------------------------------------------- - Convert from MSDOS-format local time and date to Unix-format 32-bit GMT - time: adjust base year from 1980 to 1970, do usual conversions from - yy/mm/dd hh:mm:ss to elapsed seconds, and account for timezone and day- - light savings time differences. If we have a Unix extra field, however, - we're laughing: both mtime and atime are ours. On the other hand, we - then have to check for restoration of UID/GID. - ---------------------------------------------------------------------------*/ - int have_uidgid_flg; - unsigned eb_izux_flg; - - eb_izux_flg = (G.extra_field ? ef_scan_for_izux(G.extra_field, - G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, -#ifdef IZ_CHECK_TZ - (G.tz_is_valid ? pzt : NULL), -#else - pzt, -#endif - z_uidgid) : 0); - if (eb_izux_flg & EB_UT_FL_MTIME) { - TTrace((stderr, "\nget_extattribs: Unix e.f. modif. time = %ld\n", - pzt->mtime)); - } else { - pzt->mtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - } - if (eb_izux_flg & EB_UT_FL_ATIME) { - TTrace((stderr, "get_extattribs: Unix e.f. access time = %ld\n", - pzt->atime)); - } else { - pzt->atime = pzt->mtime; - TTrace((stderr, "\nget_extattribs: modification/access times = %ld\n", - pzt->mtime)); - } - - /* if -X option was specified and we have UID/GID info, restore it */ - have_uidgid_flg = -#ifdef RESTORE_UIDGID - (uO.X_flag && (eb_izux_flg & EB_UX2_VALID)); -#else - 0; -#endif - return have_uidgid_flg; -} -#endif /* !MTS || SET_DIR_ATTRIB */ - - - -#ifndef MTS - -/****************************/ -/* Function close_outfile() */ -/****************************/ - -void close_outfile(__G) /* GRR: change to return PK-style warning level */ - __GDEF -{ - union { - iztimes t3; /* mtime, atime, ctime */ - ztimbuf t2; /* modtime, actime */ - } zt; - ulg z_uidgid[2]; - int have_uidgid_flg; - - have_uidgid_flg = get_extattribs(__G__ &(zt.t3), z_uidgid); - -/*--------------------------------------------------------------------------- - If symbolic links are supported, allocate storage for a symlink control - structure, put the uncompressed "data" and other required info in it, and - add the structure to the "deferred symlinks" chain. Since we know it's a - symbolic link to start with, we shouldn't have to worry about overflowing - unsigned ints with unsigned longs. - ---------------------------------------------------------------------------*/ - -#ifdef SYMLINKS - if (G.symlnk) { - extent ucsize = (extent)G.lrec.ucsize; -# ifdef SET_SYMLINK_ATTRIBS - extent attribsize = sizeof(unsigned) + - (have_uidgid_flg ? sizeof(z_uidgid) : 0); -# else - extent attribsize = 0; -# endif - /* size of the symlink entry is the sum of - * (struct size (includes 1st '\0') + 1 additional trailing '\0'), - * system specific attribute data size (might be 0), - * and the lengths of name and link target. - */ - extent slnk_entrysize = (sizeof(slinkentry) + 1) + attribsize + - ucsize + strlen(G.filename); - slinkentry *slnk_entry; - - if (slnk_entrysize < ucsize) { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed: mem alloc overflow\n", - FnFilter1(G.filename))); - fclose(G.outfile); - return; - } - - if ((slnk_entry = (slinkentry *)malloc(slnk_entrysize)) == NULL) { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed: no mem\n", - FnFilter1(G.filename))); - fclose(G.outfile); - return; - } - slnk_entry->next = NULL; - slnk_entry->targetlen = ucsize; - slnk_entry->attriblen = attribsize; -# ifdef SET_SYMLINK_ATTRIBS - memcpy(slnk_entry->buf, &(G.pInfo->file_attr), - sizeof(unsigned)); - if (have_uidgid_flg) - memcpy(slnk_entry->buf + 4, z_uidgid, sizeof(z_uidgid)); -# endif - slnk_entry->target = slnk_entry->buf + slnk_entry->attriblen; - slnk_entry->fname = slnk_entry->target + ucsize + 1; - strcpy(slnk_entry->fname, G.filename); - - /* move back to the start of the file to re-read the "link data" */ - rewind(G.outfile); - - if (fread(slnk_entry->target, 1, ucsize, G.outfile) != ucsize) - { - Info(slide, 0x201, ((char *)slide, - "warning: symbolic link (%s) failed\n", - FnFilter1(G.filename))); - free(slnk_entry); - fclose(G.outfile); - return; - } - fclose(G.outfile); /* close "link" file for good... */ - slnk_entry->target[ucsize] = '\0'; - if (QCOND2) - Info(slide, 0, ((char *)slide, "-> %s ", - FnFilter1(slnk_entry->target))); - /* add this symlink record to the list of deferred symlinks */ - if (G.slink_last != NULL) - G.slink_last->next = slnk_entry; - else - G.slink_head = slnk_entry; - G.slink_last = slnk_entry; - return; - } -#endif /* SYMLINKS */ - -#ifdef QLZIP - if (G.extra_field) { - static void qlfix OF((__GPRO__ uch *ef_ptr, unsigned ef_len)); - - qlfix(__G__ G.extra_field, G.lrec.extra_field_length); - } -#endif - -#if (defined(NO_FCHOWN)) - fclose(G.outfile); -#endif - - /* if -X option was specified and we have UID/GID info, restore it */ - if (have_uidgid_flg - /* check that both uid and gid values fit into their data sizes */ - && ((ulg)(uid_t)(z_uidgid[0]) == z_uidgid[0]) - && ((ulg)(gid_t)(z_uidgid[1]) == z_uidgid[1])) { - TTrace((stderr, "close_outfile: restoring Unix UID/GID info\n")); -#if (defined(NO_FCHOWN)) - if (chown(G.filename, (uid_t)z_uidgid[0], (gid_t)z_uidgid[1])) -#else - if (fchown(fileno(G.outfile), (uid_t)z_uidgid[0], (gid_t)z_uidgid[1])) -#endif - { - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - z_uidgid[0], z_uidgid[1], FnFilter1(G.filename), - strerror(errno))); - else - Info(slide, 0x201, ((char *)slide, CannotSetUidGid, - z_uidgid[0], z_uidgid[1], strerror(errno))); - } - } - -#if (!defined(NO_FCHOWN) && defined(NO_FCHMOD)) - fclose(G.outfile); -#endif - -#if (!defined(NO_FCHOWN) && !defined(NO_FCHMOD)) -/*--------------------------------------------------------------------------- - Change the file permissions from default ones to those stored in the - zipfile. - ---------------------------------------------------------------------------*/ - - if (fchmod(fileno(G.outfile), filtattr(__G__ G.pInfo->file_attr))) - perror("fchmod (file attributes) error"); - - fclose(G.outfile); -#endif /* !NO_FCHOWN && !NO_FCHMOD */ - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - /* set the file's access and modification times */ - if (utime(G.filename, &(zt.t2))) { - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, CannotSetItemTimestamps, - FnFilter1(G.filename), strerror(errno))); - else - Info(slide, 0x201, ((char *)slide, CannotSetTimestamps, - strerror(errno))); - } - } - -#if (defined(NO_FCHOWN) || defined(NO_FCHMOD)) -/*--------------------------------------------------------------------------- - Change the file permissions from default ones to those stored in the - zipfile. - ---------------------------------------------------------------------------*/ - -#ifndef NO_CHMOD - if (chmod(G.filename, filtattr(__G__ G.pInfo->file_attr))) - perror("chmod (file attributes) error"); -#endif -#endif /* NO_FCHOWN || NO_FCHMOD */ - -} /* end function close_outfile() */ - -#endif /* !MTS */ - - -#if (defined(SYMLINKS) && defined(SET_SYMLINK_ATTRIBS)) -int set_symlnk_attribs(__G__ slnk_entry) - __GDEF - slinkentry *slnk_entry; -{ - if (slnk_entry->attriblen > 0) { -# if (!defined(NO_LCHOWN)) - if (slnk_entry->attriblen > sizeof(unsigned)) { - ulg *z_uidgid_p = (zvoid *)(slnk_entry->buf + sizeof(unsigned)); - /* check that both uid and gid values fit into their data sizes */ - if (((ulg)(uid_t)(z_uidgid_p[0]) == z_uidgid_p[0]) && - ((ulg)(gid_t)(z_uidgid_p[1]) == z_uidgid_p[1])) { - TTrace((stderr, - "set_symlnk_attribs: restoring Unix UID/GID info for\n\ - %s\n", - FnFilter1(slnk_entry->fname))); - if (lchown(slnk_entry->fname, - (uid_t)z_uidgid_p[0], (gid_t)z_uidgid_p[1])) - { - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - z_uidgid_p[0], z_uidgid_p[1], FnFilter1(slnk_entry->fname), - strerror(errno))); - } - } - } -# endif /* !NO_LCHOWN */ -# if (!defined(NO_LCHMOD)) - TTrace((stderr, - "set_symlnk_attribs: restoring Unix attributes for\n %s\n", - FnFilter1(slnk_entry->fname))); - if (lchmod(slnk_entry->fname, - filtattr(__G__ *(unsigned *)(zvoid *)slnk_entry->buf))) - perror("lchmod (file attributes) error"); -# endif /* !NO_LCHMOD */ - } - /* currently, no error propagation... */ - return PK_OK; -} /* end function set_symlnk_attribs() */ -#endif /* SYMLINKS && SET_SYMLINK_ATTRIBS */ - - -#ifdef SET_DIR_ATTRIB -/* messages of code for setting directory attributes */ -# ifndef NO_CHMOD - static ZCONST char DirlistChmodFailed[] = - "warning: cannot set permissions for %s\n %s\n"; -# endif - - -int defer_dir_attribs(__G__ pd) - __GDEF - direntry **pd; -{ - uxdirattr *d_entry; - - d_entry = (uxdirattr *)malloc(sizeof(uxdirattr) + strlen(G.filename)); - *pd = (direntry *)d_entry; - if (d_entry == (uxdirattr *)NULL) { - return PK_MEM; - } - d_entry->fn = d_entry->fnbuf; - strcpy(d_entry->fn, G.filename); - - d_entry->perms = G.pInfo->file_attr; - - d_entry->have_uidgid = get_extattribs(__G__ &(d_entry->u.t3), - d_entry->uidgid); - return PK_OK; -} /* end function defer_dir_attribs() */ - - -int set_direc_attribs(__G__ d) - __GDEF - direntry *d; -{ - int errval = PK_OK; - - if (UxAtt(d)->have_uidgid && - /* check that both uid and gid values fit into their data sizes */ - ((ulg)(uid_t)(UxAtt(d)->uidgid[0]) == UxAtt(d)->uidgid[0]) && - ((ulg)(gid_t)(UxAtt(d)->uidgid[1]) == UxAtt(d)->uidgid[1]) && - chown(UxAtt(d)->fn, (uid_t)UxAtt(d)->uidgid[0], - (gid_t)UxAtt(d)->uidgid[1])) - { - Info(slide, 0x201, ((char *)slide, CannotSetItemUidGid, - UxAtt(d)->uidgid[0], UxAtt(d)->uidgid[1], FnFilter1(d->fn), - strerror(errno))); - if (!errval) - errval = PK_WARN; - } - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - /* restore directory timestamps */ - if (utime(d->fn, &UxAtt(d)->u.t2)) { - Info(slide, 0x201, ((char *)slide, CannotSetItemTimestamps, - FnFilter1(d->fn), strerror(errno))); - if (!errval) - errval = PK_WARN; - } - } -#ifndef NO_CHMOD - if (chmod(d->fn, UxAtt(d)->perms)) { - Info(slide, 0x201, ((char *)slide, DirlistChmodFailed, - FnFilter1(d->fn), strerror(errno))); - if (!errval) - errval = PK_WARN; - } -#endif /* !NO_CHMOD */ - return errval; -} /* end function set_direc_attribs() */ - -#endif /* SET_DIR_ATTRIB */ - - - - -#ifdef TIMESTAMP - -/***************************/ -/* Function stamp_file() */ -/***************************/ - -int stamp_file(fname, modtime) - ZCONST char *fname; - time_t modtime; -{ - ztimbuf tp; - - tp.modtime = tp.actime = modtime; - return (utime(fname, &tp)); - -} /* end function stamp_file() */ - -#endif /* TIMESTAMP */ - - - - -#ifndef SFX - -/************************/ -/* Function version() */ -/************************/ - -void version(__G) - __GDEF -{ -#if (defined(__GNUC__) && defined(NX_CURRENT_COMPILER_RELEASE)) - char cc_namebuf[40]; - char cc_versbuf[40]; -#else -#if (defined(__SUNPRO_C)) - char cc_versbuf[17]; -#else -#if (defined(__HP_cc) || defined(__IBMC__)) - char cc_versbuf[25]; -#else -#if (defined(__DECC_VER)) - char cc_versbuf[17]; - int cc_verstyp; -#else -#if (defined(CRAY) && defined(_RELEASE)) - char cc_versbuf[40]; -#endif /* (CRAY && _RELEASE) */ -#endif /* __DECC_VER */ -#endif /* __HP_cc || __IBMC__ */ -#endif /* __SUNPRO_C */ -#endif /* (__GNUC__ && NX_CURRENT_COMPILER_RELEASE) */ - -#if ((defined(CRAY) || defined(cray)) && defined(_UNICOS)) - char os_namebuf[40]; -#else -#if defined(__NetBSD__) - char os_namebuf[40]; -#endif -#endif - - /* Pyramid, NeXT have problems with huge macro expansion, too: no Info() */ - sprintf((char *)slide, LoadFarString(CompiledWith), - -#ifdef __GNUC__ -# ifdef NX_CURRENT_COMPILER_RELEASE - (sprintf(cc_namebuf, "NeXT DevKit %d.%02d ", - NX_CURRENT_COMPILER_RELEASE/100, NX_CURRENT_COMPILER_RELEASE%100), - cc_namebuf), - (strlen(__VERSION__) > 8)? "(gcc)" : - (sprintf(cc_versbuf, "(gcc %s)", __VERSION__), cc_versbuf), -# else - "gcc ", __VERSION__, -# endif -#else -#if defined(__SUNPRO_C) - "Sun C ", (sprintf(cc_versbuf, "version %x", __SUNPRO_C), cc_versbuf), -#else -#if (defined(__HP_cc)) - "HP C ", - (((__HP_cc% 100) == 0) ? - (sprintf(cc_versbuf, "version A.%02d.%02d", - (__HP_cc/ 10000), ((__HP_cc% 10000)/ 100))) : - (sprintf(cc_versbuf, "version A.%02d.%02d.%02d", - (__HP_cc/ 10000), ((__HP_cc% 10000)/ 100), (__HP_cc% 100))), - cc_versbuf), -#else -#if (defined(__DECC_VER)) - "DEC C ", - (sprintf(cc_versbuf, "%c%d.%d-%03d", - ((cc_verstyp = (__DECC_VER / 10000) % 10) == 6 ? 'T' : - (cc_verstyp == 8 ? 'S' : 'V')), - __DECC_VER / 10000000, - (__DECC_VER % 10000000) / 100000, __DECC_VER % 1000), - cc_versbuf), -#else -#if defined(CRAY) && defined(_RELEASE) - "cc ", (sprintf(cc_versbuf, "version %d", _RELEASE), cc_versbuf), -#else -#ifdef __IBMC__ - "IBM C ", - (sprintf(cc_versbuf, "version %d.%d.%d", - (__IBMC__ / 100), ((__IBMC__ / 10) % 10), (__IBMC__ % 10)), - cc_versbuf), -#else -#ifdef __VERSION__ -# ifndef IZ_CC_NAME -# define IZ_CC_NAME "cc " -# endif - IZ_CC_NAME, __VERSION__ -#else -# ifndef IZ_CC_NAME -# define IZ_CC_NAME "cc" -# endif - IZ_CC_NAME, "", -#endif /* ?__VERSION__ */ -#endif /* ?__IBMC__ */ -#endif /* ?(CRAY && _RELEASE) */ -#endif /* ?__DECC_VER */ -#endif /* ?__HP_cc */ -#endif /* ?__SUNPRO_C */ -#endif /* ?__GNUC__ */ - -#ifndef IZ_OS_NAME -# define IZ_OS_NAME "Unix" -#endif - IZ_OS_NAME, - -#if defined(sgi) || defined(__sgi) - " (Silicon Graphics IRIX)", -#else -#ifdef sun -# ifdef sparc -# ifdef __SVR4 - " (Sun SPARC/Solaris)", -# else /* may or may not be SunOS */ - " (Sun SPARC)", -# endif -# else -# if defined(sun386) || defined(i386) - " (Sun 386i)", -# else -# if defined(mc68020) || defined(__mc68020__) - " (Sun 3)", -# else /* mc68010 or mc68000: Sun 2 or earlier */ - " (Sun 2)", -# endif -# endif -# endif -#else -#ifdef __hpux - " (HP-UX)", -#else -#ifdef __osf__ - " (DEC OSF/1)", -#else -#ifdef _AIX - " (IBM AIX)", -#else -#ifdef aiws - " (IBM RT/AIX)", -#else -#if defined(CRAY) || defined(cray) -# ifdef _UNICOS - (sprintf(os_namebuf, " (Cray UNICOS release %d)", _UNICOS), os_namebuf), -# else - " (Cray UNICOS)", -# endif -#else -#if defined(uts) || defined(UTS) - " (Amdahl UTS)", -#else -#ifdef NeXT -# ifdef mc68000 - " (NeXTStep/black)", -# else - " (NeXTStep for Intel)", -# endif -#else /* the next dozen or so are somewhat order-dependent */ -#ifdef LINUX -# ifdef __ELF__ - " (Linux ELF)", -# else - " (Linux a.out)", -# endif -#else -#ifdef MINIX - " (Minix)", -#else -#ifdef M_UNIX - " (SCO Unix)", -#else -#ifdef M_XENIX - " (SCO Xenix)", -#else -#ifdef __NetBSD__ -# ifdef NetBSD0_8 - (sprintf(os_namebuf, " (NetBSD 0.8%c)", (char)(NetBSD0_8 - 1 + 'A')), - os_namebuf), -# else -# ifdef NetBSD0_9 - (sprintf(os_namebuf, " (NetBSD 0.9%c)", (char)(NetBSD0_9 - 1 + 'A')), - os_namebuf), -# else -# ifdef NetBSD1_0 - (sprintf(os_namebuf, " (NetBSD 1.0%c)", (char)(NetBSD1_0 - 1 + 'A')), - os_namebuf), -# else - (BSD4_4 == 0.5)? " (NetBSD before 0.9)" : " (NetBSD 1.1 or later)", -# endif -# endif -# endif -#else -#ifdef __FreeBSD__ - (BSD4_4 == 0.5)? " (FreeBSD 1.x)" : " (FreeBSD 2.0 or later)", -#else -#ifdef __bsdi__ - (BSD4_4 == 0.5)? " (BSD/386 1.0)" : " (BSD/386 1.1 or later)", -#else -#ifdef __386BSD__ - (BSD4_4 == 1)? " (386BSD, post-4.4 release)" : " (386BSD)", -#else -#ifdef __CYGWIN__ - " (Cygwin)", -#else -#if defined(i686) || defined(__i686) || defined(__i686__) - " (Intel 686)", -#else -#if defined(i586) || defined(__i586) || defined(__i586__) - " (Intel 586)", -#else -#if defined(i486) || defined(__i486) || defined(__i486__) - " (Intel 486)", -#else -#if defined(i386) || defined(__i386) || defined(__i386__) - " (Intel 386)", -#else -#ifdef pyr - " (Pyramid)", -#else -#ifdef ultrix -# ifdef mips - " (DEC/MIPS)", -# else -# ifdef vax - " (DEC/VAX)", -# else /* __alpha? */ - " (DEC/Alpha)", -# endif -# endif -#else -#ifdef gould - " (Gould)", -#else -#ifdef MTS - " (MTS)", -#else -#ifdef __convexc__ - " (Convex)", -#else -#ifdef __QNX__ - " (QNX 4)", -#else -#ifdef __QNXNTO__ - " (QNX Neutrino)", -#else -#ifdef Lynx - " (LynxOS)", -#else -#ifdef __APPLE__ -# ifdef __i386__ - " Mac OS X Intel i32", -# else -# ifdef __ppc__ - " Mac OS X PowerPC", -# else -# ifdef __ppc64__ - " Mac OS X PowerPC64", -# else - " Mac OS X", -# endif /* __ppc64__ */ -# endif /* __ppc__ */ -# endif /* __i386__ */ -#else - "", -#endif /* Apple */ -#endif /* Lynx */ -#endif /* QNX Neutrino */ -#endif /* QNX 4 */ -#endif /* Convex */ -#endif /* MTS */ -#endif /* Gould */ -#endif /* DEC */ -#endif /* Pyramid */ -#endif /* 386 */ -#endif /* 486 */ -#endif /* 586 */ -#endif /* 686 */ -#endif /* Cygwin */ -#endif /* 386BSD */ -#endif /* BSDI BSD/386 */ -#endif /* NetBSD */ -#endif /* FreeBSD */ -#endif /* SCO Xenix */ -#endif /* SCO Unix */ -#endif /* Minix */ -#endif /* Linux */ -#endif /* NeXT */ -#endif /* Amdahl */ -#endif /* Cray */ -#endif /* RT/AIX */ -#endif /* AIX */ -#endif /* OSF/1 */ -#endif /* HP-UX */ -#endif /* Sun */ -#endif /* SGI */ - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - - (*G.message)((zvoid *)&G, slide, (ulg)strlen((char *)slide), 0); - -} /* end function version() */ - -#endif /* !SFX */ - - - - -#ifdef QLZIP - -struct qdirect { - long d_length __attribute__ ((packed)); /* file length */ - unsigned char d_access __attribute__ ((packed)); /* file access type */ - unsigned char d_type __attribute__ ((packed)); /* file type */ - long d_datalen __attribute__ ((packed)); /* data length */ - long d_reserved __attribute__ ((packed));/* Unused */ - short d_szname __attribute__ ((packed)); /* size of name */ - char d_name[36] __attribute__ ((packed));/* name area */ - long d_update __attribute__ ((packed)); /* last update */ - long d_refdate __attribute__ ((packed)); - long d_backup __attribute__ ((packed)); /* EOD */ -}; - -#define LONGID "QDOS02" -#define EXTRALEN (sizeof(struct qdirect) + 8) -#define JBLONGID "QZHD" -#define JBEXTRALEN (sizeof(jbextra) - 4 * sizeof(char)) - -typedef struct { - char eb_header[4] __attribute__ ((packed)); /* place_holder */ - char longid[8] __attribute__ ((packed)); - struct qdirect header __attribute__ ((packed)); -} qdosextra; - -typedef struct { - char eb_header[4]; /* place_holder */ - char longid[4]; - struct qdirect header; -} jbextra; - - - -/* The following two functions SH() and LG() convert big-endian short - * and long numbers into native byte order. They are some kind of - * counterpart to the generic UnZip's makeword() and makelong() functions. - */ -static ush SH(ush val) -{ - uch swapbuf[2]; - - swapbuf[1] = (uch)(val & 0xff); - swapbuf[0] = (uch)(val >> 8); - return (*(ush *)swapbuf); -} - - - -static ulg LG(ulg val) -{ - /* convert the big-endian unsigned long number `val' to the machine - * dependent representation - */ - ush swapbuf[2]; - - swapbuf[1] = SH((ush)(val & 0xffff)); - swapbuf[0] = SH((ush)(val >> 16)); - return (*(ulg *)swapbuf); -} - - - -static void qlfix(__G__ ef_ptr, ef_len) - __GDEF - uch *ef_ptr; - unsigned ef_len; -{ - while (ef_len >= EB_HEADSIZE) - { - unsigned eb_id = makeword(EB_ID + ef_ptr); - unsigned eb_len = makeword(EB_LEN + ef_ptr); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "qlfix: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) { - case EF_QDOS: - { - struct _ntc_ - { - long id; - long dlen; - } ntc; - long dlen = 0; - - qdosextra *extra = (qdosextra *)ef_ptr; - jbextra *jbp = (jbextra *)ef_ptr; - - if (!strncmp(extra->longid, LONGID, strlen(LONGID))) - { - if (eb_len != EXTRALEN) - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in Qdos field for %s\n", - FnFilter1(G.filename))); - else - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in Qdos field")); - - if (extra->header.d_type) - { - dlen = extra->header.d_datalen; - } - } - - if (!strncmp(jbp->longid, JBLONGID, strlen(JBLONGID))) - { - if (eb_len != JBEXTRALEN) - if (uO.qflag) - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in QZ field for %s\n", - FnFilter1(G.filename))); - else - Info(slide, 0x201, ((char *)slide, - "warning: invalid length in QZ field")); - if (jbp->header.d_type) - { - dlen = jbp->header.d_datalen; - } - } - - if ((long)LG(dlen) > 0) - { - zfseeko(G.outfile, -8, SEEK_END); - fread(&ntc, 8, 1, G.outfile); - if (ntc.id != *(long *)"XTcc") - { - ntc.id = *(long *)"XTcc"; - ntc.dlen = dlen; - fwrite (&ntc, 8, 1, G.outfile); - } - Info(slide, 0x201, ((char *)slide, "QData = %d", LG(dlen))); - } - return; /* finished, cancel further extra field scanning */ - } - - default: - Trace((stderr,"qlfix: unknown extra field block, ID=%d\n", - eb_id)); - } - - /* Skip this extra field block */ - ef_ptr += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } -} -#endif /* QLZIP */ diff --git a/data/windows/unzipfx-catia/unix/unxcfg.h b/data/windows/unzipfx-catia/unix/unxcfg.h deleted file mode 100644 index e39b283..0000000 --- a/data/windows/unzipfx-catia/unix/unxcfg.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - Unix specific configuration section: - ---------------------------------------------------------------------------*/ - -#ifndef __unxcfg_h -#define __unxcfg_h - - -/* LARGE FILE SUPPORT - 10/6/04 EG */ -/* This needs to be set before the includes so they set the right sizes */ - -#if (defined(NO_LARGE_FILE_SUPPORT) && defined(LARGE_FILE_SUPPORT)) -# undef LARGE_FILE_SUPPORT -#endif - -/* Automatically set ZIP64_SUPPORT if LFS */ -#ifdef LARGE_FILE_SUPPORT -# if (!defined(NO_ZIP64_SUPPORT) && !defined(ZIP64_SUPPORT)) -# define ZIP64_SUPPORT -# endif -#endif - -/* NO_ZIP64_SUPPORT takes preceedence over ZIP64_SUPPORT */ -#if defined(NO_ZIP64_SUPPORT) && defined(ZIP64_SUPPORT) -# undef ZIP64_SUPPORT -#endif - -#ifdef LARGE_FILE_SUPPORT - /* 64-bit Large File Support */ - - /* The following Large File Summit (LFS) defines turn on large file support - on Linux (probably 2.4 or later kernel) and many other unixen */ - - /* These have to be before any include that sets types so the large file - versions of the types are set in the includes */ - -# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */ -# define _LARGEFILE64_SOURCE -# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */ -# define _LARGE_FILES /* some OSes need this for 64-bit off_t */ -# define __USE_LARGEFILE64 -#endif /* LARGE_FILE_SUPPORT */ - - -#include /* off_t, time_t, dev_t, ... */ -#include - -#ifdef NO_OFF_T - typedef long zoff_t; -#else - typedef off_t zoff_t; -#endif -#define ZOFF_T_DEFINED -typedef struct stat z_stat; -#define Z_STAT_DEFINED - -#ifndef COHERENT -# include /* O_BINARY for open() w/o CR/LF translation */ -#else /* COHERENT */ -# ifdef _I386 -# include /* Coherent 4.0.x, Mark Williams C */ -# else -# include /* Coherent 3.10, Mark Williams C */ -# endif -# define SHORT_SYMS -# ifndef __COHERENT__ /* Coherent 4.2 has tzset() */ -# define tzset settz -# endif -#endif /* ?COHERENT */ - -#ifndef NO_PARAM_H -# ifdef NGROUPS_MAX -# undef NGROUPS_MAX /* SCO bug: defined again in */ -# endif -# ifdef BSD -# define TEMP_BSD /* may be defined again in */ -# undef BSD -# endif -# include /* conflict with , some systems? */ -# ifdef TEMP_BSD -# undef TEMP_BSD -# ifndef BSD -# define BSD -# endif -# endif -#endif /* !NO_PARAM_H */ - -#ifdef __osf__ -# define DIRENT -# ifdef BSD -# undef BSD -# endif -#endif /* __osf__ */ - -#ifdef __CYGWIN__ -# include -# define DIRENT -# define HAVE_TERMIOS_H -# ifndef timezone -# define timezone _timezone -# endif -#endif - -#ifdef BSD -# include -# include -# if (defined(_AIX) || defined(__GLIBC__) || defined(__GNU__)) -# include -# endif -#else -# include - struct tm *gmtime(), *localtime(); -#endif - -#if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN))) -# include /* this includes utime.h on SGIs */ -# if (defined(BSD4_4) || defined(linux) || defined(__GLIBC__)) -# include -# define GOT_UTIMBUF -# endif -# if (!defined(GOT_UTIMBUF) && (defined(__hpux) || defined(__SUNPRO_C))) -# include -# define GOT_UTIMBUF -# endif -# if (!defined(GOT_UTIMBUF) && defined(__GNU__)) -# include -# define GOT_UTIMBUF -# endif -#endif -#if (defined(__DGUX__) && !defined(GOT_UTIMBUF)) - /* DG/UX requires this because of a non-standard struct utimebuf */ -# include -# define GOT_UTIMBUF -#endif - -#if (defined(V7) || defined(pyr_bsd)) -# define strchr index -# define strrchr rindex -#endif -#ifdef V7 -# define O_RDONLY 0 -# define O_WRONLY 1 -# define O_RDWR 2 -#endif - -#if defined(NO_UNICODE_SUPPORT) && defined(UNICODE_SUPPORT) - /* disable Unicode (UTF-8) support when requested */ -# undef UNICODE_SUPPORT -#endif - -#if (defined(_MBCS) && defined(NO_MBCS)) - /* disable MBCS support when requested */ -# undef _MBCS -#endif - -#if (!defined(NO_SETLOCALE) && !defined(_MBCS)) -# if (!defined(UNICODE_SUPPORT) || !defined(UTF8_MAYBE_NATIVE)) - /* enable setlocale here, unless this happens later for UTF-8 and/or - * MBCS support */ -# include -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -# endif -#endif -#ifndef NO_SETLOCALE -# if (!defined(NO_WORKING_ISPRINT) && !defined(HAVE_WORKING_ISPRINT)) - /* enable "enhanced" unprintable chars detection in fnfilter() */ -# define HAVE_WORKING_ISPRINT -# endif -#endif - -#ifdef MINIX -# include -#endif -#if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP)) -# define NO_STRNICMP -#endif -#ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */ -#endif -#define lenEOL 1 -#ifdef EBCDIC -# define PutNativeEOL *q++ = '\n'; -#else -# define PutNativeEOL *q++ = native(LF); -#endif -#define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) -#define SCREENWIDTH 80 -#define SCREENLWRAP 1 -#define USE_EF_UT_TIME -#if (!defined(NO_LCHOWN) || !defined(NO_LCHMOD)) -# define SET_SYMLINK_ATTRIBS -#endif -#ifdef MTS -# ifdef SET_DIR_ATTRIB -# undef SET_DIR_ATTRIB -# endif -#else /* !MTS */ -# define SET_DIR_ATTRIB -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) /* GRR 970513 */ -# define TIMESTAMP -# endif -# define RESTORE_UIDGID -#endif /* ?MTS */ - -/* Static variables that we have to add to Uz_Globs: */ -#define SYSTEM_SPECIFIC_GLOBALS \ - int created_dir, renamed_fullpath;\ - char *rootpath, *buildpath, *end;\ - ZCONST char *wildname;\ - char *dirname, matchname[FILNAMSIZ];\ - int rootlen, have_dirname, dirnamelen, notfirstcall;\ - zvoid *wild_dir; - -/* created_dir, and renamed_fullpath are used by both mapname() and */ -/* checkdir(). */ -/* rootlen, rootpath, buildpath and end are used by checkdir(). */ -/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ -/* and notfirstcall are used by do_wild(). */ - -#endif /* !__unxcfg_h */ diff --git a/data/windows/unzipfx-catia/unzip.c b/data/windows/unzipfx-catia/unzip.c deleted file mode 100644 index bc75c73..0000000 --- a/data/windows/unzipfx-catia/unzip.c +++ /dev/null @@ -1,2666 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unzip.c - - UnZip - a zipfile extraction utility. See below for make instructions, or - read the comments in Makefile and the various Contents files for more de- - tailed explanations. To report a bug, submit a *complete* description via - //www.info-zip.org/zip-bug.html; include machine type, operating system and - version, compiler and version, and reasonably detailed error messages or - problem report. To join Info-ZIP, see the instructions in README. - - UnZip 5.x is a greatly expanded and partially rewritten successor to 4.x, - which in turn was almost a complete rewrite of version 3.x. For a detailed - revision history, see UnzpHist.zip at quest.jpl.nasa.gov. For a list of - the many (near infinite) contributors, see "CONTRIBS" in the UnZip source - distribution. - - UnZip 6.0 adds support for archives larger than 4 GiB using the Zip64 - extensions as well as support for Unicode information embedded per the - latest zip standard additions. - - --------------------------------------------------------------------------- - - [from original zipinfo.c] - - This program reads great gobs of totally nifty information, including the - central directory stuff, from ZIP archives ("zipfiles" for short). It - started as just a testbed for fooling with zipfiles, but at this point it - is actually a useful utility. It also became the basis for the rewrite of - UnZip (3.16 -> 4.0), using the central directory for processing rather than - the individual (local) file headers. - - As of ZipInfo v2.0 and UnZip v5.1, the two programs are combined into one. - If the executable is named "unzip" (or "unzip.exe", depending), it behaves - like UnZip by default; if it is named "zipinfo" or "ii", it behaves like - ZipInfo. The ZipInfo behavior may also be triggered by use of unzip's -Z - option; for example, "unzip -Z [zipinfo_options] archive.zip". - - Another dandy product from your buddies at Newtware! - - Author: Greg Roelofs, newt@pobox.com, http://pobox.com/~newt/ - 23 August 1990 -> April 1997 - - --------------------------------------------------------------------------- - - Version: unzip5??.{tar.Z | tar.gz | zip} for Unix, VMS, OS/2, MS-DOS, Amiga, - Atari, Windows 3.x/95/NT/CE, Macintosh, Human68K, Acorn RISC OS, - AtheOS, BeOS, SMS/QDOS, VM/CMS, MVS, AOS/VS, Tandem NSK, Theos - and TOPS-20. - - Copyrights: see accompanying file "LICENSE" in UnZip source distribution. - (This software is free but NOT IN THE PUBLIC DOMAIN.) - - ---------------------------------------------------------------------------*/ - - - -#define __UNZIP_C /* identifies this source module */ -#define UNZIP_INTERNAL -#include "unzip.h" /* includes, typedefs, macros, prototypes, etc. */ -#include "crypt.h" -#include "unzvers.h" - -#include "unzipfx/appDetails.h" - -#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */ - -/***************************/ -/* Local type declarations */ -/***************************/ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -typedef struct _sign_info - { - struct _sign_info *previous; - void (*sighandler)(int); - int sigtype; - } savsigs_info; -#endif - -/*******************/ -/* Local Functions */ -/*******************/ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -static int setsignalhandler OF((__GPRO__ savsigs_info **p_savedhandler_chain, - int signal_type, void (*newhandler)(int))); -#endif -#ifndef SFX -static void help_extended OF((__GPRO)); -static void show_version_info OF((__GPRO)); -#endif - - -/*************/ -/* Constants */ -/*************/ - -#include "consts.h" /* all constant global variables are in here */ - /* (non-constant globals were moved to globals.c) */ - -/* constant local variables: */ - -#ifndef SFX -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - static ZCONST char Far EnvUnZip[] = ENV_UNZIP; - static ZCONST char Far EnvUnZip2[] = ENV_UNZIP2; - static ZCONST char Far EnvZipInfo[] = ENV_ZIPINFO; - static ZCONST char Far EnvZipInfo2[] = ENV_ZIPINFO2; -#ifdef RISCOS - static ZCONST char Far EnvUnZipExts[] = ENV_UNZIPEXTS; -#endif /* RISCOS */ - static ZCONST char Far NoMemEnvArguments[] = - "envargs: cannot get memory for arguments"; -#endif /* !_WIN32_WCE */ - static ZCONST char Far CmdLineParamTooLong[] = - "error: command line parameter #%d exceeds internal size limit\n"; -#endif /* !SFX */ - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) - static ZCONST char Far CantSaveSigHandler[] = - "error: cannot save signal handler settings\n"; -#endif - -#if (!defined(SFX) || defined(SFX_EXDIR)) - static ZCONST char Far NotExtracting[] = - "caution: not extracting; -d ignored\n"; - static ZCONST char Far MustGiveExdir[] = - "error: must specify directory to which to extract with -d option\n"; - static ZCONST char Far OnlyOneExdir[] = - "error: -d option used more than once (only one exdir allowed)\n"; -#endif -#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR)) - static ZCONST char Far UTF8EscapeUnSupp[] = - "warning: -U \"escape all non-ASCII UTF-8 chars\" is not supported\n"; -#endif - -#if CRYPT - static ZCONST char Far MustGivePasswd[] = - "error: must give decryption password with -P option\n"; -#endif - -#ifndef SFX - static ZCONST char Far Zfirst[] = - "error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n"; -#endif -static ZCONST char Far InvalidOptionsMsg[] = "error:\ - -fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n"; -static ZCONST char Far IgnoreOOptionMsg[] = - "caution: both -n and -o specified; ignoring -o\n"; - -/* usage() strings */ -#ifndef SFX -#ifdef VMS - static ZCONST char Far Example3[] = "vms.c"; - static ZCONST char Far Example2[] = " unzip \"-V\" foo \"Bar\"\ - (Quote names to preserve case, unless SET PROC/PARS=EXT)\n"; -#else /* !VMS */ - static ZCONST char Far Example3[] = "ReadMe"; -#ifdef RISCOS - static ZCONST char Far Example2[] = -" unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n"; -#else /* !RISCOS */ -#if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE))) - static ZCONST char Far Example2[] = - ""; /* no room: too many local3[] items */ -#else /* !OS2 */ -#ifdef MACOS - static ZCONST char Far Example2[] = ""; /* not needed */ -#else /* !MACOS */ - static ZCONST char Far Example2[] = " \ - unzip -p foo | more => send contents of foo.zip via pipe into program more\n"; -#endif /* ?MACOS */ -#endif /* ?OS2 */ -#endif /* ?RISCOS */ -#endif /* ?VMS */ - -/* local1[]: command options */ -#if defined(TIMESTAMP) - static ZCONST char Far local1[] = - " -T timestamp archive to latest"; -#else /* !TIMESTAMP */ - static ZCONST char Far local1[] = ""; -#endif /* ?TIMESTAMP */ - -/* local2[] and local3[]: modifier options */ -#ifdef DOS_FLX_H68_OS2_W32 -#ifdef FLEXOS - static ZCONST char Far local2[] = ""; -#else - static ZCONST char Far local2[] = - " -$ label removables (-$$ => fixed disks)"; -#endif -#ifdef OS2 -#ifdef MORE - static ZCONST char Far local3[] = "\ - -X restore ACLs if supported -s spaces in filenames => '_'\n\ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = " \ - -X restore ACLs if supported -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#else /* !OS2 */ -#ifdef WIN32 -#ifdef NTSD_EAS -#ifdef MORE - static ZCONST char Far local3[] = "\ - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = " \ - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#else /* !NTSD_EAS */ -#ifdef MORE - static ZCONST char Far local3[] = "\ - -M pipe through \"more\" pager \ - -s spaces in filenames => '_'\n\n"; -#else - static ZCONST char Far local3[] = " \ - -s spaces in filenames => '_'\n\n"; -#endif /* ?MORE */ -#endif /* ?NTSD_EAS */ -#else /* !WIN32 */ -#ifdef MORE - static ZCONST char Far local3[] = " -\ -M pipe through \"more\" pager -s spaces in filenames => '_'\n\n"; -#else - static ZCONST char Far local3[] = "\ - -s spaces in filenames => '_'\n"; -#endif -#endif /* ?WIN32 */ -#endif /* ?OS2 || ?WIN32 */ -#else /* !DOS_FLX_OS2_W32 */ -#ifdef VMS - static ZCONST char Far local2[] = " -X restore owner/ACL protection info"; -#ifdef MORE - static ZCONST char Far local3[] = "\ - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ - --D restore dir (-D: no) timestamps -M pipe through \"more\" pager\n\ - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ -\n\n"; -#else - static ZCONST char Far local3[] = "\n\ - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ - --D restore dir (-D: no) timestamps\n\ - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ -\n\n"; -#endif -#else /* !VMS */ -#ifdef ATH_BEO_UNX - static ZCONST char Far local2[] = " -X restore UID/GID info"; -#ifdef MORE - static ZCONST char Far local3[] = "\ - -K keep setuid/setgid/tacky permissions -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\ - -K keep setuid/setgid/tacky permissions\n"; -#endif -#else /* !ATH_BEO_UNX */ -#ifdef TANDEM - static ZCONST char Far local2[] = "\ - -X restore Tandem User ID -r remove file extensions\n\ - -b create 'C' (180) text files "; -#ifdef MORE - static ZCONST char Far local3[] = " \ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\n"; -#endif -#else /* !TANDEM */ -#ifdef AMIGA - static ZCONST char Far local2[] = " -N restore comments as filenotes"; -#ifdef MORE - static ZCONST char Far local3[] = " \ - -M pipe through \"more\" pager\n"; -#else - static ZCONST char Far local3[] = "\n"; -#endif -#else /* !AMIGA */ -#ifdef MACOS - static ZCONST char Far local2[] = " -E show Mac info during extraction"; - static ZCONST char Far local3[] = " \ - -i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\ -\n"; -#else /* !MACOS */ -#ifdef MORE - static ZCONST char Far local2[] = " -M pipe through \"more\" pager"; - static ZCONST char Far local3[] = "\n"; -#else - static ZCONST char Far local2[] = ""; /* Atari, Mac, CMS/MVS etc. */ - static ZCONST char Far local3[] = ""; -#endif -#endif /* ?MACOS */ -#endif /* ?AMIGA */ -#endif /* ?TANDEM */ -#endif /* ?ATH_BEO_UNX */ -#endif /* ?VMS */ -#endif /* ?DOS_FLX_OS2_W32 */ -#endif /* !SFX */ - -#ifndef NO_ZIPINFO -#ifdef VMS - static ZCONST char Far ZipInfoExample[] = "* or % (e.g., \"*font-%.zip\")"; -#else - static ZCONST char Far ZipInfoExample[] = "*, ?, [] (e.g., \"[a-j]*.zip\")"; -#endif - -static ZCONST char Far ZipInfoUsageLine1[] = "\ -ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\ -\n\ -List name, date/time, attribute, size, compression method, etc., about files\n\ -in list (excluding those in xlist) contained in the specified .zip archive(s).\ -\n\"file[.zip]\" may be a wildcard name containing %s.\n\n\ - usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\ - or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n"; - -static ZCONST char Far ZipInfoUsageLine2[] = "\nmain\ - listing-format options: -s short Unix \"ls -l\" format (def.)\n\ - -1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\ - -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ - -v verbose, multi-page format\n"; - -static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ - -h print header line -t print totals for listed files or for all\n\ - -z print zipfile comment -T print file times in sortable decimal format\ -\n -C be case-insensitive %s\ - -x exclude filenames that follow from listing\n"; -#ifdef MORE - static ZCONST char Far ZipInfoUsageLine4[] = - " -M page output through built-in \"more\"\n"; -#else /* !MORE */ - static ZCONST char Far ZipInfoUsageLine4[] = ""; -#endif /* ?MORE */ -#endif /* !NO_ZIPINFO */ - -#ifdef BETA -# ifdef VMSCLI - /* BetaVersion[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far BetaVersion[] = "%s\ - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; -# else - static ZCONST char Far BetaVersion[] = "%s\ - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; -# endif -#endif - -#ifdef SFX -# ifdef VMSCLI - /* UnzipSFXBanner[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far UnzipSFXBanner[] = -# else - static ZCONST char Far UnzipSFXBanner[] = -# endif - SFX_APP_BANNER "\n"; -# ifdef SFX_EXDIR - static ZCONST char Far UnzipSFXOpts[] = - "Valid options are -tfupcz and -d ; modifiers are -abjnoqCL%sV%s.\n"; -# else - static ZCONST char Far UnzipSFXOpts[] = - "Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n"; -# endif -#else /* !SFX */ - static ZCONST char Far CompileOptions[] = - "UnZip special compilation options:\n"; - static ZCONST char Far CompileOptFormat[] = " %s\n"; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - static ZCONST char Far EnvOptions[] = - "\nUnZip and ZipInfo environment options:\n"; - static ZCONST char Far EnvOptFormat[] = "%16s: %.1024s\n"; -#endif - static ZCONST char Far None[] = "[none]"; -# ifdef ACORN_FTYPE_NFS - static ZCONST char Far AcornFtypeNFS[] = "ACORN_FTYPE_NFS"; -# endif -# ifdef ASM_CRC - static ZCONST char Far AsmCRC[] = "ASM_CRC"; -# endif -# ifdef ASM_INFLATECODES - static ZCONST char Far AsmInflateCodes[] = "ASM_INFLATECODES"; -# endif -# ifdef CHECK_VERSIONS - static ZCONST char Far Check_Versions[] = "CHECK_VERSIONS"; -# endif -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far Copyright_Clean[] = - "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)"; -# endif -# ifdef DEBUG - static ZCONST char Far UDebug[] = "DEBUG"; -# endif -# ifdef DEBUG_TIME - static ZCONST char Far DebugTime[] = "DEBUG_TIME"; -# endif -# ifdef DLL - static ZCONST char Far Dll[] = "DLL"; -# endif -# ifdef DOSWILD - static ZCONST char Far DosWild[] = "DOSWILD"; -# endif -# ifdef LZW_CLEAN - static ZCONST char Far LZW_Clean[] = - "LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)"; -# endif -# ifndef MORE - static ZCONST char Far No_More[] = "NO_MORE"; -# endif -# ifdef NO_ZIPINFO - static ZCONST char Far No_ZipInfo[] = "NO_ZIPINFO"; -# endif -# ifdef NTSD_EAS - static ZCONST char Far NTSDExtAttrib[] = "NTSD_EAS"; -# endif -# if defined(WIN32) && defined(NO_W32TIMES_IZFIX) - static ZCONST char Far W32NoIZTimeFix[] = "NO_W32TIMES_IZFIX"; -# endif -# ifdef OLD_THEOS_EXTRA - static ZCONST char Far OldTheosExtra[] = - "OLD_THEOS_EXTRA (handle also old Theos port extra field)"; -# endif -# ifdef OS2_EAS - static ZCONST char Far OS2ExtAttrib[] = "OS2_EAS"; -# endif -# ifdef QLZIP - static ZCONST char Far SMSExFldOnUnix[] = "QLZIP"; -# endif -# ifdef REENTRANT - static ZCONST char Far Reentrant[] = "REENTRANT"; -# endif -# ifdef REGARGS - static ZCONST char Far RegArgs[] = "REGARGS"; -# endif -# ifdef RETURN_CODES - static ZCONST char Far Return_Codes[] = "RETURN_CODES"; -# endif -# ifdef SET_DIR_ATTRIB - static ZCONST char Far SetDirAttrib[] = "SET_DIR_ATTRIB"; -# endif -# ifdef SYMLINKS - static ZCONST char Far SymLinkSupport[] = - "SYMLINKS (symbolic links supported, if RTL and file system permit)"; -# endif -# ifdef TIMESTAMP - static ZCONST char Far TimeStamp[] = "TIMESTAMP"; -# endif -# ifdef UNIXBACKUP - static ZCONST char Far UnixBackup[] = "UNIXBACKUP"; -# endif -# ifdef USE_EF_UT_TIME - static ZCONST char Far Use_EF_UT_time[] = "USE_EF_UT_TIME"; -# endif -# ifndef LZW_CLEAN - static ZCONST char Far Use_Unshrink[] = - "USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)"; -# endif -# ifndef COPYRIGHT_CLEAN - static ZCONST char Far Use_Smith_Code[] = - "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)"; -# endif -# ifdef USE_DEFLATE64 - static ZCONST char Far Use_Deflate64[] = - "USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)"; -# endif -# ifdef UNICODE_SUPPORT -# ifdef UTF8_MAYBE_NATIVE -# ifdef UNICODE_WCHAR - /* direct native UTF-8 check AND charset transform via wchar_t */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [wide-chars, char coding: %s] (handle UTF-8 paths)"; -# else - /* direct native UTF-8 check, only */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [char coding: %s] (handle UTF-8 paths)"; -# endif - static ZCONST char Far SysChUTF8[] = "UTF-8"; - static ZCONST char Far SysChOther[] = "other"; -# else /* !UTF8_MAYBE_NATIVE */ - /* charset transform via wchar_t, no native UTF-8 support */ - static ZCONST char Far Use_Unicode[] = - "UNICODE_SUPPORT [wide-chars] (handle UTF-8 paths)"; -# endif /* ?UTF8_MAYBE_NATIVE */ -# endif /* UNICODE_SUPPORT */ -# ifdef _MBCS - static ZCONST char Far Have_MBCS_Support[] = - "MBCS-support (multibyte character support, MB_CUR_MAX = %u)"; -# endif -# ifdef MULT_VOLUME - static ZCONST char Far Use_MultiVol[] = - "MULT_VOLUME (multi-volume archives supported)"; -# endif -# ifdef LARGE_FILE_SUPPORT - static ZCONST char Far Use_LFS[] = - "LARGE_FILE_SUPPORT (large files over 2 GiB supported)"; -# endif -# ifdef ZIP64_SUPPORT - static ZCONST char Far Use_Zip64[] = - "ZIP64_SUPPORT (archives using Zip64 for large files supported)"; -# endif -# if (defined(__DJGPP__) && (__DJGPP__ >= 2)) -# ifdef USE_DJGPP_ENV - static ZCONST char Far Use_DJGPP_Env[] = "USE_DJGPP_ENV"; -# endif -# ifdef USE_DJGPP_GLOB - static ZCONST char Far Use_DJGPP_Glob[] = "USE_DJGPP_GLOB"; -# endif -# endif /* __DJGPP__ && (__DJGPP__ >= 2) */ -# ifdef USE_VFAT - static ZCONST char Far Use_VFAT_support[] = "USE_VFAT"; -# endif -# ifdef USE_ZLIB - static ZCONST char Far UseZlib[] = - "USE_ZLIB (compiled with version %s; using version %s)"; -# endif -# ifdef USE_BZIP2 - static ZCONST char Far UseBZip2[] = - "USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version %s)"; -# endif -# ifdef VMS_TEXT_CONV - static ZCONST char Far VmsTextConv[] = "VMS_TEXT_CONV"; -# endif -# ifdef VMSCLI - static ZCONST char Far VmsCLI[] = "VMSCLI"; -# endif -# ifdef VMSWILD - static ZCONST char Far VmsWild[] = "VMSWILD"; -# endif -# ifdef WILD_STOP_AT_DIR - static ZCONST char Far WildStopAtDir[] = "WILD_STOP_AT_DIR"; -# endif -# if CRYPT -# ifdef PASSWD_FROM_STDIN - static ZCONST char Far PasswdStdin[] = "PASSWD_FROM_STDIN"; -# endif - static ZCONST char Far Decryption[] = - " [decryption, version %d.%d%s of %s]\n"; - static ZCONST char Far CryptDate[] = CR_VERSION_DATE; -# endif -# ifndef __RSXNT__ -# ifdef __EMX__ - static ZCONST char Far EnvEMX[] = "EMX"; - static ZCONST char Far EnvEMXOPT[] = "EMXOPT"; -# endif -# if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) - static ZCONST char Far EnvGO32[] = "GO32"; - static ZCONST char Far EnvGO32TMP[] = "GO32TMP"; -# endif -# endif /* !__RSXNT__ */ - -#ifdef VMS -/* UnzipUsageLine1[] is also used in vms/cmdline.c: do not make it static */ - ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n"; -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far UnzipUsageLine1v[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# else - static ZCONST char Far UnzipUsageLine1v[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# endif /* ?COPYRIGHT_CLEAN */ -#else /* !VMS */ -# ifdef COPYRIGHT_CLEAN - static ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# else - static ZCONST char Far UnzipUsageLine1[] = "\ -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ -\n\n"; -# endif /* ?COPYRIGHT_CLEAN */ -# define UnzipUsageLine1v UnzipUsageLine1 -#endif /* ?VMS */ - -static ZCONST char Far UnzipUsageLine2v[] = "\ -Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;\ -\nsee ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.\ -\n\n"; - -#ifdef MACOS -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \ - Default action is to extract files in list, to exdir;\n\ - file[.zip] may be a wildcard. %s\n"; -#else /* !MACOS */ -#ifdef VM_CMS -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \ - Default action is to extract files in list, except those in xlist, to disk fm;\ -\n file[.zip] may be a wildcard. %s\n"; -#else /* !VM_CMS */ -static ZCONST char Far UnzipUsageLine2[] = "\ -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \ - Default action is to extract files in list, except those in xlist, to exdir;\n\ - file[.zip] may be a wildcard. %s\n"; -#endif /* ?VM_CMS */ -#endif /* ?MACOS */ - -#ifdef NO_ZIPINFO -# define ZIPINFO_MODE_OPTION "" - static ZCONST char Far ZipInfoMode[] = - "(ZipInfo mode is disabled in this version.)"; -#else -# define ZIPINFO_MODE_OPTION "[-Z] " - static ZCONST char Far ZipInfoMode[] = - "-Z => ZipInfo mode (\"unzip -Z\" for usage)."; -#endif /* ?NO_ZIPINFO */ - -#ifdef VMS - static ZCONST char Far VMSusageLine2b[] = "\ -=> define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\ -\n"; -#endif - -#ifdef MACOS -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -d extract files into exdir -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n"; -#else /* !MACOS */ -#ifdef VM_CMS -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -p extract files to pipe, no messages -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n\ - -x exclude files that follow (in xlist) -d extract files onto disk fm\n"; -#else /* !VM_CMS */ -static ZCONST char Far UnzipUsageLine3[] = "\n\ - -p extract files to pipe, no messages -l list files (short format)\n\ - -f freshen existing files, create none -t test compressed archive data\n\ - -u update files, create if necessary -z display archive comment only\n\ - -v list verbosely/show version info %s\n\ - -x exclude files that follow (in xlist) -d extract files into exdir\n"; -#endif /* ?VM_CMS */ -#endif /* ?MACOS */ - -/* There is not enough space on a standard 80x25 Windows console screen for - * the additional line advertising the UTF-8 debugging options. This may - * eventually also be the case for other ports. Probably, the -U option need - * not be shown on the introductory screen at all. [Chr. Spieler, 2008-02-09] - * - * Likely, other advanced options should be moved to an extended help page and - * the option to list that page put here. [E. Gordon, 2008-3-16] - */ -#if (defined(UNICODE_SUPPORT) && !defined(WIN32)) -#ifdef VMS -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite or make a new version of an existing file\n\ - -o always make a new version (-oo: overwrite original) of an existing file\n\ - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#else /* !VMS */ -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#endif /* ?VMS */ -#else /* !UNICODE_SUPPORT */ -#ifdef VMS -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite or make a new version of an existing file\n\ - -o always make a new version (-oo: overwrite original) of an existing file\n\ - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#else /* !VMS */ -static ZCONST char Far UnzipUsageLine4[] = "\ -modifiers:\n\ - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ - -j junk paths (do not make directories) -aa treat ALL files as text\n\ - -C match filenames case-insensitively -L make (some) names \ -lowercase\n %-42s -V retain VMS version numbers\n%s"; -#endif /* ?VMS */ -#endif /* ?UNICODE_SUPPORT */ - -static ZCONST char Far UnzipUsageLine5[] = "\ -See \"unzip -hh\" or unzip.txt for more help. Examples:\n\ - unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\ -%s\ - unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n"; -#endif /* ?SFX */ - - - - - -/*****************************/ -/* main() / UzpMain() stub */ -/*****************************/ - -int MAIN(argc, argv) /* return PK-type error code (except under VMS) */ - int argc; - char *argv[]; -{ - int r; - - CONSTRUCTGLOBALS(); - r = unzip(__G__ argc, argv); - DESTROYGLOBALS(); - RETURN(r); -} - - - - -/*******************************/ -/* Primary UnZip entry point */ -/*******************************/ - -int unzip(__G__ argc, argv) - __GDEF - int argc; - char *argv[]; -{ -#ifndef NO_ZIPINFO - char *p; -#endif -#if (defined(DOS_FLX_H68_NLM_OS2_W32) || !defined(SFX)) - int i; -#endif - int retcode, error=FALSE; -#ifndef NO_EXCEPT_SIGNALS -#ifdef REENTRANT - savsigs_info *oldsighandlers = NULL; -# define SET_SIGHANDLER(sigtype, newsighandler) \ - if ((retcode = setsignalhandler(__G__ &oldsighandlers, (sigtype), \ - (newsighandler))) > PK_WARN) \ - goto cleanup_and_exit -#else -# define SET_SIGHANDLER(sigtype, newsighandler) \ - signal((sigtype), (newsighandler)) -#endif -#endif /* NO_EXCEPT_SIGNALS */ - - /* initialize international char support to the current environment */ - SETLOCALE(LC_CTYPE, ""); - -#ifdef UNICODE_SUPPORT - /* see if can use UTF-8 Unicode locale */ -# ifdef UTF8_MAYBE_NATIVE - { - char *codeset; -# if !(defined(NO_NL_LANGINFO) || defined(NO_LANGINFO_H)) - /* get the codeset (character set encoding) currently used */ -# include - - codeset = nl_langinfo(CODESET); -# else /* NO_NL_LANGINFO || NO_LANGINFO_H */ - /* query the current locale setting for character classification */ - codeset = setlocale(LC_CTYPE, NULL); - if (codeset != NULL) { - /* extract the codeset portion of the locale name */ - codeset = strchr(codeset, '.'); - if (codeset != NULL) ++codeset; - } -# endif /* ?(NO_NL_LANGINFO || NO_LANGINFO_H) */ - /* is the current codeset UTF-8 ? */ - if ((codeset != NULL) && (strcmp(codeset, "UTF-8") == 0)) { - /* successfully found UTF-8 char coding */ - G.native_is_utf8 = TRUE; - } else { - /* Current codeset is not UTF-8 or cannot be determined. */ - G.native_is_utf8 = FALSE; - } - /* Note: At least for UnZip, trying to change the process codeset to - * UTF-8 does not work. For the example Linux setup of the - * UnZip maintainer, a successful switch to "en-US.UTF-8" - * resulted in garbage display of all non-basic ASCII characters. - */ - } -# endif /* UTF8_MAYBE_NATIVE */ - - /* initialize Unicode */ - G.unicode_escape_all = 0; - G.unicode_mismatch = 0; - - G.unipath_version = 0; - G.unipath_checksum = 0; - G.unipath_filename = NULL; -#endif /* UNICODE_SUPPORT */ - - -#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) - extern void DebugMalloc(void); - - atexit(DebugMalloc); -#endif - -#ifdef MALLOC_WORK - /* The following (rather complex) expression determines the allocation - size of the decompression work area. It simulates what the - combined "union" and "struct" declaration of the "static" work - area reservation achieves automatically at compile time. - Any decent compiler should evaluate this expression completely at - compile time and provide constants to the zcalloc() call. - (For better readability, some subexpressions are encapsulated - in temporarly defined macros.) - */ -# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch)) -# define UZ_NUMOF_CHUNKS \ - (unsigned)(((WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK > HSIZE) ? \ - (WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK : HSIZE) - G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK); -# undef UZ_SLIDE_CHUNK -# undef UZ_NUMOF_CHUNKS - G.area.shrink.Parent = (shrint *)G.area.Slide; - G.area.shrink.value = G.area.Slide + (sizeof(shrint)*(HSIZE)); - G.area.shrink.Stack = G.area.Slide + - (sizeof(shrint) + sizeof(uch))*(HSIZE); -#endif - -/*--------------------------------------------------------------------------- - Set signal handler for restoring echo, warn of zipfile corruption, etc. - ---------------------------------------------------------------------------*/ -#ifndef NO_EXCEPT_SIGNALS -#ifdef SIGINT - SET_SIGHANDLER(SIGINT, handler); -#endif -#ifdef SIGTERM /* some systems really have no SIGTERM */ - SET_SIGHANDLER(SIGTERM, handler); -#endif -#if defined(SIGABRT) && !(defined(AMIGA) && defined(__SASC)) - SET_SIGHANDLER(SIGABRT, handler); -#endif -#ifdef SIGBREAK - SET_SIGHANDLER(SIGBREAK, handler); -#endif -#ifdef SIGBUS - SET_SIGHANDLER(SIGBUS, handler); -#endif -#ifdef SIGILL - SET_SIGHANDLER(SIGILL, handler); -#endif -#ifdef SIGSEGV - SET_SIGHANDLER(SIGSEGV, handler); -#endif -#endif /* NO_EXCEPT_SIGNALS */ - -#if (defined(WIN32) && defined(__RSXNT__)) - for (i = 0 ; i < argc; i++) { - _ISO_INTERN(argv[i]); - } -#endif - -/*--------------------------------------------------------------------------- - Macintosh initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef MACOS - { - int a; - - for (a = 0; a < 4; ++a) - G.rghCursor[a] = GetCursor(a+128); - G.giCursor = 0; - } -#endif - -/*--------------------------------------------------------------------------- - NetWare initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef NLM - InitUnZipConsole(); -#endif - -/*--------------------------------------------------------------------------- - Acorn RISC OS initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef RISCOS - set_prefix(); -#endif - -/*--------------------------------------------------------------------------- - Theos initialization code. - ---------------------------------------------------------------------------*/ - -#ifdef THEOS - /* The easiest way found to force creation of libraries when selected - * members are to be unzipped. Explicitly add libraries names to the - * arguments list before the first member of the library. - */ - if (! _setargv(&argc, &argv)) { - Info(slide, 0x401, ((char *)slide, "cannot process argv\n")); - retcode = PK_MEM; - goto cleanup_and_exit; - } -#endif - -/*--------------------------------------------------------------------------- - Sanity checks. Commentary by Otis B. Driftwood and Fiorello: - - D: It's all right. That's in every contract. That's what they - call a sanity clause. - - F: Ha-ha-ha-ha-ha. You can't fool me. There ain't no Sanity - Claus. - ---------------------------------------------------------------------------*/ - -#ifdef DEBUG -# ifdef LARGE_FILE_SUPPORT - /* test if we can support large files - 10/6/04 EG */ - if (sizeof(zoff_t) < 8) { - Info(slide, 0x401, ((char *)slide, "LARGE_FILE_SUPPORT set but not supported\n")); - retcode = PK_BADERR; - goto cleanup_and_exit; - } - /* test if we can show 64-bit values */ - { - zoff_t z = ~(zoff_t)0; /* z should be all 1s now */ - char *sz; - - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); - if ((sz[0] != 'F') || (strlen(sz) != 16)) - { - z = 0; - } - - /* shift z so only MSB is set */ - z <<= 63; - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); - if ((sz[0] != '8') || (strlen(sz) != 16)) - { - Info(slide, 0x401, ((char *)slide, - "Can't show 64-bit values correctly\n")); - retcode = PK_BADERR; - goto cleanup_and_exit; - } - } -# endif /* LARGE_FILE_SUPPORT */ - - /* 2004-11-30 SMS. - Test the NEXTBYTE macro for proper operation. - */ - { - int test_char; - static uch test_buf[2] = { 'a', 'b' }; - - G.inptr = test_buf; - G.incnt = 1; - - test_char = NEXTBYTE; /* Should get 'a'. */ - if (test_char == 'a') - { - test_char = NEXTBYTE; /* Should get EOF, not 'b'. */ - } - if (test_char != EOF) - { - Info(slide, 0x401, ((char *)slide, - "NEXTBYTE macro failed. Try compiling with ALT_NEXTBYTE defined?")); - - retcode = PK_BADERR; - goto cleanup_and_exit; - } - } -#endif /* DEBUG */ - -/*--------------------------------------------------------------------------- - First figure out if we're running in UnZip mode or ZipInfo mode, and put - the appropriate environment-variable options into the queue. Then rip - through any command-line options lurking about... - ---------------------------------------------------------------------------*/ - -#ifdef SFX - G.argv0 = argv[0]; -#if (defined(OS2) || defined(WIN32)) - G.zipfn = GetLoadPath(__G);/* non-MSC NT puts path into G.filename[] */ -#else - G.zipfn = G.argv0; -#endif - -#ifdef VMSCLI - { - ulg status = vms_unzip_cmdline(&argc, &argv); - if (!(status & 1)) { - retcode = (int)status; - goto cleanup_and_exit; - } - } -#endif /* VMSCLI */ - - uO.zipinfo_mode = FALSE; - error = uz_opts(__G__ &argc, &argv); /* UnZipSFX call only */ - -#else /* !SFX */ - -#ifdef RISCOS - /* get the extensions to swap from environment */ - getRISCOSexts(ENV_UNZIPEXTS); -#endif - -#ifdef MSDOS - /* extract MKS extended argument list from environment (before envargs!) */ - mksargs(&argc, &argv); -#endif - -#ifdef VMSCLI - { - ulg status = vms_unzip_cmdline(&argc, &argv); - if (!(status & 1)) { - retcode = (int)status; - goto cleanup_and_exit; - } - } -#endif /* VMSCLI */ - - G.noargs = (argc == 1); /* no options, no zipfile, no anything */ - -#ifndef NO_ZIPINFO - for (p = argv[0] + strlen(argv[0]); p >= argv[0]; --p) { - if (*p == DIR_END -#ifdef DIR_END2 - || *p == DIR_END2 -#endif - ) - break; - } - ++p; - -#ifdef THEOS - if (strncmp(p, "ZIPINFO.",8) == 0 || strstr(p, ".ZIPINFO:") != NULL || - strncmp(p, "II.",3) == 0 || strstr(p, ".II:") != NULL || -#else - if (STRNICMP(p, LoadFarStringSmall(Zipnfo), 7) == 0 || - STRNICMP(p, "ii", 2) == 0 || -#endif - (argc > 1 && strncmp(argv[1], "-Z", 2) == 0)) - { - uO.zipinfo_mode = TRUE; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvZipInfo), - LoadFarStringSmall2(EnvZipInfo2))) != PK_OK) - perror(LoadFarString(NoMemEnvArguments)); -#endif - } else -#endif /* !NO_ZIPINFO */ - { - uO.zipinfo_mode = FALSE; -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvUnZip), - LoadFarStringSmall2(EnvUnZip2))) != PK_OK) - perror(LoadFarString(NoMemEnvArguments)); -#endif - } - - if (!error) { - /* Check the length of all passed command line parameters. - * Command arguments might get sent through the Info() message - * system, which uses the sliding window area as string buffer. - * As arguments may additionally get fed through one of the FnFilter - * macros, we require all command line arguments to be shorter than - * WSIZE/4 (and ca. 2 standard line widths for fixed message text). - */ - for (i = 1 ; i < argc; i++) { - if (strlen(argv[i]) > ((WSIZE>>2) - 160)) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(CmdLineParamTooLong), i)); - retcode = PK_PARAM; - goto cleanup_and_exit; - } - } -#ifndef NO_ZIPINFO - if (uO.zipinfo_mode) - error = zi_opts(__G__ &argc, &argv); - else -#endif /* !NO_ZIPINFO */ - error = uz_opts(__G__ &argc, &argv); - } - -#endif /* ?SFX */ - - if ((argc < 0) || error) { - retcode = error; - goto cleanup_and_exit; - } - -/*--------------------------------------------------------------------------- - Now get the zipfile name from the command line and then process any re- - maining options and file specifications. - ---------------------------------------------------------------------------*/ - -#ifdef DOS_FLX_H68_NLM_OS2_W32 - /* convert MSDOS-style 'backward slash' directory separators to Unix-style - * 'forward slashes' for user's convenience (include zipfile name itself) - */ -#ifdef SFX - for (G.pfnames = argv, i = argc; i > 0; --i) { -#else - /* argc does not include the zipfile specification */ - for (G.pfnames = argv, i = argc+1; i > 0; --i) { -#endif -#ifdef __human68k__ - extern char *_toslash(char *); - _toslash(*G.pfnames); -#else /* !__human68k__ */ - char *q = *G.pfnames; - - while (*q != '\0') { - if (*q == '\\') - *q = '/'; - INCSTR(q); - } -#endif /* ?__human68k__ */ - ++G.pfnames; - } -#endif /* DOS_FLX_H68_NLM_OS2_W32 */ - -#ifndef SFX - G.wildzipfn = *argv++; -#endif - -#if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */ - - G.filespecs = argc; - G.xfilespecs = 0; - - if (argc > 0) { - char **pp = argv-1; - - G.pfnames = argv; - while (*++pp) - if (strcmp(*pp, "-x") == 0) { - if (pp > argv) { - *pp = 0; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; - } else { - G.pfnames = (char **)fnames; /* defaults */ - G.filespecs = 0; - } - G.pxnames = pp + 1; /* excluded-names ptr: _after_ -x */ - G.xfilespecs = argc - G.filespecs - 1; - break; /* skip rest of args */ - } - G.process_all_files = FALSE; - } else - G.process_all_files = TRUE; /* for speed */ - -#else /* !SFX || SFX_EXDIR */ /* check for -x or -d */ - - G.filespecs = argc; - G.xfilespecs = 0; - - if (argc > 0) { - int in_files=FALSE, in_xfiles=FALSE; - char **pp = argv-1; - - G.process_all_files = FALSE; - G.pfnames = argv; - while (*++pp) { - Trace((stderr, "pp - argv = %d\n", pp-argv)); -#ifdef CMS_MVS - if (!uO.exdir && STRNICMP(*pp, "-d", 2) == 0) { -#else - if (!uO.exdir && strncmp(*pp, "-d", 2) == 0) { -#endif - int firstarg = (pp == argv); - - uO.exdir = (*pp) + 2; - if (in_files) { /* ... zipfile ... -d exdir ... */ - *pp = (char *)NULL; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; - in_files = FALSE; - } else if (in_xfiles) { - *pp = (char *)NULL; /* terminate G.pxnames */ - G.xfilespecs = pp - G.pxnames; - /* "... -x xlist -d exdir": nothing left */ - } - /* first check for "-dexdir", then for "-d exdir" */ - if (*uO.exdir == '\0') { - if (*++pp) - uO.exdir = *pp; - else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - /* don't extract here by accident */ - retcode = PK_PARAM; - goto cleanup_and_exit; - } - } - if (firstarg) { /* ... zipfile -d exdir ... */ - if (pp[1]) { - G.pfnames = pp + 1; /* argv+2 */ - G.filespecs = argc - (G.pfnames-argv); /* for now... */ - } else { - G.process_all_files = TRUE; - G.pfnames = (char **)fnames; /* GRR: necessary? */ - G.filespecs = 0; /* GRR: necessary? */ - break; - } - } - } else if (!in_xfiles) { - if (strcmp(*pp, "-x") == 0) { - in_xfiles = TRUE; - if (pp == G.pfnames) { - G.pfnames = (char **)fnames; /* defaults */ - G.filespecs = 0; - } else if (in_files) { - *pp = 0; /* terminate G.pfnames */ - G.filespecs = pp - G.pfnames; /* adjust count */ - in_files = FALSE; - } - G.pxnames = pp + 1; /* excluded-names ptr starts after -x */ - G.xfilespecs = argc - (G.pxnames-argv); /* anything left */ - } else - in_files = TRUE; - } - } - } else - G.process_all_files = TRUE; /* for speed */ - - if (uO.exdir != (char *)NULL && !G.extract_flag) /* -d ignored */ - Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting))); -#endif /* ?(SFX && !SFX_EXDIR) */ - -#ifdef UNICODE_SUPPORT - /* set Unicode-escape-all if option -U used */ - if (uO.U_flag == 1) -# ifdef UNICODE_WCHAR - G.unicode_escape_all = TRUE; -# else - Info(slide, 0x401, ((char *)slide, LoadFarString(UTF8EscapeUnSupp))); -# endif -#endif - - -/*--------------------------------------------------------------------------- - Okey dokey, we have everything we need to get started. Let's roll. - ---------------------------------------------------------------------------*/ - - retcode = process_zipfiles(__G); - -cleanup_and_exit: -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) - /* restore all signal handlers back to their state at function entry */ - while (oldsighandlers != NULL) { - savsigs_info *thissigsav = oldsighandlers; - - signal(thissigsav->sigtype, thissigsav->sighandler); - oldsighandlers = thissigsav->previous; - free(thissigsav); - } -#endif -#if (defined(MALLOC_WORK) && !defined(REENTRANT)) - if (G.area.Slide != (uch *)NULL) { - free(G.area.Slide); - G.area.Slide = (uch *)NULL; - } -#endif -#if (defined(MSDOS) && !defined(SFX) && !defined(WINDLL)) - if (retcode != PK_OK) - check_for_windows("UnZip"); -#endif - return(retcode); - -} /* end main()/unzip() */ - - - - - -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) -/*******************************/ -/* Function setsignalhandler() */ -/*******************************/ - -static int setsignalhandler(__G__ p_savedhandler_chain, signal_type, - newhandler) - __GDEF - savsigs_info **p_savedhandler_chain; - int signal_type; - void (*newhandler)(int); -{ - savsigs_info *savsig; - - savsig = malloc(sizeof(savsigs_info)); - if (savsig == NULL) { - /* error message and break */ - Info(slide, 0x401, ((char *)slide, LoadFarString(CantSaveSigHandler))); - return PK_MEM; - } - savsig->sigtype = signal_type; - savsig->sighandler = signal(SIGINT, newhandler); - if (savsig->sighandler == SIG_ERR) { - free(savsig); - } else { - savsig->previous = *p_savedhandler_chain; - *p_savedhandler_chain = savsig; - } - return PK_OK; - -} /* end function setsignalhandler() */ - -#endif /* REENTRANT && !NO_EXCEPT_SIGNALS */ - - - - - -/**********************/ -/* Function uz_opts() */ -/**********************/ - -int uz_opts(__G__ pargc, pargv) - __GDEF - int *pargc; - char ***pargv; -{ - char **argv, *s; - int argc, c, error=FALSE, negative=0, showhelp=0; - - - argc = *pargc; - argv = *pargv; - - uO.exdir = sfx_get_tmp_path(0); - uO.overwrite_all = 1; - - sfx_app_set_args(argc-1, argv+1); - - while (++argv, (--argc > 0 && *argv != NULL /*&& **argv == '-'*/)) { -#if 0 - s = *argv + 1; - while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ -#ifdef CMS_MVS - switch (tolower(c)) -#else - switch (c) -#endif - { - case ('-'): - ++negative; - break; -#ifdef RISCOS - case ('/'): - if (negative) { /* negative not allowed with -/ swap */ - Info(slide, 0x401, ((char *)slide, - "error: must give extensions list")); - return(PK_PARAM); /* don't extract here by accident */ - } - exts2swap = s; /* override Unzip$Exts */ - s += strlen(s); - break; -#endif - case ('a'): - if (negative) { - uO.aflag = MAX(uO.aflag-negative,0); - negative = 0; - } else - ++uO.aflag; - break; -#if (defined(DLL) && defined(API_DOC)) - case ('A'): /* extended help for API */ - APIhelp(__G__ argc, argv); - *pargc = -1; /* signal to exit successfully */ - return 0; -#endif - case ('b'): - if (negative) { -#if (defined(TANDEM) || defined(VMS)) - uO.bflag = MAX(uO.bflag-negative,0); -#endif - negative = 0; /* do nothing: "-b" is default */ - } else { -#ifdef VMS - if (uO.aflag == 0) - ++uO.bflag; -#endif -#ifdef TANDEM - ++uO.bflag; -#endif - uO.aflag = 0; - } - break; -#ifdef UNIXBACKUP - case ('B'): /* -B: back up existing files */ - if (negative) - uO.B_flag = FALSE, negative = 0; - else - uO.B_flag = TRUE; - break; -#endif - case ('c'): - if (negative) { - uO.cflag = FALSE, negative = 0; -#ifdef NATIVE - uO.aflag = 0; -#endif - } else { - uO.cflag = TRUE; -#ifdef NATIVE - uO.aflag = 2; /* so you can read it on the screen */ -#endif -#ifdef DLL - if (G.redirect_text) - G.redirect_data = 2; -#endif - } - break; -#ifndef CMS_MVS - case ('C'): /* -C: match filenames case-insensitively */ - if (negative) - uO.C_flag = FALSE, negative = 0; - else - uO.C_flag = TRUE; - break; -#endif /* !CMS_MVS */ -#if (!defined(SFX) || defined(SFX_EXDIR)) - case ('d'): - if (negative) { /* negative not allowed with -d exdir */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); /* don't extract here by accident */ - } - if (uO.exdir != (char *)NULL) { - Info(slide, 0x401, ((char *)slide, - LoadFarString(OnlyOneExdir))); - return(PK_PARAM); /* GRR: stupid restriction? */ - } else { - /* first check for "-dexdir", then for "-d exdir" */ - uO.exdir = s; - if (*uO.exdir == '\0') { - if (argc > 1) { - --argc; - uO.exdir = *++argv; - if (*uO.exdir == '-') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); - } - /* else uO.exdir points at extraction dir */ - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGiveExdir))); - return(PK_PARAM); - } - } - /* uO.exdir now points at extraction dir (-dexdir or - * -d exdir); point s at end of exdir to avoid mis- - * interpretation of exdir characters as more options - */ - if (*s != 0) - while (*++s != 0) - ; - } - break; -#endif /* !SFX || SFX_EXDIR */ -#if (!defined(NO_TIMESTAMPS)) - case ('D'): /* -D: Skip restoring dir (or any) timestamp. */ - if (negative) { - uO.D_flag = MAX(uO.D_flag-negative,0); - negative = 0; - } else - uO.D_flag++; - break; -#endif /* (!NO_TIMESTAMPS) */ - case ('e'): /* just ignore -e, -x options (extract) */ - break; -#ifdef MACOS - case ('E'): /* -E [MacOS] display Mac e.f. when restoring */ - if( negative ) { - uO.E_flag = FALSE, negative = 0; - } else { - uO.E_flag = TRUE; - } - break; -#endif /* MACOS */ - case ('f'): /* "freshen" (extract only newer files) */ - if (negative) - uO.fflag = uO.uflag = FALSE, negative = 0; - else - uO.fflag = uO.uflag = TRUE; - break; -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - case ('F'): /* Acorn filetype & NFS extension handling */ - if (negative) - uO.acorn_nfs_ext = FALSE, negative = 0; - else - uO.acorn_nfs_ext = TRUE; - break; -#endif /* RISCOS || ACORN_FTYPE_NFS */ - case ('h'): /* just print help message and quit */ - if (showhelp == 0) { -#ifndef SFX - if (*s == 'h') - showhelp = 2; - else -#endif /* !SFX */ - { - showhelp = 1; - } - } - break; -#ifdef MACOS - case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */ - if( negative ) { - uO.i_flag = FALSE, negative = 0; - } else { - uO.i_flag = TRUE; - } - break; -#endif /* MACOS */ - case ('j'): /* junk pathnames/directory structure */ - if (negative) - uO.jflag = FALSE, negative = 0; - else - uO.jflag = TRUE; - break; -#if (defined(ATH_BEO) || defined(MACOS)) - case ('J'): /* Junk AtheOS, BeOS or MacOS file attributes */ - if( negative ) { - uO.J_flag = FALSE, negative = 0; - } else { - uO.J_flag = TRUE; - } - break; -#endif /* ATH_BEO || MACOS */ -#ifdef ATH_BEO_UNX - case ('K'): - if (negative) { - uO.K_flag = FALSE, negative = 0; - } else { - uO.K_flag = TRUE; - } - break; -#endif /* ATH_BEO_UNX */ -#ifndef SFX - case ('l'): - if (negative) { - uO.vflag = MAX(uO.vflag-negative,0); - negative = 0; - } else - ++uO.vflag; - break; -#endif /* !SFX */ -#ifndef CMS_MVS - case ('L'): /* convert (some) filenames to lowercase */ - if (negative) { - uO.L_flag = MAX(uO.L_flag-negative,0); - negative = 0; - } else - ++uO.L_flag; - break; -#endif /* !CMS_MVS */ -#ifdef MORE -#ifdef CMS_MVS - case ('m'): -#endif - case ('M'): /* send all screen output through "more" fn. */ -/* GRR: eventually check for numerical argument => height */ - if (negative) - G.M_flag = FALSE, negative = 0; - else - G.M_flag = TRUE; - break; -#endif /* MORE */ - case ('n'): /* don't overwrite any files */ - if (negative) - uO.overwrite_none = FALSE, negative = 0; - else - uO.overwrite_none = TRUE; - break; -#ifdef AMIGA - case ('N'): /* restore comments as filenotes */ - if (negative) - uO.N_flag = FALSE, negative = 0; - else - uO.N_flag = TRUE; - break; -#endif /* AMIGA */ - case ('o'): /* OK to overwrite files without prompting */ - if (negative) { - uO.overwrite_all = MAX(uO.overwrite_all-negative,0); - negative = 0; - } else - ++uO.overwrite_all; - break; - case ('p'): /* pipes: extract to stdout, no messages */ - if (negative) { - uO.cflag = FALSE; - uO.qflag = MAX(uO.qflag-999,0); - negative = 0; - } else { - uO.cflag = TRUE; - uO.qflag += 999; - } - break; -#if CRYPT - /* GRR: yes, this is highly insecure, but dozens of people - * have pestered us for this, so here we go... */ - case ('P'): - if (negative) { /* negative not allowed with -P passwd */ - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); /* don't extract here by accident */ - } - if (uO.pwdarg != (char *)NULL) { -/* - GRR: eventually support multiple passwords? - Info(slide, 0x401, ((char *)slide, - LoadFarString(OnlyOnePasswd))); - return(PK_PARAM); - */ - } else { - /* first check for "-Ppasswd", then for "-P passwd" */ - uO.pwdarg = s; - if (*uO.pwdarg == '\0') { - if (argc > 1) { - --argc; - uO.pwdarg = *++argv; - if (*uO.pwdarg == '-') { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); - } - /* else pwdarg points at decryption password */ - } else { - Info(slide, 0x401, ((char *)slide, - LoadFarString(MustGivePasswd))); - return(PK_PARAM); - } - } - /* pwdarg now points at decryption password (-Ppasswd or - * -P passwd); point s at end of passwd to avoid mis- - * interpretation of passwd characters as more options - */ - if (*s != 0) - while (*++s != 0) - ; - } - break; -#endif /* CRYPT */ - case ('q'): /* quiet: fewer comments/messages */ - if (negative) { - uO.qflag = MAX(uO.qflag-negative,0); - negative = 0; - } else - ++uO.qflag; - break; -#ifdef QDOS - case ('Q'): /* QDOS flags */ - qlflag ^= strtol(s, &s, 10); - break; /* we XOR this as we can config qlflags */ -#endif -#ifdef TANDEM - case ('r'): /* remove file extensions */ - if (negative) - uO.rflag = FALSE, negative = 0; - else - uO.rflag = TRUE; - break; -#endif /* TANDEM */ -#ifdef DOS_FLX_NLM_OS2_W32 - case ('s'): /* spaces in filenames: allow by default */ - if (negative) - uO.sflag = FALSE, negative = 0; - else - uO.sflag = TRUE; - break; -#endif /* DOS_FLX_NLM_OS2_W32 */ -#ifdef VMS - /* VMS: extract "text" files in Stream_LF format (-a[a]) */ - case ('S'): - if (negative) - uO.S_flag = FALSE, negative = 0; - else - uO.S_flag = TRUE; - break; -#endif /* VMS */ - case ('t'): - if (negative) - uO.tflag = FALSE, negative = 0; - else - uO.tflag = TRUE; - break; -#ifdef TIMESTAMP - case ('T'): - if (negative) - uO.T_flag = FALSE, negative = 0; - else - uO.T_flag = TRUE; - break; -#endif - case ('u'): /* update (extract only new and newer files) */ - if (negative) - uO.uflag = FALSE, negative = 0; - else - uO.uflag = TRUE; - break; -#ifdef UNICODE_SUPPORT - case ('U'): /* escape UTF-8, or disable UTF-8 support */ - if (negative) { - uO.U_flag = MAX(uO.U_flag-negative,0); - negative = 0; - } else - uO.U_flag++; - break; -#else /* !UNICODE_SUPPORT */ -#ifndef CMS_MVS - case ('U'): /* obsolete; to be removed in version 6.0 */ - if (negative) - uO.L_flag = TRUE, negative = 0; - else - uO.L_flag = FALSE; - break; -#endif /* !CMS_MVS */ -#endif /* ?UNICODE_SUPPORT */ -#ifndef SFX - case ('v'): /* verbose */ - if (negative) { - uO.vflag = MAX(uO.vflag-negative,0); - negative = 0; - } else if (uO.vflag) - ++uO.vflag; - else - uO.vflag = 2; - break; -#endif /* !SFX */ -#ifndef CMS_MVS - case ('V'): /* Version (retain VMS/DEC-20 file versions) */ - if (negative) - uO.V_flag = FALSE, negative = 0; - else - uO.V_flag = TRUE; - break; -#endif /* !CMS_MVS */ -#ifdef WILD_STOP_AT_DIR - case ('W'): /* Wildcard interpretation (stop at '/'?) */ - if (negative) - uO.W_flag = FALSE, negative = 0; - else - uO.W_flag = TRUE; - break; -#endif /* WILD_STOP_AT_DIR */ - case ('x'): /* extract: default */ -#ifdef SFX - /* when 'x' is the only option in this argument, and the - * next arg is not an option, assume this initiates an - * exclusion list (-x xlist): terminate option-scanning - * and leave uz_opts with argv still pointing to "-x"; - * the xlist is processed later - */ - if (s - argv[0] == 2 && *s == '\0' && - argc > 1 && argv[1][0] != '-') { - /* break out of nested loops without "++argv;--argc" */ - goto opts_done; - } -#endif /* SFX */ - break; -#if (defined(RESTORE_UIDGID) || defined(RESTORE_ACL)) - case ('X'): /* restore owner/protection info (need privs?) */ - if (negative) { - uO.X_flag = MAX(uO.X_flag-negative,0); - negative = 0; - } else - ++uO.X_flag; - break; -#endif /* RESTORE_UIDGID || RESTORE_ACL */ -#ifdef VMS - case ('Y'): /* Treat ".nnn" as ";nnn" version. */ - if (negative) - uO.Y_flag = FALSE, negative = 0; - else - uO.Y_flag = TRUE; - break; -#endif /* VMS */ - case ('z'): /* display only the archive comment */ - if (negative) { - uO.zflag = MAX(uO.zflag-negative,0); - negative = 0; - } else - ++uO.zflag; - break; -#ifndef SFX - case ('Z'): /* should have been first option (ZipInfo) */ - Info(slide, 0x401, ((char *)slide, LoadFarString(Zfirst))); - error = TRUE; - break; -#endif /* !SFX */ -#ifdef VMS - case ('2'): /* Force ODS2-compliant names. */ - if (negative) - uO.ods2_flag = FALSE, negative = 0; - else - uO.ods2_flag = TRUE; - break; -#endif /* VMS */ -#ifdef DOS_H68_OS2_W32 - case ('$'): - if (negative) { - uO.volflag = MAX(uO.volflag-negative,0); - negative = 0; - } else - ++uO.volflag; - break; -#endif /* DOS_H68_OS2_W32 */ -#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) - case (':'): /* allow "parent dir" path components */ - if (negative) { - uO.ddotflag = MAX(uO.ddotflag-negative,0); - negative = 0; - } else - ++uO.ddotflag; - break; -#endif /* !RISCOS && !CMS_MVS && !TANDEM */ -#ifdef UNIX - case ('^'): /* allow control chars in filenames */ - if (negative) { - uO.cflxflag = MAX(uO.cflxflag-negative,0); - negative = 0; - } else - ++uO.cflxflag; - break; -#endif /* UNIX */ - default: - error = TRUE; - break; - - } /* end switch */ - } /* end while (not end of argument string) */ -#endif - } /* end while (not done with switches) */ - -/*--------------------------------------------------------------------------- - Check for nonsensical combinations of options. - ---------------------------------------------------------------------------*/ - -#if 0 -#ifdef SFX -opts_done: /* yes, very ugly...but only used by UnZipSFX with -x xlist */ -#endif - - if (showhelp > 0) { /* just print help message and quit */ - *pargc = -1; -#ifndef SFX - if (showhelp == 2) { - help_extended(__G); - return PK_OK; - } else -#endif /* !SFX */ - { - return USAGE(PK_OK); - } - } - - if ((uO.cflag && (uO.tflag || uO.uflag)) || - (uO.tflag && uO.uflag) || (uO.fflag && uO.overwrite_none)) - { - Info(slide, 0x401, ((char *)slide, LoadFarString(InvalidOptionsMsg))); - error = TRUE; - } - if (uO.aflag > 2) - uO.aflag = 2; -#ifdef VMS - if (uO.bflag > 2) - uO.bflag = 2; - /* Clear -s flag when converting text files. */ - if (uO.aflag <= 0) - uO.S_flag = 0; -#endif /* VMS */ - if (uO.overwrite_all && uO.overwrite_none) { - Info(slide, 0x401, ((char *)slide, LoadFarString(IgnoreOOptionMsg))); - uO.overwrite_all = FALSE; - } -#ifdef MORE - if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func. useless */ - G.M_flag = 0; -#endif - -#ifdef SFX - if (error) -#else - if ((argc-- == 0) || error) -#endif - { - *pargc = argc; - *pargv = argv; -#ifndef SFX - if (uO.vflag >= 2 && argc == -1) { /* "unzip -v" */ - show_version_info(__G); - return PK_OK; - } - if (!G.noargs && !error) - error = TRUE; /* had options (not -h or -v) but no zipfile */ -#endif /* !SFX */ - return USAGE(error); - } -#endif - -#ifdef SFX - /* print our banner unless we're being fairly quiet */ - if (uO.qflag < 2) - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); -#ifdef BETA - /* always print the beta warning: no unauthorized distribution!! */ - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", - "SFX")); -#endif -#endif /* SFX */ - - if (uO.cflag || uO.tflag || uO.vflag || uO.zflag -#ifdef TIMESTAMP - || uO.T_flag -#endif - ) - G.extract_flag = FALSE; - else - G.extract_flag = TRUE; - - *pargc = argc; - *pargv = argv; - return PK_OK; - -} /* end function uz_opts() */ - - - - -/********************/ -/* Function usage() */ -/********************/ - -#ifdef SFX -# ifdef VMS -# define LOCAL "X.\n\ -(Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)" -# endif -# ifdef UNIX -# define LOCAL "X" -# endif -# ifdef DOS_OS2_W32 -# define LOCAL "s$" -# endif -# if (defined(FLEXOS) || defined(NLM)) -# define LOCAL "s" -# endif -# ifdef AMIGA -# define LOCAL "N" -# endif - /* Default for all other systems: */ -# ifndef LOCAL -# define LOCAL "" -# endif - -# ifndef NO_TIMESTAMP -# ifdef MORE -# define SFXOPT1 "DM" -# else -# define SFXOPT1 "D" -# endif -# else -# ifdef MORE -# define SFXOPT1 "M" -# else -# define SFXOPT1 "" -# endif -# endif - -int usage(__G__ error) /* return PK-type error code */ - __GDEF - int error; -{ - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXOpts), - SFXOPT1, LOCAL)); -#ifdef BETA - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", - "SFX")); -#endif - - if (error) - return PK_PARAM; - else - return PK_COOL; /* just wanted usage screen: no error */ - -} /* end function usage() */ - - - - - -#else /* !SFX */ -# ifdef VMS -# define QUOT '\"' -# define QUOTS "\"" -# else -# define QUOT ' ' -# define QUOTS "" -# endif - -int usage(__G__ error) /* return PK-type error code */ - __GDEF - int error; -{ - int flag = (error? 1 : 0); - - -/*--------------------------------------------------------------------------- - Print either ZipInfo usage or UnZip usage, depending on incantation. - (Strings must be no longer than 512 bytes for Turbo C, apparently.) - ---------------------------------------------------------------------------*/ - - if (uO.zipinfo_mode) { - -#ifndef NO_ZIPINFO - - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine1), - ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate), - LoadFarStringSmall2(ZipInfoExample), QUOTS,QUOTS)); - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine2))); - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine3), - LoadFarStringSmall(ZipInfoUsageLine4))); -#ifdef VMS - Info(slide, flag, ((char *)slide, "\n\ -You must quote non-lowercase options and filespecs, unless SET PROC/PARSE=EXT.\ -\n")); -#endif - -#endif /* !NO_ZIPINFO */ - - } else { /* UnZip mode */ - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine1), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); -#ifdef BETA - Info(slide, flag, ((char *)slide, LoadFarString(BetaVersion), "", "")); -#endif - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine2), - ZIPINFO_MODE_OPTION, LoadFarStringSmall(ZipInfoMode))); -#ifdef VMS - if (!error) /* maybe no command-line tail found; show extra help */ - Info(slide, flag, ((char *)slide, LoadFarString(VMSusageLine2b))); -#endif - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine3), - LoadFarStringSmall(local1))); - - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine4), - LoadFarStringSmall(local2), LoadFarStringSmall2(local3))); - - /* This is extra work for SMALL_MEM, but it will work since - * LoadFarStringSmall2 uses the same buffer. Remember, this - * is a hack. */ - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5), - LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3), - LoadFarStringSmall2(Example3))); - - } /* end if (uO.zipinfo_mode) */ - - if (error) - return PK_PARAM; - else - return PK_COOL; /* just wanted usage screen: no error */ - -} /* end function usage() */ - -#endif /* ?SFX */ - - - - -#ifndef SFX - -/* Print extended help to stdout. */ -static void help_extended(__G) - __GDEF -{ - extent i; /* counter for help array */ - - /* help array */ - static ZCONST char *text[] = { - "", - "Extended Help for UnZip", - "", - "See the UnZip Manual for more detailed help", - "", - "", - "UnZip lists and extracts files in zip archives. The default action is to", - "extract zipfile entries to the current directory, creating directories as", - "needed. With appropriate options, UnZip lists the contents of archives", - "instead.", - "", - "Basic unzip command line:", - " unzip [-Z] options archive[.zip] [file ...] [-x xfile ...] [-d exdir]", - "", - "Some examples:", - " unzip -l foo.zip - list files in short format in archive foo.zip", - "", - " unzip -t foo - test the files in archive foo", - "", - " unzip -Z foo - list files using more detailed zipinfo format", - "", - " unzip foo - unzip the contents of foo in current dir", - "", - " unzip -a foo - unzip foo and convert text files to local OS", - "", - "If unzip is run in zipinfo mode, a more detailed list of archive contents", - "is provided. The -Z option sets zipinfo mode and changes the available", - "options.", - "", - "Basic zipinfo command line:", - " zipinfo options archive[.zip] [file ...] [-x xfile ...]", - " unzip -Z options archive[.zip] [file ...] [-x xfile ...]", - "", - "Below, Mac OS refers to Mac OS before Mac OS X. Mac OS X is a Unix based", - "port and is referred to as Unix Apple.", - "", - "", - "unzip options:", - " -Z Switch to zipinfo mode. Must be first option.", - " -hh Display extended help.", - " -A [OS/2, Unix DLL] Print extended help for DLL.", - " -c Extract files to stdout/screen. As -p but include names. Also,", - " -a allowed and EBCDIC conversions done if needed.", - " -f Freshen by extracting only if older file on disk.", - " -l List files using short form.", - " -p Extract files to pipe (stdout). Only file data is output and all", - " files extracted in binary mode (as stored).", - " -t Test archive files.", - " -T Set timestamp on archive(s) to that of newest file. Similar to", - " zip -o but faster.", - " -u Update existing older files on disk as -f and extract new files.", - " -v Use verbose list format. If given alone as unzip -v show version", - " information. Also can be added to other list commands for more", - " verbose output.", - " -z Display only archive comment.", - "", - "unzip modifiers:", - " -a Convert text files to local OS format. Convert line ends, EOF", - " marker, and from or to EBCDIC character set as needed.", - " -b Treat all files as binary. [Tandem] Force filecode 180 ('C').", - " [VMS] Autoconvert binary files. -bb forces convert of all files.", - " -B [UNIXBACKUP compile option enabled] Save a backup copy of each", - " overwritten file in foo~ or foo~99999 format.", - " -C Use case-insensitive matching.", - " -D Skip restoration of timestamps for extracted directories. On VMS this", - " is on by default and -D essentially becames -DD.", - " -DD Skip restoration of timestamps for all entries.", - " -E [MacOS (not Unix Apple)] Display contents of MacOS extra field during", - " restore.", - " -F [Acorn] Suppress removal of NFS filetype extension. [Non-Acorn if", - " ACORN_FTYPE_NFS] Translate filetype and append to name.", - " -i [MacOS] Ignore filenames in MacOS extra field. Instead, use name in", - " standard header.", - " -j Junk paths and deposit all files in extraction directory.", - " -J [BeOS] Junk file attributes. [MacOS] Ignore MacOS specific info.", - " -K [AtheOS, BeOS, Unix] Restore SUID/SGID/Tacky file attributes.", - " -L Convert to lowercase any names from uppercase only file system.", - " -LL Convert all files to lowercase.", - " -M Pipe all output through internal pager similar to Unix more(1).", - " -n Never overwrite existing files. Skip extracting that file, no prompt.", - " -N [Amiga] Extract file comments as Amiga filenotes.", - " -o Overwrite existing files without prompting. Useful with -f. Use with", - " care.", - " -P p Use password p to decrypt files. THIS IS INSECURE! Some OS show", - " command line to other users.", - " -q Perform operations quietly. The more q (as in -qq) the quieter.", - " -s [OS/2, NT, MS-DOS] Convert spaces in filenames to underscores.", - " -S [VMS] Convert text files (-a, -aa) into Stream_LF format.", - " -U [UNICODE enabled] Show non-local characters as #Uxxxx or #Lxxxxxx ASCII", - " text escapes where x is hex digit. [Old] -U used to leave names", - " uppercase if created on MS-DOS, VMS, etc. See -L.", - " -UU [UNICODE enabled] Disable use of stored UTF-8 paths. Note that UTF-8", - " paths stored as native local paths are still processed as Unicode.", - " -V Retain VMS file version numbers.", - " -W [Only if WILD_STOP_AT_DIR] Modify pattern matching so ? and * do not", - " match directory separator /, but ** does. Allows matching at specific", - " directory levels.", - " -X [VMS, Unix, OS/2, NT, Tandem] Restore UICs and ACL entries under VMS,", - " or UIDs/GIDs under Unix, or ACLs under certain network-enabled", - " versions of OS/2, or security ACLs under Windows NT. Can require", - " user privileges.", - " -XX [NT] Extract NT security ACLs after trying to enable additional", - " system privileges.", - " -Y [VMS] Treat archived name endings of .nnn as VMS version numbers.", - " -$ [MS-DOS, OS/2, NT] Restore volume label if extraction medium is", - " removable. -$$ allows fixed media (hard drives) to be labeled.", - " -/ e [Acorn] Use e as extension list.", - " -: [All but Acorn, VM/CMS, MVS, Tandem] Allow extract archive members into", - " locations outside of current extraction root folder. This allows", - " paths such as ../foo to be extracted above the current extraction", - " directory, which can be a security problem.", - " -^ [Unix] Allow control characters in names of extracted entries. Usually", - " this is not a good thing and should be avoided.", - " -2 [VMS] Force unconditional conversion of names to ODS-compatible names.", - " Default is to exploit destination file system, preserving cases and", - " extended name characters on ODS5 and applying ODS2 filtering on ODS2.", - "", - "", - "Wildcards:", - " Internally unzip supports the following wildcards:", - " ? (or %% or #, depending on OS) matches any single character", - " * matches any number of characters, including zero", - " [list] matches char in list (regex), can do range [ac-f], all but [!bf]", - " If port supports [], must escape [ as [[]", - " For shells that expand wildcards, escape (\\* or \"*\") so unzip can recurse.", - "", - "Include and Exclude:", - " -i pattern pattern ... include files that match a pattern", - " -x pattern pattern ... exclude files that match a pattern", - " Patterns are paths with optional wildcards and match paths as stored in", - " archive. Exclude and include lists end at next option or end of line.", - " unzip archive -x pattern pattern ...", - "", - "Multi-part (split) archives (archives created as a set of split files):", - " Currently split archives are not readable by unzip. A workaround is", - " to use zip to convert the split archive to a single-file archive and", - " use unzip on that. See the manual page for Zip 3.0 or later.", - "", - "Streaming (piping into unzip):", - " Currently unzip does not support streaming. The funzip utility can be", - " used to process the first entry in a stream.", - " cat archive | funzip", - "", - "Testing archives:", - " -t test contents of archive", - " This can be modified using -q for quieter operation, and -qq for even", - " quieter operation.", - "", - "Unicode:", - " If compiled with Unicode support, unzip automatically handles archives", - " with Unicode entries. Currently Unicode on Win32 systems is limited.", - " Characters not in the current character set are shown as ASCII escapes", - " in the form #Uxxxx where the Unicode character number fits in 16 bits,", - " or #Lxxxxxx where it doesn't, where x is the ASCII character for a hex", - " digit.", - "", - "", - "zipinfo options (these are used in zipinfo mode (unzip -Z ...)):", - " -1 List names only, one per line. No headers/trailers. Good for scripts.", - " -2 List names only as -1, but include headers, trailers, and comments.", - " -s List archive entries in short Unix ls -l format. Default list format.", - " -m List in long Unix ls -l format. As -s, but includes compression %.", - " -l List in long Unix ls -l format. As -m, but compression in bytes.", - " -v List zipfile information in verbose, multi-page format.", - " -h List header line. Includes archive name, actual size, total files.", - " -M Pipe all output through internal pager similar to Unix more(1) command.", - " -t List totals for files listed or for all files. Includes uncompressed", - " and compressed sizes, and compression factors.", - " -T Print file dates and times in a sortable decimal format (yymmdd.hhmmss)", - " Default date and time format is a more human-readable version.", - " -U [UNICODE] If entry has a UTF-8 Unicode path, display any characters", - " not in current character set as text #Uxxxx and #Lxxxxxx escapes", - " representing the Unicode character number of the character in hex.", - " -UU [UNICODE] Disable use of any UTF-8 path information.", - " -z Include archive comment if any in listing.", - "", - "", - "funzip stream extractor:", - " funzip extracts the first member in an archive to stdout. Typically", - " used to unzip the first member of a stream or pipe. If a file argument", - " is given, read from that file instead of stdin.", - "", - "funzip command line:", - " funzip [-password] [input[.zip|.gz]]", - "", - "", - "unzipsfx self extractor:", - " Self-extracting archives made with unzipsfx are no more (or less)", - " portable across different operating systems than unzip executables.", - " In general, a self-extracting archive made on a particular Unix system,", - " for example, will only self-extract under the same flavor of Unix.", - " Regular unzip may still be used to extract embedded archive however.", - "", - "unzipsfx command line:", - " [-options] [file(s) ... [-x xfile(s) ...]]", - "", - "unzipsfx options:", - " -c, -p - Output to pipe. (See above for unzip.)", - " -f, -u - Freshen and Update, as for unzip.", - " -t - Test embedded archive. (Can be used to list contents.)", - " -z - Print archive comment. (See unzip above.)", - "", - "unzipsfx modifiers:", - " Most unzip modifiers are supported. These include", - " -a - Convert text files.", - " -n - Never overwrite.", - " -o - Overwrite without prompting.", - " -q - Quiet operation.", - " -C - Match names case-insensitively.", - " -j - Junk paths.", - " -V - Keep version numbers.", - " -s - Convert spaces to underscores.", - " -$ - Restore volume label.", - "", - "If unzipsfx compiled with SFX_EXDIR defined, -d option also available:", - " -d exd - Extract to directory exd.", - "By default, all files extracted to current directory. This option", - "forces extraction to specified directory.", - "", - "See unzipsfx manual page for more information.", - "" - }; - - for (i = 0; i < sizeof(text)/sizeof(char *); i++) - { - Info(slide, 0, ((char *)slide, "%s\n", text[i])); - } -} /* end function help_extended() */ - - - - -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ -#if (!defined(MODERN) || defined(NO_STDLIB_H)) -/* Declare getenv() to be sure (might be missing in some environments) */ -extern char *getenv(); -#endif -#endif - -/********************************/ -/* Function show_version_info() */ -/********************************/ - -static void show_version_info(__G) - __GDEF -{ - if (uO.qflag > 3) /* "unzip -vqqqq" */ - Info(slide, 0, ((char *)slide, "%d\n", - (UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL))); - else { -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - char *envptr; -#endif - int numopts = 0; - - Info(slide, 0, ((char *)slide, LoadFarString(UnzipUsageLine1v), - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, - LoadFarStringSmall(VersionDate))); - Info(slide, 0, ((char *)slide, - LoadFarString(UnzipUsageLine2v))); - version(__G); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptions))); -#ifdef ACORN_FTYPE_NFS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AcornFtypeNFS))); - ++numopts; -#endif -#ifdef ASM_CRC - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AsmCRC))); - ++numopts; -#endif -#ifdef ASM_INFLATECODES - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(AsmInflateCodes))); - ++numopts; -#endif -#ifdef CHECK_VERSIONS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Check_Versions))); - ++numopts; -#endif -#ifdef COPYRIGHT_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Copyright_Clean))); - ++numopts; -#endif -#ifdef DEBUG - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(UDebug))); - ++numopts; -#endif -#ifdef DEBUG_TIME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(DebugTime))); - ++numopts; -#endif -#ifdef DLL - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Dll))); - ++numopts; -#endif -#ifdef DOSWILD - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(DosWild))); - ++numopts; -#endif -#ifdef LZW_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(LZW_Clean))); - ++numopts; -#endif -#ifndef MORE - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(No_More))); - ++numopts; -#endif -#ifdef NO_ZIPINFO - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(No_ZipInfo))); - ++numopts; -#endif -#ifdef NTSD_EAS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(NTSDExtAttrib))); - ++numopts; -#endif -#if defined(WIN32) && defined(NO_W32TIMES_IZFIX) - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(W32NoIZTimeFix))); - ++numopts; -#endif -#ifdef OLD_THEOS_EXTRA - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(OldTheosExtra))); - ++numopts; -#endif -#ifdef OS2_EAS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(OS2ExtAttrib))); - ++numopts; -#endif -#ifdef QLZIP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SMSExFldOnUnix))); - ++numopts; -#endif -#ifdef REENTRANT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Reentrant))); - ++numopts; -#endif -#ifdef REGARGS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(RegArgs))); - ++numopts; -#endif -#ifdef RETURN_CODES - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Return_Codes))); - ++numopts; -#endif -#ifdef SET_DIR_ATTRIB - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SetDirAttrib))); - ++numopts; -#endif -#ifdef SYMLINKS - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(SymLinkSupport))); - ++numopts; -#endif -#ifdef TIMESTAMP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(TimeStamp))); - ++numopts; -#endif -#ifdef UNIXBACKUP - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(UnixBackup))); - ++numopts; -#endif -#ifdef USE_EF_UT_TIME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_EF_UT_time))); - ++numopts; -#endif -#ifndef COPYRIGHT_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Smith_Code))); - ++numopts; -#endif -#ifndef LZW_CLEAN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Unshrink))); - ++numopts; -#endif -#ifdef USE_DEFLATE64 - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Deflate64))); - ++numopts; -#endif -#ifdef UNICODE_SUPPORT -# ifdef UTF8_MAYBE_NATIVE - sprintf((char *)(slide+256), LoadFarStringSmall(Use_Unicode), - LoadFarStringSmall2(G.native_is_utf8 ? SysChUTF8 : SysChOther)); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); -# else - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Unicode))); -# endif - ++numopts; -#endif -#ifdef _MBCS - sprintf((char *)(slide+256), LoadFarStringSmall(Have_MBCS_Support), - (unsigned int)MB_CUR_MAX); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef MULT_VOLUME - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_MultiVol))); - ++numopts; -#endif -#ifdef LARGE_FILE_SUPPORT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_LFS))); - ++numopts; -#endif -#ifdef ZIP64_SUPPORT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_Zip64))); - ++numopts; -#endif -#if (defined(__DJGPP__) && (__DJGPP__ >= 2)) -# ifdef USE_DJGPP_ENV - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_DJGPP_Env))); - ++numopts; -# endif -# ifdef USE_DJGPP_GLOB - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_DJGPP_Glob))); - ++numopts; -# endif -#endif /* __DJGPP__ && (__DJGPP__ >= 2) */ -#ifdef USE_VFAT - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(Use_VFAT_support))); - ++numopts; -#endif -#ifdef USE_ZLIB - sprintf((char *)(slide+256), LoadFarStringSmall(UseZlib), - ZLIB_VERSION, zlibVersion()); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef USE_BZIP2 - sprintf((char *)(slide+256), LoadFarStringSmall(UseBZip2), - BZ2_bzlibVersion()); - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - (char *)(slide+256))); - ++numopts; -#endif -#ifdef VMS_TEXT_CONV - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsTextConv))); - ++numopts; -#endif -#ifdef VMSCLI - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsCLI))); - ++numopts; -#endif -#ifdef VMSWILD - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(VmsWild))); - ++numopts; -#endif -#ifdef WILD_STOP_AT_DIR - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(WildStopAtDir))); - ++numopts; -#endif -#if CRYPT -# ifdef PASSWD_FROM_STDIN - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), - LoadFarStringSmall(PasswdStdin))); -# endif - Info(slide, 0, ((char *)slide, LoadFarString(Decryption), - CR_MAJORVER, CR_MINORVER, CR_BETA_VER, - LoadFarStringSmall(CryptDate))); - ++numopts; -#endif /* CRYPT */ - if (numopts == 0) - Info(slide, 0, ((char *)slide, - LoadFarString(CompileOptFormat), - LoadFarStringSmall(None))); - -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptions))); - envptr = getenv(LoadFarStringSmall(EnvUnZip)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZip), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvUnZip2)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZip2), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvZipInfo)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvZipInfo), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvZipInfo2)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvZipInfo2), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#ifndef __RSXNT__ -#ifdef __EMX__ - envptr = getenv(LoadFarStringSmall(EnvEMX)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvEMX), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvEMXOPT)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvEMXOPT), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* __EMX__ */ -#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) - envptr = getenv(LoadFarStringSmall(EnvGO32)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvGO32), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); - envptr = getenv(LoadFarStringSmall(EnvGO32TMP)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvGO32TMP), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* __GO32__ && !(__DJGPP__ >= 2) */ -#endif /* !__RSXNT__ */ -#ifdef RISCOS - envptr = getenv(LoadFarStringSmall(EnvUnZipExts)); - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), - LoadFarStringSmall(EnvUnZipExts), - (envptr == (char *)NULL || *envptr == 0)? - LoadFarStringSmall2(None) : envptr)); -#endif /* RISCOS */ -#endif /* !_WIN32_WCE */ - } -} /* end function show_version() */ - -#endif /* !SFX */ -#endif /* !WINDLL */ diff --git a/data/windows/unzipfx-catia/unzip.h b/data/windows/unzipfx-catia/unzip.h deleted file mode 100644 index 5b2a326..0000000 --- a/data/windows/unzipfx-catia/unzip.h +++ /dev/null @@ -1,722 +0,0 @@ -/*--------------------------------------------------------------------------- - - unzip.h (new) - - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - This header file contains the public macros and typedefs required by - both the UnZip sources and by any application using the UnZip API. If - UNZIP_INTERNAL is defined, it includes unzpriv.h (containing includes, - prototypes and extern variables used by the actual UnZip sources). - - ---------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------- -This is version 2009-Jan-02 of the Info-ZIP license. -The definitive version of this document should be available at -ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and -a copy at http://www.info-zip.org/pub/infozip/license.html. - - -Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - -For the purposes of this copyright and license, "Info-ZIP" is defined as -the following set of individuals: - - Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois, - Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth, - Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, - David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko, - Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, - Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda, - Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren, - Rich Wales, Mike White. - -This software is provided "as is," without warranty of any kind, express -or implied. In no event shall Info-ZIP or its contributors be held liable -for any direct, indirect, incidental, special or consequential damages -arising out of the use of or inability to use this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the above disclaimer and the following restrictions: - - 1. Redistributions of source code (in whole or in part) must retain - the above copyright notice, definition, disclaimer, and this list - of conditions. - - 2. Redistributions in binary form (compiled executables and libraries) - must reproduce the above copyright notice, definition, disclaimer, - and this list of conditions in documentation and/or other materials - provided with the distribution. Additional documentation is not needed - for executables where a command line license option provides these and - a note regarding this option is in the executable's startup banner. The - sole exception to this condition is redistribution of a standard - UnZipSFX binary (including SFXWiz) as part of a self-extracting archive; - that is permitted without inclusion of this license, as long as the - normal SFX banner has not been removed from the binary or disabled. - - 3. Altered versions--including, but not limited to, ports to new operating - systems, existing ports with new graphical interfaces, versions with - modified or added functionality, and dynamic, shared, or static library - versions not from Info-ZIP--must be plainly marked as such and must not - be misrepresented as being the original source or, if binaries, - compiled from the original source. Such altered versions also must not - be misrepresented as being Info-ZIP releases--including, but not - limited to, labeling of the altered versions with the names "Info-ZIP" - (or any variation thereof, including, but not limited to, different - capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the - explicit permission of Info-ZIP. Such altered versions are further - prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP - e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP - will provide support for the altered versions. - - 4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," - "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its - own source and binary releases. - ---------------------------------------------------------------------------*/ - -#ifndef __unzip_h /* prevent multiple inclusions */ -#define __unzip_h - -/*--------------------------------------------------------------------------- - Predefined, machine-specific macros. - ---------------------------------------------------------------------------*/ - -#ifdef __GO32__ /* MS-DOS extender: NOT Unix */ -# ifdef unix -# undef unix -# endif -# ifdef _unix -# undef _unix -# endif -# ifdef __unix -# undef __unix -# endif -# ifdef __unix__ -# undef __unix__ -# endif -#endif - -#if ((defined(__convex__) || defined(__convexc__)) && !defined(CONVEX)) -# define CONVEX -#endif - -#if (defined(unix) || defined(_unix) || defined(__unix) || defined(__unix__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* unix || _unix || __unix || __unix__ */ -#if (defined(M_XENIX) || defined(COHERENT) || defined(__hpux)) -# ifndef UNIX -# define UNIX -# endif -#endif /* M_XENIX || COHERENT || __hpux */ -#if (defined(__NetBSD__) || defined(__FreeBSD__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* __NetBSD__ || __FreeBSD__ */ -#if (defined(CONVEX) || defined(MINIX) || defined(_AIX) || defined(__QNX__)) -# ifndef UNIX -# define UNIX -# endif -#endif /* CONVEX || MINIX || _AIX || __QNX__ */ - -#if (defined(VM_CMS) || defined(MVS)) -# define CMS_MVS -#endif - -#if (defined(__OS2__) && !defined(OS2)) -# define OS2 -#endif - -#if (defined(__TANDEM) && !defined(TANDEM)) -# define TANDEM -#endif - -#if (defined(__VMS) && !defined(VMS)) -# define VMS -#endif - -#if ((defined(__WIN32__) || defined(_WIN32)) && !defined(WIN32)) -# define WIN32 -#endif -#if ((defined(__WINNT__) || defined(__WINNT)) && !defined(WIN32)) -# define WIN32 -#endif - -#if defined(_WIN32_WCE) -# ifndef WIN32 /* WinCE is treated as a variant of the Win32 API */ -# define WIN32 -# endif -# ifndef UNICODE /* WinCE requires UNICODE wide character support */ -# define UNICODE -# endif -#endif - -#ifdef __COMPILER_KCC__ -# include -# ifdef SYS_T20 -# define TOPS20 -# endif -#endif /* __COMPILER_KCC__ */ - -/* Borland C does not define __TURBOC__ if compiling for a 32-bit platform */ -#ifdef __BORLANDC__ -# ifndef __TURBOC__ -# define __TURBOC__ -# endif -# if (!defined(__MSDOS__) && !defined(OS2) && !defined(WIN32)) -# define __MSDOS__ -# endif -#endif - -/* define MSDOS for Turbo C (unless OS/2) and Power C as well as Microsoft C */ -#ifdef __POWERC -# define __TURBOC__ -# define MSDOS -#endif /* __POWERC */ - -#if (defined(__MSDOS__) && !defined(MSDOS)) /* just to make sure */ -# define MSDOS -#endif - -/* RSXNTDJ (at least up to v1.3) compiles for WIN32 (RSXNT) using a derivate - of the EMX environment, but defines MSDOS and __GO32__. ARG !!! */ -#if (defined(MSDOS) && defined(WIN32)) -# undef MSDOS /* WIN32 is >>>not<<< MSDOS */ -#endif -#if (defined(__GO32__) && defined(__EMX__) && defined(__RSXNT__)) -# undef __GO32__ -#endif - -#if (defined(linux) && !defined(LINUX)) -# define LINUX -#endif - -#ifdef __riscos -# define RISCOS -#endif - -#if (defined(THINK_C) || defined(MPW)) -# define MACOS -#endif -#if (defined(__MWERKS__) && defined(macintosh)) -# define MACOS -#endif - -/* use prototypes and ANSI libraries if __STDC__, or MS-DOS, or OS/2, or Win32, - * or IBM C Set/2, or Borland C, or Watcom C, or GNU gcc (emx or Cygwin), - * or Macintosh, or Sequent, or Atari, or IBM RS/6000, or Silicon Graphics, - * or Convex?, or AtheOS, or BeOS. - */ -#if (defined(__STDC__) || defined(MSDOS) || defined(OS2) || defined(WIN32)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(__EMX__) || defined(__CYGWIN__)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(MACOS) || defined(ATARI_ST) || defined(RISCOS) || defined(THEOS)) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -/* Sequent running Dynix/ptx: non-modern compiler */ -#if (defined(_AIX) || defined(sgi) || (defined(_SEQUENT_) && !defined(PTX))) -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -#if (defined(CMS_MVS) || defined(__ATHEOS__) || defined(__BEOS__)) -/* || defined(CONVEX) ? */ -# ifndef PROTO -# define PROTO -# endif -# ifndef MODERN -# define MODERN -# endif -#endif -/* Bundled C compiler on HP-UX needs this. Others shouldn't care. */ -#if (defined(__hpux)) -# ifndef MODERN -# define MODERN -# endif -#endif - -/* turn off prototypes if requested */ -#if (defined(NOPROTO) && defined(PROTO)) -# undef PROTO -#endif - -/* used to remove arguments in function prototypes for non-ANSI C */ -#ifdef PROTO -# define OF(a) a -#else -# define OF(a) () -#endif - -/* enable the "const" keyword only if MODERN and if not otherwise instructed */ -#ifdef MODERN -# if (!defined(ZCONST) && (defined(USE_CONST) || !defined(NO_CONST))) -# define ZCONST const -# endif -#endif - -#ifndef ZCONST -# define ZCONST -#endif - -/* Tell Microsoft Visual C++ 2005 (and newer) to leave us alone - * and let us use standard C functions the way we're supposed to. - * (These preprocessor symbols must appear before the first system - * header include. They are located here, because for WINDLL the - * first system header includes follow just below.) - */ -#if defined(_MSC_VER) && (_MSC_VER >= 1400) -# ifndef _CRT_SECURE_NO_WARNINGS -# define _CRT_SECURE_NO_WARNINGS -# endif -# ifndef _CRT_NONSTDC_NO_WARNINGS -# define _CRT_NONSTDC_NO_WARNINGS -# endif -# if defined(POCKET_UNZIP) && !defined(_CRT_NON_CONFORMING_SWPRINTFS) -# define _CRT_NON_CONFORMING_SWPRINTFS -# endif -#endif - -/* NO_UNIXBACKUP overrides UNIXBACKUP */ -#if defined(NO_UNIXBACKUP) && defined(UNIXBACKUP) -# undef UNIXBACKUP -#endif - -/*--------------------------------------------------------------------------- - Grab system-specific public include headers. - ---------------------------------------------------------------------------*/ - -#ifdef POCKET_UNZIP /* WinCE port */ -# include "wince/punzip.h" /* must appear before windows.h */ -#endif - -#ifdef WINDLL - /* for UnZip, the "basic" part of the win32 api is sufficient */ -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# define IZ_HASDEFINED_WIN32LEAN -# endif -# include -# include "windll/structs.h" -# ifdef IZ_HASDEFINED_WIN32LEAN -# undef WIN32_LEAN_AND_MEAN -# undef IZ_HASDEFINED_WIN32LEAN -# endif -#endif - -/*--------------------------------------------------------------------------- - Grab system-dependent definition of EXPENTRY for prototypes below. - ---------------------------------------------------------------------------*/ - -#if 0 -#if (defined(OS2) && !defined(FUNZIP)) -# ifdef UNZIP_INTERNAL -# define INCL_NOPM -# define INCL_DOSNLS -# define INCL_DOSPROCESS -# define INCL_DOSDEVICES -# define INCL_DOSDEVIOCTL -# define INCL_DOSERRORS -# define INCL_DOSMISC -# ifdef OS2DLL -# define INCL_REXXSAA -# include -# endif -# endif /* UNZIP_INTERNAL */ -# include -# define UZ_EXP EXPENTRY -#endif /* OS2 && !FUNZIP */ -#endif /* 0 */ - -#if (defined(OS2) && !defined(FUNZIP)) -# if (defined(__IBMC__) || defined(__WATCOMC__)) -# define UZ_EXP _System /* compiler keyword */ -# else -# define UZ_EXP -# endif -#endif /* OS2 && !FUNZIP */ - -#if (defined(WINDLL) || defined(USE_UNZIP_LIB)) -# ifndef EXPENTRY -# define UZ_EXP WINAPI -# else -# define UZ_EXP EXPENTRY -# endif -#endif - -#ifndef UZ_EXP -# define UZ_EXP -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - Public typedefs. - ---------------------------------------------------------------------------*/ - -#ifndef _IZ_TYPES_DEFINED -#ifdef MODERN - typedef void zvoid; -#else /* !MODERN */ -# ifndef AOS_VS /* mostly modern? */ -# ifndef VAXC /* not fully modern, but has knows 'void' */ -# define void int -# endif /* !VAXC */ -# endif /* !AOS_VS */ - typedef char zvoid; -#endif /* ?MODERN */ -typedef unsigned char uch; /* code assumes unsigned bytes; these type- */ -typedef unsigned short ush; /* defs replace byte/UWORD/ULONG (which are */ -typedef unsigned long ulg; /* predefined on some systems) & match zip */ -#define _IZ_TYPES_DEFINED -#endif /* !_IZ_TYPES_DEFINED */ - -/* InputFn is not yet used and is likely to change: */ -#ifdef PROTO - typedef int (UZ_EXP MsgFn) (zvoid *pG, uch *buf, ulg size, int flag); - typedef int (UZ_EXP InputFn) (zvoid *pG, uch *buf, int *size, int flag); - typedef void (UZ_EXP PauseFn) (zvoid *pG, ZCONST char *prompt, int flag); - typedef int (UZ_EXP PasswdFn) (zvoid *pG, int *rcnt, char *pwbuf, - int size, ZCONST char *zfn, - ZCONST char *efn); - typedef int (UZ_EXP StatCBFn) (zvoid *pG, int fnflag, ZCONST char *zfn, - ZCONST char *efn, ZCONST zvoid *details); - typedef void (UZ_EXP UsrIniFn) (void); -#else /* !PROTO */ - typedef int (UZ_EXP MsgFn) (); - typedef int (UZ_EXP InputFn) (); - typedef void (UZ_EXP PauseFn) (); - typedef int (UZ_EXP PasswdFn) (); - typedef int (UZ_EXP StatCBFn) (); - typedef void (UZ_EXP UsrIniFn) (); -#endif /* ?PROTO */ - -typedef struct _UzpBuffer { /* rxstr */ - ulg strlength; /* length of string */ - char *strptr; /* pointer to string */ -} UzpBuffer; - -typedef struct _UzpInit { - ulg structlen; /* length of the struct being passed */ - - /* GRR: can we assume that each of these is a 32-bit pointer? if not, - * does it matter? add "far" keyword to make sure? */ - MsgFn *msgfn; - InputFn *inputfn; - PauseFn *pausefn; - UsrIniFn *userfn; /* user init function to be called after */ - /* globals constructed and initialized */ - - /* pointer to program's environment area or something? */ - /* hooks for performance testing? */ - /* hooks for extra unzip -v output? (detect CPU or other hardware?) */ - /* anything else? let me (Greg) know... */ -} UzpInit; - -typedef struct _UzpCB { - ulg structlen; /* length of the struct being passed */ - /* GRR: can we assume that each of these is a 32-bit pointer? if not, - * does it matter? add "far" keyword to make sure? */ - MsgFn *msgfn; - InputFn *inputfn; - PauseFn *pausefn; - PasswdFn *passwdfn; - StatCBFn *statrepfn; -} UzpCB; - -/* the collection of general UnZip option flags and option arguments */ -typedef struct _UzpOpts { -#ifndef FUNZIP - char *exdir; /* pointer to extraction root directory (-d option) */ - char *pwdarg; /* pointer to command-line password (-P option) */ - int zipinfo_mode; /* behave like ZipInfo or like normal UnZip? */ - int aflag; /* -a: do ASCII-EBCDIC and/or end-of-line translation */ -#ifdef VMS - int bflag; /* -b: force fixed record format for binary files */ -#endif -#ifdef TANDEM - int bflag; /* -b: create text files in 'C' format (180)*/ -#endif -#if defined(UNIX) || defined(OS2) || defined(WIN32) - int B_flag; /* -B: back up existing files by renaming to *~##### */ -#else -#ifdef UNIXBACKUP - int B_flag; /* -B: back up existing files by renaming to *~##### */ -#endif -#endif - int cflag; /* -c: output to stdout */ - int C_flag; /* -C: match filenames case-insensitively */ - int D_flag; /* -D: don't restore directory (-DD: any) timestamps */ -#ifdef MACOS - int E_flag; /* -E: [MacOS] show Mac extra field during restoring */ -#endif - int fflag; /* -f: "freshen" (extract only newer files) */ -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - int acorn_nfs_ext; /* -F: RISC OS types & NFS filetype extensions */ -#endif - int hflag; /* -h: header line (zipinfo) */ -#ifdef MACOS - int i_flag; /* -i: [MacOS] ignore filenames stored in Mac e.f. */ -#endif -#ifdef RISCOS - int scanimage; /* -I: scan image files */ -#endif - int jflag; /* -j: junk pathnames (unzip) */ -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(MACOS)) - int J_flag; /* -J: ignore AtheOS/BeOS/MacOS e. f. info (unzip) */ -#endif -#if (defined(__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) - int K_flag; /* -K: keep setuid/setgid/tacky permissions */ -#endif - int lflag; /* -12slmv: listing format (zipinfo) */ - int L_flag; /* -L: convert filenames from some OSes to lowercase */ - int overwrite_none; /* -n: never overwrite files (no prompting) */ -#ifdef AMIGA - int N_flag; /* -N: restore comments as AmigaDOS filenotes */ -#endif - int overwrite_all; /* -o: OK to overwrite files without prompting */ -#endif /* !FUNZIP */ - int qflag; /* -q: produce a lot less output */ -#ifdef TANDEM - int rflag; /* -r: remove file extensions */ -#endif -#ifndef FUNZIP -#if (defined(MSDOS) || defined(FLEXOS) || defined(OS2) || defined(WIN32)) - int sflag; /* -s: convert spaces in filenames to underscores */ -#endif -#if (defined(NLM)) - int sflag; /* -s: convert spaces in filenames to underscores */ -#endif -#ifdef VMS - int S_flag; /* -S: use Stream_LF for text files (-a[a]) */ -#endif -#if (defined(MSDOS) || defined(__human68k__) || defined(OS2) || defined(WIN32)) - int volflag; /* -$: extract volume labels */ -#endif - int tflag; /* -t: test (unzip) or totals line (zipinfo) */ - int T_flag; /* -T: timestamps (unzip) or dec. time fmt (zipinfo) */ - int uflag; /* -u: "update" (extract only newer/brand-new files) */ -#if defined(UNIX) || defined(VMS) || defined(WIN32) - int U_flag; /* -U: escape non-ASCII, -UU No Unicode paths */ -#endif - int vflag; /* -v: (verbosely) list directory */ - int V_flag; /* -V: don't strip VMS version numbers */ - int W_flag; /* -W: wildcard '*' won't match '/' dir separator */ -#if (defined (__ATHEOS__) || defined(__BEOS__) || defined(UNIX)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#else -#if (defined(TANDEM) || defined(THEOS)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#else -#if (defined(OS2) || defined(VMS) || defined(WIN32)) - int X_flag; /* -X: restore owner/protection or UID/GID or ACLs */ -#endif -#endif -#endif -#ifdef VMS - int Y_flag; /* -Y: treat ".nnn" as ";nnn" version */ -#endif - int zflag; /* -z: display the zipfile comment (only, for unzip) */ -#ifdef VMS - int ods2_flag; /* -2: force names to conform to ODS2 */ -#endif -#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) - int ddotflag; /* -:: don't skip over "../" path elements */ -#endif -#ifdef UNIX - int cflxflag; /* -^: allow control chars in extracted filenames */ -#endif -#endif /* !FUNZIP */ -} UzpOpts; - -/* intended to be a private struct: */ -typedef struct _ver { - uch major; /* e.g., integer 5 */ - uch minor; /* e.g., 2 */ - uch patchlevel; /* e.g., 0 */ - uch not_used; -} _version_type; - -typedef struct _UzpVer { - ulg structlen; /* length of the struct being passed */ - ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ - ZCONST char *betalevel; /* e.g. "g BETA" or "" */ - ZCONST char *date; /* e.g. "9 Oct 08" (beta) or "9 October 2008" */ - ZCONST char *zlib_version;/* e.g. "1.2.3" or NULL */ - _version_type unzip; /* current UnZip version */ - _version_type zipinfo; /* current ZipInfo version */ - _version_type os2dll; /* OS2DLL version (retained for compatibility */ - _version_type windll; /* WinDLL version (retained for compatibility */ - _version_type dllapimin; /* last incompatible change of library API */ -} UzpVer; - -/* for Visual BASIC access to Windows DLLs: */ -typedef struct _UzpVer2 { - ulg structlen; /* length of the struct being passed */ - ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ - char betalevel[10]; /* e.g. "g BETA" or "" */ - char date[20]; /* e.g. "9 Oct 08" (beta) or "9 October 2008" */ - char zlib_version[10]; /* e.g. "1.2.3" or NULL */ - _version_type unzip; /* current UnZip version */ - _version_type zipinfo; /* current ZipInfo version */ - _version_type os2dll; /* OS2DLL version (retained for compatibility */ - _version_type windll; /* WinDLL version (retained for compatibility */ - _version_type dllapimin; /* last incompatible change of library API */ -} UzpVer2; - - -typedef struct _Uzp_Siz64 { - unsigned long lo32; - unsigned long hi32; -} Uzp_Siz64; - -typedef struct _Uzp_cdir_Rec { - uch version_made_by[2]; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ulg last_mod_dos_datetime; - ulg crc32; - Uzp_Siz64 csize; - Uzp_Siz64 ucsize; - ush filename_length; - ush extra_field_length; - ush file_comment_length; - ush disk_number_start; - ush internal_file_attributes; - ulg external_file_attributes; - Uzp_Siz64 relative_offset_local_header; -} Uzp_cdir_Rec; - - -#define UZPINIT_LEN sizeof(UzpInit) -#define UZPVER_LEN sizeof(UzpVer) -#define cbList(func) int (* UZ_EXP func)(char *filename, Uzp_cdir_Rec *crec) - - -/*--------------------------------------------------------------------------- - Return (and exit) values of the public UnZip API functions. - ---------------------------------------------------------------------------*/ - -/* external return codes */ -#define PK_OK 0 /* no error */ -#define PK_COOL 0 /* no error */ -#define PK_WARN 1 /* warning error */ -#define PK_ERR 2 /* error in zipfile */ -#define PK_BADERR 3 /* severe error in zipfile */ -#define PK_MEM 4 /* insufficient memory (during initialization) */ -#define PK_MEM2 5 /* insufficient memory (password failure) */ -#define PK_MEM3 6 /* insufficient memory (file decompression) */ -#define PK_MEM4 7 /* insufficient memory (memory decompression) */ -#define PK_MEM5 8 /* insufficient memory (not yet used) */ -#define PK_NOZIP 9 /* zipfile not found */ -#define PK_PARAM 10 /* bad or illegal parameters specified */ -#define PK_FIND 11 /* no files found */ -#define PK_DISK 50 /* disk full */ -#define PK_EOF 51 /* unexpected EOF */ - -#define IZ_CTRLC 80 /* user hit ^C to terminate */ -#define IZ_UNSUP 81 /* no files found: all unsup. compr/encrypt. */ -#define IZ_BADPWD 82 /* no files found: all had bad password */ -#define IZ_ERRBF 83 /* big-file archive, small-file program */ - -/* return codes of password fetches (negative = user abort; positive = error) */ -#define IZ_PW_ENTERED 0 /* got some password string; use/try it */ -#define IZ_PW_CANCEL -1 /* no password available (for this entry) */ -#define IZ_PW_CANCELALL -2 /* no password, skip any further pwd. request */ -#define IZ_PW_ERROR 5 /* = PK_MEM2 : failure (no mem, no tty, ...) */ - -/* flag values for status callback function */ -#define UZ_ST_START_EXTRACT 1 /* no details */ -#define UZ_ST_IN_PROGRESS 2 /* no details */ -#define UZ_ST_FINISH_MEMBER 3 /* 'details': extracted size */ - -/* return values of status callback function */ -#define UZ_ST_CONTINUE 0 -#define UZ_ST_BREAK 1 - - -/*--------------------------------------------------------------------------- - Prototypes for public UnZip API (DLL) functions. - ---------------------------------------------------------------------------*/ - -#define UzpMatch match - -int UZ_EXP UzpMain OF((int argc, char **argv)); -int UZ_EXP UzpAltMain OF((int argc, char **argv, UzpInit *init)); -ZCONST UzpVer * UZ_EXP UzpVersion OF((void)); -void UZ_EXP UzpFreeMemBuffer OF((UzpBuffer *retstr)); -#ifndef WINDLL -int UZ_EXP UzpUnzipToMemory OF((char *zip, char *file, UzpOpts *optflgs, - UzpCB *UsrFunc, UzpBuffer *retstr)); -int UZ_EXP UzpGrep OF((char *archive, char *file, - char *pattern, int cmd, int SkipBin, - UzpCB *UsrFunc)); -#endif -#ifdef OS2 -int UZ_EXP UzpFileTree OF((char *name, cbList(callBack), - char *cpInclude[], char *cpExclude[])); -#endif - -unsigned UZ_EXP UzpVersion2 OF((UzpVer2 *version)); -int UZ_EXP UzpValidate OF((char *archive, int AllCodes)); - - -/* default I/O functions (can be swapped out via UzpAltMain() entry point): */ - -int UZ_EXP UzpMessagePrnt OF((zvoid *pG, uch *buf, ulg size, int flag)); -int UZ_EXP UzpMessageNull OF((zvoid *pG, uch *buf, ulg size, int flag)); -int UZ_EXP UzpInput OF((zvoid *pG, uch *buf, int *size, int flag)); -void UZ_EXP UzpMorePause OF((zvoid *pG, ZCONST char *prompt, int flag)); -int UZ_EXP UzpPassword OF((zvoid *pG, int *rcnt, char *pwbuf, - int size, ZCONST char *zfn, - ZCONST char *efn)); - -#ifdef __cplusplus -} -#endif - - -/*--------------------------------------------------------------------------- - Remaining private stuff for UnZip compilation. - ---------------------------------------------------------------------------*/ - -#ifdef UNZIP_INTERNAL -# include "unzpriv.h" -#endif - - -#endif /* !__unzip_h */ diff --git a/data/windows/unzipfx-catia/unzipfx/appDetails.c b/data/windows/unzipfx-catia/unzipfx/appDetails.c deleted file mode 100644 index 7f53dcb..0000000 --- a/data/windows/unzipfx-catia/unzipfx/appDetails.c +++ /dev/null @@ -1,80 +0,0 @@ - -#include -#include - -#ifdef WIN32 -# include -#endif - -#include "appDetails.h" - -#define CMD_BUF_LEN 1024 - -static int sfx_app_argc = 0; -static char** sfx_app_argv = NULL; -static char sfx_tmp_path[512] = { 0 }; - -void sfx_app_set_args(int argc, char** argv) -{ - sfx_app_argc = argc; - sfx_app_argv = argv; -} - -int sfx_app_autorun_now() -{ - int i, cmdBufLen = 0; - char cmdBuf[CMD_BUF_LEN]; - -#ifdef WIN32 - strcpy(cmdBuf, sfx_get_tmp_path(1)); - strcat(cmdBuf, SFX_AUTORUN_CMD); -#else - strcpy(cmdBuf, "cd "); - strcat(cmdBuf, sfx_get_tmp_path(1)); - strcat(cmdBuf, "; "); - strcat(cmdBuf, SFX_AUTORUN_CMD); -#endif - - cmdBufLen = strlen(cmdBuf); - - for (i=0; i < sfx_app_argc; i++) - { - if (! sfx_app_argv[i]) - continue; - - cmdBufLen += strlen(sfx_app_argv[i]) + 1; - if (cmdBufLen >= CMD_BUF_LEN-1) - break; - - strcat(cmdBuf, " "); - strcat(cmdBuf, sfx_app_argv[i]); - } - - return system(cmdBuf); -} - -char* sfx_get_tmp_path(int withAppName) -{ -#ifdef WIN32 - { - GetTempPathA(512 - strlen(SFX_APP_MININAME), sfx_tmp_path); - - if (withAppName == 1) - strcat(sfx_tmp_path, SFX_APP_MININAME); - } -#else - { - char* tmp = getenv("TMP"); - - if (tmp) - strcpy(sfx_tmp_path, tmp); - else - strcpy(sfx_tmp_path, "/tmp"); - - if (withAppName == 1) - strcat(sfx_tmp_path, "/" SFX_APP_MININAME); - } -#endif - - return sfx_tmp_path; -} diff --git a/data/windows/unzipfx-catia/unzipfx/appDetails.h b/data/windows/unzipfx-catia/unzipfx/appDetails.h deleted file mode 100644 index d89c069..0000000 --- a/data/windows/unzipfx-catia/unzipfx/appDetails.h +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef __APP_DETAILS_H__ -#define __APP_DETAILS_H__ - -#define SFX_APP_VERSION "0.8.1" -#define SFX_APP_BANNER "Catia self-contained executable " SFX_APP_VERSION ", based on UnZipSFX." - -#ifndef SFX_APP_MININAME -# define SFX_APP_MININAME "Catia" -#endif - -#ifdef WIN32 -# define SFX_AUTORUN_CMD "\\" SFX_APP_MININAME ".exe" -#else -# define SFX_AUTORUN_CMD "./" SFX_APP_MININAME -#endif - -void sfx_app_set_args(int argc, char** argv); -int sfx_app_autorun_now(); -char* sfx_get_tmp_path(int withAppName); - -#endif // __APP_DETAILS_H__ diff --git a/data/windows/unzipfx-catia/unzpriv.h b/data/windows/unzipfx-catia/unzpriv.h deleted file mode 100644 index 92967e7..0000000 --- a/data/windows/unzipfx-catia/unzpriv.h +++ /dev/null @@ -1,3123 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unzpriv.h - - This header file contains private (internal) macros, typedefs, prototypes - and global-variable declarations used by all of the UnZip source files. - In a prior life it was part of the main unzip.h header, but now it is only - included by that header if UNZIP_INTERNAL is defined. - - ---------------------------------------------------------------------------*/ - - - -#ifndef __unzpriv_h /* prevent multiple inclusions */ -#define __unzpriv_h - -/* First thing: Signal all following code that we compile UnZip utilities! */ -#ifndef UNZIP -# define UNZIP -#endif - -/* GRR 960204: MORE defined here in preparation for removal altogether */ -#ifndef MORE -# ifndef RISCOS -# define MORE -# endif -#endif - -/* fUnZip should never need to be reentrant */ -#ifdef FUNZIP -# ifdef REENTRANT -# undef REENTRANT -# endif -# ifdef DLL -# undef DLL -# endif -# ifdef SFX /* fUnZip is NOT the sfx stub! */ -# undef SFX -# endif -# ifdef USE_BZIP2 /* fUnZip does not support bzip2 decompression */ -# undef USE_BZIP2 -# endif -#endif - -#if (defined(USE_ZLIB) && !defined(HAVE_ZL_INFLAT64) && !defined(NO_DEFLATE64)) - /* zlib does not (yet?) provide Deflate64(tm) support */ -# define NO_DEFLATE64 -#endif - -#ifdef NO_DEFLATE64 - /* disable support for Deflate64(tm) */ -# ifdef USE_DEFLATE64 -# undef USE_DEFLATE64 -# endif -#else - /* enable Deflate64(tm) support unless compiling for SFX stub */ -# if (!defined(USE_DEFLATE64) && !defined(SFX)) -# define USE_DEFLATE64 -# endif -#endif - -/* disable bzip2 support for SFX stub, unless explicitly requested */ -#if (defined(SFX) && !defined(BZIP2_SFX) && defined(USE_BZIP2)) -# undef USE_BZIP2 -#endif - -#if (defined(NO_VMS_TEXT_CONV) || defined(VMS)) -# ifdef VMS_TEXT_CONV -# undef VMS_TEXT_CONV -# endif -#else -# if (!defined(VMS_TEXT_CONV) && !defined(SFX)) -# define VMS_TEXT_CONV -# endif -#endif - -/* Enable -B option per default on specific systems, to allow backing up - * files that would be overwritten. - * (This list of systems must be kept in sync with the list of systems - * that add the B_flag to the UzpOpts structure, see unzip.h.) - */ -#if (!defined(NO_UNIXBACKUP) && !defined(UNIXBACKUP)) -# if defined(UNIX) || defined(OS2) || defined(WIN32) -# define UNIXBACKUP -# endif -#endif - -#if (defined(DLL) && !defined(REENTRANT)) -# define REENTRANT -#endif - -#if (!defined(DYNAMIC_CRC_TABLE) && !defined(FUNZIP)) -# define DYNAMIC_CRC_TABLE -#endif - -#if (defined(DYNAMIC_CRC_TABLE) && !defined(REENTRANT)) -# ifndef DYNALLOC_CRCTAB -# define DYNALLOC_CRCTAB -# endif -#endif - -/*--------------------------------------------------------------------------- - OS-dependent configuration for UnZip internals - ---------------------------------------------------------------------------*/ - -/* Some compiler distributions for Win32/i386 systems try to emulate - * a Unix (POSIX-compatible) environment. - */ -#if (defined(WIN32) && defined(UNIX)) - /* UnZip does not support merging both ports in a single executable. */ -# if (defined(FORCE_WIN32_OVER_UNIX) && defined(FORCE_UNIX_OVER_WIN32)) - /* conflicting choice requests -> we prefer the Win32 environment */ -# undef FORCE_UNIX_OVER_WIN32 -# endif -# ifdef FORCE_WIN32_OVER_UNIX - /* native Win32 support was explicitly requested... */ -# undef UNIX -# else - /* use the POSIX (Unix) emulation features by default... */ -# undef WIN32 -# endif -#endif - -/* bad or (occasionally?) missing stddef.h: */ -#if (defined(M_XENIX) || defined(DNIX)) -# define NO_STDDEF_H -#endif - -#if (defined(M_XENIX) && !defined(M_UNIX)) /* SCO Xenix only, not SCO Unix */ -# define SCO_XENIX -# define NO_LIMITS_H /* no limits.h, but MODERN defined */ -# define NO_UID_GID /* no uid_t/gid_t */ -# define size_t int -#endif - -#ifdef realix /* Modcomp Real/IX, real-time SysV.3 variant */ -# define SYSV -# define NO_UID_GID /* no uid_t/gid_t */ -#endif - -#if (defined(_AIX) && !defined(_ALL_SOURCE)) -# define _ALL_SOURCE -#endif - -#if defined(apollo) /* defines __STDC__ */ -# define NO_STDLIB_H -#endif - -#ifdef DNIX -# define SYSV -# define SHORT_NAMES /* 14-char limitation on path components */ -/* # define FILENAME_MAX 14 */ -# define FILENAME_MAX NAME_MAX /* GRR: experiment */ -#endif - -#if (defined(SYSTEM_FIVE) || defined(__SYSTEM_FIVE)) -# ifndef SYSV -# define SYSV -# endif -#endif /* SYSTEM_FIVE || __SYSTEM_FIVE */ -#if (defined(M_SYSV) || defined(M_SYS5)) -# ifndef SYSV -# define SYSV -# endif -#endif /* M_SYSV || M_SYS5 */ -/* __SVR4 and __svr4__ catch Solaris on at least some combos of compiler+OS */ -#if (defined(__SVR4) || defined(__svr4__) || defined(sgi) || defined(__hpux)) -# ifndef SYSV -# define SYSV -# endif -#endif /* __SVR4 || __svr4__ || sgi || __hpux */ -#if (defined(LINUX) || defined(__QNX__)) -# ifndef SYSV -# define SYSV -# endif -#endif /* LINUX || __QNX__ */ - -#if (defined(ultrix) || defined(__ultrix) || defined(bsd4_2)) -# if (!defined(BSD) && !defined(SYSV)) -# define BSD -# endif -#endif /* ultrix || __ultrix || bsd4_2 */ -#if (defined(sun) || defined(pyr) || defined(CONVEX)) -# if (!defined(BSD) && !defined(SYSV)) -# define BSD -# endif -#endif /* sun || pyr || CONVEX */ - -#ifdef pyr /* Pyramid: has BSD and AT&T "universes" */ -# ifdef BSD -# define pyr_bsd -# define USE_STRINGS_H /* instead of more common string.h */ -# define ZMEM /* ZMEM now uses bcopy/bzero: not in AT&T universe */ -# endif /* (AT&T memcpy claimed to be very slow, though) */ -# define DECLARE_ERRNO -#endif /* pyr */ - -/* stat() bug for Borland, VAX C RTL, and Atari ST MiNT on TOS - * filesystems: returns 0 for wildcards! (returns 0xffffffff on Minix - * filesystem or `U:' drive under Atari MiNT.) Watcom C was previously - * included on this list; it would be good to know what version the problem - * was fixed at, if it did exist. */ -#if (defined(__TURBOC__) && !defined(WIN32)) -/*# define WILD_STAT_BUG*/ -#endif -#if (defined(VMS) || defined(__MINT__)) -# define WILD_STAT_BUG -#endif - -/*--------------------------------------------------------------------------- - OS-dependent includes - ---------------------------------------------------------------------------*/ - - -/*--------------------------------------------------------------------------- - API (DLL) section: - ---------------------------------------------------------------------------*/ - -#ifdef DLL -# define MAIN UZ_EXP UzpMain /* was UzpUnzip */ -# ifdef OS2DLL -# undef Info -# define REDIRECTC(c) varputchar(__G__ c) -# define REDIRECTPRINT(buf,size) varmessage(__G__ buf, size) -# define FINISH_REDIRECT() finish_REXX_redirect(__G) -# else -# define REDIRECTC(c) -# define REDIRECTPRINT(buf,size) 0 -# define FINISH_REDIRECT() close_redirect(__G) -# endif -#endif - -/*--------------------------------------------------------------------------- - Acorn RISCOS section: - ---------------------------------------------------------------------------*/ - -#ifdef RISCOS -# include "acorn/riscos.h" -#endif - -/*--------------------------------------------------------------------------- - Amiga section: - ---------------------------------------------------------------------------*/ - -#ifdef AMIGA -# include "amiga/amiga.h" -#endif - -/*--------------------------------------------------------------------------- - AOS/VS section (somewhat similar to Unix, apparently): - ---------------------------------------------------------------------------*/ - -#ifdef AOS_VS -# ifdef __FILEIO_C -# include "aosvs/aosvs.h" -# endif -#endif - -/*--------------------------------------------------------------------------- - Atari ST section: - ---------------------------------------------------------------------------*/ - -#ifdef ATARI -# include -# include -# include -# include -# define SYMLINKS -# define EXE_EXTENSION ".tos" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_DMY -# endif -# define DIR_END '/' -# define INT_SPRINTF -# define timezone _timezone -# define lenEOL 2 -# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} -# undef SHORT_NAMES -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -# endif -#endif - -/*--------------------------------------------------------------------------- - AtheOS section: - ---------------------------------------------------------------------------*/ - -#ifdef __ATHEOS__ -# include "atheos/athcfg.h" -#endif - -/*--------------------------------------------------------------------------- - BeOS section: - ---------------------------------------------------------------------------*/ - -#ifdef __BEOS__ -# include "beos/beocfg.h" -#endif - -/*--------------------------------------------------------------------------- - Human68k/X680x0 section: - ---------------------------------------------------------------------------*/ - -#ifdef __human68k__ - /* DO NOT DEFINE DOS_OS2 HERE! If Human68k is so much */ - /* like MS-DOS and/or OS/2, create DOS_H68_OS2 macro. */ -# if (!defined(_MBCS) && !defined(NO_MBCS)) - /* enable MBCS support by default for this system */ -# define _MBCS -# endif -# if (defined(_MBCS) && defined(NO_MBCS)) - /* disable MBCS support when explicitely requested */ -# undef _MBCS -# endif -# include -# include -# include -# include -# include -# ifdef HAVE_MBSTRING_H -# include -# endif -# ifdef HAVE_MBCTYPE_H -# include -# else -# ifndef _ismbblead -# define _ismbblead(c) (0x80 <= (c) && ((c) < 0xa0 || 0xe0 <= (c))) -# endif -# endif -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_YMD /* Japanese standard */ -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -# define INT_SPRINTF -# define SYMLINKS -# ifdef SFX -# define MAIN main_sfx -# endif -#endif - -/*--------------------------------------------------------------------------- - Mac section: - ---------------------------------------------------------------------------*/ - -#ifdef MACOS -# include "maccfg.h" -#endif /* MACOS */ - -/*--------------------------------------------------------------------------- - MS-DOS, OS/2, FLEXOS section: - ---------------------------------------------------------------------------*/ - -#ifdef WINDLL -# ifdef MORE -# undef MORE -# endif -# ifdef OS2_EAS -# undef OS2_EAS -# endif -#endif - -#if (defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__))) -# ifndef MSC -# define MSC /* This should work for older MSC, too! */ -# endif -#endif - -#if (defined(MSDOS) || defined(OS2) || defined(FLEXOS)) -# include /* off_t, time_t, dev_t, ... */ -# include -# include /* lseek(), open(), setftime(), dup(), creat() */ -# include /* localtime() */ -# include /* O_BINARY for open() w/o CR/LF translation */ - -# ifdef OS2 /* defined for all OS/2 compilers */ -# include "os2/os2cfg.h" -# else -# ifdef FLEXOS -# include "flexos/flxcfg.h" -# else -# include "msdos/doscfg.h" -# endif -# endif - -# if (defined(_MSC_VER) && (_MSC_VER == 700) && !defined(GRR)) - /* - * ARGH. MSC 7.0 libraries think times are based on 1899 Dec 31 00:00, not - * 1970 Jan 1 00:00. So we have to diddle time_t's appropriately: add or - * subtract 70 years' worth of seconds; i.e., number of days times 86400; - * i.e., (70*365 regular days + 17 leap days + 1 1899 day) * 86400 == - * (25550 + 17 + 1) * 86400 == 2209075200 seconds. We know time_t is an - * unsigned long (ulg) on the only system with this bug. - */ -# define TIMET_TO_NATIVE(x) (x) += (ulg)2209075200L; -# define NATIVE_TO_TIMET(x) (x) -= (ulg)2209075200L; -# endif -# if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0450)) -# define timezone _timezone -# endif -# if (defined(__GO32__) || defined(FLEXOS)) -# define DIR_END '/' -# else -# define DIR_END '\\' /* OS uses '\\' as directory separator */ -# define DIR_END2 '/' /* also check for '/' (RTL may convert) */ -# endif -# ifdef DATE_FORMAT -# undef DATE_FORMAT -# endif -# define DATE_FORMAT dateformat() -# define lenEOL 2 -# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} -# if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -# endif -#endif /* MSDOS || OS2 || FLEXOS */ - -/*--------------------------------------------------------------------------- - MTS section (piggybacks UNIX, I think): - ---------------------------------------------------------------------------*/ - -#ifdef MTS -# include /* off_t, time_t, dev_t, ... */ -# include -# include /* MTS uses this instead of fcntl.h */ -# include -# include -# include /* some important non-ANSI routines */ -# define mkdir(s,n) (-1) /* no "make directory" capability */ -# define EBCDIC /* set EBCDIC conversion on */ -# define NO_STRNICMP /* unzip's is as good the one in MTS */ -# define USE_FWRITE -# define close_outfile() fclose(G.outfile) /* can't set time on files */ -# define umask(n) /* don't have umask() on MTS */ -# define FOPWT "w" /* open file for writing in TEXT mode */ -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -#endif /* MTS */ - - /*--------------------------------------------------------------------------- - Novell Netware NLM section - ---------------------------------------------------------------------------*/ - -#ifdef NLM -# include "netware/nlmcfg.h" -#endif - - /*--------------------------------------------------------------------------- - QDOS section - ---------------------------------------------------------------------------*/ - -#ifdef QDOS -# define DIRENT -# include -# include -# include -# include -# include "qdos/izqdos.h" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define lenEOL 1 -# define PutNativeEOL *q++ = native(LF); -# define DIR_END '_' -# define RETURN QReturn -# undef PATH_MAX -# define PATH_MAX 36 -# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -# endif -# define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols) -# define SCREENWIDTH 80 -#endif - -/*--------------------------------------------------------------------------- - Tandem NSK section: - ---------------------------------------------------------------------------*/ - -#ifdef TANDEM -# include "tandem.h" -# include -# ifndef __INT32 - /* We are compiling with non-WIDE memory model, int = 16 bits */ -# ifndef INT_16BIT -# define INT_16BIT /* report "int" size is 16-bit to inflate setup */ -# endif -# ifdef USE_DEFLATE64 - /* Following required for 64k WSIZE of Deflate64 support */ -# define MED_MEM /* else OUTBUFSIZ is 64K and fails in do_string */ -# define INBUFSIZ 8192 /* but larger buffer for real OSes */ -# endif -# endif - /* use a single LF delimiter so that writes to 101 text files work */ -# define PutNativeEOL *q++ = native(LF); -# define lenEOL 1 -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_DMY -# endif -# define SCREENLINES 25 - /* USE_EF_UT_TIME is set in tandem.h */ -# define RESTORE_UIDGID -# define NO_STRNICMP -#endif - -/*--------------------------------------------------------------------------- - THEOS section: - ---------------------------------------------------------------------------*/ - -#ifdef THEOS -# include "theos/thscfg.h" -#endif - -/*--------------------------------------------------------------------------- - TOPS-20 section: - ---------------------------------------------------------------------------*/ - -#ifdef TOPS20 -# include /* off_t, time_t, dev_t, ... */ -# include -# include -# include -# include -# include -# include -# include /* get amazing monsym() macro */ - extern int open(), close(), read(); - extern int stat(), unlink(), jsys(), fcntl(); - extern long lseek(), dup(), creat(); -# define strchr index /* GRR: necessary? */ -# define strrchr rindex -# define REALLY_SHORT_SYMS -# define NO_MKDIR -# ifndef HAVE_STRNICMP -# define NO_STRNICMP /* probably not provided by TOPS20 C RTL */ -# endif -# define DIR_BEG '<' -# define DIR_END '>' -# define DIR_EXT ".directory" -# ifndef DATE_FORMAT -# define DATE_FORMAT DF_MDY -# endif -# define EXE_EXTENSION ".exe" /* just a guess... */ -#endif /* TOPS20 */ - -/*--------------------------------------------------------------------------- - Unix section: - ---------------------------------------------------------------------------*/ - -#ifdef UNIX -# include "unix/unxcfg.h" -#endif /* UNIX */ - -/*--------------------------------------------------------------------------- - VM/CMS and MVS section: - ---------------------------------------------------------------------------*/ - -#ifdef CMS_MVS -# include "vmmvs.h" -# define CLOSE_INFILE() close_infile(__G) -#endif - -/*--------------------------------------------------------------------------- - VMS section: - ---------------------------------------------------------------------------*/ - -#ifdef VMS -# include "vms/vmscfg.h" -#endif /* VMS */ - -/*--------------------------------------------------------------------------- - Win32 (Windows 95/NT) section: - ---------------------------------------------------------------------------*/ - -#if (defined(WIN32) && !defined(POCKET_UNZIP) && !defined(_WIN32_WCE)) -# include "win32/w32cfg.h" -#endif - -/*--------------------------------------------------------------------------- - Win32 Windows CE section (also POCKET_UNZIP) - ---------------------------------------------------------------------------*/ - -#if (defined(_WIN32_WCE) || defined(POCKET_UNZIP)) -# include "wince/wcecfg.h" -#endif - - - -/* ---------------------------------------------------------------------------- - MUST BE AFTER LARGE FILE INCLUDES - ---------------------------------------------------------------------------- */ -/* This stuff calls in types and messes up large file includes. It needs to - go after large file defines in local includes. - I am guessing that moving them here probably broke some ports, but hey. - 10/31/2004 EG */ -/* ---------------------------------------------------------------------------- - Common includes - ---------------------------------------------------------------------------- */ - -/* Some ports apply specific adjustments which must be in effect before - reading the "standard" include headers. - */ - -#ifdef EFT -# define Z_OFF_T off_t /* Amdahl UTS nonsense ("extended file types") */ -#else -#if (defined(UNIX) && defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) -# define Z_OFF_T off_t /* 64bit offsets to support 2GB < zipfile size < 4GB */ -#else -# define Z_OFF_T long long -#endif -#endif - -#ifndef ZOFF_T_DEFINED - typedef Z_OFF_T zoff_t; -# define ZOFF_T_DEFINED -#endif -#ifndef Z_STAT_DEFINED - typedef struct stat z_stat; -# define Z_STAT_DEFINED -#endif - -#ifndef MINIX /* Minix needs it after all the other includes (?) */ -# include -#endif - -#include /* skip for VMS, to use tolower() function? */ -#include /* used in mapname() */ -#ifdef USE_STRINGS_H -# include /* strcpy, strcmp, memcpy, index/rindex, etc. */ -#else -# include /* strcpy, strcmp, memcpy, strchr/strrchr, etc. */ -#endif -#if (defined(MODERN) && !defined(NO_LIMITS_H)) -# include /* MAX/MIN constant symbols for system types... */ -#endif - -/* this include must be down here for SysV.4, for some reason... */ -#include /* used in unzip.c, fileio.c */ - - -#ifdef MODERN -# ifndef NO_STDDEF_H -# include -# endif -# ifndef NO_STDLIB_H -# include /* standard library prototypes, malloc(), etc. */ -# endif - typedef size_t extent; -#else /* !MODERN */ -# ifndef AOS_VS /* mostly modern? */ - Z_OFF_T lseek(); -# ifdef VAXC /* not fully modern, but has stdlib.h and void */ -# include -# else - char *malloc(); -# endif /* ?VAXC */ -# endif /* !AOS_VS */ - typedef unsigned int extent; -#endif /* ?MODERN */ - - - - -/*************/ -/* Defines */ -/*************/ - -#define UNZIP_BZ2VERS 46 -#ifdef ZIP64_SUPPORT -# ifdef USE_BZIP2 -# define UNZIP_VERSION UNZIP_BZ2VERS -# else -# define UNZIP_VERSION 45 -# endif -#else -#ifdef USE_DEFLATE64 -# define UNZIP_VERSION 21 /* compatible with PKUNZIP 4.0 */ -#else -# define UNZIP_VERSION 20 /* compatible with PKUNZIP 2.0 */ -#endif -#endif -#define VMS_UNZIP_VERSION 42 /* if OS-needed-to-extract is VMS: can do */ - -#if (defined(MSDOS) || defined(OS2)) -# define DOS_OS2 -#endif - -#if (defined(OS2) || defined(WIN32)) -# define OS2_W32 -#endif - -#if (defined(DOS_OS2) || defined(WIN32)) -# define DOS_OS2_W32 -# define DOS_W32_OS2 /* historical: don't use */ -#endif - -#if (defined(DOS_OS2_W32) || defined(__human68k__)) -# define DOS_H68_OS2_W32 -#endif - -#if (defined(DOS_OS2) || defined(FLEXOS)) -# define DOS_FLX_OS2 -#endif - -#if (defined(DOS_OS2_W32) || defined(FLEXOS)) -# define DOS_FLX_OS2_W32 -#endif - -#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS)) -# define DOS_FLX_H68_OS2_W32 -#endif - -#if (defined(DOS_FLX_OS2) || defined(NLM)) -# define DOS_FLX_NLM_OS2 -#endif - -#if (defined(DOS_FLX_OS2_W32) || defined(NLM)) -# define DOS_FLX_NLM_OS2_W32 -#endif - -#if (defined(DOS_FLX_H68_OS2_W32) || defined(NLM)) -# define DOS_FLX_H68_NLM_OS2_W32 -#endif - -#if (defined(TOPS20) || defined(VMS)) -# define T20_VMS -#endif - -#if (defined(MSDOS) || defined(T20_VMS)) -# define DOS_T20_VMS -#endif - -#if (defined(__ATHEOS__) || defined(__BEOS__)) -# define ATH_BEO -#endif - -#if (defined(ATH_BEO) || defined(UNIX)) -# define ATH_BEO_UNX -#endif - -#if (defined(ATH_BEO_UNX) || defined(THEOS)) -# define ATH_BEO_THS_UNX -#endif - -/* clean up with a few defaults */ -#ifndef DIR_END -# define DIR_END '/' /* last char before program name or filename */ -#endif -#ifndef DATE_FORMAT -# ifdef DATEFMT_ISO_DEFAULT -# define DATE_FORMAT DF_YMD /* defaults to invariant ISO-style */ -# else -# define DATE_FORMAT DF_MDY /* defaults to US convention */ -# endif -#endif -#ifndef DATE_SEPCHAR -# define DATE_SEPCHAR '-' -#endif -#ifndef CLOSE_INFILE -# define CLOSE_INFILE() close(G.zipfd) -#endif -#ifndef RETURN -# define RETURN return /* only used in main() */ -#endif -#ifndef EXIT -# define EXIT exit -#endif -#ifndef USAGE -# define USAGE(ret) usage(__G__ (ret)) /* used in unzip.c, zipinfo.c */ -#endif -#ifndef TIMET_TO_NATIVE /* everybody but MSC 7.0 and Macintosh */ -# define TIMET_TO_NATIVE(x) -# define NATIVE_TO_TIMET(x) -#endif -#ifndef STRNICMP -# ifdef NO_STRNICMP -# define STRNICMP zstrnicmp -# else -# define STRNICMP strnicmp -# endif -#endif - - -#if (defined(DOS_FLX_NLM_OS2_W32) || defined(ATH_BEO_UNX) || defined(RISCOS)) -# ifndef HAVE_UNLINK -# define HAVE_UNLINK -# endif -#endif -#if (defined(AOS_VS) || defined(ATARI)) /* GRR: others? */ -# ifndef HAVE_UNLINK -# define HAVE_UNLINK -# endif -#endif - -/* OS-specific exceptions to the "ANSI <--> INT_SPRINTF" rule */ - -#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) -# if (defined(SYSV) || defined(CONVEX) || defined(NeXT) || defined(BSD4_4)) -# define INT_SPRINTF /* sprintf() returns int: SysVish/Posix */ -# endif -# if (defined(DOS_FLX_NLM_OS2_W32) || defined(VMS) || defined(AMIGA)) -# define INT_SPRINTF /* sprintf() returns int: ANSI */ -# endif -# if (defined(ultrix) || defined(__ultrix)) /* Ultrix 4.3 and newer */ -# if (defined(POSIX) || defined(__POSIX)) -# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ -# endif -# ifdef __GNUC__ -# define PCHAR_SPRINTF /* undetermined actual return value */ -# endif -# endif -# if (defined(__osf__) || defined(_AIX) || defined(CMS_MVS) || defined(THEOS)) -# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */ -# endif -# if defined(sun) -# define PCHAR_SPRINTF /* sprintf() returns char *: SunOS cc *and* gcc */ -# endif -#endif - -/* defaults that we hope will take care of most machines in the future */ - -#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF)) -# ifdef __STDC__ -# define INT_SPRINTF /* sprintf() returns int: ANSI */ -# endif -# ifndef INT_SPRINTF -# define PCHAR_SPRINTF /* sprintf() returns char *: BSDish */ -# endif -#endif - -#define MSG_STDERR(f) (f & 1) /* bit 0: 0 = stdout, 1 = stderr */ -#define MSG_INFO(f) ((f & 6) == 0) /* bits 1 and 2: 0 = info */ -#define MSG_WARN(f) ((f & 6) == 2) /* bits 1 and 2: 1 = warning */ -#define MSG_ERROR(f) ((f & 6) == 4) /* bits 1 and 2: 2 = error */ -#define MSG_FATAL(f) ((f & 6) == 6) /* bits 1 and 2: (3 = fatal error) */ -#define MSG_ZFN(f) (f & 0x0008) /* bit 3: 1 = print zipfile name */ -#define MSG_FN(f) (f & 0x0010) /* bit 4: 1 = print filename */ -#define MSG_LNEWLN(f) (f & 0x0020) /* bit 5: 1 = leading newline if !SOL */ -#define MSG_TNEWLN(f) (f & 0x0040) /* bit 6: 1 = trailing newline if !SOL */ -#define MSG_MNEWLN(f) (f & 0x0080) /* bit 7: 1 = trailing NL for prompts */ -/* the following are subject to change */ -#define MSG_NO_WGUI(f) (f & 0x0100) /* bit 8: 1 = skip if Windows GUI */ -#define MSG_NO_AGUI(f) (f & 0x0200) /* bit 9: 1 = skip if Acorn GUI */ -#define MSG_NO_DLL2(f) (f & 0x0400) /* bit 10: 1 = skip if OS/2 DLL */ -#define MSG_NO_NDLL(f) (f & 0x0800) /* bit 11: 1 = skip if WIN32 DLL */ -#define MSG_NO_WDLL(f) (f & 0x1000) /* bit 12: 1 = skip if Windows DLL */ - -#if (defined(MORE) && !defined(SCREENLINES)) -# ifdef DOS_FLX_NLM_OS2_W32 -# define SCREENLINES 25 /* can be (should be) a function instead */ -# else -# define SCREENLINES 24 /* VT-100s are assumed to be minimal hardware */ -# endif -#endif -#if (defined(MORE) && !defined(SCREENSIZE)) -# ifndef SCREENWIDTH -# define SCREENSIZE(scrrows, scrcols) { \ - if ((scrrows) != NULL) *(scrrows) = SCREENLINES; } -# else -# define SCREENSIZE(scrrows, scrcols) { \ - if ((scrrows) != NULL) *(scrrows) = SCREENLINES; \ - if ((scrcols) != NULL) *(scrcols) = SCREENWIDTH; } -# endif -#endif - -#if (defined(__16BIT__) || defined(MED_MEM) || defined(SMALL_MEM)) -# define DIR_BLKSIZ 64 /* number of directory entries per block - * (should fit in 4096 bytes, usually) */ -#else -# define DIR_BLKSIZ 16384 /* use more memory, to reduce long-range seeks */ -#endif - -#ifndef WSIZE -# ifdef USE_DEFLATE64 -# define WSIZE 65536L /* window size--must be a power of two, and */ -# else /* at least 64K for PKZip's deflate64 method */ -# define WSIZE 0x8000 /* window size--must be a power of two, and */ -# endif /* at least 32K for zip's deflate method */ -#endif - -#ifdef __16BIT__ -# ifndef INT_16BIT -# define INT_16BIT /* on 16-bit systems int size is 16 bits */ -# endif -#else -# define nearmalloc malloc -# define nearfree free -# if (!defined(__IBMC__) || !defined(OS2)) -# ifndef near -# define near -# endif -# ifndef far -# define far -# endif -# endif -#endif - -#if (defined(DYNALLOC_CRCTAB) && !defined(DYNAMIC_CRC_TABLE)) -# undef DYNALLOC_CRCTAB -#endif - -#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT)) -# undef DYNALLOC_CRCTAB /* not safe with reentrant code */ -#endif - -#if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB)) -# ifdef DYNALLOC_CRCTAB -# undef DYNALLOC_CRCTAB -# endif -#endif - -#if (defined(USE_ZLIB) && defined(ASM_CRC)) -# undef ASM_CRC -#endif - -#ifdef USE_ZLIB -# ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -# endif -# ifdef IZ_CRC_LE_OPTIMIZ -# undef IZ_CRC_LE_OPTIMIZ -# endif -#endif -#if (!defined(IZ_CRC_BE_OPTIMIZ) && !defined(IZ_CRC_LE_OPTIMIZ)) -# ifdef IZ_CRCOPTIM_UNFOLDTBL -# undef IZ_CRCOPTIM_UNFOLDTBL -# endif -#endif - -#ifndef INBUFSIZ -# if (defined(MED_MEM) || defined(SMALL_MEM)) -# define INBUFSIZ 2048 /* works for MS-DOS small model */ -# else -# define INBUFSIZ 8192 /* larger buffers for real OSes */ -# endif -#endif - -#if (defined(INT_16BIT) && (defined(USE_DEFLATE64) || lenEOL > 1)) - /* For environments using 16-bit integers OUTBUFSIZ must be limited to - * less than 64k (do_string() uses "unsigned" in calculations involving - * OUTBUFSIZ). This is achieved by defining MED_MEM when WSIZE = 64k (aka - * Deflate64 support enabled) or EOL markers contain multiple characters. - * (The rule gets applied AFTER the default rule for INBUFSIZ because it - * is not neccessary to reduce INBUFSIZE in this case.) - */ -# if (!defined(SMALL_MEM) && !defined(MED_MEM)) -# define MED_MEM -# endif -#endif - -/* Logic for case of small memory, length of EOL > 1: if OUTBUFSIZ == 2048, - * OUTBUFSIZ>>1 == 1024 and OUTBUFSIZ>>7 == 16; therefore rawbuf is 1008 bytes - * and transbuf 1040 bytes. Have room for 32 extra EOL chars; 1008/32 == 31.5 - * chars/line, smaller than estimated 35-70 characters per line for C source - * and normal text. Hence difference is sufficient for most "average" files. - * (Argument scales for larger OUTBUFSIZ.) - */ -#ifdef SMALL_MEM /* i.e., 16-bit OSes: MS-DOS, OS/2 1.x, etc. */ -# define LoadFarString(x) fLoadFarString(__G__ (x)) -# define LoadFarStringSmall(x) fLoadFarStringSmall(__G__ (x)) -# define LoadFarStringSmall2(x) fLoadFarStringSmall2(__G__ (x)) -# if (defined(_MSC_VER) && (_MSC_VER >= 600)) -# define zfstrcpy(dest, src) _fstrcpy((dest), (src)) -# define zfstrcmp(s1, s2) _fstrcmp((s1), (s2)) -# endif -# if !(defined(SFX) || defined(FUNZIP)) -# if (defined(_MSC_VER)) -# define zfmalloc(sz) _fmalloc((sz)) -# define zffree(x) _ffree(x) -# endif -# if (defined(__TURBOC__)) -# include -# define zfmalloc(sz) farmalloc((unsigned long)(sz)) -# define zffree(x) farfree(x) -# endif -# endif /* !(SFX || FUNZIP) */ -# ifndef Far -# define Far far /* __far only works for MSC 6.00, not 6.0a or Borland */ -# endif -# define OUTBUFSIZ INBUFSIZ -# if (lenEOL == 1) -# define RAWBUFSIZ (OUTBUFSIZ>>1) -# else -# define RAWBUFSIZ ((OUTBUFSIZ>>1) - (OUTBUFSIZ>>7)) -# endif -# define TRANSBUFSIZ (OUTBUFSIZ-RAWBUFSIZ) - typedef short shrint; /* short/int or "shrink int" (unshrink) */ -#else -# define zfstrcpy(dest, src) strcpy((dest), (src)) -# define zfstrcmp(s1, s2) strcmp((s1), (s2)) -# define zfmalloc malloc -# define zffree(x) free(x) -# ifdef QDOS -# define LoadFarString(x) Qstrfix(x) /* fix up _ for '.' */ -# define LoadFarStringSmall(x) Qstrfix(x) -# define LoadFarStringSmall2(x) Qstrfix(x) -# else -# define LoadFarString(x) (char *)(x) -# define LoadFarStringSmall(x) (char *)(x) -# define LoadFarStringSmall2(x) (char *)(x) -# endif -# ifdef MED_MEM -# define OUTBUFSIZ 0xFF80 /* can't malloc arrays of 0xFFE8 or more */ -# define TRANSBUFSIZ 0xFF80 - typedef short shrint; -# else -# define OUTBUFSIZ (lenEOL*WSIZE) /* more efficient text conversion */ -# define TRANSBUFSIZ (lenEOL*OUTBUFSIZ) -# ifdef AMIGA - typedef short shrint; -# else - typedef int shrint; /* for efficiency/speed, we hope... */ -# endif -# endif /* ?MED_MEM */ -# define RAWBUFSIZ OUTBUFSIZ -#endif /* ?SMALL_MEM */ - -#ifndef Far -# define Far -#endif - -#ifndef Cdecl -# define Cdecl -#endif - -#ifndef MAIN -# define MAIN main -#endif - -#ifdef SFX /* disable some unused features for SFX executables */ -# ifndef NO_ZIPINFO -# define NO_ZIPINFO -# endif -# ifdef TIMESTAMP -# undef TIMESTAMP -# endif -#endif - -#ifdef SFX -# ifdef CHEAP_SFX_AUTORUN -# ifndef NO_SFX_EXDIR -# define NO_SFX_EXDIR -# endif -# endif -# ifndef NO_SFX_EXDIR -# ifndef SFX_EXDIR -# define SFX_EXDIR -# endif -# else -# ifdef SFX_EXDIR -# undef SFX_EXDIR -# endif -# endif -#endif - -/* user may have defined both by accident... NOTIMESTAMP takes precedence */ -#if (defined(TIMESTAMP) && defined(NOTIMESTAMP)) -# undef TIMESTAMP -#endif - -#if (!defined(COPYRIGHT_CLEAN) && !defined(USE_SMITH_CODE)) -# define COPYRIGHT_CLEAN -#endif - -/* The LZW patent is expired worldwide since 2004-Jul-07, so USE_UNSHRINK - * is now enabled by default. See unshrink.c. - */ -#if (!defined(LZW_CLEAN) && !defined(USE_UNSHRINK)) -# define USE_UNSHRINK -#endif - -#ifndef O_BINARY -# define O_BINARY 0 -#endif - -#ifndef PIPE_ERROR -# ifndef EPIPE -# define EPIPE -1 -# endif -# define PIPE_ERROR (errno == EPIPE) -#endif - -/* File operations--use "b" for binary if allowed or fixed length 512 on VMS */ -#ifdef VMS -# define FOPR "r","ctx=stm" -# define FOPM "r+","ctx=stm","rfm=fix","mrs=512" -# define FOPW "w","ctx=stm","rfm=fix","mrs=512" -# define FOPWR "w+","ctx=stm","rfm=fix","mrs=512" -#endif /* VMS */ - -#ifdef CMS_MVS -/* Binary files must be RECFM=F,LRECL=1 for ftell() to get correct pos */ -/* ...unless byteseek is used. Let's try that for a while. */ -# define FOPR "rb,byteseek" -# define FOPM "r+b,byteseek" -# ifdef MVS -# define FOPW "wb,recfm=u,lrecl=32760,byteseek" /* New binary files */ -# define FOPWE "wb" /* Existing binary files */ -# define FOPWT "w,lrecl=133" /* New text files */ -# define FOPWTE "w" /* Existing text files */ -# else -# define FOPW "wb,recfm=v,lrecl=32760" -# define FOPWT "w" -# endif -#endif /* CMS_MVS */ - -#ifdef TOPS20 /* TOPS-20 MODERN? You kidding? */ -# define FOPW "w8" -#endif /* TOPS20 */ - -/* Defaults when nothing special has been defined previously. */ -#ifdef MODERN -# ifndef FOPR -# define FOPR "rb" -# endif -# ifndef FOPM -# define FOPM "r+b" -# endif -# ifndef FOPW -# define FOPW "wb" -# endif -# ifndef FOPWT -# define FOPWT "wt" -# endif -# ifndef FOPWR -# define FOPWR "w+b" -# endif -#else /* !MODERN */ -# ifndef FOPR -# define FOPR "r" -# endif -# ifndef FOPM -# define FOPM "r+" -# endif -# ifndef FOPW -# define FOPW "w" -# endif -# ifndef FOPWT -# define FOPWT "w" -# endif -# ifndef FOPWR -# define FOPWR "w+" -# endif -#endif /* ?MODERN */ - -/* - * If exists on most systems, should include that, since it may - * define some or all of the following: NAME_MAX, PATH_MAX, _POSIX_NAME_MAX, - * _POSIX_PATH_MAX. - */ -#ifdef DOS_FLX_NLM_OS2_W32 -# include -#endif - -/* 2008-07-22 SMS. - * Unfortunately, on VMS, exists, and is included by - * (so it's pretty much unavoidable), and it defines PATH_MAX to a fixed - * short value (256, correct only for older systems without ODS-5 support), - * rather than one based on the real RMS NAM[L] situation. So, we - * artificially undefine it here, to allow our better-defined _MAX_PATH - * (see vms/vmscfg.h) to be used. - */ -#ifdef VMS -# undef PATH_MAX -#endif - -#ifndef PATH_MAX -# ifdef MAXPATHLEN -# define PATH_MAX MAXPATHLEN /* in on some systems */ -# else -# ifdef _MAX_PATH -# define PATH_MAX _MAX_PATH -# else -# if FILENAME_MAX > 255 -# define PATH_MAX FILENAME_MAX /* used like PATH_MAX on some systems */ -# else -# define PATH_MAX 1024 -# endif -# endif /* ?_MAX_PATH */ -# endif /* ?MAXPATHLEN */ -#endif /* !PATH_MAX */ - -/* - * buffer size required to hold the longest legal local filepath - * (including the trailing '\0') - */ -#define FILNAMSIZ PATH_MAX - -#ifdef UNICODE_SUPPORT -# if !(defined(UTF8_MAYBE_NATIVE) || defined(UNICODE_WCHAR)) -# undef UNICODE_SUPPORT -# endif -#endif -/* 2007-09-18 SMS. - * Include here if it will be needed later for Unicode. - * Otherwise, SETLOCALE may be defined here, and then defined again - * (differently) when is read later. - */ -#ifdef UNICODE_SUPPORT -# ifdef UNICODE_WCHAR -# if !(defined(_WIN32_WCE) || defined(POCKET_UNZIP)) -# include -# endif -# endif -# ifndef _MBCS /* no need to include twice, see below */ -# include -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -# endif -#endif /* UNICODE_SUPPORT */ - -/* DBCS support for Info-ZIP (mainly for japanese (-: ) - * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) - */ -#ifdef _MBCS -# include - /* Multi Byte Character Set */ -# define ___MBS_TMP_DEF char *___tmp_ptr; -# define ___TMP_PTR ___tmp_ptr -# ifndef CLEN -# define NEED_UZMBCLEN -# define CLEN(ptr) (int)uzmbclen((ZCONST unsigned char *)(ptr)) -# endif -# ifndef PREINCSTR -# define PREINCSTR(ptr) (ptr += CLEN(ptr)) -# endif -# define POSTINCSTR(ptr) (___TMP_PTR=(char *)(ptr), PREINCSTR(ptr),___TMP_PTR) - char *plastchar OF((ZCONST char *ptr, extent len)); -# define lastchar(ptr, len) ((int)(unsigned)*plastchar(ptr, len)) -# ifndef MBSCHR -# define NEED_UZMBSCHR -# define MBSCHR(str,c) (char *)uzmbschr((ZCONST unsigned char *)(str), c) -# endif -# ifndef MBSRCHR -# define NEED_UZMBSRCHR -# define MBSRCHR(str,c) (char *)uzmbsrchr((ZCONST unsigned char *)(str), c) -# endif -# ifndef SETLOCALE -# define SETLOCALE(category, locale) setlocale(category, locale) -# endif -#else /* !_MBCS */ -# define ___MBS_TMP_DEF -# define ___TMP_PTR -# define CLEN(ptr) 1 -# define PREINCSTR(ptr) (++(ptr)) -# define POSTINCSTR(ptr) ((ptr)++) -# define plastchar(ptr, len) (&ptr[(len)-1]) -# define lastchar(ptr, len) (ptr[(len)-1]) -# define MBSCHR(str, c) strchr(str, c) -# define MBSRCHR(str, c) strrchr(str, c) -# ifndef SETLOCALE -# define SETLOCALE(category, locale) -# endif -#endif /* ?_MBCS */ -#define INCSTR(ptr) PREINCSTR(ptr) - - -#if (defined(MALLOC_WORK) && !defined(MY_ZCALLOC)) - /* Any system without a special calloc function */ -# ifndef zcalloc -# define zcalloc(items, size) \ - (zvoid far *)calloc((unsigned)(items), (unsigned)(size)) -# endif -# ifndef zcfree -# define zcfree free -# endif -#endif /* MALLOC_WORK && !MY_ZCALLOC */ - -#if (defined(CRAY) && defined(ZMEM)) -# undef ZMEM -#endif - -#ifdef ZMEM -# undef ZMEM -# define memcmp(b1,b2,len) bcmp(b2,b1,len) -# define memcpy(dest,src,len) bcopy(src,dest,len) -# define memzero bzero -#else -# define memzero(dest,len) memset(dest,0,len) -#endif - -#ifndef TRUE -# define TRUE 1 /* sort of obvious */ -#endif -#ifndef FALSE -# define FALSE 0 -#endif - -#ifndef SEEK_SET -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 -#endif - -#if (!defined(S_IEXEC) && defined(S_IXUSR)) -# define S_IEXEC S_IXUSR -#endif - -#if (defined(UNIX) && defined(S_IFLNK) && !defined(MTS)) -# define SYMLINKS -# ifndef S_ISLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -# endif -#endif /* UNIX && S_IFLNK && !MTS */ - -#ifndef S_ISDIR -# ifdef CMS_MVS -# define S_ISDIR(m) (FALSE) -# else -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# endif -#endif - -#ifndef IS_VOLID -# define IS_VOLID(m) ((m) & 0x08) -#endif - -/***********************************/ -/* LARGE_FILE_SUPPORT */ -/***********************************/ -/* This whole section lifted from Zip 3b tailor.h - - * Types are in OS dependent headers (eg, w32cfg.h) - * - * LARGE_FILE_SUPPORT and ZIP64_SUPPORT are automatically - * set in OS dependent headers (for some ports) based on the port and compiler. - * - * Function prototypes are below as OF is defined earlier in this file - * but after OS dependent header is included. - * - * E. Gordon 9/21/2003 - * Updated 1/28/2004 - * Lifted and placed here 6/7/2004 - Myles Bennett - */ -#ifdef LARGE_FILE_SUPPORT - /* 64-bit Large File Support */ - -/* ---------------------------- */ - -# if defined(UNIX) || defined(VMS) - - /* 64-bit stat functions */ -# define zstat stat -# define zfstat fstat - - /* 64-bit fseeko */ -# define zlseek lseek -# define zfseeko fseeko - - /* 64-bit ftello */ -# define zftello ftello - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif /* UNIX || VMS */ - -/* ---------------------------- */ - -# ifdef WIN32 - -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__LCC__) - /* MS C (VC), MinGW GCC port and LCC-32 use the MS C Runtime lib */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - - /* 64-bit lseek */ -# define zlseek _lseeki64 - -# if defined(_MSC_VER) && (_MSC_VER >= 1400) - /* Beginning with VS 8.0 (Visual Studio 2005, MSC 14), the Microsoft - C rtl publishes its (previously internal) implmentations of - "fseeko" and "ftello" for 64-bit file offsets. */ - /* 64-bit fseeko */ -# define zfseeko _fseeki64 - /* 64-bit ftello */ -# define zftello _ftelli64 - -# else /* not (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ - -# if defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ >= 0x800) - /* Up-to-date versions of MinGW define the macro __MSVCRT_VERSION__ - to denote the version of the MS C rtl dll used for linking. When - configured to link against the runtime of MS Visual Studio 8 (or - newer), the built-in 64-bit fseek/ftell functions are available. */ - /* 64-bit fseeko */ -# define zfseeko _fseeki64 - /* 64-bit ftello */ -# define zftello _ftelli64 - -# else /* !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__>=0x800)) */ - /* The version of the C runtime is lower than MSC 14 or unknown. */ - - /* The newest MinGW port contains built-in extensions to the MSC rtl - that provide fseeko and ftello, but our implementations will do - for now. */ - /* 64-bit fseeko */ - int zfseeko OF((FILE *, zoff_t, int)); - - /* 64-bit ftello */ - zoff_t zftello OF((FILE *)); - -# endif /* ? (__MSVCRT_VERSION__ >= 0x800) */ -# endif /* ? (_MSC_VER >= 1400) */ - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif /* _MSC_VER || __MINGW__ || __LCC__ */ - -# ifdef __CYGWIN__ - /* CYGWIN GCC Posix emulator on Windows - (configuration not yet finished/tested) */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - - /* 64-bit lseek */ -# define zlseek _lseeki64 - - /* 64-bit fseeko */ -# define zfseeko fseeko - - /* 64-bit ftello */ -# define zftello ftello - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif -# if defined(__WATCOMC__) || defined(__BORLANDC__) - /* WATCOM C and Borland C provide their own C runtime libraries, - but they are sufficiently compatible with MS CRTL. */ - - /* 64-bit stat functions */ -# define zstat _stati64 -# define zfstat _fstati64 - -# ifdef __WATCOMC__ - /* 64-bit lseek */ -# define zlseek _lseeki64 -# endif - - /* 64-bit fseeko */ - int zfseeko OF((FILE *, zoff_t, int)); - - /* 64-bit ftello */ - zoff_t zftello OF((FILE *)); - - /* 64-bit fopen */ -# define zfopen fopen -# define zfdopen fdopen - -# endif -# ifdef __IBMC__ - /* IBM C */ - - /* 64-bit stat functions */ - - /* 64-bit fseeko */ - - /* 64-bit ftello */ - - /* 64-bit fopen */ - -# endif - -# endif /* WIN32 */ - -#else - /* No Large File Support */ - -# ifndef REGULUS /* returns the inode number on success(!)...argh argh argh */ -# define zstat stat -# endif -# define zfstat fstat -# define zlseek lseek -# define zfseeko fseek -# define zftello ftell -# define zfopen fopen -# define zfdopen fdopen - -# if defined(UNIX) || defined(VMS) || defined(WIN32) - /* For these systems, implement "64bit file vs. 32bit prog" check */ -# ifndef DO_SAFECHECK_2GB -# define DO_SAFECHECK_2GB -# endif -# endif - -#endif - -/* No "64bit file vs. 32bit prog" check for SFX stub, to save space */ -#if (defined(DO_SAFECHECK_2GB) && defined(SFX)) -# undef DO_SAFECHECK_2GB -#endif - -#ifndef SSTAT -# ifdef WILD_STAT_BUG -# define SSTAT(path,pbuf) (iswild(path) || zstat(path,pbuf)) -# else -# define SSTAT zstat -# endif -#endif - - -/* Default fzofft() format selection. */ - -#ifndef FZOFFT_FMT - -# ifdef LARGE_FILE_SUPPORT -# define FZOFFT_FMT "ll" -# define FZOFFT_HEX_WID_VALUE "16" -# else /* def LARGE_FILE_SUPPORT */ -# define FZOFFT_FMT "l" -# define FZOFFT_HEX_WID_VALUE "8" -# endif /* def LARGE_FILE_SUPPORT */ - -#endif /* ndef FZOFFT_FMT */ - -#define FZOFFT_HEX_WID ((char *) -1) -#define FZOFFT_HEX_DOT_WID ((char *) -2) - -#define FZOFFT_NUM 4 /* Number of chambers. */ -#define FZOFFT_LEN 24 /* Number of characters/chamber. */ - - -#ifdef SHORT_SYMS /* Mark Williams C, ...? */ -# define extract_or_test_files xtr_or_tst_files -# define extract_or_test_member xtr_or_tst_member -#endif - -#ifdef REALLY_SHORT_SYMS /* TOPS-20 linker: first 6 chars */ -# define process_cdir_file_hdr XXpcdfh -# define process_local_file_hdr XXplfh -# define extract_or_test_files XXxotf /* necessary? */ -# define extract_or_test_member XXxotm /* necessary? */ -# define check_for_newer XXcfn -# define overwrite_all XXoa -# define process_all_files XXpaf -# define extra_field XXef -# define explode_lit8 XXel8 -# define explode_lit4 XXel4 -# define explode_nolit8 XXnl8 -# define explode_nolit4 XXnl4 -# define cpdist8 XXcpdist8 -# define inflate_codes XXic -# define inflate_stored XXis -# define inflate_fixed XXif -# define inflate_dynamic XXid -# define inflate_block XXib -# define maxcodemax XXmax -#endif - -#ifndef S_TIME_T_MAX /* max value of signed (>= 32-bit) time_t */ -# define S_TIME_T_MAX ((time_t)(ulg)0x7fffffffL) -#endif -#ifndef U_TIME_T_MAX /* max value of unsigned (>= 32-bit) time_t */ -# define U_TIME_T_MAX ((time_t)(ulg)0xffffffffL) -#endif -#ifdef DOSTIME_MINIMUM /* min DOSTIME value (1980-01-01) */ -# undef DOSTIME_MINIMUM -#endif -#define DOSTIME_MINIMUM ((ulg)0x00210000L) -#ifdef DOSTIME_2038_01_18 /* approximate DOSTIME equivalent of */ -# undef DOSTIME_2038_01_18 /* the signed-32-bit time_t limit */ -#endif -#define DOSTIME_2038_01_18 ((ulg)0x74320000L) - -#ifdef QDOS -# define ZSUFX "_zip" -# define ALT_ZSUFX ".zip" -#else -# ifdef RISCOS -# define ZSUFX "/zip" -# else -# define ZSUFX ".zip" -# endif -# define ALT_ZSUFX ".ZIP" /* Unix-only so far (only case-sensitive fs) */ -#endif - -#define CENTRAL_HDR_SIG "\001\002" /* the infamous "PK" signature bytes, */ -#define LOCAL_HDR_SIG "\003\004" /* w/o "PK" (so unzip executable not */ -#define END_CENTRAL_SIG "\005\006" /* mistaken for zipfile itself) */ -#define EXTD_LOCAL_SIG "\007\010" /* [ASCII "\113" == EBCDIC "\080" ??] */ - -/** internal-only return codes **/ -#define IZ_DIR 76 /* potential zipfile is a directory */ -/* special return codes for mapname() */ -#define MPN_OK 0 /* mapname successful */ -#define MPN_INF_TRUNC (1<<8) /* caution - filename truncated */ -#define MPN_INF_SKIP (2<<8) /* info - skipped because nothing to do */ -#define MPN_ERR_SKIP (3<<8) /* error - entry skipped */ -#define MPN_ERR_TOOLONG (4<<8) /* error - path too long */ -#define MPN_NOMEM (10<<8) /* error - out of memory, file skipped */ -#define MPN_CREATED_DIR (16<<8) /* directory created: set time & permission */ -#define MPN_VOL_LABEL (17<<8) /* volume label, but can't set on hard disk */ -#define MPN_INVALID (99<<8) /* internal logic error, should never reach */ -/* mask for internal mapname&checkdir return codes */ -#define MPN_MASK 0x7F00 -/* error code for extracting/testing extra field blocks */ -#define IZ_EF_TRUNC 79 /* local extra field truncated (PKZIP'd) */ - -/* choice of activities for do_string() */ -#define SKIP 0 /* skip header block */ -#define DISPLAY 1 /* display archive comment (ASCII) */ -#define DISPL_8 5 /* display file comment (ext. ASCII) */ -#define DS_FN 2 /* read filename (ext. ASCII, chead) */ -#define DS_FN_C 2 /* read filename from central header */ -#define DS_FN_L 6 /* read filename from local header */ -#define EXTRA_FIELD 3 /* copy extra field into buffer */ -#define DS_EF 3 -#ifdef AMIGA -# define FILENOTE 4 /* convert file comment to filenote */ -#endif -#if (defined(SFX) && defined(CHEAP_SFX_AUTORUN)) -# define CHECK_AUTORUN 7 /* copy command, display remainder */ -# define CHECK_AUTORUN_Q 8 /* copy command, skip remainder */ -#endif - -#define DOES_NOT_EXIST -1 /* return values for check_for_newer() */ -#define EXISTS_AND_OLDER 0 -#define EXISTS_AND_NEWER 1 - -#define OVERWRT_QUERY 0 /* status values for G.overwrite_mode */ -#define OVERWRT_ALWAYS 1 -#define OVERWRT_NEVER 2 - -#define IS_OVERWRT_ALL (G.overwrite_mode == OVERWRT_ALWAYS) -#define IS_OVERWRT_NONE (G.overwrite_mode == OVERWRT_NEVER) - -#ifdef VMS - /* return codes for VMS-specific open_outfile() function */ -# define OPENOUT_OK 0 /* file openend normally */ -# define OPENOUT_FAILED 1 /* file open failed */ -# define OPENOUT_SKIPOK 2 /* file not opened, skip at error level OK */ -# define OPENOUT_SKIPWARN 3 /* file not opened, skip at error level WARN */ -#endif /* VMS */ - -#define ROOT 0 /* checkdir() extract-to path: called once */ -#define INIT 1 /* allocate buildpath: called once per member */ -#define APPEND_DIR 2 /* append a dir comp.: many times per member */ -#define APPEND_NAME 3 /* append actual filename: once per member */ -#define GETPATH 4 /* retrieve the complete path and free it */ -#define END 5 /* free root path prior to exiting program */ - -/* version_made_by codes (central dir): make sure these */ -/* are not defined on their respective systems!! */ -#define FS_FAT_ 0 /* filesystem used by MS-DOS, OS/2, Win32 */ -#define AMIGA_ 1 -#define VMS_ 2 -#define UNIX_ 3 -#define VM_CMS_ 4 -#define ATARI_ 5 /* what if it's a minix filesystem? [cjh] */ -#define FS_HPFS_ 6 /* filesystem used by OS/2 (and NT 3.x) */ -#define MAC_ 7 /* HFS filesystem used by MacOS */ -#define Z_SYSTEM_ 8 -#define CPM_ 9 -#define TOPS20_ 10 -#define FS_NTFS_ 11 /* filesystem used by Windows NT */ -#define QDOS_ 12 -#define ACORN_ 13 /* Archimedes Acorn RISC OS */ -#define FS_VFAT_ 14 /* filesystem used by Windows 95, NT */ -#define MVS_ 15 -#define BEOS_ 16 /* hybrid POSIX/database filesystem */ -#define TANDEM_ 17 /* Tandem NSK */ -#define THEOS_ 18 /* THEOS */ -#define MAC_OSX_ 19 /* Mac OS/X (Darwin) */ -#define ATHEOS_ 30 /* AtheOS */ -#define NUM_HOSTS 31 /* index of last system + 1 */ -/* don't forget to update zipinfo.c appropiately if NUM_HOSTS changes! */ - -#define STORED 0 /* compression methods */ -#define SHRUNK 1 -#define REDUCED1 2 -#define REDUCED2 3 -#define REDUCED3 4 -#define REDUCED4 5 -#define IMPLODED 6 -#define TOKENIZED 7 -#define DEFLATED 8 -#define ENHDEFLATED 9 -#define DCLIMPLODED 10 -#define BZIPPED 12 -#define LZMAED 14 -#define IBMTERSED 18 -#define IBMLZ77ED 19 -#define WAVPACKED 97 -#define PPMDED 98 -#define NUM_METHODS 17 /* number of known method IDs */ -/* don't forget to update list.c (list_files()), extract.c and zipinfo.c - * appropriately if NUM_METHODS changes */ - -/* (the PK-class error codes are public and have been moved into unzip.h) */ - -#define DF_MDY 0 /* date format 10/26/91 (USA only) */ -#define DF_DMY 1 /* date format 26/10/91 (most of the world) */ -#define DF_YMD 2 /* date format 91/10/26 (a few countries) */ - -/*--------------------------------------------------------------------------- - Extra-field block ID values and offset info. - ---------------------------------------------------------------------------*/ -/* extra-field ID values, all little-endian: */ -#define EF_PKSZ64 0x0001 /* PKWARE's 64-bit filesize extensions */ -#define EF_AV 0x0007 /* PKWARE's authenticity verification */ -#define EF_EFS 0x0008 /* PKWARE's extended language encoding */ -#define EF_OS2 0x0009 /* OS/2 extended attributes */ -#define EF_PKW32 0x000a /* PKWARE's Win95/98/WinNT filetimes */ -#define EF_PKVMS 0x000c /* PKWARE's VMS */ -#define EF_PKUNIX 0x000d /* PKWARE's Unix */ -#define EF_PKFORK 0x000e /* PKWARE's future stream/fork descriptors */ -#define EF_PKPATCH 0x000f /* PKWARE's patch descriptor */ -#define EF_PKPKCS7 0x0014 /* PKWARE's PKCS#7 store for X.509 Certs */ -#define EF_PKFX509 0x0015 /* PKWARE's file X.509 Cert&Signature ID */ -#define EF_PKCX509 0x0016 /* PKWARE's central dir X.509 Cert ID */ -#define EF_PKENCRHD 0x0017 /* PKWARE's Strong Encryption header */ -#define EF_PKRMCTL 0x0018 /* PKWARE's Record Management Controls*/ -#define EF_PKLSTCS7 0x0019 /* PKWARE's PKCS#7 Encr. Recipient Cert List */ -#define EF_PKIBM 0x0065 /* PKWARE's IBM S/390 & AS/400 attributes */ -#define EF_PKIBM2 0x0066 /* PKWARE's IBM S/390 & AS/400 compr. attribs */ -#define EF_IZVMS 0x4d49 /* Info-ZIP's VMS ("IM") */ -#define EF_IZUNIX 0x5855 /* Info-ZIP's first Unix[1] ("UX") */ -#define EF_IZUNIX2 0x7855 /* Info-ZIP's second Unix[2] ("Ux") */ -#define EF_IZUNIX3 0x7875 /* Info-ZIP's newest Unix[3] ("ux") */ -#define EF_TIME 0x5455 /* universal timestamp ("UT") */ -#define EF_UNIPATH 0x7075 /* Info-ZIP Unicode Path ("up") */ -#define EF_UNICOMNT 0x6375 /* Info-ZIP Unicode Comment ("uc") */ -#define EF_MAC3 0x334d /* Info-ZIP's new Macintosh (= "M3") */ -#define EF_JLMAC 0x07c8 /* Johnny Lee's old Macintosh (= 1992) */ -#define EF_ZIPIT 0x2605 /* Thomas Brown's Macintosh (ZipIt) */ -#define EF_ZIPIT2 0x2705 /* T. Brown's Mac (ZipIt) v 1.3.8 and newer ? */ -#define EF_SMARTZIP 0x4d63 /* Mac SmartZip by Marco Bambini */ -#define EF_VMCMS 0x4704 /* Info-ZIP's VM/CMS ("\004G") */ -#define EF_MVS 0x470f /* Info-ZIP's MVS ("\017G") */ -#define EF_ACL 0x4c41 /* (OS/2) access control list ("AL") */ -#define EF_NTSD 0x4453 /* NT security descriptor ("SD") */ -#define EF_ATHEOS 0x7441 /* AtheOS ("At") */ -#define EF_BEOS 0x6542 /* BeOS ("Be") */ -#define EF_QDOS 0xfb4a /* SMS/QDOS ("J\373") */ -#define EF_AOSVS 0x5356 /* AOS/VS ("VS") */ -#define EF_SPARK 0x4341 /* David Pilling's Acorn/SparkFS ("AC") */ -#define EF_TANDEM 0x4154 /* Tandem NSK ("TA") */ -#define EF_THEOS 0x6854 /* Jean-Michel Dubois' Theos "Th" */ -#define EF_THEOSO 0x4854 /* old Theos port */ -#define EF_MD5 0x4b46 /* Fred Kantor's MD5 ("FK") */ -#define EF_ASIUNIX 0x756e /* ASi's Unix ("nu") */ - -#define EB_HEADSIZE 4 /* length of extra field block header */ -#define EB_ID 0 /* offset of block ID in header */ -#define EB_LEN 2 /* offset of data length field in header */ -#define EB_UCSIZE_P 0 /* offset of ucsize field in compr. data */ -#define EB_CMPRHEADLEN 6 /* lenght of compression header */ - -#define EB_UX_MINLEN 8 /* minimal "UX" field contains atime, mtime */ -#define EB_UX_FULLSIZE 12 /* full "UX" field (atime, mtime, uid, gid) */ -#define EB_UX_ATIME 0 /* offset of atime in "UX" extra field data */ -#define EB_UX_MTIME 4 /* offset of mtime in "UX" extra field data */ -#define EB_UX_UID 8 /* byte offset of UID in "UX" field data */ -#define EB_UX_GID 10 /* byte offset of GID in "UX" field data */ - -#define EB_UX2_MINLEN 4 /* minimal "Ux" field contains UID/GID */ -#define EB_UX2_UID 0 /* byte offset of UID in "Ux" field data */ -#define EB_UX2_GID 2 /* byte offset of GID in "Ux" field data */ -#define EB_UX2_VALID (1 << 8) /* UID/GID present */ - -#define EB_UX3_MINLEN 7 /* minimal "ux" field size (2-byte UID/GID) */ - -#define EB_UT_MINLEN 1 /* minimal UT field contains Flags byte */ -#define EB_UT_FLAGS 0 /* byte offset of Flags field */ -#define EB_UT_TIME1 1 /* byte offset of 1st time value */ -#define EB_UT_FL_MTIME (1 << 0) /* mtime present */ -#define EB_UT_FL_ATIME (1 << 1) /* atime present */ -#define EB_UT_FL_CTIME (1 << 2) /* ctime present */ - -#define EB_FLGS_OFFS 4 /* offset of flags area in generic compressed - extra field blocks (BEOS, MAC, and others) */ -#define EB_OS2_HLEN 4 /* size of OS2/ACL compressed data header */ -#define EB_BEOS_HLEN 5 /* length of BeOS&AtheOS e.f attribute header */ -#define EB_BE_FL_UNCMPR 0x01 /* "BeOS&AtheOS attribs uncompr." bit flag */ -#define EB_MAC3_HLEN 14 /* length of Mac3 attribute block header */ -#define EB_SMARTZIP_HLEN 64 /* fixed length of the SmartZip extra field */ -#define EB_M3_FL_DATFRK 0x01 /* "this entry is data fork" flag */ -#define EB_M3_FL_UNCMPR 0x04 /* "Mac3 attributes uncompressed" bit flag */ -#define EB_M3_FL_TIME64 0x08 /* "Mac3 time fields are 64 bit wide" flag */ -#define EB_M3_FL_NOUTC 0x10 /* "Mac3 timezone offset fields missing" flag */ - -#define EB_NTSD_C_LEN 4 /* length of central NT security data */ -#define EB_NTSD_L_LEN 5 /* length of minimal local NT security data */ -#define EB_NTSD_VERSION 4 /* offset of NTSD version byte */ -#define EB_NTSD_MAX_VER (0) /* maximum version # we know how to handle */ - -#define EB_ASI_CRC32 0 /* offset of ASI Unix field's crc32 checksum */ -#define EB_ASI_MODE 4 /* offset of ASI Unix permission mode field */ - -#define EB_IZVMS_HLEN 12 /* length of IZVMS attribute block header */ -#define EB_IZVMS_FLGS 4 /* offset of compression type flag */ -#define EB_IZVMS_UCSIZ 6 /* offset of ucsize field in IZVMS header */ -#define EB_IZVMS_BCMASK 07 /* 3 bits for compression type */ -#define EB_IZVMS_BCSTOR 0 /* Stored */ -#define EB_IZVMS_BC00 1 /* 0byte -> 0bit compression */ -#define EB_IZVMS_BCDEFL 2 /* Deflated */ - - -/*--------------------------------------------------------------------------- - True sizes of the various headers (excluding their 4-byte signatures), - as defined by PKWARE--so it is not likely that these will ever change. - But if they do, make sure both these defines AND the typedefs below get - updated accordingly. - - 12/27/2006 - The Zip64 End Of Central Directory record is variable size and now - comes in two flavors, version 1 and the new version 2 that supports - central directory encryption. We only use the old fields at the - top of the Zip64 EOCDR, and this block is a fixed size still, but - need to be aware of the stuff following. - ---------------------------------------------------------------------------*/ -#define LREC_SIZE 26 /* lengths of local file headers, central */ -#define CREC_SIZE 42 /* directory headers, end-of-central-dir */ -#define ECREC_SIZE 18 /* record, zip64 end-of-cent-dir locator */ -#define ECLOC64_SIZE 16 /* and zip64 end-of-central-dir record, */ -#define ECREC64_SIZE 52 /* respectively */ - -#define MAX_BITS 13 /* used in unshrink() */ -#define HSIZE (1 << MAX_BITS) /* size of global work area */ - -#define LF 10 /* '\n' on ASCII machines; must be 10 due to EBCDIC */ -#define CR 13 /* '\r' on ASCII machines; must be 13 due to EBCDIC */ -#define CTRLZ 26 /* DOS & OS/2 EOF marker (used in fileio.c, vms.c) */ - -#ifdef EBCDIC -# define foreign(c) ascii[(uch)(c)] -# define native(c) ebcdic[(uch)(c)] -# define NATIVE "EBCDIC" -# define NOANSIFILT -#endif - -#ifdef VMS -# define ENV_UNZIP "UNZIP_OPTS" /* names of environment variables */ -# define ENV_ZIPINFO "ZIPINFO_OPTS" -#endif /* VMS */ -#ifdef RISCOS -# define ENV_UNZIP "Unzip$Options" -# define ENV_ZIPINFO "Zipinfo$Options" -# define ENV_UNZIPEXTS "Unzip$Exts" -#endif /* RISCOS */ -#ifndef ENV_UNZIP -# define ENV_UNZIP "UNZIP" /* the standard names */ -# define ENV_ZIPINFO "ZIPINFO" -#endif -#define ENV_UNZIP2 "UNZIPOPT" /* alternate names, for zip compat. */ -#define ENV_ZIPINFO2 "ZIPINFOOPT" - -#if (!defined(QQ) && !defined(NOQQ)) -# define QQ -#endif - -#ifdef QQ /* Newtware version: no file */ -# define QCOND (!uO.qflag) /* comments with -vq or -vqq */ -#else /* Bill Davidsen version: no way to */ -# define QCOND (longhdr) /* kill file comments when listing */ -#endif - -#ifdef OLD_QQ -# define QCOND2 (uO.qflag < 2) -#else -# define QCOND2 (!uO.qflag) -#endif - -#ifdef WILD_STOP_AT_DIR -# define __WDLPRO , int sepc -# define __WDL , sepc -# define __WDLDEF int sepc; -# define WISEP , (uO.W_flag ? '/' : '\0') -#else -# define __WDLPRO -# define __WDL -# define __WDLDEF -# define WISEP -#endif - - - - -/**************/ -/* Typedefs */ -/**************/ - -#ifdef ZIP64_SUPPORT -# ifndef Z_UINT8_DEFINED -# if (defined(__GNUC__) || defined(__hpux) || defined(__SUNPRO_C)) - typedef unsigned long long z_uint8; -# else - typedef unsigned __int64 z_uint8; -# endif -# define Z_UINT8_DEFINED -# endif -#endif -#ifndef Z_UINT4_DEFINED -# if (defined(MODERN) && !defined(NO_LIMITS_H)) -# if (defined(UINT_MAX) && (UINT_MAX == 0xffffffffUL)) - typedef unsigned int z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(ULONG_MAX) && (ULONG_MAX == 0xffffffffUL)) - typedef unsigned long z_uint4; -# define Z_UINT4_DEFINED -# else -# if (defined(USHRT_MAX) && (USHRT_MAX == 0xffffffffUL)) - typedef unsigned short z_uint4; -# define Z_UINT4_DEFINED -# endif -# endif -# endif -# endif /* MODERN && !NO_LIMITS_H */ -#endif /* !Z_UINT4_DEFINED */ -#ifndef Z_UINT4_DEFINED - typedef ulg z_uint4; -# define Z_UINT4_DEFINED -#endif - -/* The following three user-defined unsigned integer types are used for - holding zipfile entities (required widths without / with Zip64 support): - a) sizes and offset of zipfile entries - (4 bytes / 8 bytes) - b) enumeration and counts of zipfile entries - (2 bytes / 8 bytes) - Remark: internally, we use 4 bytes for archive member counting in the - No-Zip64 case, because UnZip supports more than 64k entries for - classic Zip archives without Zip64 extensions. - c) enumeration and counts of zipfile volumes of multivolume archives - (2 bytes / 4 bytes) - */ -#ifdef ZIP64_SUPPORT - typedef z_uint8 zusz_t; /* zipentry sizes & offsets */ - typedef z_uint8 zucn_t; /* archive entry counts */ - typedef z_uint4 zuvl_t; /* multivolume numbers */ -# define MASK_ZUCN64 (~(zucn_t)0) -/* In case we ever get to support an environment where z_uint8 may be WIDER - than 64 bit wide, we will have to apply a construct similar to - #define MASK_ZUCN64 (~(zucn_t)0 & (zucn_t)0xffffffffffffffffULL) - for the 64-bit mask. - */ -#else - typedef ulg zusz_t; /* zipentry sizes & offsets */ - typedef unsigned int zucn_t; /* archive entry counts */ - typedef unsigned short zuvl_t; /* multivolume numbers */ -# define MASK_ZUCN64 (~(zucn_t)0) -#endif -#define MASK_ZUCN16 ((zucn_t)0xFFFF) - -#ifdef NO_UID_GID -# ifdef UID_USHORT - typedef unsigned short uid_t; /* TI SysV.3 */ - typedef unsigned short gid_t; -# else - typedef unsigned int uid_t; /* SCO Xenix */ - typedef unsigned int gid_t; -# endif -#endif - -#if (defined(GOT_UTIMBUF) || defined(sgi) || defined(ATARI)) - typedef struct utimbuf ztimbuf; -#else - typedef struct ztimbuf { - time_t actime; /* new access time */ - time_t modtime; /* new modification time */ - } ztimbuf; -#endif - -typedef struct iztimes { - time_t atime; /* new access time */ - time_t mtime; /* new modification time */ - time_t ctime; /* used for creation time; NOT same as st_ctime */ -} iztimes; - -#ifdef SET_DIR_ATTRIB - typedef struct direntry { /* head of system-specific struct holding */ - struct direntry *next; /* defered directory attributes info */ - char *fn; /* filename of directory */ - char buf[1]; /* start of system-specific internal data */ - } direntry; -#endif /* SET_DIR_ATTRIB */ - -#ifdef SYMLINKS - typedef struct slinkentry { /* info for deferred symlink creation */ - struct slinkentry *next; /* pointer to next entry in chain */ - extent targetlen; /* length of target filespec */ - extent attriblen; /* length of system-specific attrib data */ - char *target; /* pointer to target filespec */ - char *fname; /* pointer to name of link */ - char buf[1]; /* data/name/link buffer */ - } slinkentry; -#endif /* SYMLINKS */ - -typedef struct min_info { - zoff_t offset; - zusz_t compr_size; /* compressed size (needed if extended header) */ - zusz_t uncompr_size; /* uncompressed size (needed if extended header) */ - ulg crc; /* crc (needed if extended header) */ - zuvl_t diskstart; /* no of volume where this entry starts */ - uch hostver; - uch hostnum; - unsigned file_attr; /* local flavor, as used by creat(), chmod()... */ - unsigned encrypted : 1; /* file encrypted: decrypt before uncompressing */ - unsigned ExtLocHdr : 1; /* use time instead of CRC for decrypt check */ - unsigned textfile : 1; /* file is text (according to zip) */ - unsigned textmode : 1; /* file is to be extracted as text */ - unsigned lcflag : 1; /* convert filename to lowercase */ - unsigned vollabel : 1; /* "file" is an MS-DOS volume (disk) label */ -#ifdef SYMLINKS - unsigned symlink : 1; /* file is a symbolic link */ -#endif - unsigned HasUxAtt : 1; /* crec ext_file_attr has Unix style mode bits */ -#ifdef UNICODE_SUPPORT - unsigned GPFIsUTF8: 1; /* crec gen_purpose_flag UTF-8 bit 11 is set */ -#endif -#ifndef SFX - char Far *cfilname; /* central header version of filename */ -#endif -} min_info; - -typedef struct VMStimbuf { - char *revdate; /* (both roughly correspond to Unix modtime/st_mtime) */ - char *credate; -} VMStimbuf; - -/*--------------------------------------------------------------------------- - Zipfile work area declarations. - ---------------------------------------------------------------------------*/ - -#ifdef MALLOC_WORK - union work { - struct { /* unshrink(): */ - shrint *Parent; /* pointer to (8192 * sizeof(shrint)) */ - uch *value; /* pointer to 8KB char buffer */ - uch *Stack; /* pointer to another 8KB char buffer */ - } shrink; - uch *Slide; /* explode(), inflate(), unreduce() */ - }; -#else /* !MALLOC_WORK */ - union work { - struct { /* unshrink(): */ - shrint Parent[HSIZE]; /* (8192 * sizeof(shrint)) == 16KB minimum */ - uch value[HSIZE]; /* 8KB */ - uch Stack[HSIZE]; /* 8KB */ - } shrink; /* total = 32KB minimum; 80KB on Cray/Alpha */ - uch Slide[WSIZE]; /* explode(), inflate(), unreduce() */ - }; -#endif /* ?MALLOC_WORK */ - -#define slide G.area.Slide - -#if (defined(DLL) && !defined(NO_SLIDE_REDIR)) -# define redirSlide G.redirect_sldptr -#else -# define redirSlide G.area.Slide -#endif - -/*--------------------------------------------------------------------------- - Zipfile layout declarations. If these headers ever change, make sure the - xxREC_SIZE defines (above) change with them! - ---------------------------------------------------------------------------*/ - - typedef uch local_byte_hdr[ LREC_SIZE ]; -# define L_VERSION_NEEDED_TO_EXTRACT_0 0 -# define L_VERSION_NEEDED_TO_EXTRACT_1 1 -# define L_GENERAL_PURPOSE_BIT_FLAG 2 -# define L_COMPRESSION_METHOD 4 -# define L_LAST_MOD_DOS_DATETIME 6 -# define L_CRC32 10 -# define L_COMPRESSED_SIZE 14 -# define L_UNCOMPRESSED_SIZE 18 -# define L_FILENAME_LENGTH 22 -# define L_EXTRA_FIELD_LENGTH 24 - - typedef uch cdir_byte_hdr[ CREC_SIZE ]; -# define C_VERSION_MADE_BY_0 0 -# define C_VERSION_MADE_BY_1 1 -# define C_VERSION_NEEDED_TO_EXTRACT_0 2 -# define C_VERSION_NEEDED_TO_EXTRACT_1 3 -# define C_GENERAL_PURPOSE_BIT_FLAG 4 -# define C_COMPRESSION_METHOD 6 -# define C_LAST_MOD_DOS_DATETIME 8 -# define C_CRC32 12 -# define C_COMPRESSED_SIZE 16 -# define C_UNCOMPRESSED_SIZE 20 -# define C_FILENAME_LENGTH 24 -# define C_EXTRA_FIELD_LENGTH 26 -# define C_FILE_COMMENT_LENGTH 28 -# define C_DISK_NUMBER_START 30 -# define C_INTERNAL_FILE_ATTRIBUTES 32 -# define C_EXTERNAL_FILE_ATTRIBUTES 34 -# define C_RELATIVE_OFFSET_LOCAL_HEADER 38 - - typedef uch ec_byte_rec[ ECREC_SIZE+4 ]; -/* define SIGNATURE 0 space-holder only */ -# define NUMBER_THIS_DISK 4 -# define NUM_DISK_WITH_START_CEN_DIR 6 -# define NUM_ENTRIES_CEN_DIR_THS_DISK 8 -# define TOTAL_ENTRIES_CENTRAL_DIR 10 -# define SIZE_CENTRAL_DIRECTORY 12 -# define OFFSET_START_CENTRAL_DIRECTORY 16 -# define ZIPFILE_COMMENT_LENGTH 20 - - typedef uch ec_byte_loc64[ ECLOC64_SIZE+4 ]; -# define NUM_DISK_START_EOCDR64 4 -# define OFFSET_START_EOCDR64 8 -# define NUM_THIS_DISK_LOC64 16 - - typedef uch ec_byte_rec64[ ECREC64_SIZE+4 ]; -# define ECREC64_LENGTH 4 -# define EC_VERSION_MADE_BY_0 12 -# define EC_VERSION_NEEDED_0 14 -# define NUMBER_THIS_DSK_REC64 16 -# define NUM_DISK_START_CEN_DIR64 20 -# define NUM_ENTRIES_CEN_DIR_THS_DISK64 24 -# define TOTAL_ENTRIES_CENTRAL_DIR64 32 -# define SIZE_CENTRAL_DIRECTORY64 40 -# define OFFSET_START_CENTRAL_DIRECT64 48 - - -/* The following structs are used to hold all header data of a zip entry. - Traditionally, the structs' layouts followed the data layout of the - corresponding zipfile header structures. However, the zipfile header - layouts were designed in the old ages of 16-bit CPUs, they are subject - to structure padding and/or alignment issues on newer systems with a - "natural word width" of more than 2 bytes. - Please note that the structure members are now reordered by size - (top-down), to prevent internal padding and optimize memory usage! - */ - typedef struct local_file_header { /* LOCAL */ - zusz_t csize; - zusz_t ucsize; - ulg last_mod_dos_datetime; - ulg crc32; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ush filename_length; - ush extra_field_length; - } local_file_hdr; - - typedef struct central_directory_file_header { /* CENTRAL */ - zusz_t csize; - zusz_t ucsize; - zusz_t relative_offset_local_header; - ulg last_mod_dos_datetime; - ulg crc32; - ulg external_file_attributes; - zuvl_t disk_number_start; - ush internal_file_attributes; - uch version_made_by[2]; - uch version_needed_to_extract[2]; - ush general_purpose_bit_flag; - ush compression_method; - ush filename_length; - ush extra_field_length; - ush file_comment_length; - } cdir_file_hdr; - - typedef struct end_central_dir_record { /* END CENTRAL */ - zusz_t size_central_directory; - zusz_t offset_start_central_directory; - zucn_t num_entries_centrl_dir_ths_disk; - zucn_t total_entries_central_dir; - zuvl_t number_this_disk; - zuvl_t num_disk_start_cdir; - int have_ecr64; /* valid Zip64 ecdir-record exists */ - int is_zip64_archive; /* Zip64 ecdir-record is mandatory */ - ush zipfile_comment_length; - } ecdir_rec; - - -/* Huffman code lookup table entry--this entry is four bytes for machines - that have 16-bit pointers (e.g. PC's in the small or medium model). - Valid extra bits are 0..16. e == 31 is EOB (end of block), e == 32 - means that v is a literal, 32 < e < 64 means that v is a pointer to - the next table, which codes (e & 31) bits, and lastly e == 99 indicates - an unused code. If a code with e == 99 is looked up, this implies an - error in the data. */ - -struct huft { - uch e; /* number of extra bits or operation */ - uch b; /* number of bits in this code or subcode */ - union { - ush n; /* literal, length base, or distance base */ - struct huft *t; /* pointer to next level of table */ - } v; -}; - - -typedef struct _APIDocStruct { - char *compare; - char *function; - char *syntax; - char *purpose; -} APIDocStruct; - - - - -/*************/ -/* Globals */ -/*************/ - -#if (defined(OS2) && !defined(FUNZIP)) -# include "os2/os2data.h" -#endif - -#include "globals.h" - - - -/*************************/ -/* Function Prototypes */ -/*************************/ - -/*--------------------------------------------------------------------------- - Functions in unzip.c (initialization routines): - ---------------------------------------------------------------------------*/ - -#ifndef WINDLL - int MAIN OF((int argc, char **argv)); - int unzip OF((__GPRO__ int argc, char **argv)); - int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); - int usage OF((__GPRO__ int error)); -#endif /* !WINDLL */ - -/*--------------------------------------------------------------------------- - Functions in process.c (main driver routines): - ---------------------------------------------------------------------------*/ - -int process_zipfiles OF((__GPRO)); -void free_G_buffers OF((__GPRO)); -/* static int do_seekable OF((__GPRO__ int lastchance)); */ -/* static int find_ecrec OF((__GPRO__ long searchlen)); */ -/* static int process_central_comment OF((__GPRO)); */ -int process_cdir_file_hdr OF((__GPRO)); -int process_local_file_hdr OF((__GPRO)); -int getZip64Data OF((__GPRO__ ZCONST uch *ef_buf, - unsigned ef_len)); -#ifdef UNICODE_SUPPORT - int getUnicodeData OF((__GPRO__ ZCONST uch *ef_buf, - unsigned ef_len)); -#endif -unsigned ef_scan_for_izux OF((ZCONST uch *ef_buf, unsigned ef_len, - int ef_is_c, ulg dos_mdatetime, - iztimes *z_utim, ulg *z_uidgid)); -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) - zvoid *getRISCOSexfield OF((ZCONST uch *ef_buf, unsigned ef_len)); -#endif - -#ifndef SFX - -/*--------------------------------------------------------------------------- - Functions in zipinfo.c (`zipinfo-style' listing routines): - ---------------------------------------------------------------------------*/ - -#ifndef NO_ZIPINFO -#ifndef WINDLL - int zi_opts OF((__GPRO__ int *pargc, char ***pargv)); -#endif -void zi_end_central OF((__GPRO)); -int zipinfo OF((__GPRO)); -/* static int zi_long OF((__GPRO__ zusz_t *pEndprev)); */ -/* static int zi_short OF((__GPRO)); */ -/* static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, - ZCONST time_t *modtimez, char *d_t_str));*/ -#endif /* !NO_ZIPINFO */ - -/*--------------------------------------------------------------------------- - Functions in list.c (generic zipfile-listing routines): - ---------------------------------------------------------------------------*/ - -int list_files OF((__GPRO)); -#ifdef TIMESTAMP - int get_time_stamp OF((__GPRO__ time_t *last_modtime, - ulg *nmember)); -#endif -int ratio OF((zusz_t uc, zusz_t c)); -void fnprint OF((__GPRO)); - -#endif /* !SFX */ - -/*--------------------------------------------------------------------------- - Functions in fileio.c: - ---------------------------------------------------------------------------*/ - -int open_input_file OF((__GPRO)); -int open_outfile OF((__GPRO)); /* also vms.c */ -void undefer_input OF((__GPRO)); -void defer_leftover_input OF((__GPRO)); -unsigned readbuf OF((__GPRO__ char *buf, register unsigned len)); -int readbyte OF((__GPRO)); -int fillinbuf OF((__GPRO)); -int seek_zipf OF((__GPRO__ zoff_t abs_offset)); -#ifdef FUNZIP - int flush OF((__GPRO__ ulg size)); /* actually funzip.c */ -#else - int flush OF((__GPRO__ uch *buf, ulg size, int unshrink)); -#endif -/* static int disk_error OF((__GPRO)); */ -void handler OF((int signal)); -time_t dos_to_unix_time OF((ulg dos_datetime)); -int check_for_newer OF((__GPRO__ char *filename)); /* os2,vmcms,vms */ -int do_string OF((__GPRO__ unsigned int length, int option)); -ush makeword OF((ZCONST uch *b)); -ulg makelong OF((ZCONST uch *sig)); -zusz_t makeint64 OF((ZCONST uch *sig)); -char *fzofft OF((__GPRO__ zoff_t val, - ZCONST char *pre, ZCONST char *post)); -#if (!defined(STR_TO_ISO) || defined(NEED_STR2ISO)) - char *str2iso OF((char *dst, ZCONST char *src)); -#endif -#if (!defined(STR_TO_OEM) || defined(NEED_STR2OEM)) - char *str2oem OF((char *dst, ZCONST char *src)); -#endif -#ifdef NO_STRNICMP - int zstrnicmp OF((register ZCONST char *s1, - register ZCONST char *s2, - register unsigned n)); -#endif -#ifdef REGULUS - int zstat OF((ZCONST char *p, struct stat *s)); -#endif -#ifdef ZMEM /* MUST be ifdef'd because of conflicts with the standard def. */ - zvoid *memset OF((register zvoid *, register int, register unsigned int)); - int memcmp OF((register ZCONST zvoid*, register ZCONST zvoid *, - register unsigned int)); - zvoid *memcpy OF((register zvoid *, register ZCONST zvoid *, - register unsigned int)); -#endif -#ifdef NEED_UZMBCLEN - extent uzmbclen OF((ZCONST unsigned char *ptr)); -#endif -#ifdef NEED_UZMBSCHR - unsigned char *uzmbschr OF((ZCONST unsigned char *str, unsigned int c)); -#endif -#ifdef NEED_UZMBSRCHR - unsigned char *uzmbsrchr OF((ZCONST unsigned char *str, unsigned int c)); -#endif -#ifdef SMALL_MEM - char *fLoadFarString OF((__GPRO__ const char Far *sz)); - char *fLoadFarStringSmall OF((__GPRO__ const char Far *sz)); - char *fLoadFarStringSmall2 OF((__GPRO__ const char Far *sz)); - #ifndef zfstrcpy - char Far * Far zfstrcpy OF((char Far *s1, const char Far *s2)); - #endif - #if (!defined(SFX) && !defined(zfstrcmp)) - int Far zfstrcmp OF((const char Far *s1, const char Far *s2)); - #endif -#endif - - -/*--------------------------------------------------------------------------- - Functions in extract.c: - ---------------------------------------------------------------------------*/ - -int extract_or_test_files OF((__GPRO)); -/* static int store_info OF((void)); */ -/* static int extract_or_test_member OF((__GPRO)); */ -/* static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); */ -/* static int test_OS2 OF((__GPRO__ uch *eb, unsigned eb_size)); */ -/* static int test_NT OF((__GPRO__ uch *eb, unsigned eb_size)); */ -#ifndef SFX - unsigned find_compr_idx OF((unsigned compr_methodnum)); -#endif -int memextract OF((__GPRO__ uch *tgt, ulg tgtsize, - ZCONST uch *src, ulg srcsize)); -int memflush OF((__GPRO__ ZCONST uch *rawbuf, ulg size)); -#if (defined(VMS) || defined(VMS_TEXT_CONV)) - uch *extract_izvms_block OF((__GPRO__ ZCONST uch *ebdata, - unsigned size, unsigned *retlen, - ZCONST uch *init, unsigned needlen)); -#endif -char *fnfilter OF((ZCONST char *raw, uch *space, - extent size)); - -/*--------------------------------------------------------------------------- - Decompression functions: - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) && !defined(FUNZIP)) -int explode OF((__GPRO)); /* explode.c */ -#endif -int huft_free OF((struct huft *t)); /* inflate.c */ -int huft_build OF((__GPRO__ ZCONST unsigned *b, unsigned n, - unsigned s, ZCONST ush *d, ZCONST uch *e, - struct huft **t, unsigned *m)); -#ifdef USE_ZLIB - int UZinflate OF((__GPRO__ int is_defl64)); /* inflate.c */ -# define inflate_free(x) inflateEnd(&((Uz_Globs *)(&G))->dstrm) -#else - int inflate OF((__GPRO__ int is_defl64)); /* inflate.c */ - int inflate_free OF((__GPRO)); /* inflate.c */ -#endif /* ?USE_ZLIB */ -#if (!defined(SFX) && !defined(FUNZIP)) -#ifndef COPYRIGHT_CLEAN - int unreduce OF((__GPRO)); /* unreduce.c */ -/* static void LoadFollowers OF((__GPRO__ f_array *follower, uch *Slen)); - * unreduce.c */ -#endif /* !COPYRIGHT_CLEAN */ -#ifndef LZW_CLEAN - int unshrink OF((__GPRO)); /* unshrink.c */ -/* static void partial_clear OF((__GPRO)); * unshrink.c */ -#endif /* !LZW_CLEAN */ -#endif /* !SFX && !FUNZIP */ -#ifdef USE_BZIP2 - int UZbunzip2 OF((__GPRO)); /* extract.c */ - void bz_internal_error OF((int bzerrcode)); /* ubz2err.c */ -#endif - -/*--------------------------------------------------------------------------- - Internal API functions (only included in DLL versions): - ---------------------------------------------------------------------------*/ - -#ifdef DLL - void setFileNotFound OF((__GPRO)); /* api.c */ - int unzipToMemory OF((__GPRO__ char *zip, char *file, - UzpBuffer *retstr)); /* api.c */ - int redirect_outfile OF((__GPRO)); /* api.c */ - int writeToMemory OF((__GPRO__ ZCONST uch *rawbuf, - extent size)); /* api.c */ - int close_redirect OF((__GPRO)); /* api.c */ - /* this obsolescent entry point kept for compatibility: */ - int UzpUnzip OF((int argc, char **argv));/* use UzpMain */ -#ifdef OS2DLL - int varmessage OF((__GPRO__ ZCONST uch *buf, ulg size)); - int varputchar OF((__GPRO__ int c)); /* rexxapi.c */ - int finish_REXX_redirect OF((__GPRO)); /* rexxapi.c */ -#endif -#ifdef API_DOC - void APIhelp OF((__GPRO__ int argc, char **argv)); -#endif /* apihelp.c */ -#endif /* DLL */ - -/*--------------------------------------------------------------------------- - MSDOS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef MSDOS -#if (!defined(FUNZIP) && !defined(SFX) && !defined(WINDLL)) - void check_for_windows OF((ZCONST char *app)); /* msdos.c */ -#endif -#if (defined(__GO32__) || defined(__EMX__)) - unsigned _dos_getcountryinfo(void *); /* msdos.c */ -#if (!defined(__DJGPP__) || (__DJGPP__ < 2)) - unsigned _dos_setftime(int, unsigned, unsigned); /* msdos.c */ - unsigned _dos_setfileattr(const char *, unsigned); /* msdos.c */ - unsigned _dos_creat(const char *, unsigned, int *); /* msdos.c */ - void _dos_getdrive(unsigned *); /* msdos.c */ - unsigned _dos_close(int); /* msdos.c */ -#endif /* !__DJGPP__ || (__DJGPP__ < 2) */ -#endif /* __GO32__ || __EMX__ */ -#endif - -/*--------------------------------------------------------------------------- - OS/2-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef OS2 /* GetFileTime conflicts with something in Win32 header files */ -#if (defined(REENTRANT) && defined(USETHREADID)) - ulg GetThreadId OF((void)); -#endif - int GetCountryInfo OF((void)); /* os2.c */ - long GetFileTime OF((ZCONST char *name)); /* os2.c */ -/* static void SetPathAttrTimes OF((__GPRO__ int flags, int dir)); os2.c */ -/* static int SetEAs OF((__GPRO__ const char *path, - void *eablock)); os2.c */ -/* static int SetACL OF((__GPRO__ const char *path, - void *eablock)); os2.c */ -/* static int IsFileNameValid OF((const char *name)); os2.c */ -/* static void map2fat OF((char *pathcomp, char **pEndFAT)); os2.c */ -/* static int SetLongNameEA OF((char *name, char *longname)); os2.c */ -/* static void InitNLS OF((void)); os2.c */ - int IsUpperNLS OF((int nChr)); /* os2.c */ - int ToLowerNLS OF((int nChr)); /* os2.c */ - void DebugMalloc OF((void)); /* os2.c */ -#endif - -/*--------------------------------------------------------------------------- - QDOS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef QDOS - int QMatch (uch, uch); - void QFilename (__GPRO__ char *); - char *Qstrfix (char *); - int QReturn (int zip_error); -#endif - -/*--------------------------------------------------------------------------- - TOPS20-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef TOPS20 - int upper OF((char *s)); /* tops20.c */ - int enquote OF((char *s)); /* tops20.c */ - int dequote OF((char *s)); /* tops20.c */ - int fnlegal OF(()); /* error if prototyped? */ /* tops20.c */ -#endif - -/*--------------------------------------------------------------------------- - VM/CMS- and MVS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef CMS_MVS - extent getVMMVSexfield OF((char *type, uch *ef_block, unsigned datalen)); - FILE *vmmvs_open_infile OF((__GPRO)); /* vmmvs.c */ - void close_infile OF((__GPRO)); /* vmmvs.c */ -#endif - -/*--------------------------------------------------------------------------- - VMS-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef VMS - int check_format OF((__GPRO)); /* vms.c */ -/* int open_outfile OF((__GPRO)); * (see fileio.c) vms.c */ -/* int flush OF((__GPRO__ uch *rawbuf, unsigned size, - int final_flag)); * (see fileio.c) vms.c */ - char *vms_msg_text OF((void)); /* vms.c */ -#ifdef RETURN_CODES - void return_VMS OF((__GPRO__ int zip_error)); /* vms.c */ -#else - void return_VMS OF((int zip_error)); /* vms.c */ -#endif -#ifdef VMSCLI - ulg vms_unzip_cmdline OF((int *, char ***)); /* cmdline.c */ - int VMSCLI_usage OF((__GPRO__ int error)); /* cmdline.c */ -#endif -#endif - -/*--------------------------------------------------------------------------- - WIN32-only functions: - ---------------------------------------------------------------------------*/ - -#ifdef WIN32 - int IsWinNT OF((void)); /* win32.c */ -#ifdef NTSD_EAS - void process_defer_NT OF((__GPRO)); /* win32.c */ - int test_NTSD OF((__GPRO__ uch *eb, unsigned eb_size, - uch *eb_ucptr, ulg eb_ucsize)); /* win32.c */ -# define TEST_NTSD test_NTSD -#endif -#ifdef W32_STAT_BANDAID - int zstat_win32 OF((__W32STAT_GLOBALS__ - const char *path, z_stat *buf)); /* win32.c */ -#endif -#endif - -/*--------------------------------------------------------------------------- - Miscellaneous/shared functions: - ---------------------------------------------------------------------------*/ - -Uz_Globs *globalsCtor OF((void)); /* globals.c */ - -int envargs OF((int *Pargc, char ***Pargv, - ZCONST char *envstr, ZCONST char *envstr2)); - /* envargs.c */ -void mksargs OF((int *argcp, char ***argvp)); /* envargs.c */ - -int match OF((ZCONST char *s, ZCONST char *p, - int ic __WDLPRO)); /* match.c */ -int iswild OF((ZCONST char *p)); /* match.c */ - -/* declarations of public CRC-32 functions have been moved into crc32.h - (free_crc_table(), get_crc_table(), crc32()) crc32.c */ - -int dateformat OF((void)); /* local */ -char dateseparator OF((void)); /* local */ -#ifndef WINDLL - void version OF((__GPRO)); /* local */ -#endif -int mapattr OF((__GPRO)); /* local */ -int mapname OF((__GPRO__ int renamed)); /* local */ -int checkdir OF((__GPRO__ char *pathcomp, int flag)); /* local */ -char *do_wild OF((__GPRO__ ZCONST char *wildzipfn)); /* local */ -char *GetLoadPath OF((__GPRO)); /* local */ -#if (defined(MORE) && (defined(ATH_BEO_UNX) || defined(QDOS) || defined(VMS))) - int screensize OF((int *tt_rows, int *tt_cols)); /* local */ -# if defined(VMS) - int screenlinewrap OF((void)); /* local */ -# endif -#endif /* MORE && (ATH_BEO_UNX || QDOS || VMS) */ -#ifdef OS2_W32 - int SetFileSize OF((FILE *file, zusz_t filesize)); /* local */ -#endif -#ifndef MTS /* macro in MTS */ - void close_outfile OF((__GPRO)); /* local */ -#endif -#ifdef SET_SYMLINK_ATTRIBS - int set_symlnk_attribs OF((__GPRO__ slinkentry *slnk_entry)); /* local */ -#endif -#ifdef SET_DIR_ATTRIB - int defer_dir_attribs OF((__GPRO__ direntry **pd)); /* local */ - int set_direc_attribs OF((__GPRO__ direntry *d)); /* local */ -#endif -#ifdef TIMESTAMP -# ifdef WIN32 - int stamp_file OF((__GPRO__ - ZCONST char *fname, time_t modtime)); /* local */ -# else - int stamp_file OF((ZCONST char *fname, time_t modtime)); /* local */ -# endif -#endif -#ifdef NEED_ISO_OEM_INIT - void prepare_ISO_OEM_translat OF((__GPRO)); /* local */ -#endif -#if (defined(MALLOC_WORK) && defined(MY_ZCALLOC)) - zvoid far *zcalloc OF((unsigned int, unsigned int)); - zvoid zcfree OF((zvoid far *)); -#endif /* MALLOC_WORK && MY_ZCALLOC */ -#ifdef SYSTEM_SPECIFIC_CTOR - void SYSTEM_SPECIFIC_CTOR OF((__GPRO)); /* local */ -#endif -#ifdef SYSTEM_SPECIFIC_DTOR - void SYSTEM_SPECIFIC_DTOR OF((__GPRO)); /* local */ -#endif - - - - - -/************/ -/* Macros */ -/************/ - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifdef DEBUG -# if (defined(THEOS) && defined(NO_BOGUS_SPC)) -# define NO_DEBUG_IN_MACROS -# define Trace(x) _fprintf x -# else -# define Trace(x) fprintf x -# endif -#else -# define Trace(x) -#endif - -#ifdef DEBUG_TIME -# define TTrace(x) fprintf x -#else -# define TTrace(x) -#endif - -#ifdef NO_DEBUG_IN_MACROS -# define MTrace(x) -#else -# define MTrace(x) Trace(x) -#endif - -#if (defined(UNIX) || defined(T20_VMS)) /* generally old systems */ -# define ToLower(x) ((char)(isupper((int)x)? tolower((int)x) : x)) -#else -# define ToLower tolower /* assumed "smart"; used in match() */ -#endif - -#ifdef USE_STRM_INPUT - /* ``Replace'' the unbuffered UNIX style I/O function with similar - * standard C functions from . - */ -# define read(fd,buf,n) fread((buf),1,(n),(FILE *)(fd)) -# ifdef zlseek -# undef zlseek -# endif -# define zlseek(fd,o,w) zfseeko((FILE *)(fd),(o),(w)) -# define close(fd) fclose((FILE *)(fd)) -#endif /* USE_STRM_INPUT */ - -/* The return value of the Info() "macro function" is never checked in - * UnZip. Otherwise, to get the same behaviour as for (*G.message)(), the - * Info() definition for "FUNZIP" would have to be corrected: - * #define Info(buf,flag,sprf_arg) \ - * (fputs((char *)(sprintf sprf_arg, (buf)), \ - * (flag)&1? stderr : stdout) < 0) - */ -#ifndef Info /* may already have been defined for redirection */ -# ifdef FUNZIP -# define Info(buf,flag,sprf_arg) \ - fputs((char *)(sprintf sprf_arg, (buf)), (flag)&1? stderr : stdout) -# else -# ifdef INT_SPRINTF /* optimized version for "int sprintf()" flavour */ -# define Info(buf,flag,sprf_arg) \ - (*G.message)((zvoid *)&G, (uch *)(buf), (ulg)sprintf sprf_arg, (flag)) -# else /* generic version, does not use sprintf() return value */ -# define Info(buf,flag,sprf_arg) \ - (*G.message)((zvoid *)&G, (uch *)(buf), \ - (ulg)(sprintf sprf_arg, strlen((char *)(buf))), (flag)) -# endif -# endif -#endif /* !Info */ - -/* This wrapper macro around fzofft() is just defined to "hide" the - * argument needed to reference the global storage buffers. - */ -#define FmZofft(val, pre, post) fzofft(__G__ val, pre, post) - -/* The following macro wrappers around the fnfilter function are used many - * times to prepare archive entry names or name components for displaying - * listings and (warning/error) messages. They use sections in the upper half - * of 'slide' as buffer, since their output is normally fed through the - * Info() macro with 'slide' (the start of this area) as message buffer. - */ -#define FnFilter1(fname) \ - fnfilter((fname), slide + (extent)(WSIZE>>1), (extent)(WSIZE>>2)) -#define FnFilter2(fname) \ - fnfilter((fname), slide + (extent)((WSIZE>>1) + (WSIZE>>2)),\ - (extent)(WSIZE>>2)) - -#ifndef FUNZIP /* used only in inflate.c */ -# define MESSAGE(str,len,flag) (*G.message)((zvoid *)&G,(str),(len),(flag)) -#endif - -#if 0 /* Optimization: use the (const) result of crc32(0L,NULL,0) */ -# define CRCVAL_INITIAL crc32(0L, NULL, 0) -#else -# define CRCVAL_INITIAL 0L -#endif - -#ifdef SYMLINKS - /* This macro defines the Zip "made by" hosts that are considered - to support storing symbolic link entries. */ -# define SYMLINK_HOST(hn) ((hn) == UNIX_ || (hn) == ATARI_ || \ - (hn) == ATHEOS_ || (hn) == BEOS_ || (hn) == VMS_) -#endif - -#ifndef TEST_NTSD /* "NTSD valid?" checking function */ -# define TEST_NTSD NULL /* ... is not available */ -#endif - -#define SKIP_(length) if(length&&((error=do_string(__G__ length,SKIP))!=0))\ - {error_in_archive=error; if(error>1) return error;} - -/* - * Skip a variable-length field, and report any errors. Used in zipinfo.c - * and unzip.c in several functions. - * - * macro SKIP_(length) - * ush length; - * { - * if (length && ((error = do_string(length, SKIP)) != 0)) { - * error_in_archive = error; /-* might be warning *-/ - * if (error > 1) /-* fatal *-/ - * return (error); - * } - * } - * - */ - - -#ifdef FUNZIP -# define FLUSH(w) flush(__G__ (ulg)(w)) -# define NEXTBYTE getc(G.in) /* redefined in crypt.h if full version */ -#else -# define FLUSH(w) ((G.mem_mode) ? memflush(__G__ redirSlide,(ulg)(w)) \ - : flush(__G__ redirSlide,(ulg)(w),0)) -# define NEXTBYTE (G.incnt-- > 0 ? (int)(*G.inptr++) : readbyte(__G)) -#endif - - -#define READBITS(nbits,zdest) {if(nbits>G.bits_left) {int temp; G.zipeof=1;\ - while (G.bits_left<=8*(int)(sizeof(G.bitbuf)-1) && (temp=NEXTBYTE)!=EOF) {\ - G.bitbuf|=(ulg)temp<>=nbits;\ - G.bits_left-=nbits;} - -/* - * macro READBITS(nbits,zdest) * only used by unreduce and unshrink * - * { - * if (nbits > G.bits_left) { * fill G.bitbuf, 8*sizeof(ulg) bits * - * int temp; - * - * G.zipeof = 1; - * while (G.bits_left <= 8*(int)(sizeof(G.bitbuf)-1) && - * (temp = NEXTBYTE) != EOF) { - * G.bitbuf |= (ulg)temp << G.bits_left; - * G.bits_left += 8; - * G.zipeof = 0; - * } - * } - * zdest = (shrint)((unsigned)G.bitbuf & mask_bits[nbits]); - * G.bitbuf >>= nbits; - * G.bits_left -= nbits; - * } - * - */ - - -/* GRR: should use StringLower for STRLOWER macro if possible */ - -/* - * Copy the zero-terminated string in str1 into str2, converting any - * uppercase letters to lowercase as we go. str2 gets zero-terminated - * as well, of course. str1 and str2 may be the same character array. - */ -#ifdef _MBCS -# define STRLOWER(str1, str2) \ - { \ - char *p, *q, c; unsigned i; \ - p = (char *)(str1); \ - q = (char *)(str2); \ - while ((c = *p) != '\0') { \ - if ((i = CLEN(p)) > 1) { \ - while (i--) *q++ = *p++; \ - } else { \ - *q++ = (char)(isupper((int)(c))? tolower((int)(c)) : c); \ - p++; \ - } \ - } \ - *q = '\0'; \ - } -#else -# define STRLOWER(str1, str2) \ - { \ - char *p, *q; \ - p = (char *)(str1) - 1; \ - q = (char *)(str2); \ - while (*++p) \ - *q++ = (char)(isupper((int)(*p))? tolower((int)(*p)) : *p); \ - *q = '\0'; \ - } -#endif -/* - * NOTES: This macro makes no assumptions about the characteristics of - * the tolower() function or macro (beyond its existence), nor does it - * make assumptions about the structure of the character set (i.e., it - * should work on EBCDIC machines, too). The fact that either or both - * of isupper() and tolower() may be macros has been taken into account; - * watch out for "side effects" (in the C sense) when modifying this - * macro. - */ - -#ifndef foreign -# define foreign(c) (c) -#endif - -#ifndef native -# define native(c) (c) -# define A_TO_N(str1) -#else -# ifndef NATIVE -# define NATIVE "native chars" -# endif -# define A_TO_N(str1) {register uch *p;\ - for (p=(uch *)(str1); *p; p++) *p=native(*p);} -#endif -/* - * Translate the zero-terminated string in str1 from ASCII to the native - * character set. The translation is performed in-place and uses the - * "native" macro to translate each character. - * - * NOTE: Using the "native" macro means that is it the only part of unzip - * which knows which translation table (if any) is actually in use to - * produce the native character set. This makes adding new character set - * translation tables easy, insofar as all that is needed is an appropriate - * "native" macro definition and the translation table itself. Currently, - * the only non-ASCII native character set implemented is EBCDIC, but this - * may not always be so. - */ - - -/* default setup for internal codepage: assume ISO 8859-1 compatibility!! */ -#if (!defined(NATIVE) && !defined(CRTL_CP_IS_ISO) && !defined(CRTL_CP_IS_OEM)) -# define CRTL_CP_IS_ISO -#endif - - -/* Translate "extended ASCII" chars (OEM coding for DOS and OS/2; else - * ISO-8859-1 [ISO Latin 1, Win Ansi,...]) into the internal "native" - * code page. As with A_TO_N(), conversion is done in place. - */ -#ifndef _ISO_INTERN -# ifdef CRTL_CP_IS_OEM -# ifndef IZ_ISO2OEM_ARRAY -# define IZ_ISO2OEM_ARRAY -# endif -# define _ISO_INTERN(str1) if (iso2oem) {register uch *p;\ - for (p=(uch *)(str1); *p; p++)\ - *p = native((*p & 0x80) ? iso2oem[*p & 0x7f] : *p);} -# else -# define _ISO_INTERN(str1) A_TO_N(str1) -# endif -#endif - -#ifndef _OEM_INTERN -# ifdef CRTL_CP_IS_OEM -# define _OEM_INTERN(str1) A_TO_N(str1) -# else -# ifndef IZ_OEM2ISO_ARRAY -# define IZ_OEM2ISO_ARRAY -# endif -# define _OEM_INTERN(str1) if (oem2iso) {register uch *p;\ - for (p=(uch *)(str1); *p; p++)\ - *p = native((*p & 0x80) ? oem2iso[*p & 0x7f] : *p);} -# endif -#endif - -#ifndef STR_TO_ISO -# ifdef CRTL_CP_IS_ISO -# define STR_TO_ISO strcpy -# else -# define STR_TO_ISO str2iso -# define NEED_STR2ISO -# endif -#endif - -#ifndef STR_TO_OEM -# ifdef CRTL_CP_IS_OEM -# define STR_TO_OEM strcpy -# else -# define STR_TO_OEM str2oem -# define NEED_STR2OEM -# endif -#endif - -#if (!defined(INTERN_TO_ISO) && !defined(ASCII2ISO)) -# ifdef CRTL_CP_IS_OEM - /* know: "ASCII" is "OEM" */ -# define ASCII2ISO(c) \ - ((((c) & 0x80) && oem2iso) ? oem2iso[(c) & 0x7f] : (c)) -# if (defined(NEED_STR2ISO) && !defined(CRYP_USES_OEM2ISO)) -# define CRYP_USES_OEM2ISO -# endif -# else - /* assume: "ASCII" is "ISO-ANSI" */ -# define ASCII2ISO(c) (c) -# endif -#endif - -#if (!defined(INTERN_TO_OEM) && !defined(ASCII2OEM)) -# ifdef CRTL_CP_IS_OEM - /* know: "ASCII" is "OEM" */ -# define ASCII2OEM(c) (c) -# else - /* assume: "ASCII" is "ISO-ANSI" */ -# define ASCII2OEM(c) \ - ((((c) & 0x80) && iso2oem) ? iso2oem[(c) & 0x7f] : (c)) -# if (defined(NEED_STR2OEM) && !defined(CRYP_USES_ISO2OEM)) -# define CRYP_USES_ISO2OEM -# endif -# endif -#endif - -/* codepage conversion setup for testp() in crypt.c */ -#ifdef CRTL_CP_IS_ISO -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_OEM -# endif -#else -# ifdef CRTL_CP_IS_OEM -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_ISO -# endif -# else /* native internal CP is neither ISO nor OEM */ -# ifndef STR_TO_CP1 -# define STR_TO_CP1 STR_TO_ISO -# endif -# ifndef STR_TO_CP2 -# define STR_TO_CP2 STR_TO_OEM -# endif -# endif -#endif - - -/* Convert filename (and file comment string) into "internal" charset. - * This macro assumes that Zip entry filenames are coded in OEM (IBM DOS) - * codepage when made on - * -> DOS (this includes 16-bit Windows 3.1) (FS_FAT_) - * -> OS/2 (FS_HPFS_) - * -> Win95/WinNT with Nico Mak's WinZip (FS_NTFS_ && hostver == "5.0") - * EXCEPTIONS: - * PKZIP for Windows 2.5, 2.6, and 4.0 flag their entries as "FS_FAT_", but - * the filename stored in the local header is coded in Windows ANSI (CP 1252 - * resp. ISO 8859-1 on US and western Europe locale settings). - * Likewise, PKZIP for UNIX 2.51 flags its entries as "FS_FAT_", but the - * filenames stored in BOTH the local and the central header are coded - * in the local system's codepage (usually ANSI codings like ISO 8859-1). - * - * All other ports are assumed to code zip entry filenames in ISO 8859-1. - */ -#ifndef Ext_ASCII_TO_Native -# define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \ - if (((hostnum) == FS_FAT_ && \ - !(((islochdr) || (isuxatt)) && \ - ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \ - (hostnum) == FS_HPFS_ || \ - ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \ - _OEM_INTERN((string)); \ - } else { \ - _ISO_INTERN((string)); \ - } -#endif - - - -/**********************/ -/* Global constants */ -/**********************/ - - extern ZCONST unsigned near mask_bits[17]; - extern ZCONST char *fnames[2]; - -#ifdef EBCDIC - extern ZCONST uch ebcdic[]; -#endif -#ifdef IZ_ISO2OEM_ARRAY - extern ZCONST uch Far *iso2oem; - extern ZCONST uch Far iso2oem_850[]; -#endif -#ifdef IZ_OEM2ISO_ARRAY - extern ZCONST uch Far *oem2iso; - extern ZCONST uch Far oem2iso_850[]; -#endif - - extern ZCONST char Far VersionDate[]; - extern ZCONST char Far CentSigMsg[]; -#ifndef SFX - extern ZCONST char Far EndSigMsg[]; -#endif - extern ZCONST char Far SeekMsg[]; - extern ZCONST char Far FilenameNotMatched[]; - extern ZCONST char Far ExclFilenameNotMatched[]; - extern ZCONST char Far ReportMsg[]; - -#ifndef SFX - extern ZCONST char Far Zipnfo[]; - extern ZCONST char Far CompiledWith[]; -#endif /* !SFX */ - - - -/***********************************/ -/* Global (shared?) RTL variables */ -/***********************************/ - -#ifdef DECLARE_ERRNO - extern int errno; -#endif - -/*--------------------------------------------------------------------- - Unicode Support - 28 August 2005 - ---------------------------------------------------------------------*/ -#if (defined(UNICODE_SUPPORT) && defined(UNICODE_WCHAR)) - - /* Default character when a zwchar too big for wchar_t */ -# define zwchar_to_wchar_t_default_char '_' - - /* Default character string when wchar_t does not convert to mb */ -# define wide_to_mb_default_string "_" - - /* wide character type */ - typedef unsigned long zwchar; - - /* UTF-8 related conversion functions, currently found in process.c */ - -# if 0 /* currently unused */ - /* check if string is all ASCII */ - int is_ascii_string OF((ZCONST char *mbstring)); -# endif /* unused */ - - /* convert UTF-8 string to multi-byte string */ - char *utf8_to_local_string OF((ZCONST char *utf8_string, int escape_all)); - - /* convert UTF-8 string to wide string */ - zwchar *utf8_to_wide_string OF((ZCONST char *utf8_string)); - - /* convert wide string to multi-byte string */ - char *wide_to_local_string OF((ZCONST zwchar *wide_string, int escape_all)); - -# if 0 /* currently unused */ - /* convert local string to multi-byte display string */ - char *local_to_display_string OF((ZCONST char *local_string)); -# endif /* unused */ - - /* convert wide character to escape string */ - char *wide_to_escape_string OF((unsigned long)); - -# define utf8_to_escaped_string(utf8_string) \ - utf8_to_local_string(utf8_string, TRUE) - -# if 0 /* currently unused */ - /* convert escape string to wide character */ - unsigned long escape_string_to_wide OF((ZCONST char *escape_string)); - - /* convert local to UTF-8 */ - char *local_to_utf8_string OF ((ZCONST char *local_string)); - - /* convert local to wide string */ - zwchar *local_to_wide_string OF ((ZCONST char *local_string)); - - /* convert wide string to UTF-8 */ - char *wide_to_utf8_string OF((ZCONST zwchar *wide_string)); -# endif /* unused */ - -#endif /* UNICODE_SUPPORT && UNICODE_WCHAR */ - - -#endif /* !__unzpriv_h */ diff --git a/data/windows/unzipfx-catia/unzvers.h b/data/windows/unzipfx-catia/unzvers.h deleted file mode 100644 index 828f537..0000000 --- a/data/windows/unzipfx-catia/unzvers.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - unzvers.h (for UnZip) by Info-ZIP. - */ - -#ifndef __unzvers_h /* don't include more than once */ -#define __unzvers_h - -#ifdef BETA -# undef BETA /* undefine BETA for public releases */ -#endif - -#ifdef BETA -# define UZ_BETALEVEL "h03 BETA" -# define UZ_VERSION_DATE "17 Apr 09" /* internal beta version */ -#else -# define UZ_BETALEVEL "" -# define UZ_VERSION_DATE "20 April 2009" /* official release version */ -# define RELEASE -#endif - -#define UZ_MAJORVER 6 /* UnZip */ -#define UZ_MINORVER 0 - -#define ZI_MAJORVER 3 /* ZipInfo */ -#define ZI_MINORVER 0 - -#define UZ_PATCHLEVEL 0 - -#define UZ_VER_STRING "6.0" /* keep in sync with Version numbers! */ - -#ifndef IZ_COMPANY_NAME /* might be already defined... */ -# define IZ_COMPANY_NAME "Info-ZIP" -#endif - -/* these are obsolete but remain for backward compatibility: */ -#if (defined(OS2) || defined(__OS2__)) -# define D2_MAJORVER UZ_MAJORVER /* DLL for OS/2 */ -# define D2_MINORVER UZ_MINORVER -# define D2_PATCHLEVEL UZ_PATCHLEVEL -#endif - -#define DW_MAJORVER UZ_MAJORVER /* DLL for MS Windows */ -#define DW_MINORVER UZ_MINORVER -#define DW_PATCHLEVEL UZ_PATCHLEVEL - -#define WIN_VERSION_DATE UZ_VERSION_DATE - -#define UNZ_DLL_VERSION UZ_VER_STRING - -/* The following version constants specify the UnZip version that introduced - * the most recent incompatible change (means: change that breaks backward - * compatibility) of a DLL/Library binary API definition. - * - * Currently, UnZip supports three distinct DLL/Library APIs, which each - * carry their own "compatibility level": - * a) The "generic" (console-mode oriented) API has been used on UNIX, - * for example. This API provides a "callable" interface similar to the - * interactive command line of the normal program executables. - * b) The OS/2-only API provides (additional) functions specially tailored - * for interfacing with the REXX shell. - * c) The Win32 DLL API with a pure binary interface which can be used to - * build GUI mode as well as Console mode applications. - * - * Whenever a change that breaks backward compatibility gets applied to - * any of the DLL/Library APIs, the corresponding compatibility level should - * be synchronized with the current UnZip version numbers. - */ -/* generic DLL API minimum compatible version*/ -#define UZ_GENAPI_COMP_MAJOR 6 -#define UZ_GENAPI_COMP_MINOR 0 -#define UZ_GENAPI_COMP_REVIS 0 -/* os2dll API minimum compatible version*/ -#define UZ_OS2API_COMP_MAJOR 6 -#define UZ_OS2API_COMP_MINOR 0 -#define UZ_OS2API_COMP_REVIS 0 -/* windll API minimum compatible version*/ -#define UZ_WINAPI_COMP_MAJOR 6 -#define UZ_WINAPI_COMP_MINOR 0 -#define UZ_WINAPI_COMP_REVIS 0 - -#endif /* !__unzvers_h */ diff --git a/data/windows/unzipfx-catia/win32/nt.c b/data/windows/unzipfx-catia/win32/nt.c deleted file mode 100644 index a6cf859..0000000 --- a/data/windows/unzipfx-catia/win32/nt.c +++ /dev/null @@ -1,554 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* - - Copyright (c) 1996 Scott Field (dedicated to Info-Zip group) - - Module Name: - - nt.c - - Abstract: - - This module implements WinNT security descriptor operations for the - Win32 Info-ZIP project. Operation such as setting file security, - using/querying local and remote privileges, and queuing of operations - is performed here. The contents of this module are only relevant - when the code is running on Windows NT, and the target volume supports - persistent Acl storage. - - User privileges that allow accessing certain privileged aspects of the - security descriptor (such as the Sacl) are only used if the user specified - to do so. - - Author: - - Scott Field (sfield@microsoft.com) - - Last revised: 18 Jan 97 - - */ - -#define WIN32_LEAN_AND_MEAN -#define UNZIP_INTERNAL -#include "../unzip.h" -#include -#ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -#endif -#include "../win32/nt.h" - - -#ifdef NTSD_EAS /* This file is only needed for NTSD handling */ - -/* Borland C++ does not define FILE_SHARE_DELETE. Others also? */ -#ifndef FILE_SHARE_DELETE -# define FILE_SHARE_DELETE 0x00000004 -#endif - -/* This macro definition is missing in old versions of MS' winbase.h. */ -#ifndef InterlockedExchangePointer -# define InterlockedExchangePointer(Target, Value) \ - (PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value)) -#endif - - -/* private prototypes */ - -static BOOL Initialize(VOID); -static VOID GetRemotePrivilegesSet(CHAR *FileName, PDWORD dwRemotePrivileges); -static VOID InitLocalPrivileges(VOID); - - -volatile BOOL bInitialized = FALSE; /* module level stuff initialized? */ -HANDLE hInitMutex = NULL; /* prevent multiple initialization */ - -BOOL g_bRestorePrivilege = FALSE; /* for local set file security override */ -BOOL g_bSaclPrivilege = FALSE; /* for local set sacl operations, only when - restore privilege not present */ - -/* our single cached volume capabilities structure that describes the last - volume root we encountered. A single entry like this works well in the - zip/unzip scenario for a number of reasons: - 1. typically one extraction path during unzip. - 2. typically process one volume at a time during zip, and then move - on to the next. - 3. no cleanup code required and no memory leaks. - 4. simple code. - - This approach should be reworked to a linked list approach if we expect to - be called by many threads which are processing a variety of input/output - volumes, since lock contention and stale data may become a bottleneck. */ - -VOLUMECAPS g_VolumeCaps; -CRITICAL_SECTION VolumeCapsLock; - - -static BOOL Initialize(VOID) -{ - HANDLE hMutex; - HANDLE hOldMutex; - - if (bInitialized) return TRUE; - - hMutex = CreateMutex(NULL, TRUE, NULL); - if(hMutex == NULL) return FALSE; - - hOldMutex = (HANDLE)InterlockedExchangePointer((void *)&hInitMutex, - hMutex); - - if (hOldMutex != NULL) { - /* somebody setup the mutex already */ - InterlockedExchangePointer((void *)&hInitMutex, - hOldMutex); - - CloseHandle(hMutex); /* close new, un-needed mutex */ - - /* wait for initialization to complete and return status */ - WaitForSingleObject(hOldMutex, INFINITE); - ReleaseMutex(hOldMutex); - - return bInitialized; - } - - if (!bInitialized) { - /* initialize module level resources */ - - InitializeCriticalSection( &VolumeCapsLock ); - memset(&g_VolumeCaps, 0, sizeof(VOLUMECAPS)); - - InitLocalPrivileges(); - - bInitialized = TRUE; - } - - InterlockedExchangePointer((void *)&hInitMutex, - NULL); - - ReleaseMutex(hMutex); /* release correct mutex */ - - CloseHandle(hMutex); /* free the no longer needed handle resource */ - - return TRUE; -} - - -BOOL ValidateSecurity(uch *securitydata) -{ - PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; - PACL pAcl; - PSID pSid; - BOOL bAclPresent; - BOOL bDefaulted; - - if(!IsWinNT()) return TRUE; /* don't do anything if not on WinNT */ - - if(!IsValidSecurityDescriptor(sd)) return FALSE; - - /* verify Dacl integrity */ - - if(!GetSecurityDescriptorDacl(sd, &bAclPresent, &pAcl, &bDefaulted)) - return FALSE; - - if(bAclPresent && pAcl!=NULL) { - if(!IsValidAcl(pAcl)) return FALSE; - } - - /* verify Sacl integrity */ - - if(!GetSecurityDescriptorSacl(sd, &bAclPresent, &pAcl, &bDefaulted)) - return FALSE; - - if(bAclPresent && pAcl!=NULL) { - if(!IsValidAcl(pAcl)) return FALSE; - } - - /* verify owner integrity */ - - if(!GetSecurityDescriptorOwner(sd, &pSid, &bDefaulted)) - return FALSE; - - if(pSid != NULL) { - if(!IsValidSid(pSid)) return FALSE; - } - - /* verify group integrity */ - - if(!GetSecurityDescriptorGroup(sd, &pSid, &bDefaulted)) - return FALSE; - - if(pSid != NULL) { - if(!IsValidSid(pSid)) return FALSE; - } - - return TRUE; -} - -static VOID GetRemotePrivilegesSet(char *FileName, PDWORD dwRemotePrivileges) -{ - HANDLE hFile; - - *dwRemotePrivileges = 0; - - /* see if we have the SeRestorePrivilege */ - - hFile = CreateFileA( - FileName, - ACCESS_SYSTEM_SECURITY | WRITE_DAC | WRITE_OWNER | READ_CONTROL, - FILE_SHARE_READ | FILE_SHARE_DELETE, /* no sd updating allowed here */ - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS, - NULL - ); - - if(hFile != INVALID_HANDLE_VALUE) { - /* no remote way to determine SeRestorePrivilege -- just try a - read/write to simulate it */ - SECURITY_INFORMATION si = DACL_SECURITY_INFORMATION | - SACL_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION | - GROUP_SECURITY_INFORMATION; - PSECURITY_DESCRIPTOR sd; - DWORD cbBuf = 0; - - GetKernelObjectSecurity(hFile, si, NULL, cbBuf, &cbBuf); - - if(ERROR_INSUFFICIENT_BUFFER == GetLastError()) { - if((sd = HeapAlloc(GetProcessHeap(), 0, cbBuf)) != NULL) { - if(GetKernelObjectSecurity(hFile, si, sd, cbBuf, &cbBuf)) { - if(SetKernelObjectSecurity(hFile, si, sd)) - *dwRemotePrivileges |= OVERRIDE_RESTORE; - } - HeapFree(GetProcessHeap(), 0, sd); - } - } - - CloseHandle(hFile); - } else { - - /* see if we have the SeSecurityPrivilege */ - /* note we don't need this if we have SeRestorePrivilege */ - - hFile = CreateFileA( - FileName, - ACCESS_SYSTEM_SECURITY, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, /* max */ - NULL, - OPEN_EXISTING, - 0, - NULL - ); - - if(hFile != INVALID_HANDLE_VALUE) { - CloseHandle(hFile); - *dwRemotePrivileges |= OVERRIDE_SACL; - } - } -} - - -BOOL GetVolumeCaps( - char *rootpath, /* filepath, or NULL */ - char *name, /* filename associated with rootpath */ - PVOLUMECAPS VolumeCaps /* result structure describing capabilities */ - ) -{ - char TempRootPath[MAX_PATH + 1]; - DWORD cchTempRootPath = 0; - BOOL bSuccess = TRUE; /* assume success until told otherwise */ - - if(!bInitialized) if(!Initialize()) return FALSE; - - /* process the input path to produce a consistent path suitable for - compare operations and also suitable for certain picky Win32 API - that don't like forward slashes */ - - if(rootpath != NULL && rootpath[0] != '\0') { - DWORD i; - - cchTempRootPath = lstrlenA(rootpath); - if(cchTempRootPath > MAX_PATH) return FALSE; - - /* copy input, converting forward slashes to back slashes as we go */ - - for(i = 0 ; i <= cchTempRootPath ; i++) { - if(rootpath[i] == '/') TempRootPath[i] = '\\'; - else TempRootPath[i] = rootpath[i]; - } - - /* check for UNC and Null terminate or append trailing \ as - appropriate */ - - /* possible valid UNCs we are passed follow: - \\machine\foo\bar (path is \\machine\foo\) - \\machine\foo (path is \\machine\foo\) - \\machine\foo\ - \\.\c$\ (FIXFIX: Win32API doesn't like this - GetComputerName()) - LATERLATER: handling mounted DFS drives in the future will require - slightly different logic which isn't available today. - This is required because directories can point at - different servers which have differing capabilities. - */ - - if(TempRootPath[0] == '\\' && TempRootPath[1] == '\\') { - DWORD slash = 0; - - for(i = 2 ; i < cchTempRootPath ; i++) { - if(TempRootPath[i] == '\\') { - slash++; - - if(slash == 2) { - i++; - TempRootPath[i] = '\0'; - cchTempRootPath = i; - break; - } - } - } - - /* if there was only one slash found, just tack another onto the - end */ - - if(slash == 1 && TempRootPath[cchTempRootPath] != '\\') { - TempRootPath[cchTempRootPath] = TempRootPath[0]; /* '\\' */ - TempRootPath[cchTempRootPath+1] = '\0'; - cchTempRootPath++; - } - - } else { - - if(TempRootPath[1] == ':') { - - /* drive letter specified, truncate to root */ - TempRootPath[2] = '\\'; - TempRootPath[3] = '\0'; - cchTempRootPath = 3; - } else { - - /* must be file on current drive */ - TempRootPath[0] = '\0'; - cchTempRootPath = 0; - } - - } - - } /* if path != NULL */ - - /* grab lock protecting cached entry */ - EnterCriticalSection( &VolumeCapsLock ); - - if(!g_VolumeCaps.bValid || - lstrcmpiA(g_VolumeCaps.RootPath, TempRootPath) != 0) - { - - /* no match found, build up new entry */ - - DWORD dwFileSystemFlags; - DWORD dwRemotePrivileges = 0; - BOOL bRemote = FALSE; - - /* release lock during expensive operations */ - LeaveCriticalSection( &VolumeCapsLock ); - - bSuccess = GetVolumeInformationA( - (TempRootPath[0] == '\0') ? NULL : TempRootPath, - NULL, 0, - NULL, NULL, - &dwFileSystemFlags, - NULL, 0); - - - /* only if target volume supports Acls, and we were told to use - privileges do we need to go out and test for the remote case */ - - if(bSuccess && (dwFileSystemFlags & FS_PERSISTENT_ACLS) && - VolumeCaps->bUsePrivileges) - { - if(GetDriveTypeA( (TempRootPath[0] == '\0') ? NULL : TempRootPath ) - == DRIVE_REMOTE) - { - bRemote = TRUE; - - /* make a determination about our remote capabilities */ - - GetRemotePrivilegesSet(name, &dwRemotePrivileges); - } - } - - /* always take the lock again, since we release it below */ - EnterCriticalSection( &VolumeCapsLock ); - - /* replace the existing data if successful */ - if(bSuccess) { - - lstrcpynA(g_VolumeCaps.RootPath, TempRootPath, cchTempRootPath+1); - g_VolumeCaps.dwFileSystemFlags = dwFileSystemFlags; - g_VolumeCaps.bRemote = bRemote; - g_VolumeCaps.dwRemotePrivileges = dwRemotePrivileges; - g_VolumeCaps.bValid = TRUE; - } - } - - if(bSuccess) { - /* copy input elements */ - g_VolumeCaps.bUsePrivileges = VolumeCaps->bUsePrivileges; - g_VolumeCaps.dwFileAttributes = VolumeCaps->dwFileAttributes; - - /* give caller results */ - memcpy(VolumeCaps, &g_VolumeCaps, sizeof(VOLUMECAPS)); - } else { - g_VolumeCaps.bValid = FALSE; - } - - LeaveCriticalSection( &VolumeCapsLock ); /* release lock */ - - return bSuccess; -} - - -BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata) -{ - HANDLE hFile; - DWORD dwDesiredAccess = 0; - DWORD dwFlags = 0; - PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR)securitydata; - SECURITY_DESCRIPTOR_CONTROL sdc; - SECURITY_INFORMATION RequestedInfo = 0; - DWORD dwRev; - BOOL bRestorePrivilege = FALSE; - BOOL bSaclPrivilege = FALSE; - BOOL bSuccess; - - if(!bInitialized) if(!Initialize()) return FALSE; - - /* defer directory processing */ - - if(VolumeCaps->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - /* opening a directory requires FILE_FLAG_BACKUP_SEMANTICS */ - dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; - } - - /* evaluate the input security descriptor and act accordingly */ - - if(!IsValidSecurityDescriptor(sd)) - return FALSE; - - if(!GetSecurityDescriptorControl(sd, &sdc, &dwRev)) - return FALSE; - - /* setup privilege usage based on if told we can use privileges, and if so, - what privileges we have */ - - if(VolumeCaps->bUsePrivileges) { - if(VolumeCaps->bRemote) { - /* use remotely determined privileges */ - if(VolumeCaps->dwRemotePrivileges & OVERRIDE_RESTORE) - bRestorePrivilege = TRUE; - - if(VolumeCaps->dwRemotePrivileges & OVERRIDE_SACL) - bSaclPrivilege = TRUE; - - } else { - /* use local privileges */ - bRestorePrivilege = g_bRestorePrivilege; - bSaclPrivilege = g_bSaclPrivilege; - } - } - - - /* if a Dacl is present write Dacl out */ - /* if we have SeRestorePrivilege, write owner and group info out */ - - if(sdc & SE_DACL_PRESENT) { - dwDesiredAccess |= WRITE_DAC; - RequestedInfo |= DACL_SECURITY_INFORMATION; - - if(bRestorePrivilege) { - dwDesiredAccess |= WRITE_OWNER; - RequestedInfo |= (OWNER_SECURITY_INFORMATION | - GROUP_SECURITY_INFORMATION); - } - } - - /* if a Sacl is present and we have either SeRestorePrivilege or - SeSystemSecurityPrivilege try to write Sacl out */ - - if((sdc & SE_SACL_PRESENT) && (bRestorePrivilege || bSaclPrivilege)) { - dwDesiredAccess |= ACCESS_SYSTEM_SECURITY; - RequestedInfo |= SACL_SECURITY_INFORMATION; - } - - if(RequestedInfo == 0) /* nothing to do */ - return FALSE; - - if(bRestorePrivilege) - dwFlags |= FILE_FLAG_BACKUP_SEMANTICS; - - hFile = CreateFileA( - resource, - dwDesiredAccess, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,/* max sharing */ - NULL, - OPEN_EXISTING, - dwFlags, - NULL - ); - - if(hFile == INVALID_HANDLE_VALUE) - return FALSE; - - bSuccess = SetKernelObjectSecurity(hFile, RequestedInfo, sd); - - CloseHandle(hFile); - - return bSuccess; -} - -static VOID InitLocalPrivileges(VOID) -{ - HANDLE hToken; - TOKEN_PRIVILEGES tp; - - /* try to enable some interesting privileges that give us the ability - to get some security information that we normally cannot. - - note that enabling privileges is only relevant on the local machine; - when accessing files that are on a remote machine, any privileges - that are present on the remote machine get enabled by default. */ - - if(!OpenProcessToken(GetCurrentProcess(), - TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken)) - return; - - tp.PrivilegeCount = 1; - tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - if(LookupPrivilegeValue(NULL, SE_RESTORE_NAME, &tp.Privileges[0].Luid)) { - - /* try to enable SeRestorePrivilege; if this succeeds, we can write - all aspects of the security descriptor */ - - if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && - GetLastError() == ERROR_SUCCESS) g_bRestorePrivilege = TRUE; - - } - - /* try to enable SeSystemSecurityPrivilege, if SeRestorePrivilege not - present; if this succeeds, we can write the Sacl */ - - if(!g_bRestorePrivilege && - LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid)) { - - if(AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) && - GetLastError() == ERROR_SUCCESS) g_bSaclPrivilege = TRUE; - } - - CloseHandle(hToken); -} -#endif /* NTSD_EAS */ diff --git a/data/windows/unzipfx-catia/win32/nt.h b/data/windows/unzipfx-catia/win32/nt.h deleted file mode 100644 index 774c754..0000000 --- a/data/windows/unzipfx-catia/win32/nt.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* nt.h: central header for EF_NTSD "SD" extra field */ - -#ifndef _NT_H -#define _NT_H - -#define NTSD_BUFFERSIZE (1024) /* threshold to cause malloc() */ -#define OVERRIDE_BACKUP 1 /* we have SeBackupPrivilege on remote */ -#define OVERRIDE_RESTORE 2 /* we have SeRestorePrivilege on remote */ -#define OVERRIDE_SACL 4 /* we have SeSystemSecurityPrivilege on remote */ - -typedef struct { - BOOL bValid; /* are our contents valid? */ - BOOL bUsePrivileges; /* use privilege overrides? */ - DWORD dwFileSystemFlags; /* describes target file system */ - BOOL bRemote; /* is volume remote? */ - DWORD dwRemotePrivileges; /* relevant only on remote volumes */ - DWORD dwFileAttributes; - char RootPath[MAX_PATH+1]; /* path to network / filesystem */ -} VOLUMECAPS, *PVOLUMECAPS, *LPVOLUMECAPS; - -BOOL SecuritySet(char *resource, PVOLUMECAPS VolumeCaps, uch *securitydata); -BOOL GetVolumeCaps(char *rootpath, char *name, PVOLUMECAPS VolumeCaps); -BOOL ValidateSecurity(uch *securitydata); - -#endif /* _NT_H */ diff --git a/data/windows/unzipfx-catia/win32/w32cfg.h b/data/windows/unzipfx-catia/win32/w32cfg.h deleted file mode 100644 index 0e4f584..0000000 --- a/data/windows/unzipfx-catia/win32/w32cfg.h +++ /dev/null @@ -1,571 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - Win32 specific configuration section: - ---------------------------------------------------------------------------*/ - -#ifndef __w32cfg_h -#define __w32cfg_h - -#ifdef __MINGW32__ -# define USE_STRM_INPUT -#endif - -#ifdef __CYGWIN__ -/* We treat the file system underneath the Cygwin Unix emulator environment - * as "native VFAT/NTFS" and use the WIN32 API for its special attributes... - */ -# ifdef UNIX -# undef UNIX -# endif -#endif - -#if (defined(_MSC_VER) && !defined(MSC)) -# define MSC -#endif - -/* enable multibyte character set support by default */ -#if (!defined(_MBCS) && !defined(NO_MBCS)) -# define _MBCS -#endif -#if (defined(_MBCS) && defined(NO_MBCS)) -# undef _MBCS -#endif -#if (defined(__CYGWIN__) && defined(_MBCS)) -# undef _MBCS /* Cygwin RTL lacks support for __mb_cur_max */ -#endif -#if (defined(__DJGPP__) && !defined(__EMX__) && defined(_MBCS)) -# undef _MBCS /* __mb_cur_max missing for RSXNTdj 1.6 beta */ -#endif - -#include /* off_t, time_t, dev_t, ... */ -#include -#include /* read(), open(), etc. */ -#include -#if ((defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)) -# define tzset _tzset -#endif -#if (defined(__LCC__) && !defined(tzset)) -# define tzset _tzset -#endif -#ifdef W32_USE_IZ_TIMEZONE -# ifdef __BORLANDC__ -# define tzname tzname -# define IZTZ_DEFINESTDGLOBALS -# endif -# ifdef __WATCOMC__ -# define IZTZ_DEFINESTDGLOBALS -# endif -# ifndef tzset -# define tzset _tzset -# endif -# ifndef timezone -# define timezone _timezone -# endif -# ifndef daylight -# define daylight _daylight -# endif -# ifndef tzname -# define tzname _tzname -# endif -# if (!defined(NEED__ISINDST) && !defined(__BORLANDC__)) -# define NEED__ISINDST -# endif -# ifdef IZTZ_GETLOCALETZINFO -# undef IZTZ_GETLOCALETZINFO -# endif -# define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone -#endif /* W32_USE_IZ_TIMEZONE */ -#include -#if (!defined(__RSXNT__) && !defined(__CYGWIN__)) -# include /* mkdir() */ -#endif -#include -#ifdef __CYGWIN__ -# include - extern int setmode(int, int); /* this is missing in */ -#endif -#if (defined(MSC) || defined(__WATCOMC__) || defined(__MINGW32__)) -# include -#else -# include -#endif -#define GOT_UTIMBUF - -#ifdef _MBCS -# if (!defined(__EMX__) && !defined(__DJGPP__) && !defined(__CYGWIN__)) -# if (!defined(__MINGW32__) || defined(__MSVCRT__)) -# include -# include - /* for MSC (and compatible compilers), use routines supplied by RTL */ -# define CLEN(ptr) _mbclen((const uch *)(ptr)) -# define PREINCSTR(ptr) (ptr = (char *)_mbsinc((const uch *)(ptr))) -# define MBSCHR(str, c) (char *)_mbschr((const uch *)(str), (c)) -# define MBSRCHR(str, c) (char *)_mbsrchr((const uch *)(str), (c)) -# endif -# endif -# if (defined(__MINGW32__) && !defined(MB_CUR_MAX)) -# ifdef __MSVCRT__ - extern int *__p___mb_cur_max(void); -# define MB_CUR_MAX (*__p___mb_cur_max()) -# else - extern int *_imp____mb_cur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif -# endif -# if (defined(__LCC__) && !defined(MB_CUR_MAX)) - extern int *_imp____mb_cur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# endif -# if (defined(__DJGPP__) && !defined(__EMX__) && !defined(MB_CUR_MAX)) - extern int *_imp____mb_cur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# endif -#endif - -/* for UnZip, the "basic" part of the win32 api is sufficient */ -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif - -#if defined(__FILEIO_C) -# ifndef __CYGWIN__ -# include -# endif -# include -# ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -# endif -# ifndef TIME_ZONE_ID_INVALID -# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL -# endif -#endif -#if (defined(__ENVARGS_C) || defined(__EXTRACT_C) || defined(__UNZIP_C) || \ - defined(ZCRYPT_INTERNAL)) -# include -# ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -# endif -# ifndef TIME_ZONE_ID_INVALID -# define TIME_ZONE_ID_INVALID (DWORD)0xFFFFFFFFL -# endif -#endif - -#ifndef Cdecl -# define Cdecl __cdecl -#endif - -/* the following definitions are considered as "obsolete" by Microsoft and - * might be missing in some versions of - */ -#ifndef AnsiToOem -# define AnsiToOem CharToOemA -#endif -#ifndef OemToAnsi -# define OemToAnsi OemToCharA -#endif - -#define DIR_END '\\' /* OS uses '\\' as directory separator */ -#define DIR_END2 '/' /* also check for '/' (RTL may convert) */ -#ifdef DATE_FORMAT -# undef DATE_FORMAT -#endif -#define DATE_FORMAT dateformat() -#ifdef DATE_SEPCHAR -# undef DATE_SEPCHAR -#endif -#define DATE_SEPCHAR dateseparator() -#define lenEOL 2 -#define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);} - -#if (defined(__RSXNT__) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (defined(MSC) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (defined(__CYGWIN__) && defined(HAVE_MKTIME)) -# undef HAVE_MKTIME /* Cygnus' mktime() implementation is buggy */ -#endif -#if (defined(W32_USE_IZ_TIMEZONE) && !defined(HAVE_MKTIME)) -# define HAVE_MKTIME /* use mktime() in time conversion routines */ -#endif -#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -#endif -#if (!defined(NO_DIR_ATTRIB) && !defined(SET_DIR_ATTRIB)) -# define SET_DIR_ATTRIB -#endif -#if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP)) -# define TIMESTAMP -#endif -#if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS)) -# define NTSD_EAS /* enable NTSD support unless explicitly suppressed */ -#endif -#if (defined(NTSD_EAS) && !defined(RESTORE_ACL)) -# define RESTORE_ACL /* "restore ACLs" only needed when NTSD_EAS active */ -#endif -#if (!defined(NO_UNICODE_SUPPORT) && !defined(UNICODE_SUPPORT)) -# define UNICODE_SUPPORT /* enable UTF-8 filename support by default */ -#endif -#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR)) -# define UNICODE_WCHAR /* wchar_t is UTF-16 encoded on WIN32 */ -#endif -#ifdef UTF8_MAYBE_NATIVE -# undef UTF8_MAYBE_NATIVE /* UTF-8 cannot be system charset on WIN32 */ -#endif - -/* The following compiler systems provide or use a runtime library with a - * locale-aware isprint() implementation. For these systems, the "enhanced" - * unprintable charcode detection in fnfilter() gets enabled. - */ -#if (!defined(HAVE_WORKING_ISPRINT) && !defined(NO_WORKING_ISPRINT)) -# if defined(MSC) || defined(__BORLANDC__) -# define HAVE_WORKING_ISPRINT -# endif -# if defined(__MINGW32__) && defined(__MSVCRT__) -# define HAVE_WORKING_ISPRINT -# endif -#endif - -/* WIN32 runs solely on little-endian processors; enable support - * for the 32-bit optimized CRC-32 C code by default. - */ -#ifdef IZ_CRC_BE_OPTIMIZ -# undef IZ_CRC_BE_OPTIMIZ -#endif -#if !defined(IZ_CRC_LE_OPTIMIZ) && !defined(NO_CRC_OPTIMIZ) -# define IZ_CRC_LE_OPTIMIZ -#endif - -/* handlers for OEM <--> ANSI string conversions */ -#ifdef __RSXNT__ - /* RSXNT uses OEM coded strings in functions supplied by C RTL */ -# ifdef CRTL_CP_IS_ISO -# undef CRTL_CP_IS_ISO -# endif -# ifndef CRTL_CP_IS_OEM -# define CRTL_CP_IS_OEM -# endif -#else - /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */ -# ifndef CRTL_CP_IS_ISO -# define CRTL_CP_IS_ISO -# endif -# ifdef CRTL_CP_IS_OEM -# undef CRTL_CP_IS_OEM -# endif -#endif - -#ifdef CRTL_CP_IS_ISO - /* C RTL's file system support assumes ANSI coded strings */ -# define ISO_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define OEM_TO_INTERN(src, dst) OemToAnsi(src, dst) -# define INTERN_TO_ISO(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define INTERN_TO_OEM(src, dst) AnsiToOem(src, dst) -#endif /* CRTL_CP_IS_ISO */ -#ifdef CRTL_CP_IS_OEM - /* C RTL's file system support assumes OEM coded strings */ -# define ISO_TO_INTERN(src, dst) AnsiToOem(src, dst) -# define OEM_TO_INTERN(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -# define INTERN_TO_ISO(src, dst) OemToAnsi(src, dst) -# define INTERN_TO_OEM(src, dst) {if ((src) != (dst)) strcpy((dst), (src));} -#endif /* CRTL_CP_IS_OEM */ -#define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1) -#define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1) -#ifndef WINDLL - /* Despite best intentions, for the command-line version UzpPassword() - * could return either character set, depending on whether running under - * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */ -# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) -# define STR_TO_CP3(dst, src) (OemToAnsi(src, dst), dst) -#else - /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */ -# define STR_TO_CP2(dst, src) (AnsiToOem(src, dst), dst) -#endif -/* dummy defines to disable these functions, they are not needed */ -#define STR_TO_OEM -#define STR_TO_ISO - -/* Static variables that we have to add to Uz_Globs: */ -#define SYSTEM_SPECIFIC_GLOBALS \ - int created_dir, renamed_fullpath, fnlen;\ - unsigned nLabelDrive;\ - char lastRootPath[4];\ - int lastVolOldFAT, lastVolLocTim;\ - char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\ - ZCONST char *wildname;\ - char *dirname, matchname[FILNAMSIZ];\ - int rootlen, have_dirname, dirnamelen, notfirstcall;\ - zvoid *wild_dir; - -/* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by */ -/* both mapname() and checkdir(). */ -/* lastRootPath, lastVolOldFAT and lastVolLocTim are used by */ -/* IsVolumeOldFAT() and NTQueryVolInfo(). */ -/* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */ -/* are used by checkdir(). */ -/* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */ -/* and notfirstcall are used by do_wild(). */ - -/* This replacement for C-RTL-supplied getch() (or similar) functionality - * avoids leaving unabsorbed LFs in the keyboard buffer under Windows95, - * and supports the +[0] feature. - */ -int getch_win32 OF((void)); - -/* Up to now, all versions of Microsoft C runtime libraries lack the support - * for customized (non-US) switching rules between daylight saving time and - * standard time in the TZ environment variable string. - * But non-US timezone rules are correctly supported when timezone information - * is read from the OS system settings in the Win32 registry. - * The following work-around deletes any TZ environment setting from - * the process environment. This results in a fallback of the RTL time - * handling code to the (correctly interpretable) OS system settings, read - * from the registry. - */ -#ifdef USE_EF_UT_TIME -# if (defined(__WATCOMC__) || defined(__CYGWIN__) || \ - defined(W32_USE_IZ_TIMEZONE)) -# define iz_w32_prepareTZenv() -# else -# define iz_w32_prepareTZenv() putenv("TZ=") -# endif -#endif - -/* This patch of stat() is useful for at least two compilers. It is */ -/* difficult to take a stat() of a root directory under Windows95, so */ -/* zstat_win32() detects that case and fills in suitable values. */ -#ifndef __RSXNT__ -# ifndef W32_STATROOT_FIX -# define W32_STATROOT_FIX -# endif -#endif /* !__RSXNT__ */ - -#define W32_STAT_BANDAID -#if defined(REENTRANT) -# define __W32STAT_GLOBALS__ Uz_Globs *pG, -# define __W32STAT_G__ pG, -#else -# define __W32STAT_GLOBALS__ -# define __W32STAT_G__ -#endif -#ifdef SSTAT -# undef SSTAT -#endif -#ifdef WILD_STAT_BUG -# define SSTAT(path, pbuf) (iswild(path) || zstat_win32(__W32STAT_G__ path, pbuf)) -#else -# define SSTAT(path, pbuf) zstat_win32(__W32STAT_G__ path, pbuf) -#endif - -#ifdef __WATCOMC__ -# ifdef __386__ -# ifndef WATCOMC_386 -# define WATCOMC_386 -# endif -# define __32BIT__ -# undef far -# define far -# undef near -# define near -# undef Cdecl -# define Cdecl - -/* gaah -- Watcom's docs claim that _get_osfhandle exists, but it doesn't. */ -# define _get_osfhandle _os_handle - -/* Get asm routines to link properly without using "__cdecl": */ -# ifndef USE_ZLIB -# pragma aux crc32 "_*" parm caller [] value [eax] modify [eax] -# pragma aux get_crc_table "_*" parm caller [] value [eax] \ - modify [eax ecx edx] -# endif /* !USE_ZLIB */ -# endif /* __386__ */ -#endif /* __WATCOMC__ */ - -#define SCREENWIDTH 80 -#define SCREENSIZE(scrrows, scrcols) screensize(scrrows, scrcols) -int screensize(int *tt_rows, int *tt_cols); - -/* on the DOS or NT console screen, line-wraps are always enabled */ -#define SCREENLWRAP 1 -#define TABSIZE 8 - - -/* 64-bit-Integers & Large File Support - * (pasted here from Zip 3b, osdep.h - Myles Bennett 7-jun-2004) - * (updated from Zip 3.0d - Ed Gordon 6-oct-2004) - * - * If this is set it is assumed that the port - * supports 64-bit file calls. The types are - * defined here. Any local implementations are - * in w32i64.c and the prototypes for the calls are - * in unzip.h. Note that a port must support - * these calls fully or should not set - * LARGE_FILE_SUPPORT. - */ - -/* Automatically set ZIP64_SUPPORT if supported */ - -#ifndef NO_ZIP64_SUPPORT -# ifndef ZIP64_SUPPORT -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) -# define ZIP64_SUPPORT -# elif defined(__LCC__) - /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */ -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) -# define ZIP64_SUPPORT -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */ -# endif -# endif -#endif - -#ifdef ZIP64_SUPPORT - /* base type for file offsets and file sizes */ -# if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) - typedef long long zoff_t; -# else - /* all other compilers use this as intrinsic 64-bit type */ - typedef __int64 zoff_t; -# endif -# define ZOFF_T_DEFINED - - /* user-defined types and format strings for 64-bit numbers and - * file pointer functions (these depend on the rtl library and library - * headers used; they are NOT compiler-specific) - */ -# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__LCC__) - /* MS C and VC, MinGW32, lcc32 */ - /* these systems use the Microsoft C RTL */ - - /* 64-bit stat struct */ - typedef struct _stati64 z_stat; -# define Z_STAT_DEFINED - -# ifdef __LCC__ - /* The LCC headers lack these declarations of MSC rtl functions in - sys/stat.h. */ - struct _stati64 { - unsigned int st_dev; - unsigned short st_ino; - unsigned short st_mode; - short st_nlink; - short st_uid; - short st_gid; - unsigned int st_rdev; - __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; - }; - int _stati64(const char *, struct _stati64 *); - int _fstati64(int, struct _stati64 *); - __int64 _lseeki64(int, __int64, int); -# endif /* __LCC__ */ - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "I64" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n" - -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C 5.2 or newer */ - - /* 64-bit stat struct */ - typedef struct stati64 z_stat; -# define Z_STAT_DEFINED - - /* Borland C does not provide a 64-bit-capable _lseeki64(), so we - need to use the stdio.h stream functions instead. */ -# ifndef USE_STRM_INPUT -# define USE_STRM_INPUT -# endif - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "L" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9Lu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9Lu %9lu file%s\n" - -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) - /* WATCOM C */ - - /* 64-bit stat struct */ - typedef struct _stati64 z_stat; -# define Z_STAT_DEFINED - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "ll" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9llu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9llu %9lu file%s\n" - -# elif (defined(__IBMC__) && (__IBMC__ >= 350)) - /* IBM C */ - - /* 64-bit stat struct */ - - /* printf format size prefix for zoff_t values */ -# define FZOFFT_FMT "I64" -# define FZOFFT_HEX_WID_VALUE "16" - -# define SHORTHDRSTATS "%9I64u %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9I64u %9lu file%s\n" - -# endif - -#endif - -/* If port has LARGE_FILE_SUPPORT then define here - to make automatic unless overridden */ - -#ifndef LARGE_FILE_SUPPORT -# ifndef NO_LARGE_FILE_SUPPORT -# if defined(_MSC_VER) || defined(__MINGW32__) -# define LARGE_FILE_SUPPORT -# elif defined(__LCC__) - /* LCC links against crtdll.dll -> no support of 64-bit offsets :( */ -# elif defined(__CYGWIN__) -# define LARGE_FILE_SUPPORT -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) -# define LARGE_FILE_SUPPORT -# elif (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)) - /* Borland C RTL lacks any support to get/set 64-bit file pointer :( */ -# endif -# endif -#endif - - -#ifndef LARGE_FILE_SUPPORT - /* No Large File Support */ - - /* base type for file offsets and file sizes */ - typedef long zoff_t; -# define ZOFF_T_DEFINED - - /* stat struct */ - typedef struct stat z_stat; -# define Z_STAT_DEFINED - -# define FZOFFT_FMT "l" -# define FZOFFT_HEX_WID_VALUE "8" - - -# define SHORTHDRSTATS "%9lu %02u%c%02u%c%02u %02u:%02u %c" -# define SHORTFILETRAILER " -------- -------\n%9lu %9lu file%s\n" - -#endif /* LARGE_FILE_SUPPORT */ - -#endif /* !__w32cfg_h */ diff --git a/data/windows/unzipfx-catia/win32/win32.c b/data/windows/unzipfx-catia/win32/win32.c deleted file mode 100644 index 410207f..0000000 --- a/data/windows/unzipfx-catia/win32/win32.c +++ /dev/null @@ -1,3139 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-04 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - win32.c - - 32-bit Windows-specific (NT/9x) routines for use with Info-ZIP's UnZip 5.3 - and later. - - Contains: GetLoadPath() - Opendir() - Readdir() - Closedir() - SetSD() set security descriptor on file - FindSDExtraField() extract SD e.f. block from extra field - IsWinNT() indicate type of WIN32 platform - test_NTSD() test integrity of NT security data - utime2NtfsFileTime() - utime2VFatFileTime() - FStampIsLocTime() - NtfsFileTime2utime() - VFatFileTime2utime() - getNTfiletime() - SetFileSize() - close_outfile() - defer_dir_attribs() - set_direc_attribs() - stamp_file() - isfloppy() - NTQueryVolInfo() - IsVolumeOldFAT() - do_wild() - mapattr() - mapname() - maskDOSdevice() - map2fat() - checkdir() - dateformat() - dateseparator() - version() - screensize() - zstat_win32() - conv_to_rule() - GetPlatformLocalTimezone() - getch_win32() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "../unzip.h" -#include /* must be AFTER unzip.h to avoid struct G problems */ -#ifdef __RSXNT__ -# include "../win32/rsxntwin.h" -#endif -#include "../win32/nt.h" - -#ifndef FUNZIP /* most of this file is not used with fUnZip */ - -/* some non-MS runtime headers (e.g. lcc) may miss this definition */ -#ifndef FILE_WRITE_ATTRIBUTES -# define FILE_WRITE_ATTRIBUTES 0x0100 -#endif - -#if (defined(__EMX__) || defined(__CYGWIN__)) -# define MKDIR(path,mode) mkdir(path,mode) -#else -# define MKDIR(path,mode) mkdir(path) -#endif - -#ifdef HAVE_WORKING_DIRENT_H -# undef HAVE_WORKING_DIRENT_H -#endif -/* The emxrtl dirent support of (__GO32__ || __EMX__) converts to lowercase! */ -#if defined(__CYGWIN__) -# define HAVE_WORKING_DIRENT_H -#endif - -#ifndef SFX -# ifdef HAVE_WORKING_DIRENT_H -# include /* use readdir() */ -# define zdirent dirent -# define zDIR DIR -# define Opendir opendir -# define Readdir readdir -# define Closedir closedir -# else /* !HAVE_WORKING_DIRENT_H */ - typedef struct zdirent { - char reserved [21]; - char ff_attrib; - short ff_ftime; - short ff_fdate; - long size; - char d_name[MAX_PATH]; - int d_first; - HANDLE d_hFindFile; - } zDIR; - - static zDIR *Opendir (const char *n); - static struct zdirent *Readdir (zDIR *d); - static void Closedir (zDIR *d); -# endif /* ?HAVE_WORKING_DIRENT_H */ -#endif /* !SFX */ - -#ifdef SET_DIR_ATTRIB -typedef struct NTdirattr { /* struct for holding unix style directory */ - struct NTdirattr *next; /* info until can be sorted and set at end */ - char *fn; /* filename of directory */ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - FILETIME Accft; /* NT file time type, `last access' time */ - FILETIME Creft; /* NT file time type, `file creation' time */ - int gotTime; - unsigned perms; /* same as min_info.file_attr */ -#ifdef NTSD_EAS - unsigned SDlen; /* length of SD data in buf */ -#endif - char buf[1]; /* buffer stub for directory SD and name */ -} NTdirattr; -#define NtAtt(d) ((NTdirattr *)d) /* typecast shortcut */ -#endif /* SET_DIR_ATTRIB */ - - -/* Function prototypes */ -#ifdef NTSD_EAS - static int SetSD(__GPRO__ char *path, unsigned fperms, - uch *eb_ptr, unsigned eb_len); - static int FindSDExtraField(__GPRO__ - uch *ef_ptr, unsigned ef_len, - uch **p_ebSD_ptr, unsigned *p_ebSD_len); -#endif - -#ifndef NO_W32TIMES_IZFIX - static void utime2NtfsFileTime(time_t ut, FILETIME *pft); -#endif -static void utime2VFatFileTime(time_t ut, FILETIME *pft, int clipDosMin); -#if (defined(W32_STAT_BANDAID) && !defined(NO_W32TIMES_IZFIX)) - static int NtfsFileTime2utime(const FILETIME *pft, time_t *ut); -#endif -#ifdef W32_STAT_BANDAID - static int VFatFileTime2utime(const FILETIME *pft, time_t *ut); -#endif -static int FStampIsLocTime(__GPRO__ const char *path); - - -static int getNTfiletime (__GPRO__ FILETIME *pModFT, FILETIME *pAccFT, - FILETIME *pCreFT); -static int isfloppy (int nDrive); -static int NTQueryVolInfo (__GPRO__ const char *name); -static int IsVolumeOldFAT (__GPRO__ const char *name); -static void maskDOSdevice (__GPRO__ char *pathcomp); -static void map2fat (char *pathcomp, char **pEndFAT); - - -#if (defined(__MINGW32__) && !defined(USE_MINGW_GLOBBING)) - int _CRT_glob = 0; /* suppress command line globbing by C RTL */ -#endif - -#ifdef ACORN_FTYPE_NFS -/* Acorn bits for NFS filetyping */ -typedef struct { - uch ID[2]; - uch size[2]; - uch ID_2[4]; - uch loadaddr[4]; - uch execaddr[4]; - uch attr[4]; -} RO_extra_block; - -#endif /* ACORN_FTYPE_NFS */ - -/* static int created_dir; */ /* used by mapname(), checkdir() */ -/* static int renamed_fullpath; */ /* ditto */ -/* static int fnlen; */ /* ditto */ -/* static unsigned nLabelDrive; */ /* ditto */ - -extern char Far TruncNTSD[]; /* in extract.c */ - - - -#ifdef SFX - -/**************************/ -/* Function GetLoadPath() */ -/**************************/ - -char *GetLoadPath(__GPRO) -{ -#ifdef MSC - extern char *_pgmptr; - return _pgmptr; - -#else /* use generic API call */ - - GetModuleFileName(NULL, G.filename, FILNAMSIZ); - _ISO_INTERN(G.filename); /* translate to codepage of C rtl's stdio */ - return G.filename; -#endif - -} /* end function GetLoadPath() */ - - - - - -#else /* !SFX */ - -#ifndef HAVE_WORKING_DIRENT_H - -/**********************/ /* Borrowed from ZIP 2.0 sources */ -/* Function Opendir() */ /* Difference: no special handling for */ -/**********************/ /* hidden or system files. */ - -static zDIR *Opendir(n) - const char *n; /* directory to open */ -{ - zDIR *d; /* malloc'd return value */ - char *p; /* malloc'd temporary string */ - WIN32_FIND_DATAA fd; - extent len = strlen(n); - - /* Start searching for files in directory n */ - - if ((d = (zDIR *)malloc(sizeof(zDIR))) == NULL || - (p = malloc(strlen(n) + 5)) == NULL) - { - if (d != (zDIR *)NULL) - free((void *)d); - return (zDIR *)NULL; - } - INTERN_TO_ISO(n, p); - if (len > 0) { - if (p[len-1] == ':') - p[len++] = '.'; /* x: => x:. */ - else if (p[len-1] == '/' || p[len-1] == '\\') - --len; /* foo/ => foo */ - } - strcpy(p+len, "/*"); - - if (INVALID_HANDLE_VALUE == (d->d_hFindFile = FindFirstFileA(p, &fd))) { - free((zvoid *)d); - free((zvoid *)p); - return NULL; - } - strcpy(d->d_name, fd.cFileName); - - free((zvoid *)p); - d->d_first = 1; - return d; - -} /* end of function Opendir() */ - - - - -/**********************/ /* Borrowed from ZIP 2.0 sources */ -/* Function Readdir() */ /* Difference: no special handling for */ -/**********************/ /* hidden or system files. */ - -static struct zdirent *Readdir(d) - zDIR *d; /* directory stream from which to read */ -{ - /* Return pointer to first or next directory entry, or NULL if end. */ - - if ( d->d_first ) - d->d_first = 0; - else - { - WIN32_FIND_DATAA fd; - - if ( !FindNextFileA(d->d_hFindFile, &fd) ) - return NULL; - - ISO_TO_INTERN(fd.cFileName, d->d_name); - } - return (struct zdirent *)d; - -} /* end of function Readdir() */ - - - - -/***********************/ -/* Function Closedir() */ /* Borrowed from ZIP 2.0 sources */ -/***********************/ - -static void Closedir(d) - zDIR *d; /* directory stream to close */ -{ - FindClose(d->d_hFindFile); - free(d); -} - -#endif /* !HAVE_WORKING_DIRENT_H */ -#endif /* ?SFX */ - - - - -#ifdef NTSD_EAS - -/**********************/ -/* Function SetSD() */ /* return almost-PK errors */ -/**********************/ - -static int SetSD(__G__ path, fperms, eb_ptr, eb_len) - __GDEF - char *path; - unsigned fperms; - uch *eb_ptr; - unsigned eb_len; -{ - ulg ntsd_ucSize; - VOLUMECAPS VolumeCaps; - uch *security_data; - int error; - - ntsd_ucSize = makelong(eb_ptr + (EB_HEADSIZE+EB_UCSIZE_P)); - if (ntsd_ucSize > 0L && eb_len <= (EB_NTSD_L_LEN + EB_CMPRHEADLEN)) - return IZ_EF_TRUNC; /* no compressed data! */ - - /* provide useful input */ - VolumeCaps.dwFileAttributes = fperms; - VolumeCaps.bUsePrivileges = (uO.X_flag > 1); - - /* check target volume capabilities - just fall through - * and try if fail */ - if (GetVolumeCaps(G.rootpath, path, &VolumeCaps) && - !(VolumeCaps.dwFileSystemFlags & FS_PERSISTENT_ACLS)) - return PK_OK; - - /* allocate storage for uncompressed data */ - security_data = (uch *)malloc((extent)ntsd_ucSize); - if (security_data == (uch *)NULL) - return PK_MEM4; - - error = memextract(__G__ security_data, ntsd_ucSize, - (eb_ptr + (EB_HEADSIZE+EB_NTSD_L_LEN)), (ulg)(eb_len - EB_NTSD_L_LEN)); - - if (error == PK_OK) { - if (SecuritySet(path, &VolumeCaps, security_data)) { - error = PK_COOL; - if (!uO.tflag && QCOND2) - Info(slide, 0, ((char *)slide, " (%ld bytes security)", - ntsd_ucSize)); - } - } - - free(security_data); - return error; -} - - - - -/********************************/ /* scan extra fields for something */ -/* Function FindSDExtraField() */ /* we happen to know */ -/********************************/ -/* Returns TRUE when a valid NTFS SD block is found. - * Address and size of the NTSD e.f. block are passed up to the caller. - * In case of more than one valid NTSD block in the e.f., the last block - * found is passed up. - * Returns FALSE and leaves the content of the ebSD_ptr and ebSD_len - * parameters untouched when no valid NTFS SD block is found. */ -static int FindSDExtraField(__GPRO__ - uch *ef_ptr, unsigned ef_len, - uch **p_ebSD_ptr, unsigned *p_ebSD_len) -{ - int rc = FALSE; - - if (!uO.X_flag) - return FALSE; /* user said don't process ACLs; for now, no other - extra block types are handled here */ - - while (ef_len >= EB_HEADSIZE) - { - unsigned eb_id = makeword(EB_ID + ef_ptr); - unsigned eb_len = makeword(EB_LEN + ef_ptr); - - if (eb_len > (ef_len - EB_HEADSIZE)) { - /* discovered some extra field inconsistency! */ - Trace((stderr, - "FindSDExtraField: block length %u > rest ef_size %u\n", eb_len, - ef_len - EB_HEADSIZE)); - break; - } - - switch (eb_id) - { - /* process security descriptor extra data if: - Caller is WinNT AND - Target local/remote drive supports acls AND - Target file is not a directory (else we defer processing - until later) - */ - case EF_NTSD: - if (!IsWinNT()) - break; /* OS not capable of handling NTFS attributes */ - - if (eb_len < EB_NTSD_L_LEN) - break; /* not a valid NTSD extra field */ - - /* check if we know how to handle this version */ - if (*(ef_ptr + (EB_HEADSIZE+EB_NTSD_VERSION)) - > (uch)EB_NTSD_MAX_VER) - break; - - *p_ebSD_ptr = ef_ptr; - *p_ebSD_len = eb_len; - rc = TRUE; - break; - -#ifdef DEBUG - case EF_OS2: - case EF_AV: - case EF_PKVMS: - case EF_PKW32: - case EF_PKUNIX: - case EF_IZVMS: - case EF_IZUNIX: - case EF_IZUNIX2: - case EF_TIME: - case EF_MAC3: - case EF_JLMAC: - case EF_ZIPIT: - case EF_VMCMS: - case EF_MVS: - case EF_ACL: - case EF_ATHEOS: - case EF_BEOS: - case EF_QDOS: - case EF_AOSVS: - case EF_SPARK: - case EF_MD5: - case EF_ASIUNIX: - break; /* shut up for other known e.f. blocks */ -#endif /* DEBUG */ - - default: - Trace((stderr, - "FindSDExtraField: unknown extra field block, ID=%u\n", - eb_id)); - break; - } - - ef_ptr += (eb_len + EB_HEADSIZE); - ef_len -= (eb_len + EB_HEADSIZE); - } - - return rc; -} - - - - -#ifndef SFX - -/**************************/ -/* Function test_NTSD() */ /* returns PK_WARN when NTSD data is invalid */ -/**************************/ - -#ifdef __BORLANDC__ -/* Turn off warning about not using all parameters for this function only */ -#pragma argsused -#endif -int test_NTSD(__G__ eb, eb_size, eb_ucptr, eb_ucsize) - __GDEF - uch *eb; - unsigned eb_size; - uch *eb_ucptr; - ulg eb_ucsize; -{ - return (ValidateSecurity(eb_ucptr) ? PK_OK : PK_WARN); -} /* end function test_NTSD() */ - -#endif /* !SFX */ -#endif /* NTSD_EAS */ - - - - -/**********************/ -/* Function IsWinNT() */ -/**********************/ - -int IsWinNT(void) /* returns TRUE if real NT, FALSE if Win9x or Win32s */ -{ - static DWORD g_PlatformId = 0xFFFFFFFF; /* saved platform indicator */ - - if (g_PlatformId == 0xFFFFFFFF) { - /* note: GetVersionEx() doesn't exist on WinNT 3.1 */ - if (GetVersion() < 0x80000000) - g_PlatformId = TRUE; - else - g_PlatformId = FALSE; - } - return (int)g_PlatformId; -} - - -/* DEBUG_TIME insertion: */ -#ifdef DEBUG_TIME -static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft); - -static int show_NTFileTime(FILE *hdo, char *TTmsg, int isloc, FILETIME *pft) -{ - SYSTEMTIME w32tm; - int rval; - - rval = FileTimeToSystemTime(pft, &w32tm); - if (!rval) { - fprintf(hdo, "%s\n %08lX,%08lX (%s) -> Conversion failed !!!\n", - TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), - (isloc ? "local" : "UTC")); - } else { - fprintf(hdo, "%s\n %08lx,%08lx -> %04u-%02u-%02u, %02u:%02u:%02u %s\n", - TTmsg, (ulg)(pft->dwHighDateTime), (ulg)(pft->dwLowDateTime), - w32tm.wYear, w32tm.wMonth, w32tm.wDay, w32tm.wHour, - w32tm.wMinute, w32tm.wSecond, (isloc ? "local" : "UTC")); - } - return rval; -} -#define FTTrace(x) show_NTFileTime x -#else -#define FTTrace(x) -#endif /* DEBUG_TIME */ -/* end of DEBUG_TIME insertion */ - -#ifndef IZ_USE_INT64 -# if (defined(__GNUC__) || defined(ULONG_LONG_MAX)) - typedef long long LLONG64; - typedef unsigned long long ULLNG64; -# define IZ_USE_INT64 -# elif (defined(__WATCOMC__) && (__WATCOMC__ >= 1100)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif (defined(_MSC_VER) && (_MSC_VER >= 1100)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif (defined(__IBMC__) && (__IBMC__ >= 350)) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# elif defined(HAVE_INT64) - typedef __int64 LLONG64; - typedef unsigned __int64 ULLNG64; -# define IZ_USE_INT64 -# endif -#endif - -/* scale factor and offset for conversion time_t -> FILETIME */ -#define NT_QUANTA_PER_UNIX 10000000L -#define UNIX_TIME_ZERO_HI 0x019DB1DEUL -#define UNIX_TIME_ZERO_LO 0xD53E8000UL -/* special FILETIME values for bound-checks */ -#define UNIX_TIME_UMAX_HI 0x0236485EUL -#define UNIX_TIME_UMAX_LO 0xD4A5E980UL -#define UNIX_TIME_SMIN_HI 0x0151669EUL -#define UNIX_TIME_SMIN_LO 0xD53E8000UL -#define UNIX_TIME_SMAX_HI 0x01E9FD1EUL -#define UNIX_TIME_SMAX_LO 0xD4A5E980UL -#define DOSTIME_MIN_FT_HI 0x01A8E79FUL -#define DOSTIME_MIN_FT_LO 0xE1D58000UL -/* time_t equivalent of DOSTIME_MINIMUM */ -#define UTIME_1980_JAN_01_00_00 315532800L - - -#ifndef NO_W32TIMES_IZFIX -/*********************************/ -/* Function utime2NtfsFileTime() */ /* convert Unix time_t format into the */ -/*********************************/ /* form used by SetFileTime() in NT/9x */ - -static void utime2NtfsFileTime(time_t ut, FILETIME *pft) -{ -#ifdef IZ_USE_INT64 - ULLNG64 NTtime; - - /* NT_QUANTA_PER_UNIX is small enough so that "ut * NT_QUANTA_PER_UNIX" - * cannot overflow in 64-bit signed calculation, regardless whether "ut" - * is signed or unsigned. */ - NTtime = ((LLONG64)ut * NT_QUANTA_PER_UNIX) + - ((ULLNG64)UNIX_TIME_ZERO_LO + ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); - pft->dwLowDateTime = (DWORD)NTtime; - pft->dwHighDateTime = (DWORD)(NTtime >> 32); - -#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ - unsigned int b1, b2, carry = 0; - unsigned long r0, r1, r2, r3; - long r4; /* signed, to catch environments with signed time_t */ - - b1 = ut & 0xFFFF; - b2 = (ut >> 16) & 0xFFFF; /* if ut is over 32 bits, too bad */ - r1 = b1 * (NT_QUANTA_PER_UNIX & 0xFFFF); - r2 = b1 * (NT_QUANTA_PER_UNIX >> 16); - r3 = b2 * (NT_QUANTA_PER_UNIX & 0xFFFF); - r4 = b2 * (NT_QUANTA_PER_UNIX >> 16); - r0 = (r1 + (r2 << 16)) & 0xFFFFFFFFL; - if (r0 < r1) - carry++; - r1 = r0; - r0 = (r0 + (r3 << 16)) & 0xFFFFFFFFL; - if (r0 < r1) - carry++; - pft->dwLowDateTime = r0 + UNIX_TIME_ZERO_LO; - if (pft->dwLowDateTime < r0) - carry++; - pft->dwHighDateTime = r4 + (r2 >> 16) + (r3 >> 16) - + UNIX_TIME_ZERO_HI + carry; -#endif /* ?IZ_USE_INT64 */ - -} /* end function utime2NtfsFileTime() */ -#endif /* !NO_W32TIMES_IZFIX */ - - - -/*********************************/ -/* Function utime2VFatFileTime() */ /* convert Unix time_t format into the */ -/*********************************/ /* form used by SetFileTime() in NT/9x */ - -static void utime2VFatFileTime(time_t ut, FILETIME *pft, int clipDosMin) -{ - time_t utc = ut; - struct tm *ltm; - SYSTEMTIME w32tm; - FILETIME lft; - - /* The milliseconds field gets always initialized to 0. */ - w32tm.wMilliseconds = 0; - -#ifdef __BORLANDC__ /* Borland C++ 5.x crashes when trying to reference tm */ - if (utc < UTIME_1980_JAN_01_00_00) - utc = UTIME_1980_JAN_01_00_00; -#endif - ltm = localtime(&utc); - if (ltm == (struct tm *)NULL) - /* localtime() did not accept given utc time value; try to use - the UTC value */ - ltm = gmtime(&utc); - if (ltm == (struct tm *)NULL) { - if (ut <= (UTIME_1980_JAN_01_00_00 + 86400)) { - /* use DOSTIME_MINIMUM date instead of "early" failure dates */ - w32tm.wYear = 1980; - w32tm.wMonth = 1; - w32tm.wDay = 1; - w32tm.wHour = 0; - w32tm.wMinute = 0; - w32tm.wSecond = 0; - } else { - /* as a last resort, use the current system time */ - GetLocalTime(&w32tm); - } - } else if (clipDosMin && (ltm->tm_year < 80)) { - w32tm.wYear = 1980; - w32tm.wMonth = 1; - w32tm.wDay = 1; - w32tm.wHour = 0; - w32tm.wMinute = 0; - w32tm.wSecond = 0; - } else { - w32tm.wYear = ltm->tm_year + 1900; /* year + 1900 -> year */ - w32tm.wMonth = ltm->tm_mon + 1; /* 0..11 -> 1..12 */ - w32tm.wDay = ltm->tm_mday; /* 1..31 */ - w32tm.wHour = ltm->tm_hour; /* 0..23 */ - w32tm.wMinute = ltm->tm_min; /* 0..59 */ - w32tm.wSecond = ltm->tm_sec; /* 0..61 in ANSI C */ - } - - SystemTimeToFileTime(&w32tm, &lft); - LocalFileTimeToFileTime(&lft, pft); - -} /* end function utime2VFatFileTime() */ - - - - /* nonzero if `y' is a leap year, else zero */ -#define leap(y) (((y)%4 == 0 && (y)%100 != 0) || (y)%400 == 0) - /* number of leap years from 1970 to `y' (not including `y' itself) */ -#define nleap(y) (((y)-1969)/4 - ((y)-1901)/100 + ((y)-1601)/400) - -extern ZCONST ush ydays[]; /* defined in fileio.c */ - -#if (defined(W32_STAT_BANDAID) && !defined(NO_W32TIMES_IZFIX)) -/*********************************/ -/* Function NtfsFileTime2utime() */ -/*********************************/ - -static int NtfsFileTime2utime(const FILETIME *pft, time_t *ut) -{ -#ifdef IZ_USE_INT64 - ULLNG64 NTtime; - - NTtime = ((ULLNG64)pft->dwLowDateTime + - ((ULLNG64)pft->dwHighDateTime << 32)); - -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if (NTtime < ((ULLNG64)UNIX_TIME_SMIN_LO + - ((ULLNG64)UNIX_TIME_SMIN_HI << 32))) { - *ut = (time_t)LONG_MIN; - return FALSE; - } - if (NTtime > ((ULLNG64)UNIX_TIME_SMAX_LO + - ((ULLNG64)UNIX_TIME_SMAX_HI << 32))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if (NTtime < ((ULLNG64)UNIX_TIME_ZERO_LO + - ((ULLNG64)UNIX_TIME_ZERO_HI << 32))) { - *ut = (time_t)0; - return FALSE; - } - if (NTtime > ((ULLNG64)UNIX_TIME_UMAX_LO + - ((ULLNG64)UNIX_TIME_UMAX_HI << 32))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - - NTtime -= ((ULLNG64)UNIX_TIME_ZERO_LO + - ((ULLNG64)UNIX_TIME_ZERO_HI << 32)); - *ut = (time_t)(NTtime / (unsigned long)NT_QUANTA_PER_UNIX); - return TRUE; -#else /* !IZ_USE_INT64 (64-bit integer arithmetics may not be supported) */ - time_t days; - SYSTEMTIME w32tm; - -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && - (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { - *ut = (time_t)LONG_MIN; - return FALSE; - if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || - ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && - (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { - *ut = (time_t)0; - return FALSE; - } - if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - - FileTimeToSystemTime(pft, &w32tm); - - /* set `days' to the number of days into the year */ - days = w32tm.wDay - 1 + ydays[w32tm.wMonth-1] + - (w32tm.wMonth > 2 && leap (w32tm.wYear)); - - /* now set `days' to the number of days since 1 Jan 1970 */ - days += 365 * (time_t)(w32tm.wYear - 1970) + - (time_t)(nleap(w32tm.wYear)); - - *ut = (time_t)(86400L * days + 3600L * (time_t)w32tm.wHour + - (time_t)(60 * w32tm.wMinute + w32tm.wSecond)); - return TRUE; -#endif /* ?IZ_USE_INT64 */ -} /* end function NtfsFileTime2utime() */ -#endif /* W32_STAT_BANDAID && !NO_W32TIMES_IZFIX */ - - - -#ifdef W32_STAT_BANDAID -/*********************************/ -/* Function VFatFileTime2utime() */ -/*********************************/ - -static int VFatFileTime2utime(const FILETIME *pft, time_t *ut) -{ - FILETIME lft; -#ifndef HAVE_MKTIME - WORD wDOSDate, wDOSTime; -#else - SYSTEMTIME w32tm; - struct tm ltm; -#endif - - if (!FileTimeToLocalFileTime(pft, &lft)) { - /* if pft cannot be converted to local time, set ut to current time */ - time(ut); - return FALSE; - } - FTTrace((stdout, "VFatFT2utime, feed for mktime()", 1, &lft)); -#ifndef HAVE_MKTIME - /* This version of the FILETIME-to-UNIXTIME conversion function - * uses DOS-DATE-TIME format as intermediate stage. For modification - * and access times, this is no problem. But, the extra fine resolution - * of the VFAT-stored creation time gets lost. - */ - if (!FileTimeToDosDateTime(&lft, &wDOSDate, &wDOSTime)) { - static const FILETIME dosmin_ft = - {DOSTIME_MIN_FT_LO, DOSTIME_MIN_FT_HI}; - if (CompareFileTime(&lft, &dosmin_ft) <= 0) { - /* underflow -> set to minimum DOS time */ - wDOSDate = (WORD)((DWORD)DOSTIME_MINIMUM >> 16); - wDOSTime = (WORD)DOSTIME_MINIMUM; - } else { - /* overflow -> set to maximum DOS time */ - wDOSDate = (WORD)0xFF9F; /* 2107-12-31 */ - wDOSTime = (WORD)0xBF7D; /* 23:59:58 */ - } - } - TTrace((stdout,"DosDateTime is %04u-%02u-%02u %02u:%02u:%02u\n", - (unsigned)((wDOSDate>>9)&0x7f)+1980,(unsigned)((wDOSDate>>5)&0x0f), - (unsigned)(wDOSDate&0x1f),(unsigned)((wDOSTime>>11)&0x1f), - (unsigned)((wDOSTime>>5)&0x3f),(unsigned)((wDOSTime<<1)&0x3e))); - *ut = dos_to_unix_time(((ulg)wDOSDate << 16) | (ulg)wDOSTime); - - /* a cheap error check: dos_to_unix_time() only returns an odd time - * when clipping at maximum time_t value. DOS_DATE_TIME values have - * a resolution of 2 seconds and are therefore even numbers. - */ - return (((*ut)&1) == (time_t)0); -#else /* HAVE_MKTIME */ - FileTimeToSystemTime(&lft, &w32tm); -#ifndef TIME_T_TYPE_DOUBLE - /* underflow and overflow handling */ - /* TODO: The range checks are not accurate, the actual limits may - * be off by one daylight-saving-time shift (typically 1 hour), - * depending on the current state of "is_dst". - */ -#ifdef CHECK_UTIME_SIGNED_UNSIGNED - if ((time_t)0x80000000L < (time_t)0L) - { - if ((pft->dwHighDateTime < UNIX_TIME_SMIN_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMIN_HI) && - (pft->dwLowDateTime < UNIX_TIME_SMIN_LO))) { - *ut = (time_t)LONG_MIN; - return FALSE; - if ((pft->dwHighDateTime > UNIX_TIME_SMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_SMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_SMAX_LO))) { - *ut = (time_t)LONG_MAX; - return FALSE; - } - } - else -#endif /* CHECK_UTIME_SIGNED_UNSIGNED */ - { - if ((pft->dwHighDateTime < UNIX_TIME_ZERO_HI) || - ((pft->dwHighDateTime == UNIX_TIME_ZERO_HI) && - (pft->dwLowDateTime < UNIX_TIME_ZERO_LO))) { - *ut = (time_t)0; - return FALSE; - } - if ((pft->dwHighDateTime > UNIX_TIME_UMAX_HI) || - ((pft->dwHighDateTime == UNIX_TIME_UMAX_HI) && - (pft->dwLowDateTime > UNIX_TIME_UMAX_LO))) { - *ut = (time_t)ULONG_MAX; - return FALSE; - } - } -#endif /* !TIME_T_TYPE_DOUBLE */ - ltm.tm_year = w32tm.wYear - 1900; - ltm.tm_mon = w32tm.wMonth - 1; - ltm.tm_mday = w32tm.wDay; - ltm.tm_hour = w32tm.wHour; - ltm.tm_min = w32tm.wMinute; - ltm.tm_sec = w32tm.wSecond; - ltm.tm_isdst = -1; /* let mktime determine if DST is in effect */ - *ut = mktime(<m); - - /* a cheap error check: mktime returns "(time_t)-1L" on conversion errors. - * Normally, we would have to apply a consistency check because "-1" - * could also be a valid time. But, it is quite unlikely to read back odd - * time numbers from file systems that store time stamps in DOS format. - * (The only known exception is creation time on VFAT partitions.) - */ - return (*ut != (time_t)-1L); -#endif /* ?HAVE_MKTIME */ - -} /* end function VFatFileTime2utime() */ -#endif /* W32_STAT_BANDAID */ - - - -/******************************/ -/* Function FStampIsLocTime() */ -/******************************/ - -static int FStampIsLocTime(__GPRO__ const char *path) -{ - return (NTQueryVolInfo(__G__ path) ? G.lastVolLocTim : FALSE); -} - - - -#ifndef NO_W32TIMES_IZFIX -# define UTIME_2_IZFILETIME(ut, pft) \ - if (fs_uses_loctime) {utime2VFatFileTime(ut, pft, TRUE);} \ - else {utime2NtfsFileTime(ut, pft);} -#else -# define UTIME_2_IZFILETIME(ut, pft) \ - utime2VFatFileTime(ut, pft, fs_uses_loctime); -#endif - - - -/****************************/ /* Get the file time in a format that */ -/* Function getNTfiletime() */ /* can be used by SetFileTime() in NT */ -/****************************/ - -static int getNTfiletime(__G__ pModFT, pAccFT, pCreFT) - __GDEF - FILETIME *pModFT; - FILETIME *pAccFT; - FILETIME *pCreFT; -{ -#ifdef USE_EF_UT_TIME - unsigned eb_izux_flg; - iztimes z_utime; /* struct for Unix-style actime & modtime, + creatime */ -#endif - int fs_uses_loctime = FStampIsLocTime(__G__ G.filename); - - /* Copy and/or convert time and date variables, if necessary; - * return a flag indicating which time stamps are available. */ -#ifdef USE_EF_UT_TIME - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - ((eb_izux_flg = ef_scan_for_izux(G.extra_field, - G.lrec.extra_field_length, 0, G.lrec.last_mod_dos_datetime, - &z_utime, NULL)) & EB_UT_FL_MTIME)) - { - TTrace((stderr, "getNTfiletime: Unix e.f. modif. time = %lu\n", - z_utime.mtime)); - UTIME_2_IZFILETIME(z_utime.mtime, pModFT) - if (eb_izux_flg & EB_UT_FL_ATIME) { - UTIME_2_IZFILETIME(z_utime.atime, pAccFT) - } - if (eb_izux_flg & EB_UT_FL_CTIME) { - UTIME_2_IZFILETIME(z_utime.ctime, pCreFT) - } - return (int)eb_izux_flg; - } -#endif /* USE_EF_UT_TIME */ -#ifndef NO_W32TIMES_IZFIX - if (!fs_uses_loctime) { - time_t ux_modtime; - - ux_modtime = dos_to_unix_time(G.lrec.last_mod_dos_datetime); - utime2NtfsFileTime(ux_modtime, pModFT); - } else -#endif /* NO_W32TIMES_IZFIX */ - { - FILETIME lft; - - DosDateTimeToFileTime((WORD)(G.lrec.last_mod_dos_datetime >> 16), - (WORD)(G.lrec.last_mod_dos_datetime & 0xFFFFL), - &lft); - LocalFileTimeToFileTime(&lft, pModFT); - } - *pAccFT = *pModFT; - return (EB_UT_FL_MTIME | EB_UT_FL_ATIME); - -} /* end function getNTfiletime() */ - - - - -/**************************/ -/* Function SetFileSize() */ -/**************************/ - -int SetFileSize(FILE *file, zusz_t filesize) -{ -#ifdef __RSXNT__ - /* RSXNT environment lacks a translation function from C file pointer - to Win32-API file handle. So, simply do nothing. */ - return 0; -#else /* !__RSXNT__ */ - /* not yet verified, if that really creates an unfragmented file - rommel@ars.de - */ - HANDLE os_fh; -#ifdef Z_UINT8_DEFINED - LARGE_INTEGER fsbuf; -#endif - - /* Win9x supports FAT file system, only; presetting file size does - not help to prevent fragmentation. */ - if (!IsWinNT()) return 0; - - /* Win32-API calls require access to the Win32 file handle. - The interface function used to retrieve the Win32 handle for - a file opened by the C rtl is non-standard and may not be - available for every Win32 compiler environment. - (see also win32/win32.c of the Zip distribution) - */ - os_fh = (HANDLE)_get_osfhandle(fileno(file)); - /* move file pointer behind the last byte of the expected file size */ -#ifdef Z_UINT8_DEFINED - fsbuf.QuadPart = filesize; - if ((SetFilePointer(os_fh, fsbuf.LowPart, &fsbuf.HighPart, FILE_BEGIN) - == 0xFFFFFFFF) && GetLastError() != NO_ERROR) -#else - if (SetFilePointer(os_fh, (ulg)filesize, 0, FILE_BEGIN) == 0xFFFFFFFF) -#endif - return -1; - /* extend/truncate file to the current position */ - if (SetEndOfFile(os_fh) == 0) - return -1; - /* move file position pointer back to the start of the file! */ - return (SetFilePointer(os_fh, 0, 0, FILE_BEGIN) == 0xFFFFFFFF) ? -1 : 0; -#endif /* ?__RSXNT__ */ -} /* end function SetFileSize() */ - - - - -/****************************/ -/* Function close_outfile() */ -/****************************/ - -void close_outfile(__G) - __GDEF -{ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - FILETIME Accft; /* NT file time type, `last access' time */ - FILETIME Creft; /* NT file time type, `file creation' time */ - HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */ - int gotTime; -#ifdef NTSD_EAS - uch *ebSDptr; - unsigned ebSDlen; -#endif -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - -#ifndef __RSXNT__ - if (IsWinNT()) { - /* Truncate the file to the current position. - * This is needed to remove excess allocation in case the - * extraction has failed or stopped prematurely. */ - SetEndOfFile((HANDLE)_get_osfhandle(fileno(G.outfile))); - } -#endif - - /* Close the file and then re-open it using the Win32 - * CreateFile call, so that the file can be created - * with GENERIC_WRITE access, otherwise the SetFileTime - * call will fail. */ - fclose(G.outfile); - - /* don't set the time stamp and attributes on standard output */ - if (uO.cflag) - return; - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - gotTime = getNTfiletime(__G__ &Modft, &Accft, &Creft); - - /* open a handle to the file before processing extra fields; - we do this in case new security on file prevents us from updating - time stamps */ - hFile = CreateFileA(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - } else { - gotTime = 0; - } - - /* sfield@microsoft.com: set attributes before time in case we decide to - support other filetime members later. This also allows us to apply - attributes before the security is changed, which may prevent this - from succeeding otherwise. Also, since most files don't have - any interesting attributes, only change them if something other than - FILE_ATTRIBUTE_ARCHIVE appears in the attributes. This works well - as an optimization because FILE_ATTRIBUTE_ARCHIVE gets applied to the - file anyway, when it's created new. */ - if ((G.pInfo->file_attr & 0x7F) & ~FILE_ATTRIBUTE_ARCHIVE) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes\n", - (int)GetLastError())); - } - -#ifdef NTSD_EAS - /* set NTFS SD extra fields */ - if (G.extra_field && /* zipfile extra field may have extended attribs */ - FindSDExtraField(__G__ G.extra_field, G.lrec.extra_field_length, - &ebSDptr, &ebSDlen)) - { - int err = SetSD(__G__ Ansi_Fname, G.pInfo->file_attr, - ebSDptr, ebSDlen); - - if (err == IZ_EF_TRUNC) { - if (uO.qflag) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(G.filename))); - Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), - ebSDlen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), uO.qflag? "\n":"")); - } - } -#endif /* NTSD_EAS */ - - /* skip restoring time stamps on user's request */ - if (uO.D_flag <= 1) { - if ( hFile == INVALID_HANDLE_VALUE ) - Info(slide, 1, ((char *)slide, - "\nCreateFile() error %d when trying set file time\n", - (int)GetLastError())); - else { - if (gotTime) { - FILETIME *pModft = (gotTime & EB_UT_FL_MTIME) ? &Modft : NULL; - FILETIME *pAccft = (gotTime & EB_UT_FL_ATIME) ? &Accft : NULL; - FILETIME *pCreft = (gotTime & EB_UT_FL_CTIME) ? &Creft : NULL; - - if (!SetFileTime(hFile, pCreft, pAccft, pModft)) - Info(slide, 0, ((char *)slide, - "\nSetFileTime failed: %d\n", (int)GetLastError())); - } - CloseHandle(hFile); - } - } - - return; - -#undef Ansi_Fname - -} /* end function close_outfile() */ - - - - -#ifdef SET_DIR_ATTRIB - -int defer_dir_attribs(__G__ pd) - __GDEF - direntry **pd; -{ - NTdirattr *d_entry; -#ifdef NTSD_EAS - uch *ebSDptr; - unsigned ebSDlen; -#endif - - /* Win9x does not support setting directory time stamps. */ - if (!IsWinNT()) { - *pd = (direntry *)NULL; - return PK_OK; - } - -#ifdef NTSD_EAS - /* set extended attributes from extra fields */ - if (G.extra_field && /* zipfile e.f. may have extended attribs */ - FindSDExtraField(__G__ G.extra_field, G.lrec.extra_field_length, - &ebSDptr, &ebSDlen)) { - /* ebSDlen contains the payload size of the e.f. block, but - we store it including the e.b. header. */ - ebSDlen += EB_HEADSIZE; - } else { - /* no NTSD e.f. block -> no space needed to allocate */ - ebSDlen = 0; - } -#endif /* NTSD_EAS */ - - d_entry = (NTdirattr *)malloc(sizeof(NTdirattr) -#ifdef NTSD_EAS - + ebSDlen -#endif - + strlen(G.filename)); - *pd = (direntry *)d_entry; - if (d_entry == (NTdirattr *)NULL) { - return PK_MEM; - } -#ifdef NTSD_EAS - if (ebSDlen > 0) - memcpy(d_entry->buf, ebSDptr, ebSDlen); - d_entry->SDlen = ebSDlen; - d_entry->fn = d_entry->buf + ebSDlen; -#else - d_entry->fn = d_entry->buf; -#endif - - strcpy(d_entry->fn, G.filename); - - d_entry->perms = G.pInfo->file_attr; - - d_entry->gotTime = (uO.D_flag <= 0 - ? getNTfiletime(__G__ &(d_entry->Modft), - &(d_entry->Accft), &(d_entry->Creft)) - : 0); - return PK_OK; -} /* end function defer_dir_attribs() */ - - -int set_direc_attribs(__G__ d) - __GDEF - direntry *d; -{ - int errval; - HANDLE hFile = INVALID_HANDLE_VALUE; /* File handle defined in NT */ -#ifdef __RSXNT__ - char *ansi_name; -#endif - - /* Win9x does not support setting directory time stamps. */ - if (!IsWinNT()) - return PK_OK; - - errval = PK_OK; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - ansi_name = (char *)alloca(strlen(d->fn) + 1); - INTERN_TO_ISO(d->fn, ansi_name); -# define Ansi_Dirname ansi_name -#else -# define Ansi_Dirname d->fn -#endif - - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - /* Open a handle to the directory before processing extra fields; - we do this in case new security on file prevents us from updating - time stamps. - Although the WIN32 documentation recommends to use GENERIC_WRITE - access flag to create the handle for SetFileTime(), this is too - demanding for directories with the "read-only" attribute bit set. - So we use the more specific flag FILE_WRITE_ATTRIBUTES here to - request the minimum required access rights. (This problem is a - Windows bug that has been silently fixed in Windows XP SP2.) */ - hFile = CreateFileA(Ansi_Dirname, FILE_WRITE_ATTRIBUTES, - FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); - } - -#ifdef NTSD_EAS - if (NtAtt(d)->SDlen > 0) { - int err; - - if (QCOND2) { - Info(slide, 1, ((char *)slide, " set attrib: %-22s ", - FnFilter1(d->fn))); - } - - /* set NTFS SD extra fields */ - err = SetSD(__G__ Ansi_Dirname, NtAtt(d)->perms, - NtAtt(d)->buf, NtAtt(d)->SDlen - EB_HEADSIZE); - if (err == IZ_EF_TRUNC) { - if (!QCOND2) - Info(slide, 1, ((char *)slide, "%-22s ", - FnFilter1(d->fn))); - Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD), - NtAtt(d)->SDlen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n")); - } else if (QCOND2) { - Info(slide, 0, ((char *)slide, "\n")); - } - if (errval < err) - errval = err; - } -#endif /* NTSD_EAS */ - - /* Skip restoring directory time stamps on user' request. */ - if (uO.D_flag <= 0) { - if (hFile == INVALID_HANDLE_VALUE) { - Info(slide, 1, ((char *)slide, - "warning: CreateFile() error %d (set file times for %s)\n", - (int)GetLastError(), FnFilter1(d->fn))); - if (!errval) - errval = PK_WARN; - } else { - if (NtAtt(d)->gotTime) { - FILETIME *pModft = (NtAtt(d)->gotTime & EB_UT_FL_MTIME) - ? &(NtAtt(d)->Modft) : NULL; - FILETIME *pAccft = (NtAtt(d)->gotTime & EB_UT_FL_ATIME) - ? &(NtAtt(d)->Accft) : NULL; - FILETIME *pCreft = (NtAtt(d)->gotTime & EB_UT_FL_CTIME) - ? &(NtAtt(d)->Creft) : NULL; - - if (!SetFileTime(hFile, pCreft, pAccft, pModft)) { - Info(slide, 0, ((char *)slide, - "warning: SetFileTime() for %s error %d\n", - FnFilter1(d->fn), (int)GetLastError())); - if (!errval) - errval = PK_WARN; - } - } - CloseHandle(hFile); - } - } - - return errval; -} /* end function set_direc_attribs() */ - -#endif /* SET_DIR_ATTRIB */ - - - - -#ifdef TIMESTAMP - -/*************************/ -/* Function stamp_file() */ -/*************************/ - -int stamp_file(__GPRO__ ZCONST char *fname, time_t modtime) -{ - FILETIME Modft; /* File time type defined in NT, `last modified' time */ - HANDLE hFile; /* File handle defined in NT */ - int errstat = 0; /* return status: 0 == "OK", -1 == "Failure" */ - int fs_uses_loctime = FStampIsLocTime(__G__ fname); -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(fname) + 1); - - INTERN_TO_ISO(fname, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname fname -#endif - - /* open a handle to the file to prepare setting the mod-time stamp */ - hFile = CreateFileA(Ansi_Fname, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if ( hFile == INVALID_HANDLE_VALUE ) { - errstat = -1; - } else { - /* convert time_t modtime into WIN32 native 64bit format */ - UTIME_2_IZFILETIME(modtime, &Modft) - /* set Access and Modification times of the file to modtime */ - if (!SetFileTime(hFile, NULL, &Modft, &Modft)) { - errstat = -1; - } - CloseHandle(hFile); - } - - return errstat; - -#undef Ansi_Fname -} /* end function stamp_file() */ - -#endif /* TIMESTAMP */ - - - - -/***********************/ -/* Function isfloppy() */ /* more precisely, is it removable? */ -/***********************/ - -static int isfloppy(int nDrive) /* 1 == A:, 2 == B:, etc. */ -{ - char rootPathName[4]; - - rootPathName[0] = (char)('A' + nDrive - 1); /* build the root path */ - rootPathName[1] = ':'; /* name, e.g. "A:/" */ - rootPathName[2] = '/'; - rootPathName[3] = '\0'; - - return (GetDriveTypeA(rootPathName) == DRIVE_REMOVABLE); - -} /* end function isfloppy() */ - - - - -/*****************************/ -/* Function NTQueryVolInfo() */ -/*****************************/ - -/* - * Note: 8.3 limits on filenames apply only to old-style FAT filesystems. - * More recent versions of Windows (Windows NT 3.5 / Windows 4.0) - * can support long filenames (LFN) on FAT filesystems. Check the - * filesystem maximum component length field to detect LFN support. - */ - -static int NTQueryVolInfo(__GPRO__ const char *name) -{ - /* static char lastRootPath[4] = ""; */ - /* static int lastVolOldFAT; */ - /* static int lastVolLocTim; */ - char *tmp0; - char tmp1[MAX_PATH], tmp2[MAX_PATH]; - DWORD volSerNo, maxCompLen, fileSysFlags; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(name) + 1); - - INTERN_TO_ISO(name, ansi_name); - name = ansi_name; -#endif - - if ((!strncmp(name, "//", 2) || !strncmp(name, "\\\\", 2)) && - (name[2] != '\0' && name[2] != '/' && name[2] != '\\')) { - /* GetFullPathname() and GetVolumeInformation() do not work - * on UNC names. For now, we return "error". - * **FIXME**: check if UNC name is mapped to a drive letter - * and use mapped drive for volume info query. - */ - return FALSE; - } - if (isalpha((uch)name[0]) && (name[1] == ':')) - tmp0 = (char *)name; - else - { - if (!GetFullPathNameA(name, MAX_PATH, tmp1, &tmp0)) - return FALSE; - tmp0 = &tmp1[0]; - } - if (strncmp(G.lastRootPath, tmp0, 2) != 0) { - /* For speed, we skip repeated queries for the same device */ - strncpy(G.lastRootPath, tmp0, 2); /* Build the root path name, */ - G.lastRootPath[2] = '/'; /* e.g. "A:/" */ - G.lastRootPath[3] = '\0'; - - if (!GetVolumeInformationA((LPCSTR)G.lastRootPath, - (LPSTR)tmp1, (DWORD)MAX_PATH, - &volSerNo, &maxCompLen, &fileSysFlags, - (LPSTR)tmp2, (DWORD)MAX_PATH)) { - G.lastRootPath[0] = '\0'; - return FALSE; - } - - /* LFNs are available if the component length is > 12 */ - G.lastVolOldFAT = (maxCompLen <= 12); -/* G.lastVolOldFAT = !strncmp(strupr(tmp2), "FAT", 3); old version */ - - /* Volumes in (V)FAT and (OS/2) HPFS format store file timestamps in - * local time! - */ - G.lastVolLocTim = !strncmp(strupr(tmp2), "VFAT", 4) || - !strncmp(tmp2, "HPFS", 4) || - !strncmp(tmp2, "FAT", 3); - } - - return TRUE; - -} /* end function NTQueryVolInfo() */ - - - - -/*****************************/ -/* Function IsVolumeOldFAT() */ -/*****************************/ - -static int IsVolumeOldFAT(__GPRO__ const char *name) -{ - return (NTQueryVolInfo(__G__ name) ? G.lastVolOldFAT : FALSE); -} - - - - -#ifndef SFX - -/************************/ -/* Function do_wild() */ /* identical to OS/2 version */ -/************************/ - -char *do_wild(__G__ wildspec) - __GDEF - ZCONST char *wildspec; /* only used first time on a given dir */ -{ -/* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in w32cfg.h: - static zDIR *wild_dir = NULL; - static ZCONST char *wildname; - static char *dirname, matchname[FILNAMSIZ]; - static int notfirstcall=FALSE, have_dirname, dirnamelen; -*/ - char *fnamestart; - struct zdirent *file; - - /* Even when we're just returning wildspec, we *always* do so in - * matchname[]--calling routine is allowed to append four characters - * to the returned string, and wildspec may be a pointer to argv[]. - */ - if (!G.notfirstcall) { /* first call: must initialize everything */ - G.notfirstcall = TRUE; - - if (!iswild(wildspec)) { - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - G.have_dirname = FALSE; - G.wild_dir = NULL; - return G.matchname; - } - - /* break the wildspec into a directory part and a wildcard filename */ - if ((G.wildname = MBSRCHR(wildspec, '/')) == (ZCONST char *)NULL && - (G.wildname = MBSRCHR(wildspec, ':')) == (ZCONST char *)NULL) { - G.dirname = "."; - G.dirnamelen = 1; - G.have_dirname = FALSE; - G.wildname = wildspec; - } else { - ++G.wildname; /* point at character after '/' or ':' */ - G.dirnamelen = G.wildname - wildspec; - if ((G.dirname = (char *)malloc(G.dirnamelen+1)) == NULL) { - Info(slide, 1, ((char *)slide, - "warning: cannot allocate wildcard buffers\n")); - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; /* but maybe filespec was not a wildcard */ - } - strncpy(G.dirname, wildspec, G.dirnamelen); - G.dirname[G.dirnamelen] = '\0'; /* terminate for strcpy below */ - G.have_dirname = TRUE; - } - Trace((stderr, "do_wild: dirname = [%s]\n", FnFilter1(G.dirname))); - - if ((G.wild_dir = (zvoid *)Opendir(G.dirname)) != NULL) { - if (G.have_dirname) { - strcpy(G.matchname, G.dirname); - fnamestart = G.matchname + G.dirnamelen; - } else - fnamestart = G.matchname; - while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { - Trace((stderr, "do_wild: Readdir returns %s\n", - FnFilter1(file->d_name))); - strcpy(fnamestart, file->d_name); - if (MBSRCHR(fnamestart, '.') == (char *)NULL) - strcat(fnamestart, "."); - if (match(fnamestart, G.wildname, TRUE WISEP) && - /* skip "." and ".." directory entries */ - strcmp(fnamestart, ".") && strcmp(fnamestart, "..")) { - Trace((stderr, "do_wild: match() succeeds\n")); - /* remove trailing dot */ - fnamestart = plastchar(fnamestart, strlen(fnamestart)); - if (*fnamestart == '.') - *fnamestart = '\0'; - return G.matchname; - } - } - /* if we get to here directory is exhausted, so close it */ - Closedir((zDIR *)G.wild_dir); - G.wild_dir = NULL; - } - Trace((stderr, "do_wild: Opendir(%s) returns NULL\n", - FnFilter1(G.dirname))); - - /* return the raw wildspec in case that works (e.g., directory not - * searchable, but filespec was not wild and file is readable) */ - strncpy(G.matchname, wildspec, FILNAMSIZ); - G.matchname[FILNAMSIZ-1] = '\0'; - return G.matchname; - } - - /* last time through, might have failed opendir but returned raw wildspec */ - if (G.wild_dir == NULL) { - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - } - - /* If we've gotten this far, we've read and matched at least one entry - * successfully (in a previous call), so dirname has been copied into - * matchname already. - */ - if (G.have_dirname) { - /* strcpy(G.matchname, G.dirname); */ - fnamestart = G.matchname + G.dirnamelen; - } else - fnamestart = G.matchname; - while ((file = Readdir((zDIR *)G.wild_dir)) != NULL) { - Trace((stderr, "do_wild: readdir returns %s\n", - FnFilter1(file->d_name))); - strcpy(fnamestart, file->d_name); - if (MBSRCHR(fnamestart, '.') == (char *)NULL) - strcat(fnamestart, "."); - if (match(fnamestart, G.wildname, TRUE WISEP)) { - Trace((stderr, "do_wild: match() succeeds\n")); - /* remove trailing dot */ - fnamestart = plastchar(fnamestart, strlen(fnamestart)); - if (*fnamestart == '.') - *fnamestart = '\0'; - return G.matchname; - } - } - - Closedir((zDIR *)G.wild_dir); /* at least one entry read; nothing left */ - G.wild_dir = NULL; - G.notfirstcall = FALSE; /* reset for new wildspec */ - if (G.have_dirname) - free(G.dirname); - return (char *)NULL; - -} /* end function do_wild() */ - -#endif /* !SFX */ - - - -/**********************/ -/* Function mapattr() */ -/**********************/ - -/* Identical to MS-DOS, OS/2 versions. However, NT has a lot of extra - * permission stuff, so this function should probably be extended in the - * future. */ - -int mapattr(__G) - __GDEF -{ - /* set archive bit for file entries (file is not backed up): */ - G.pInfo->file_attr = ((unsigned)G.crec.external_file_attributes | - (G.crec.external_file_attributes & FILE_ATTRIBUTE_DIRECTORY ? - 0 : FILE_ATTRIBUTE_ARCHIVE)) & 0xff; - return 0; - -} /* end function mapattr() */ - - - - -/************************/ -/* Function mapname() */ -/************************/ - -int mapname(__G__ renamed) - __GDEF - int renamed; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - caution (truncated filename) - * MPN_INF_SKIP - info "skip entry" (dir doesn't exist) - * MPN_ERR_SKIP - error -> skip entry - * MPN_ERR_TOOLONG - error -> path is too long - * MPN_NOMEM - error (memory allocation failed) -> skip entry - * [also MPN_VOL_LABEL, MPN_CREATED_DIR] - */ -{ - char pathcomp[FILNAMSIZ]; /* path-component buffer */ - char *pp, *cp=NULL; /* character pointers */ - char *lastsemi = NULL; /* pointer to last semi-colon in pathcomp */ -#ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ - RO_extra_block *ef_spark; /* pointer Acorn FTYPE ef block */ -#endif - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ - int error; - register unsigned workch; /* hold the character being tested */ - - -/*--------------------------------------------------------------------------- - Initialize various pointers and counters and stuff. - ---------------------------------------------------------------------------*/ - - /* can create path as long as not just freshening, or if user told us */ - G.create_dirs = (!uO.fflag || renamed); - - G.created_dir = FALSE; /* not yet */ - G.renamed_fullpath = FALSE; - G.fnlen = strlen(G.filename); - - if (renamed) { - cp = G.filename; /* point to beginning of renamed name... */ - if (*cp) do { - if (*cp == '\\') /* convert backslashes to forward */ - *cp = '/'; - } while (*PREINCSTR(cp)); - cp = G.filename; - /* use temporary rootpath if user gave full pathname */ - if (G.filename[0] == '/') { - G.renamed_fullpath = TRUE; - pathcomp[0] = '/'; /* copy the '/' and terminate */ - pathcomp[1] = '\0'; - ++cp; - } else if (isalpha((uch)G.filename[0]) && G.filename[1] == ':') { - G.renamed_fullpath = TRUE; - pp = pathcomp; - *pp++ = *cp++; /* copy the "d:" (+ '/', possibly) */ - *pp++ = *cp++; - if (*cp == '/') - *pp++ = *cp++; /* otherwise add "./"? */ - *pp = '\0'; - } - } - - /* pathcomp is ignored unless renamed_fullpath is TRUE: */ - if ((error = checkdir(__G__ pathcomp, INIT)) != 0) /* init path buffer */ - return error; /* ...unless no mem or vol label on hard disk */ - - *pathcomp = '\0'; /* initialize translation buffer */ - pp = pathcomp; /* point to translation buffer */ - if (!renamed) { /* cp already set if renamed */ - if (uO.jflag) /* junking directories */ - cp = (char *)MBSRCHR(G.filename, '/'); - if (cp == NULL) /* no '/' or not junking dirs */ - cp = G.filename; /* point to internal zipfile-member pathname */ - else - ++cp; /* point to start of last component of path */ - } - -/*--------------------------------------------------------------------------- - Begin main loop through characters in filename. - ---------------------------------------------------------------------------*/ - - for (; (workch = (uch)*cp) != 0; INCSTR(cp)) { - - switch (workch) { - case '/': /* can assume -j flag not given */ - *pp = '\0'; - maskDOSdevice(__G__ pathcomp); - if (strcmp(pathcomp, ".") == 0) { - /* don't bother appending "./" to the path */ - *pathcomp = '\0'; - } else if (!uO.ddotflag && strcmp(pathcomp, "..") == 0) { - /* "../" dir traversal detected, skip over it */ - *pathcomp = '\0'; - killed_ddot = TRUE; /* set "show message" flag */ - } - /* when path component is not empty, append it now */ - if (*pathcomp != '\0' && - ((error = checkdir(__G__ pathcomp, APPEND_DIR)) - & MPN_MASK) > MPN_INF_TRUNC) - return error; - pp = pathcomp; /* reset conversion buffer for next piece */ - lastsemi = (char *)NULL; /* leave direct. semi-colons alone */ - break; - - case ':': /* drive spec not stored, so no colon allowed */ - case '\\': /* '\\' may come as normal filename char (not */ - case '<': /* dir sep char!) from unix-like file system */ - case '>': /* no redirection symbols allowed either */ - case '|': /* no pipe signs allowed */ - case '"': /* no double quotes allowed */ - case '?': /* no wildcards allowed */ - case '*': - *pp++ = '_'; /* these rules apply equally to FAT and NTFS */ - break; - case ';': /* start of VMS version? */ - lastsemi = pp; /* remove VMS version later... */ - *pp++ = ';'; /* but keep semicolon for now */ - break; - -#ifdef ACORN_FTYPE_NFS - case ',': /* NFS filetype extension */ - lastcomma = pp; - *pp++ = ','; /* keep for now; may need to remove */ - break; /* later, if requested */ -#endif - - case ' ': /* keep spaces unless specifically */ - /* NT cannot create filenames with spaces on FAT volumes */ - if (uO.sflag || IsVolumeOldFAT(__G__ G.filename)) - *pp++ = '_'; - else - *pp++ = ' '; - break; - - default: - /* allow European characters in filenames: */ - if (isprint(workch) || workch >= 127) -#ifdef _MBCS - { - memcpy(pp, cp, CLEN(cp)); - INCSTR(pp); - } -#else - *pp++ = (char)workch; -#endif - } /* end switch */ - - } /* end while loop */ - - /* Show warning when stripping insecure "parent dir" path components */ - if (killed_ddot && QCOND2) { - Info(slide, 0, ((char *)slide, - "warning: skipped \"../\" path component(s) in %s\n", - FnFilter1(G.filename))); - if (!(error & ~MPN_MASK)) - error = (error & MPN_MASK) | PK_WARN; - } - -/*--------------------------------------------------------------------------- - Report if directory was created (and no file to create: filename ended - in '/'), check name to be sure it exists, and combine path and name be- - fore exiting. - ---------------------------------------------------------------------------*/ - - if (lastchar(G.filename, G.fnlen) == '/') { -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - checkdir(__G__ G.filename, GETPATH); - if (G.created_dir) { - if (QCOND2) { - Info(slide, 0, ((char *)slide, " creating: %-22s\n", - FnFilter1(G.filename))); - } - - /* set file attributes: - The default for newly created directories is "DIR attribute - flags set", so there is no need to change attributes unless - one of the DOS style attribute flags is set. The readonly - attribute need not be masked, since it does not prevent - modifications in the new directory. */ - if(G.pInfo->file_attr & (0x7F & ~FILE_ATTRIBUTE_DIRECTORY)) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes for %s\n", - (int)GetLastError(), FnFilter1(G.filename))); - } - - /* set dir time (note trailing '/') */ - return (error & ~MPN_MASK) | MPN_CREATED_DIR; - } else if (IS_OVERWRT_ALL) { - /* overwrite attributes of existing directory on user's request */ - - /* set file attributes: */ - if(G.pInfo->file_attr & (0x7F & ~FILE_ATTRIBUTE_DIRECTORY)) { - if (!SetFileAttributesA(Ansi_Fname, G.pInfo->file_attr & 0x7F)) - Info(slide, 1, ((char *)slide, - "\nwarning (%d): could not set file attributes for %s\n", - (int)GetLastError(), FnFilter1(G.filename))); - } - } - /* dir existed already; don't look for data to extract */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; - } - - *pp = '\0'; /* done with pathcomp: terminate it */ - - /* if not saving them, remove VMS version numbers (appended "###") */ - if (!uO.V_flag && lastsemi) { - pp = lastsemi + 1; /* semi-colon was kept: expect #'s after */ - while (isdigit((uch)(*pp))) - ++pp; - if (*pp == '\0') /* only digits between ';' and end: nuke */ - *lastsemi = '\0'; - } - -#ifdef ACORN_FTYPE_NFS - /* translate Acorn filetype information if asked to do so */ - if (uO.acorn_nfs_ext && - (ef_spark = (RO_extra_block *) - getRISCOSexfield(G.extra_field, G.lrec.extra_field_length)) - != (RO_extra_block *)NULL) - { - /* file *must* have a RISC OS extra field */ - long ft = (long)makelong(ef_spark->loadaddr); - /*32-bit*/ - if (lastcomma) { - pp = lastcomma + 1; - while (isxdigit((uch)(*pp))) ++pp; - if (pp == lastcomma+4 && *pp == '\0') *lastcomma='\0'; /* nuke */ - } - if ((ft & 1<<31)==0) ft=0x000FFD00; - sprintf(pathcomp+strlen(pathcomp), ",%03x", (int)(ft>>8) & 0xFFF); - } -#endif /* ACORN_FTYPE_NFS */ - - maskDOSdevice(__G__ pathcomp); - - if (*pathcomp == '\0') { - Info(slide, 1, ((char *)slide, "mapname: conversion of %s failed\n", - FnFilter1(G.filename))); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - - checkdir(__G__ pathcomp, APPEND_NAME); /* returns 1 if truncated: care? */ - checkdir(__G__ G.filename, GETPATH); - - if (G.pInfo->vollabel) { /* set the volume label now */ - char drive[4]; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_name = (char *)alloca(strlen(G.filename) + 1); - INTERN_TO_ISO(G.filename, ansi_name); -# define Ansi_Fname ansi_name -#else -# define Ansi_Fname G.filename -#endif - - /* Build a drive string, e.g. "b:" */ - drive[0] = (char)('a' + G.nLabelDrive - 1); - strcpy(drive + 1, ":\\"); - if (QCOND2) - Info(slide, 0, ((char *)slide, "labelling %s %-22s\n", drive, - FnFilter1(G.filename))); - if (!SetVolumeLabelA(drive, Ansi_Fname)) { - Info(slide, 1, ((char *)slide, - "mapname: error setting volume label\n")); - return (error & ~MPN_MASK) | MPN_ERR_SKIP; - } - /* success: skip the "extraction" quietly */ - return (error & ~MPN_MASK) | MPN_INF_SKIP; -#undef Ansi_Fname - } - - Trace((stderr, "mapname returns with filename = [%s] (error = %d)\n\n", - FnFilter1(G.filename), error)); - return error; - -} /* end function mapname() */ - - - - -/****************************/ -/* Function maskDOSdevice() */ -/****************************/ - -static void maskDOSdevice(__G__ pathcomp) - __GDEF - char *pathcomp; -{ -/*--------------------------------------------------------------------------- - Put an underscore in front of the file name if the file name is a - DOS/WINDOWS device name like CON.*, AUX.*, PRN.*, etc. Trying to - extract such a file would fail at best and wedge us at worst. - ---------------------------------------------------------------------------*/ -#if !defined(S_IFCHR) && defined(_S_IFCHR) -# define S_IFCHR _S_IFCHR -#endif -#if !defined(S_ISCHR) -# if defined(_S_ISCHR) -# define S_ISCHR(m) _S_ISCHR(m) -# elif defined(S_IFCHR) -# define S_ISCHR(m) ((m) & S_IFCHR) -# endif -#endif - -#ifdef DEBUG - if (zstat(pathcomp, &G.statbuf) == 0) { - Trace((stderr, - "maskDOSdevice() stat(\"%s\", buf) st_mode result: %X, %o\n", - FnFilter1(pathcomp), G.statbuf.st_mode, G.statbuf.st_mode)); - } else { - Trace((stderr, "maskDOSdevice() stat(\"%s\", buf) failed\n", - FnFilter1(pathcomp))); - } -#endif - if (zstat(pathcomp, &G.statbuf) == 0 && S_ISCHR(G.statbuf.st_mode)) { - extent i; - - /* pathcomp contains a name of a DOS character device (builtin or - * installed device driver). - * Prepend a '_' to allow creation of the item in the file system. - */ - for (i = strlen(pathcomp) + 1; i > 0; --i) - pathcomp[i] = pathcomp[i - 1]; - pathcomp[0] = '_'; - } -} /* end function maskDOSdevice() */ - - - - - -/**********************/ -/* Function map2fat() */ /* Not quite identical to OS/2 version */ -/**********************/ - -static void map2fat(pathcomp, pEndFAT) - char *pathcomp, **pEndFAT; -{ - char *ppc = pathcomp; /* variable pointer to pathcomp */ - char *pEnd = *pEndFAT; /* variable pointer to buildpathFAT */ - char *pBegin = *pEndFAT; /* constant pointer to start of this comp. */ - char *last_dot = NULL; /* last dot not converted to underscore */ - register unsigned workch; /* hold the character being tested */ - - - /* Only need check those characters which are legal in NTFS but not - * in FAT: to get here, must already have passed through mapname. - * Also must truncate path component to ensure 8.3 compliance. - */ - while ((workch = (uch)*ppc++) != 0) { - switch (workch) { - case '[': - case ']': - case '+': - case ',': - case ';': - case '=': - *pEnd++ = '_'; /* convert brackets to underscores */ - break; - - case '.': - if (pEnd == *pEndFAT) { /* nothing appended yet... */ - if (*ppc == '\0') /* don't bother appending a */ - break; /* "./" component to the path */ - else if (*ppc == '.' && ppc[1] == '\0') { /* "../" */ - *pEnd++ = '.'; /* add first dot, */ - *pEnd++ = '.'; /* add second dot, and */ - ++ppc; /* skip over to pathcomp's end */ - } else { /* FAT doesn't allow null filename */ - *pEnd++ = '_'; /* bodies, so map .exrc -> _exrc */ - } /* (_.exr would keep max 3 chars) */ - } else { /* found dot within path component */ - last_dot = pEnd; /* point at last dot so far... */ - *pEnd++ = '_'; /* convert to underscore for now */ - } - break; - - default: - *pEnd++ = (char)workch; - - } /* end switch */ - } /* end while loop */ - - *pEnd = '\0'; /* terminate buildpathFAT */ - - /* NOTE: keep in mind that pEnd points to the end of the path - * component, and *pEndFAT still points to the *beginning* of it... - * Also note that the algorithm does not try to get too fancy: - * if there are no dots already, the name either gets truncated - * at 8 characters or the last underscore is converted to a dot - * (only if more characters are saved that way). In no case is - * a dot inserted between existing characters. - */ - if (last_dot == NULL) { /* no dots: check for underscores... */ - char *plu = MBSRCHR(pBegin, '_'); /* pointer to last underscore */ - - if ((plu != NULL) && /* found underscore: convert to dot? */ - (MIN(plu - pBegin, 8) + MIN(pEnd - plu - 1, 3) > 8)) { - last_dot = plu; /* be lazy: drop through to next if-blk */ - } else if ((pEnd - *pEndFAT) > 8) { - /* no underscore; or converting underscore to dot would save less - chars than leaving everything in the basename */ - *pEndFAT += 8; /* truncate at 8 chars */ - **pEndFAT = '\0'; - } else - *pEndFAT = pEnd; /* whole thing fits into 8 chars or less */ - } - - if (last_dot != NULL) { /* one dot is OK: */ - *last_dot = '.'; /* put it back in */ - - if ((last_dot - pBegin) > 8) { - char *p, *q; - int i; - - p = last_dot; - q = last_dot = pBegin + 8; - for (i = 0; (i < 4) && *p; ++i) /* too many chars in basename: */ - *q++ = *p++; /* shift .ext left and trun- */ - *q = '\0'; /* cate/terminate it */ - *pEndFAT = q; - } else if ((pEnd - last_dot) > 4) { /* too many chars in extension */ - *pEndFAT = last_dot + 4; - **pEndFAT = '\0'; - } else - *pEndFAT = pEnd; /* filename is fine; point at terminating zero */ - - if ((last_dot - pBegin) > 0 && last_dot[-1] == ' ') - last_dot[-1] = '_'; /* NO blank in front of '.'! */ - } -} /* end function map2fat() */ - - - - -/***********************/ /* Borrowed from os2.c for UnZip 5.1. */ -/* Function checkdir() */ /* Difference: no EA stuff */ -/***********************/ /* HPFS stuff works on NTFS too */ - -int checkdir(__G__ pathcomp, flag) - __GDEF - char *pathcomp; - int flag; -/* - * returns: - * MPN_OK - no problem detected - * MPN_INF_TRUNC - (on APPEND_NAME) truncated filename - * MPN_INF_SKIP - path doesn't exist, not allowed to create - * MPN_ERR_SKIP - path doesn't exist, tried to create and failed; or path - * exists and is not a directory, but is supposed to be - * MPN_ERR_TOOLONG - path is too long - * MPN_NOMEM - can't allocate memory for filename buffers - */ -{ - /* static int rootlen = 0; */ /* length of rootpath */ - /* static char *rootpath; */ /* user's "extract-to" directory */ - /* static char *buildpathHPFS; */ /* full path (so far) to extracted file, */ - /* static char *buildpathFAT; */ /* both HPFS/EA (main) and FAT versions */ - /* static char *endHPFS; */ /* corresponding pointers to end of */ - /* static char *endFAT; */ /* buildpath ('\0') */ - -# define FN_MASK 7 -# define FUNCTION (flag & FN_MASK) - - - -/*--------------------------------------------------------------------------- - APPEND_DIR: append the path component to the path being built and check - for its existence. If doesn't exist and we are creating directories, do - so for this one; else signal success or error as appropriate. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_DIR) { - char *p = pathcomp; - int too_long = FALSE; - - Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp))); - while ((*G.endHPFS = *p++) != '\0') /* copy to HPFS filename */ - ++G.endHPFS; - if (!IsVolumeOldFAT(__G__ G.buildpathHPFS)) { - p = pathcomp; - while ((*G.endFAT = *p++) != '\0') /* copy to FAT filename, too */ - ++G.endFAT; - } else - map2fat(pathcomp, &G.endFAT); /* map into FAT fn, update endFAT */ - - /* GRR: could do better check, see if overrunning buffer as we go: - * check endHPFS-buildpathHPFS after each append, set warning variable - * if within 20 of FILNAMSIZ; then if var set, do careful check when - * appending. Clear variable when begin new path. */ - - /* next check: need to append '/', at least one-char name, '\0' */ - if ((G.endHPFS-G.buildpathHPFS) > FILNAMSIZ-3) - too_long = TRUE; /* check if extracting dir? */ -#ifdef FIX_STAT_BUG - /* Borland C++ 5.0 does not handle a call to stat() well if the - * directory does not exist (it tends to crash in strange places.) - * This is apparently a problem only when compiling for GUI rather - * than console. The code below attempts to work around this problem. - */ - if (access(G.buildpathFAT, 0) != 0) { - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path doesn't exist: nothing to do */ - return MPN_INF_SKIP; - } - if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } -#endif /* FIX_STAT_BUG */ - if (SSTAT(G.buildpathFAT, &G.statbuf)) /* path doesn't exist */ - { - if (!G.create_dirs) { /* told not to create (freshening) */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path doesn't exist: nothing to do */ - return MPN_INF_SKIP; - } - if (too_long) { /* GRR: should allow FAT extraction w/o EAs */ - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - if (MKDIR(G.buildpathFAT, 0777) == -1) { /* create the directory */ - Info(slide, 1, ((char *)slide, - "checkdir error: cannot create %s\n\ - %s\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), - strerror(errno), - FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path didn't exist, tried to create, failed */ - return MPN_ERR_SKIP; - } - G.created_dir = TRUE; - } else if (!S_ISDIR(G.statbuf.st_mode)) { - Info(slide, 1, ((char *)slide, - "checkdir error: %s exists but is not directory\n\ - unable to process %s.\n", - FnFilter2(G.buildpathFAT), FnFilter1(G.filename))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* path existed but wasn't dir */ - return MPN_ERR_SKIP; - } - if (too_long) { - Info(slide, 1, ((char *)slide, - "checkdir error: path too long: %s\n", - FnFilter1(G.buildpathHPFS))); - free(G.buildpathHPFS); - free(G.buildpathFAT); - /* no room for filenames: fatal */ - return MPN_ERR_TOOLONG; - } - *G.endHPFS++ = '/'; - *G.endFAT++ = '/'; - *G.endHPFS = *G.endFAT = '\0'; - Trace((stderr, "buildpathHPFS now = [%s]\nbuildpathFAT now = [%s]\n", - FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); - return MPN_OK; - - } /* end if (FUNCTION == APPEND_DIR) */ - -/*--------------------------------------------------------------------------- - GETPATH: copy full FAT path to the string pointed at by pathcomp (want - filename to reflect name used on disk, not EAs; if full path is HPFS, - buildpathFAT and buildpathHPFS will be identical). Also free both paths. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == GETPATH) { - Trace((stderr, "getting and freeing FAT path [%s]\n", - FnFilter1(G.buildpathFAT))); - Trace((stderr, "freeing HPFS path [%s]\n", - FnFilter1(G.buildpathHPFS))); - strcpy(pathcomp, G.buildpathFAT); - free(G.buildpathFAT); - free(G.buildpathHPFS); - G.buildpathHPFS = G.buildpathFAT = G.endHPFS = G.endFAT = NULL; - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - APPEND_NAME: assume the path component is the filename; append it and - return without checking for existence. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == APPEND_NAME) { - char *p = pathcomp; - int error = MPN_OK; - - Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp))); - /* The buildpathHPFS buffer has been allocated large enough to - * hold the complete combined name, so there is no need to check - * for OS filename size limit overflow within the copy loop. - */ - while ((*G.endHPFS = *p++) != '\0') { /* copy to HPFS filename */ - ++G.endHPFS; - } - /* Now, check for OS filename size overflow. When detected, the - * mapped HPFS name is truncated and a warning message is shown. - */ - if ((G.endHPFS-G.buildpathHPFS) >= FILNAMSIZ) { - G.buildpathHPFS[FILNAMSIZ-1] = '\0'; - Info(slide, 1, ((char *)slide, - "checkdir warning: path too long; truncating\n \ - %s\n -> %s\n", - FnFilter1(G.filename), FnFilter2(G.buildpathHPFS))); - error = MPN_INF_TRUNC; /* filename truncated */ - } - - /* The buildpathFAT buffer has the same allocated size as the - * buildpathHPFS buffer, so there is no need for an overflow check - * within the following copy loop, either. - */ - if (G.pInfo->vollabel || !IsVolumeOldFAT(__G__ G.buildpathHPFS)) { - /* copy to FAT filename, too */ - p = pathcomp; - while ((*G.endFAT = *p++) != '\0') - ++G.endFAT; - } else - /* map into FAT fn, update endFAT */ - map2fat(pathcomp, &G.endFAT); - - /* Check that the FAT path does not exceed the FILNAMSIZ limit, and - * truncate when neccessary. - * Note that truncation can only happen when the HPFS path (which is - * never shorter than the FAT path) has been already truncated. - * So, emission of the warning message and setting the error code - * has already happened. - */ - if ((G.endFAT-G.buildpathFAT) >= FILNAMSIZ) - G.buildpathFAT[FILNAMSIZ-1] = '\0'; - Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT: %s\n", - FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT))); - - return error; /* could check for existence, prompt for new name... */ - - } /* end if (FUNCTION == APPEND_NAME) */ - -/*--------------------------------------------------------------------------- - INIT: allocate and initialize buffer space for the file currently being - extracted. If file was renamed with an absolute path, don't prepend the - extract-to path. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == INIT) { - Trace((stderr, "initializing buildpathHPFS and buildpathFAT to ")); -#ifdef ACORN_FTYPE_NFS - if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpathHPFS = (char *)malloc(G.fnlen+G.rootlen+1)) -#endif - == NULL) - return MPN_NOMEM; -#ifdef ACORN_FTYPE_NFS - if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+ - (uO.acorn_nfs_ext ? 5 : 1))) -#else - if ((G.buildpathFAT = (char *)malloc(G.fnlen+G.rootlen+1)) -#endif - == NULL) { - free(G.buildpathHPFS); - return MPN_NOMEM; - } - if (G.pInfo->vollabel) { /* use root or renamed path, but don't store */ -/* GRR: for network drives, do strchr() and return IZ_VOL_LABEL if not [1] */ - if (G.renamed_fullpath && pathcomp[1] == ':') - *G.buildpathHPFS = (char)ToLower(*pathcomp); - else if (!G.renamed_fullpath && G.rootlen > 1 && - G.rootpath[1] == ':') - *G.buildpathHPFS = (char)ToLower(*G.rootpath); - else { - char tmpN[MAX_PATH], *tmpP; - if (GetFullPathNameA(".", MAX_PATH, tmpN, &tmpP) > MAX_PATH) - { /* by definition of MAX_PATH we should never get here */ - Info(slide, 1, ((char *)slide, - "checkdir warning: current dir path too long\n")); - return MPN_INF_TRUNC; /* can't get drive letter */ - } - G.nLabelDrive = *tmpN - 'a' + 1; - *G.buildpathHPFS = (char)(G.nLabelDrive - 1 + 'a'); - } - G.nLabelDrive = *G.buildpathHPFS - 'a' + 1; /* save for mapname() */ - if (uO.volflag == 0 || *G.buildpathHPFS < 'a' /* no labels/bogus? */ - || (uO.volflag == 1 && !isfloppy(G.nLabelDrive))) { /* !fixed */ - free(G.buildpathHPFS); - free(G.buildpathFAT); - return MPN_VOL_LABEL; /* skipping with message */ - } - *G.buildpathHPFS = '\0'; - } else if (G.renamed_fullpath) /* pathcomp = valid data */ - strcpy(G.buildpathHPFS, pathcomp); - else if (G.rootlen > 0) - strcpy(G.buildpathHPFS, G.rootpath); - else - *G.buildpathHPFS = '\0'; - G.endHPFS = G.buildpathHPFS; - G.endFAT = G.buildpathFAT; - while ((*G.endFAT = *G.endHPFS) != '\0') { - ++G.endFAT; - ++G.endHPFS; - } - Trace((stderr, "[%s]\n", FnFilter1(G.buildpathHPFS))); - return MPN_OK; - } - -/*--------------------------------------------------------------------------- - ROOT: if appropriate, store the path in rootpath and create it if neces- - sary; else assume it's a zipfile member and return. This path segment - gets used in extracting all members from every zipfile specified on the - command line. Note that under OS/2 and MS-DOS, if a candidate extract-to - directory specification includes a drive letter (leading "x:"), it is - treated just as if it had a trailing '/'--that is, one directory level - will be created if the path doesn't exist, unless this is otherwise pro- - hibited (e.g., freshening). - ---------------------------------------------------------------------------*/ - -#if (!defined(SFX) || defined(SFX_EXDIR)) - if (FUNCTION == ROOT) { - Trace((stderr, "initializing root path to [%s]\n", - FnFilter1(pathcomp))); - if (pathcomp == NULL) { - G.rootlen = 0; - return MPN_OK; - } - if (G.rootlen > 0) /* rootpath was already set, nothing to do */ - return MPN_OK; - if ((G.rootlen = strlen(pathcomp)) > 0) { - int had_trailing_pathsep=FALSE, has_drive=FALSE, add_dot=FALSE; - char *tmproot; - - if ((tmproot = (char *)malloc(G.rootlen+3)) == (char *)NULL) { - G.rootlen = 0; - return MPN_NOMEM; - } - strcpy(tmproot, pathcomp); - if (isalpha((uch)tmproot[0]) && tmproot[1] == ':') - has_drive = TRUE; /* drive designator */ - if (tmproot[G.rootlen-1] == '/' || tmproot[G.rootlen-1] == '\\') { - tmproot[--G.rootlen] = '\0'; - had_trailing_pathsep = TRUE; - } - if (has_drive && (G.rootlen == 2)) { - if (!had_trailing_pathsep) /* i.e., original wasn't "x:/" */ - add_dot = TRUE; /* relative path: add '.' before '/' */ - } else if (G.rootlen > 0) { /* need not check "x:." and "x:/" */ - if (SSTAT(tmproot, &G.statbuf) || !S_ISDIR(G.statbuf.st_mode)) - { - /* path does not exist */ - if (!G.create_dirs /* || iswild(tmproot) */ ) { - free(tmproot); - G.rootlen = 0; - /* treat as stored file */ - return MPN_INF_SKIP; - } - /* create directory (could add loop here scanning tmproot - * to create more than one level, but really necessary?) */ - if (MKDIR(tmproot, 0777) == -1) { - Info(slide, 1, ((char *)slide, - "checkdir: cannot create extraction directory: %s\n", - FnFilter1(tmproot))); - free(tmproot); - G.rootlen = 0; - /* path didn't exist, tried to create, failed: */ - /* file exists, or need 2+ subdir levels */ - return MPN_ERR_SKIP; - } - } - } - if (add_dot) /* had just "x:", make "x:." */ - tmproot[G.rootlen++] = '.'; - tmproot[G.rootlen++] = '/'; - tmproot[G.rootlen] = '\0'; - if ((G.rootpath = (char *)realloc(tmproot, G.rootlen+1)) == NULL) { - free(tmproot); - G.rootlen = 0; - return MPN_NOMEM; - } - Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath))); - } - return MPN_OK; - } -#endif /* !SFX || SFX_EXDIR */ - -/*--------------------------------------------------------------------------- - END: free rootpath, immediately prior to program exit. - ---------------------------------------------------------------------------*/ - - if (FUNCTION == END) { - Trace((stderr, "freeing rootpath\n")); - if (G.rootlen > 0) { - free(G.rootpath); - G.rootlen = 0; - } - return MPN_OK; - } - - return MPN_INVALID; /* should never reach */ - -} /* end function checkdir() */ - - - - - -#ifndef SFX - -/*************************/ -/* Function dateformat() */ -/*************************/ - -int dateformat() -{ - char df[2]; /* LOCALE_IDATE has a maximum value of 2 */ - - if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IDATE, df, 2) != 0) { - switch (df[0]) - { - case '0': - return DF_MDY; - case '1': - return DF_DMY; - case '2': - return DF_YMD; - } - } - return DF_MDY; -} - - -/****************************/ -/* Function dateseparator() */ -/****************************/ - -char dateseparator() -{ - char df[2]; /* use only if it is one character */ - - if ((GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SDATE, df, 2) != 0) && - (df[0] != '\0')) - return df[0]; - else - return '-'; -} - - -#ifndef WINDLL - -/************************/ -/* Function version() */ -/************************/ - -void version(__G) - __GDEF -{ - int len; -#if (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__DJGPP__)) - char buf[80]; -#if (defined(_MSC_VER) && (_MSC_VER > 900)) - char buf2[80]; -#endif -#endif - - len = sprintf((char *)slide, CompiledWith, - -#if defined(_MSC_VER) /* MSC == VC++, but what about SDK compiler? */ - (sprintf(buf, "Microsoft C %d.%02d ", _MSC_VER/100, _MSC_VER%100), buf), -# if (_MSC_VER == 800) - "(Visual C++ v1.1)", -# elif (_MSC_VER == 850) - "(Windows NT v3.5 SDK)", -# elif (_MSC_VER == 900) - "(Visual C++ v2.x)", -# elif (_MSC_VER > 900) - (sprintf(buf2, "(Visual C++ %d.%d)", _MSC_VER/100 - 6, _MSC_VER%100/10), - buf2), -# else - "(bad version)", -# endif -#elif defined(__WATCOMC__) -# if (__WATCOMC__ % 10 > 0) - (sprintf(buf, "Watcom C/C++ %d.%02d", __WATCOMC__ / 100, - __WATCOMC__ % 100), buf), "", -# else - (sprintf(buf, "Watcom C/C++ %d.%d", __WATCOMC__ / 100, - (__WATCOMC__ % 100) / 10), buf), "", -# endif -#elif defined(__BORLANDC__) - "Borland C++", -# if (__BORLANDC__ < 0x0200) - " 1.0", -# elif (__BORLANDC__ == 0x0200) - " 2.0", -# elif (__BORLANDC__ == 0x0400) - " 3.0", -# elif (__BORLANDC__ == 0x0410) /* __TURBOC__ = 0x0310 */ - " 3.1", -# elif (__BORLANDC__ == 0x0452) /* __TURBOC__ = 0x0320 */ - " 4.0 or 4.02", -# elif (__BORLANDC__ == 0x0460) /* __TURBOC__ = 0x0340 */ - " 4.5", -# elif (__BORLANDC__ == 0x0500) /* __TURBOC__ = 0x0340 */ - " 5.0", -# elif (__BORLANDC__ == 0x0520) /* __TURBOC__ = 0x0520 */ - " 5.2 (C++ Builder 1.0)", -# elif (__BORLANDC__ == 0x0530) /* __TURBOC__ = 0x0530 */ - " 5.3 (C++ Builder 3.0)", -# elif (__BORLANDC__ == 0x0540) /* __TURBOC__ = 0x0540 */ - " 5.4 (C++ Builder 4.0)", -# elif (__BORLANDC__ == 0x0550) /* __TURBOC__ = 0x0550 */ - " 5.5 (C++ Builder 5.0)", -# elif (__BORLANDC__ == 0x0551) /* __TURBOC__ = 0x0551 */ - " 5.5.1 (C++ Builder 5.0.1)", -# elif (__BORLANDC__ == 0x0560) /* __TURBOC__ = 0x0560 */ - " 6.0 (C++ Builder 6.0)", -# else - " later than 6.0", -# endif -#elif defined(__LCC__) - "LCC-Win32", "", -#elif defined(__GNUC__) -# if defined(__RSXNT__) -# if (defined(__DJGPP__) && !defined(__EMX__)) - (sprintf(buf, "rsxnt(djgpp v%d.%02d) / gcc ", - __DJGPP__, __DJGPP_MINOR__), buf), -# elif defined(__DJGPP__) - (sprintf(buf, "rsxnt(emx+djgpp v%d.%02d) / gcc ", - __DJGPP__, __DJGPP_MINOR__), buf), -# elif (defined(__GO32__) && !defined(__EMX__)) - "rsxnt(djgpp v1.x) / gcc ", -# elif defined(__GO32__) - "rsxnt(emx + djgpp v1.x) / gcc ", -# elif defined(__EMX__) - "rsxnt(emx)+gcc ", -# else - "rsxnt(unknown) / gcc ", -# endif -# elif defined(__CYGWIN__) - "cygnus win32 / gcc ", -# elif defined(__MINGW32__) - "mingw32 / gcc ", -# else - "gcc ", -# endif - __VERSION__, -#else /* !_MSC_VER, !__WATCOMC__, !__BORLANDC__, !__LCC__, !__GNUC__ */ - "unknown compiler (SDK?)", "", -#endif /* ?compilers */ - - "\nWindows 9x / Windows NT/2K/XP/2K3", " (32-bit)", - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - - (*G.message)((zvoid *)&G, slide, (ulg)len, 0); - - return; - -} /* end function version() */ - -#endif /* !WINDLL */ -#endif /* !SFX */ - - - -#ifdef MORE - -int screensize(int *tt_rows, int *tt_cols) -{ - HANDLE hstdout; - CONSOLE_SCREEN_BUFFER_INFO scr; - - hstdout = GetStdHandle(STD_OUTPUT_HANDLE); - GetConsoleScreenBufferInfo(hstdout, &scr); - if (tt_rows != NULL) *tt_rows = scr.srWindow.Bottom - scr.srWindow.Top + 1; - if (tt_cols != NULL) *tt_cols = scr.srWindow.Right - scr.srWindow.Left + 1; - return 0; /* signal success */ -} - -#endif /* MORE */ - - - -#ifdef W32_STAT_BANDAID - -/* All currently known variants of WIN32 operating systems (Windows 95/98, - * WinNT 3.x, 4.0, 5.x) have a nasty bug in the OS kernel concerning - * conversions between UTC and local time: In the time conversion functions - * of the Win32 API, the timezone offset (including seasonal daylight saving - * shift) between UTC and local time evaluation is erratically based on the - * current system time. The correct evaluation must determine the offset - * value as it {was/is/will be} for the actual time to be converted. - * - * Newer versions of MS C runtime lib's stat() returns utc time-stamps so - * that localtime(timestamp) corresponds to the (potentially false) local - * time shown by the OS' system programs (Explorer, command shell dir, etc.) - * The RSXNT port follows the same strategy, but fails to recognize the - * access-time attribute. - * - * For the NTFS file system (and other filesystems that store time-stamps - * as UTC values), this results in st_mtime (, st_{c|a}time) fields which - * are not stable but vary according to the seasonal change of "daylight - * saving time in effect / not in effect". - * - * Other C runtime libs (CygWin), or the crtdll.dll supplied with Win9x/NT - * return the unix-time equivalent of the UTC FILETIME values as got back - * from the Win32 API call. This time, return values from NTFS are correct - * whereas utimes from files on (V)FAT volumes vary according to the DST - * switches. - * - * To achieve timestamp consistency of UTC (UT extra field) values in - * Zip archives, the Info-ZIP programs require work-around code for - * proper time handling in stat() (and other time handling routines). - * - * However, nowadays most other programs on Windows systems use the - * time conversion strategy of Microsofts C runtime lib "msvcrt.dll". - * To improve interoperability in environments where a "consistent" (but - * false) "UTC<-->LocalTime" conversion is preferred over "stable" time - * stamps, the Info-ZIP specific time conversion handling can be - * deactivated by defining the preprocessor flag NO_W32TIMES_IZFIX. - */ -/* stat() functions under Windows95 tend to fail for root directories. * - * Watcom and Borland, at least, are affected by this bug. Watcom made * - * a partial fix for 11.0 but still missed some cases. This substitute * - * detects the case and fills in reasonable values. Otherwise we get * - * effects like failure to extract to a root dir because it's not found. */ - -int zstat_win32(__W32STAT_GLOBALS__ const char *path, z_stat *buf) -{ - if (!zstat(path, buf)) - { - /* stat was successful, now redo the time-stamp fetches */ -#ifndef NO_W32TIMES_IZFIX - int fs_uses_loctime = FStampIsLocTime(__G__ path); -#endif - HANDLE h; - FILETIME Modft, Accft, Creft; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_path = (char *)alloca(strlen(path) + 1); - - INTERN_TO_ISO(path, ansi_path); -# define Ansi_Path ansi_path -#else -# define Ansi_Path path -#endif - - TTrace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime)); - h = CreateFileA(Ansi_Path, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (h != INVALID_HANDLE_VALUE) { - BOOL ftOK = GetFileTime(h, &Creft, &Accft, &Modft); - CloseHandle(h); - - if (ftOK) { - FTTrace((stdout, "GetFileTime returned Modft", 0, &Modft)); - FTTrace((stdout, "GetFileTime returned Creft", 0, &Creft)); -#ifndef NO_W32TIMES_IZFIX - if (!fs_uses_loctime) { - /* On a filesystem that stores UTC timestamps, we refill - * the time fields of the struct stat buffer by directly - * using the UTC values as returned by the Win32 - * GetFileTime() API call. - */ - NtfsFileTime2utime(&Modft, &(buf->st_mtime)); - if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) - NtfsFileTime2utime(&Accft, &(buf->st_atime)); - else - buf->st_atime = buf->st_mtime; - if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) - NtfsFileTime2utime(&Creft, &(buf->st_ctime)); - else - buf->st_ctime = buf->st_mtime; - TTrace((stdout,"NTFS, recalculated modtime %08lx\n", - buf->st_mtime)); - } else -#endif /* NO_W32TIMES_IZFIX */ - { - /* On VFAT and FAT-like filesystems, the FILETIME values - * are converted back to the stable local time before - * converting them to UTC unix time-stamps. - */ - VFatFileTime2utime(&Modft, &(buf->st_mtime)); - if (Accft.dwLowDateTime != 0 || Accft.dwHighDateTime != 0) - VFatFileTime2utime(&Accft, &(buf->st_atime)); - else - buf->st_atime = buf->st_mtime; - if (Creft.dwLowDateTime != 0 || Creft.dwHighDateTime != 0) - VFatFileTime2utime(&Creft, &(buf->st_ctime)); - else - buf->st_ctime = buf->st_mtime; - TTrace((stdout, "VFAT, recalculated modtime %08lx\n", - buf->st_mtime)); - } - } - } -# undef Ansi_Path - return 0; - } -#ifdef W32_STATROOT_FIX - else - { - DWORD flags; -#ifdef __RSXNT__ /* RSXNT/EMX C rtl uses OEM charset */ - char *ansi_path = (char *)alloca(strlen(path) + 1); - - INTERN_TO_ISO(path, ansi_path); -# define Ansi_Path ansi_path -#else -# define Ansi_Path path -#endif - - flags = GetFileAttributesA(Ansi_Path); - if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) { - Trace((stderr, "\nstat(\"%s\",...) failed on existing directory\n", - FnFilter1(path))); - memset(buf, 0, sizeof(z_stat)); - buf->st_atime = buf->st_ctime = buf->st_mtime = - dos_to_unix_time(DOSTIME_MINIMUM); /* 1-1-80 */ - buf->st_mode = S_IFDIR | S_IREAD | - ((flags & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE); - return 0; - } /* assumes: stat() won't fail on non-dirs without good reason */ -# undef Ansi_Path - } -#endif /* W32_STATROOT_FIX */ - return -1; -} - -#endif /* W32_STAT_BANDAID */ - - - -#ifdef W32_USE_IZ_TIMEZONE -#include "timezone.h" -#define SECSPERMIN 60 -#define MINSPERHOUR 60 -#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule); - -static void conv_to_rule(LPSYSTEMTIME lpw32tm, struct rule * ZCONST ptrule) -{ - if (lpw32tm->wYear != 0) { - ptrule->r_type = JULIAN_DAY; - ptrule->r_day = ydays[lpw32tm->wMonth - 1] + lpw32tm->wDay; - } else { - ptrule->r_type = MONTH_NTH_DAY_OF_WEEK; - ptrule->r_mon = lpw32tm->wMonth; - ptrule->r_day = lpw32tm->wDayOfWeek; - ptrule->r_week = lpw32tm->wDay; - } - ptrule->r_time = (long)lpw32tm->wHour * SECSPERHOUR + - (long)(lpw32tm->wMinute * SECSPERMIN) + - (long)lpw32tm->wSecond; -} - -int GetPlatformLocalTimezone(register struct state * ZCONST sp, - void (*fill_tzstate_from_rules)(struct state * ZCONST sp_res, - ZCONST struct rule * ZCONST start, - ZCONST struct rule * ZCONST end)) -{ - TIME_ZONE_INFORMATION tzinfo; - DWORD res; - - /* read current timezone settings from registry if TZ envvar missing */ - res = GetTimeZoneInformation(&tzinfo); - if (res != TIME_ZONE_ID_INVALID) - { - struct rule startrule, stoprule; - - conv_to_rule(&(tzinfo.StandardDate), &stoprule); - conv_to_rule(&(tzinfo.DaylightDate), &startrule); - sp->timecnt = 0; - sp->ttis[0].tt_abbrind = 0; - if ((sp->charcnt = - WideCharToMultiByte(CP_ACP, 0, tzinfo.StandardName, -1, - sp->chars, sizeof(sp->chars), NULL, NULL)) - == 0) - sp->chars[sp->charcnt++] = '\0'; - sp->ttis[1].tt_abbrind = sp->charcnt; - sp->charcnt += - WideCharToMultiByte(CP_ACP, 0, tzinfo.DaylightName, -1, - sp->chars + sp->charcnt, - sizeof(sp->chars) - sp->charcnt, NULL, NULL); - if ((sp->charcnt - sp->ttis[1].tt_abbrind) == 0) - sp->chars[sp->charcnt++] = '\0'; - sp->ttis[0].tt_gmtoff = - (tzinfo.Bias + tzinfo.StandardBias) - * MINSPERHOUR; - sp->ttis[1].tt_gmtoff = - (tzinfo.Bias + tzinfo.DaylightBias) - * MINSPERHOUR; - sp->ttis[0].tt_isdst = 0; - sp->ttis[1].tt_isdst = 1; - sp->typecnt = (startrule.r_mon == 0 && stoprule.r_mon == 0) ? 1 : 2; - - if (sp->typecnt > 1) - (*fill_tzstate_from_rules)(sp, &startrule, &stoprule); - return TRUE; - } - return FALSE; -} -#endif /* W32_USE_IZ_TIMEZONE */ - -#endif /* !FUNZIP */ - - - -#ifndef WINDLL -/* This replacement getch() function was originally created for Watcom C - * and then additionally used with CYGWIN. Since UnZip 5.4, all other Win32 - * ports apply this replacement rather that their supplied getch() (or - * alike) function. There are problems with unabsorbed LF characters left - * over in the keyboard buffer under Win95 (and 98) when ENTER was pressed. - * (Under Win95, ENTER returns two(!!) characters: CR-LF.) This problem - * does not appear when run on a WinNT console prompt! - */ - -/* Watcom 10.6's getch() does not handle Alt+. */ -/* Note that if PASSWD_FROM_STDIN is defined, the file containing */ -/* the password must have a carriage return after the word, not a */ -/* Unix-style newline (linefeed only). This discards linefeeds. */ - -int getch_win32(void) -{ - HANDLE stin; - DWORD rc; - unsigned char buf[2]; - int ret = -1; - DWORD odemode = ~(DWORD)0; - -# ifdef PASSWD_FROM_STDIN - stin = GetStdHandle(STD_INPUT_HANDLE); -# else - stin = CreateFileA("CONIN$", GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - if (stin == INVALID_HANDLE_VALUE) - return -1; -# endif - if (GetConsoleMode(stin, &odemode)) - SetConsoleMode(stin, ENABLE_PROCESSED_INPUT); /* raw except ^C noticed */ - if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) - ret = buf[0]; - /* when the user hits return we get CR LF. We discard the LF, not the CR, - * because when we call this for the first time after a previous input - * such as the one for "replace foo? [y]es, ..." the LF may still be in - * the input stream before whatever the user types at our prompt. */ - if (ret == '\n') - if (ReadFile(stin, &buf, 1, &rc, NULL) && rc == 1) - ret = buf[0]; - if (odemode != ~(DWORD)0) - SetConsoleMode(stin, odemode); -# ifndef PASSWD_FROM_STDIN - CloseHandle(stin); -# endif - return ret; -} -#endif /* !WINDLL */ - - - -#if (defined(UNICODE_SUPPORT) && !defined(FUNZIP)) -/* convert wide character string to multi-byte character string */ -char *wide_to_local_string(wide_string, escape_all) - ZCONST zwchar *wide_string; - int escape_all; -{ - int i; - wchar_t wc; - int bytes_char; - int default_used; - int wsize = 0; - int max_bytes = 9; - char buf[9]; - char *buffer = NULL; - char *local_string = NULL; - - for (wsize = 0; wide_string[wsize]; wsize++) ; - - if (max_bytes < MB_CUR_MAX) - max_bytes = MB_CUR_MAX; - - if ((buffer = (char *)malloc(wsize * max_bytes + 1)) == NULL) { - return NULL; - } - - /* convert it */ - buffer[0] = '\0'; - for (i = 0; i < wsize; i++) { - if (sizeof(wchar_t) < 4 && wide_string[i] > 0xFFFF) { - /* wchar_t probably 2 bytes */ - /* could do surrogates if state_dependent and wctomb can do */ - wc = zwchar_to_wchar_t_default_char; - } else { - wc = (wchar_t)wide_string[i]; - } - /* Unter some vendor's C-RTL, the Wide-to-MultiByte conversion functions - * (like wctomb() et. al.) do not use the same codepage as the other - * string arguments I/O functions (fopen, mkdir, rmdir etc.). - * Therefore, we have to fall back to the underlying Win32-API call to - * achieve a consistent behaviour for all supported compiler environments. - * Failing RTLs are for example: - * Borland (locale uses OEM-CP as default, but I/O functions expect ANSI - * names) - * Watcom (only "C" locale, wctomb() always uses OEM CP) - * (in other words: all supported environments except the Microsoft RTLs) - */ - bytes_char = WideCharToMultiByte( - CP_ACP, WC_COMPOSITECHECK, - &wc, 1, - (LPSTR)buf, sizeof(buf), - NULL, &default_used); - if (default_used) - bytes_char = -1; - if (escape_all) { - if (bytes_char == 1 && (uch)buf[0] <= 0x7f) { - /* ASCII */ - strncat(buffer, buf, 1); - } else { - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } else if (bytes_char > 0) { - /* multi-byte char */ - strncat(buffer, buf, bytes_char); - } else { - /* no MB for this wide */ - /* use escape for wide character */ - char *escape_string = wide_to_escape_string(wide_string[i]); - strcat(buffer, escape_string); - free(escape_string); - } - } - if ((local_string = (char *)realloc(buffer, strlen(buffer) + 1)) == NULL) { - free(buffer); - return NULL; - } - - return local_string; -} - - -#if 0 -wchar_t *utf8_to_wchar_string(utf8_string) - char *utf8_string; /* path to get utf-8 name for */ -{ - wchar_t *qw; - int ulen; - int ulenw; - - if (utf8_string == NULL) - return NULL; - - /* get length */ - ulenw = MultiByteToWideChar( - CP_UTF8, /* UTF-8 code page */ - 0, /* flags for character-type options */ - utf8_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - NULL, /* buffer */ - 0 ); /* buffer length (0 = return length) */ - if (ulenw == 0) { - /* failed */ - return NULL; - } - ulenw++; - /* get length in bytes */ - ulen = sizeof(wchar_t) * (ulenw + 1); - if ((qw = (wchar_t *)malloc(ulen + 1)) == NULL) { - return NULL; - } - /* convert multibyte to wide */ - ulen = MultiByteToWideChar( - CP_UTF8, /* UTF-8 code page */ - 0, /* flags for character-type options */ - utf8_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - qw, /* buffer */ - ulenw); /* buffer length (0 = return length) */ - if (ulen == 0) { - /* failed */ - free(qw); - return NULL; - } - - return qw; -} - -wchar_t *local_to_wchar_string(local_string) - char *local_string; /* path of local name */ -{ - wchar_t *qw; - int ulen; - int ulenw; - - if (local_string == NULL) - return NULL; - - /* get length */ - ulenw = MultiByteToWideChar( - CP_ACP, /* ANSI code page */ - 0, /* flags for character-type options */ - local_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - NULL, /* buffer */ - 0 ); /* buffer length (0 = return length) */ - if (ulenw == 0) { - /* failed */ - return NULL; - } - ulenw++; - /* get length in bytes */ - ulen = sizeof(wchar_t) * (ulenw + 1); - if ((qw = (wchar_t *)malloc(ulen + 1)) == NULL) { - return NULL; - } - /* convert multibyte to wide */ - ulen = MultiByteToWideChar( - CP_ACP, /* ANSI code page */ - 0, /* flags for character-type options */ - local_string, /* string to convert */ - -1, /* string length (-1 = NULL terminated) */ - qw, /* buffer */ - ulenw); /* buffer length (0 = return length) */ - if (ulen == 0) { - /* failed */ - free(qw); - return NULL; - } - - return qw; -} -#endif /* 0 */ -#endif /* UNICODE_SUPPORT && !FUNZIP */ - - - -/* --------------------------------------------------- */ -/* Large File Support - * - * Initial functions by E. Gordon and R. Nausedat - * 9/10/2003 - * Lifted from Zip 3b, win32.c and place here by Myles Bennett - * 7/6/2004 - * - * These implement 64-bit file support for Windows. The - * defines and headers are in win32/w32cfg.h. - * - * Moved to win32i64.c by Mike White to avoid conflicts in - * same name functions in WiZ using UnZip and Zip libraries. - * 9/25/2003 - */ diff --git a/data/windows/unzipfx-catia/win32/win32i64.c b/data/windows/unzipfx-catia/win32/win32i64.c deleted file mode 100644 index e303c8f..0000000 --- a/data/windows/unzipfx-catia/win32/win32i64.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - win32/win32i64.c - UnZip 6 - - 64-bit filesize support for WIN32 Zip and UnZip. - ---------------------------------------------------------------------------*/ - -#include "../zip.h" - -/* --------------------------------------------------- */ -/* Large File Support - * - * Initial functions by E. Gordon and R. Nausedat - * 9/10/2003 - * - * These implement 64-bit file support for Windows. The - * defines and headers are in win32/osdep.h. - * - * These moved from win32.c by Mike White to avoid conflicts - * in WiZ of same name functions in UnZip and Zip libraries. - * 9/25/04 EG - */ - -#if defined(LARGE_FILE_SUPPORT) && !defined(__CYGWIN__) -# ifdef USE_STRM_INPUT - -# ifndef zftello -/* 64-bit buffered ftello - * - * Win32 does not provide a 64-bit buffered - * ftell (in the published api anyway) so below provides - * hopefully close version. - * We have not gotten _telli64 to work with buffered - * streams. Below cheats by using fgetpos improperly and - * may not work on other ports. - */ - -zoff_t zftello(stream) - FILE *stream; -{ - fpos_t fpos = 0; - - if (fgetpos(stream, &fpos) != 0) { - return -1L; - } else { - return fpos; - } -} -# endif /* ndef zftello */ - - -# ifndef zfseeko -/* 64-bit buffered fseeko - * - * Win32 does not provide a 64-bit buffered - * fseeko, so use _lseeki64 and fflush. Note - * that SEEK_CUR can lose track of location - * if fflush is done between the last buffered - * io and this call. - */ - -int zfseeko(stream, offset, origin) - FILE *stream; - zoff_t offset; - int origin; -{ - - /* fseek() or its replacements are supposed to clear the eof status - of the stream. fflush() and _lseeki64() do not touch the stream's - eof flag, so we have to do it manually. */ -#if ((defined(_MSC_VER) && (_MSC_VER >= 1200)) || \ - (defined(__MINGW32__) && defined(__MSVCRT_VERSION__))) - /* For the MSC environment (VS 6 or higher), and for recent releases of - the MinGW environment, we "know" the internals of the FILE structure. - So, we can clear just the EOF bit of the status flag. */ - stream->_flag &= ~_IOEOF; -#else - /* Unfortunately, there is no standard "cleareof()" function, so we have - to use clearerr(). This has the unwanted side effect of clearing the - ferror() state as well. */ - clearerr(stream); -#endif - - if (origin == SEEK_CUR) { - /* instead of synching up lseek easier just to figure and - use an absolute offset */ - offset += zftello(stream); - origin = SEEK_SET; - } - fflush(stream); - if (_lseeki64(fileno(stream), offset, origin) == (zoff_t)-1L) { - return -1; - } else { - return 0; - } -} -# endif /* ndef fseeko */ -# endif /* USE_STRM_INPUT */ -#endif /* Win32 LARGE_FILE_SUPPORT */ - -#if 0 -FILE* zfopen(filename, mode) -const char *filename; -const char *mode; -{ - FILE* fTemp; - - fTemp = fopen(filename, mode); - if( fTemp == NULL ) - return NULL; - - /* sorry, could not make VC60 and its rtl work properly without setting the - * file buffer to NULL. the problem seems to be _telli64 which seems to - * return the max stream position, comments are welcome - */ - setbuf(fTemp, NULL); - - return fTemp; -} -#endif -/* --------------------------------------------------- */ diff --git a/data/windows/unzipfx-catia/zip.h b/data/windows/unzipfx-catia/zip.h deleted file mode 100644 index 4043bf1..0000000 --- a/data/windows/unzipfx-catia/zip.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (c) 1990-2005 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2003-May-08 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/* This is a dummy zip.h to allow the source files shared with Zip - (crypt.c, crc32.c, ttyio.c, win32/win32i64.c) to compile for UnZip. - (In case you are looking for the Info-ZIP license, please follow - the pointers above.) */ - -#ifndef __zip_h /* don't include more than once */ -#define __zip_h - -#define UNZIP_INTERNAL -#include "unzip.h" - -#define local static - -#define ZE_MEM PK_MEM -#define ziperr(c, h) return - -#endif /* !__zip_h */ diff --git a/data/windows/unzipfx-catia/zipinfo.c b/data/windows/unzipfx-catia/zipinfo.c deleted file mode 100644 index a92bca9..0000000 --- a/data/windows/unzipfx-catia/zipinfo.c +++ /dev/null @@ -1,2315 +0,0 @@ -/* - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2009-Jan-02 or later - (the contents of which are also included in unzip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - zipinfo.c Greg Roelofs et al. - - This file contains all of the ZipInfo-specific listing routines for UnZip. - - Contains: zi_opts() - zi_end_central() - zipinfo() - zi_long() - zi_short() - zi_time() - - ---------------------------------------------------------------------------*/ - - -#define UNZIP_INTERNAL -#include "unzip.h" - - -#ifndef NO_ZIPINFO /* strings use up too much space in small-memory systems */ - -/* Define OS-specific attributes for use on ALL platforms--the S_xxxx - * versions of these are defined differently (or not defined) by different - * compilers and operating systems. */ - -#define UNX_IFMT 0170000 /* Unix file type mask */ -#define UNX_IFREG 0100000 /* Unix regular file */ -#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ -#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ -#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ -#define UNX_IFDIR 0040000 /* Unix directory */ -#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ -#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ -#define UNX_ISUID 04000 /* Unix set user id on execution */ -#define UNX_ISGID 02000 /* Unix set group id on execution */ -#define UNX_ISVTX 01000 /* Unix directory permissions control */ -#define UNX_ENFMT UNX_ISGID /* Unix record locking enforcement flag */ -#define UNX_IRWXU 00700 /* Unix read, write, execute: owner */ -#define UNX_IRUSR 00400 /* Unix read permission: owner */ -#define UNX_IWUSR 00200 /* Unix write permission: owner */ -#define UNX_IXUSR 00100 /* Unix execute permission: owner */ -#define UNX_IRWXG 00070 /* Unix read, write, execute: group */ -#define UNX_IRGRP 00040 /* Unix read permission: group */ -#define UNX_IWGRP 00020 /* Unix write permission: group */ -#define UNX_IXGRP 00010 /* Unix execute permission: group */ -#define UNX_IRWXO 00007 /* Unix read, write, execute: other */ -#define UNX_IROTH 00004 /* Unix read permission: other */ -#define UNX_IWOTH 00002 /* Unix write permission: other */ -#define UNX_IXOTH 00001 /* Unix execute permission: other */ - -#define VMS_IRUSR UNX_IRUSR /* VMS read/owner */ -#define VMS_IWUSR UNX_IWUSR /* VMS write/owner */ -#define VMS_IXUSR UNX_IXUSR /* VMS execute/owner */ -#define VMS_IRGRP UNX_IRGRP /* VMS read/group */ -#define VMS_IWGRP UNX_IWGRP /* VMS write/group */ -#define VMS_IXGRP UNX_IXGRP /* VMS execute/group */ -#define VMS_IROTH UNX_IROTH /* VMS read/other */ -#define VMS_IWOTH UNX_IWOTH /* VMS write/other */ -#define VMS_IXOTH UNX_IXOTH /* VMS execute/other */ - -#define AMI_IFMT 06000 /* Amiga file type mask */ -#define AMI_IFDIR 04000 /* Amiga directory */ -#define AMI_IFREG 02000 /* Amiga regular file */ -#define AMI_IHIDDEN 00200 /* to be supported in AmigaDOS 3.x */ -#define AMI_ISCRIPT 00100 /* executable script (text command file) */ -#define AMI_IPURE 00040 /* allow loading into resident memory */ -#define AMI_IARCHIVE 00020 /* not modified since bit was last set */ -#define AMI_IREAD 00010 /* can be opened for reading */ -#define AMI_IWRITE 00004 /* can be opened for writing */ -#define AMI_IEXECUTE 00002 /* executable image, a loadable runfile */ -#define AMI_IDELETE 00001 /* can be deleted */ - -#define THS_IFMT 0xF000 /* Theos file type mask */ -#define THS_IFIFO 0x1000 /* pipe */ -#define THS_IFCHR 0x2000 /* char device */ -#define THS_IFSOCK 0x3000 /* socket */ -#define THS_IFDIR 0x4000 /* directory */ -#define THS_IFLIB 0x5000 /* library */ -#define THS_IFBLK 0x6000 /* block device */ -#define THS_IFREG 0x8000 /* regular file */ -#define THS_IFREL 0x9000 /* relative (direct) */ -#define THS_IFKEY 0xA000 /* keyed */ -#define THS_IFIND 0xB000 /* indexed */ -#define THS_IFRND 0xC000 /* ???? */ -#define THS_IFR16 0xD000 /* 16 bit real mode program */ -#define THS_IFP16 0xE000 /* 16 bit protected mode prog */ -#define THS_IFP32 0xF000 /* 32 bit protected mode prog */ -#define THS_IMODF 0x0800 /* modified */ -#define THS_INHID 0x0400 /* not hidden */ -#define THS_IEUSR 0x0200 /* erase permission: owner */ -#define THS_IRUSR 0x0100 /* read permission: owner */ -#define THS_IWUSR 0x0080 /* write permission: owner */ -#define THS_IXUSR 0x0040 /* execute permission: owner */ -#define THS_IROTH 0x0004 /* read permission: other */ -#define THS_IWOTH 0x0002 /* write permission: other */ -#define THS_IXOTH 0x0001 /* execute permission: other */ - -#ifdef OLD_THEOS_EXTRA -# include "theos/oldstat.h" -#endif - -#ifndef NSK_UNSTRUCTURED -# define NSK_UNSTRUCTURED 0 -#endif -#ifndef NSK_OBJECTFILECODE -# define NSK_OBJECTFILECODE 100 -#endif -#ifndef NSK_EDITFILECODE -# define NSK_EDITFILECODE 101 -#endif - -#define LFLAG 3 /* short "ls -l" type listing */ - -static int zi_long OF((__GPRO__ zusz_t *pEndprev, int error_in_archive)); -static int zi_short OF((__GPRO)); -static void zi_showMacTypeCreator - OF((__GPRO__ uch *ebfield)); -static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, - ZCONST time_t *modtimez, char *d_t_str)); - - -/**********************************************/ -/* Strings used in zipinfo.c (ZipInfo half) */ -/**********************************************/ - -static ZCONST char nullStr[] = ""; -static ZCONST char PlurSufx[] = "s"; - -static ZCONST char Far ZipInfHeader2[] = - "Zip file size: %s bytes, number of entries: %s\n"; -static ZCONST char Far EndCentDirRec[] = "\nEnd-of-central-directory record:\n"; -static ZCONST char Far LineSeparators[] = "-------------------------------\n\n"; -static ZCONST char Far ZipFSizeVerbose[] = "\ - Zip archive file size: %s (%sh)\n"; -static ZCONST char Far ActOffsetCentDir[] = "\ - Actual end-cent-dir record offset: %s (%sh)\n\ - Expected end-cent-dir record offset: %s (%sh)\n\ - (based on the length of the central directory and its expected offset)\n\n"; -static ZCONST char Far SinglePartArchive1[] = "\ - This zipfile constitutes the sole disk of a single-part archive; its\n\ - central directory contains %s %s.\n\ - The central directory is %s (%sh) bytes long,\n"; -static ZCONST char Far SinglePartArchive2[] = "\ - and its (expected) offset in bytes from the beginning of the zipfile\n\ - is %s (%sh).\n\n"; -static ZCONST char Far MultiPartArchive1[] = "\ - This zipfile constitutes disk %lu of a multi-part archive. The central\n\ - directory starts on disk %lu at an offset within that archive part\n"; -static ZCONST char Far MultiPartArchive2[] = "\ - of %s (%sh) bytes. The entire\n\ - central directory is %s (%sh) bytes long.\n"; -static ZCONST char Far MultiPartArchive3[] = "\ - %s of the archive entries %s contained within this zipfile volume,\n\ - out of a total of %s %s.\n\n"; - -static ZCONST char Far CentralDirEntry[] = - "\nCentral directory entry #%lu:\n---------------------------\n\n"; -static ZCONST char Far ZipfileStats[] = - "%lu file%s, %s bytes uncompressed, %s bytes compressed: %s%d.%d%%\n"; - -/* zi_long() strings */ -static ZCONST char Far OS_FAT[] = "MS-DOS, OS/2 or NT FAT"; -static ZCONST char Far OS_Amiga[] = "Amiga"; -static ZCONST char Far OS_VMS[] = "VMS"; -static ZCONST char Far OS_Unix[] = "Unix"; -static ZCONST char Far OS_VMCMS[] = "VM/CMS"; -static ZCONST char Far OS_AtariST[] = "Atari ST"; -static ZCONST char Far OS_HPFS[] = "OS/2 or NT HPFS"; -static ZCONST char Far OS_Macintosh[] = "Macintosh HFS"; -static ZCONST char Far OS_ZSystem[] = "Z-System"; -static ZCONST char Far OS_CPM[] = "CP/M"; -static ZCONST char Far OS_TOPS20[] = "TOPS-20"; -static ZCONST char Far OS_NTFS[] = "NTFS"; -static ZCONST char Far OS_QDOS[] = "SMS/QDOS"; -static ZCONST char Far OS_Acorn[] = "Acorn RISC OS"; -static ZCONST char Far OS_MVS[] = "MVS"; -static ZCONST char Far OS_VFAT[] = "Win32 VFAT"; -static ZCONST char Far OS_AtheOS[] = "AtheOS"; -static ZCONST char Far OS_BeOS[] = "BeOS"; -static ZCONST char Far OS_Tandem[] = "Tandem NSK"; -static ZCONST char Far OS_Theos[] = "Theos"; -static ZCONST char Far OS_MacDarwin[] = "Mac OS/X (Darwin)"; -#ifdef OLD_THEOS_EXTRA - static ZCONST char Far OS_TheosOld[] = "Theos (Old)"; -#endif /* OLD_THEOS_EXTRA */ - -static ZCONST char Far MthdNone[] = "none (stored)"; -static ZCONST char Far MthdShrunk[] = "shrunk"; -static ZCONST char Far MthdRedF1[] = "reduced (factor 1)"; -static ZCONST char Far MthdRedF2[] = "reduced (factor 2)"; -static ZCONST char Far MthdRedF3[] = "reduced (factor 3)"; -static ZCONST char Far MthdRedF4[] = "reduced (factor 4)"; -static ZCONST char Far MthdImplode[] = "imploded"; -static ZCONST char Far MthdToken[] = "tokenized"; -static ZCONST char Far MthdDeflate[] = "deflated"; -static ZCONST char Far MthdDeflat64[] = "deflated (enhanced-64k)"; -static ZCONST char Far MthdDCLImplode[] = "imploded (PK DCL)"; -static ZCONST char Far MthdBZip2[] = "bzipped"; -static ZCONST char Far MthdLZMA[] = "LZMA-ed"; -static ZCONST char Far MthdTerse[] = "tersed (IBM)"; -static ZCONST char Far MthdLZ77[] = "LZ77-compressed (IBM)"; -static ZCONST char Far MthdWavPack[] = "WavPacked"; -static ZCONST char Far MthdPPMd[] = "PPMd-ed"; - -static ZCONST char Far DeflNorm[] = "normal"; -static ZCONST char Far DeflMax[] = "maximum"; -static ZCONST char Far DeflFast[] = "fast"; -static ZCONST char Far DeflSFast[] = "superfast"; - -static ZCONST char Far ExtraBytesPreceding[] = - " There are an extra %s bytes preceding this file.\n\n"; - -static ZCONST char Far UnknownNo[] = "unknown (%d)"; - -#ifdef ZIP64_SUPPORT - static ZCONST char Far LocalHeaderOffset[] = - "\n offset of local header from start of archive: %s\n\ - (%sh) bytes\n"; -#else - static ZCONST char Far LocalHeaderOffset[] = - "\n offset of local header from start of archive: %s (%sh) bytes\n"; -#endif -static ZCONST char Far HostOS[] = - " file system or operating system of origin: %s\n"; -static ZCONST char Far EncodeSWVer[] = - " version of encoding software: %u.%u\n"; -static ZCONST char Far MinOSCompReq[] = - " minimum file system compatibility required: %s\n"; -static ZCONST char Far MinSWVerReq[] = - " minimum software version required to extract: %u.%u\n"; -static ZCONST char Far CompressMethod[] = - " compression method: %s\n"; -static ZCONST char Far SlideWindowSizeImplode[] = - " size of sliding dictionary (implosion): %cK\n"; -static ZCONST char Far ShannonFanoTrees[] = - " number of Shannon-Fano trees (implosion): %c\n"; -static ZCONST char Far CompressSubtype[] = - " compression sub-type (deflation): %s\n"; -static ZCONST char Far FileSecurity[] = - " file security status: %sencrypted\n"; -static ZCONST char Far ExtendedLocalHdr[] = - " extended local header: %s\n"; -static ZCONST char Far FileModDate[] = - " file last modified on (DOS date/time): %s\n"; -#ifdef USE_EF_UT_TIME - static ZCONST char Far UT_FileModDate[] = - " file last modified on (UT extra field modtime): %s %s\n"; - static ZCONST char Far LocalTime[] = "local"; -#ifndef NO_GMTIME - static ZCONST char Far GMTime[] = "UTC"; -#endif -#endif /* USE_EF_UT_TIME */ -static ZCONST char Far CRC32Value[] = - " 32-bit CRC value (hex): %.8lx\n"; -static ZCONST char Far CompressedFileSize[] = - " compressed size: %s bytes\n"; -static ZCONST char Far UncompressedFileSize[] = - " uncompressed size: %s bytes\n"; -static ZCONST char Far FilenameLength[] = - " length of filename: %u characters\n"; -static ZCONST char Far ExtraFieldLength[] = - " length of extra field: %u bytes\n"; -static ZCONST char Far FileCommentLength[] = - " length of file comment: %u characters\n"; -static ZCONST char Far FileDiskNum[] = - " disk number on which file begins: disk %lu\n"; -static ZCONST char Far ApparentFileType[] = - " apparent file type: %s\n"; -static ZCONST char Far VMSFileAttributes[] = - " VMS file attributes (%06o octal): %s\n"; -static ZCONST char Far AmigaFileAttributes[] = - " Amiga file attributes (%06o octal): %s\n"; -static ZCONST char Far UnixFileAttributes[] = - " Unix file attributes (%06o octal): %s\n"; -static ZCONST char Far NonMSDOSFileAttributes[] = - " non-MSDOS external file attributes: %06lX hex\n"; -static ZCONST char Far MSDOSFileAttributes[] = - " MS-DOS file attributes (%02X hex): none\n"; -static ZCONST char Far MSDOSFileAttributesRO[] = - " MS-DOS file attributes (%02X hex): read-only\n"; -static ZCONST char Far MSDOSFileAttributesAlpha[] = - " MS-DOS file attributes (%02X hex): %s%s%s%s%s%s%s%s\n"; -static ZCONST char Far TheosFileAttributes[] = - " Theos file attributes (%04X hex): %s\n"; - -static ZCONST char Far TheosFTypLib[] = "Library "; -static ZCONST char Far TheosFTypDir[] = "Directory "; -static ZCONST char Far TheosFTypReg[] = "Sequential "; -static ZCONST char Far TheosFTypRel[] = "Direct "; -static ZCONST char Far TheosFTypKey[] = "Keyed "; -static ZCONST char Far TheosFTypInd[] = "Indexed "; -static ZCONST char Far TheosFTypR16[] = " 86 program "; -static ZCONST char Far TheosFTypP16[] = "286 program "; -static ZCONST char Far TheosFTypP32[] = "386 program "; -static ZCONST char Far TheosFTypUkn[] = "??? "; - -static ZCONST char Far ExtraFieldTrunc[] = "\n\ - error: EF data block (type 0x%04x) size %u exceeds remaining extra field\n\ - space %u; block length has been truncated.\n"; -static ZCONST char Far ExtraFields[] = "\n\ - The central-directory extra field contains:"; -static ZCONST char Far ExtraFieldType[] = "\n\ - - A subfield with ID 0x%04x (%s) and %u data bytes"; -static ZCONST char Far efPKSZ64[] = "PKWARE 64-bit sizes"; -static ZCONST char Far efAV[] = "PKWARE AV"; -static ZCONST char Far efOS2[] = "OS/2"; -static ZCONST char Far efPKVMS[] = "PKWARE VMS"; -static ZCONST char Far efPKWin32[] = "PKWARE Win32"; -static ZCONST char Far efPKUnix[] = "PKWARE Unix"; -static ZCONST char Far efIZVMS[] = "Info-ZIP VMS"; -static ZCONST char Far efIZUnix[] = "old Info-ZIP Unix/OS2/NT"; -static ZCONST char Far efIZUnix2[] = "Unix UID/GID (16-bit)"; -static ZCONST char Far efIZUnix3[] = "Unix UID/GID (any size)"; -static ZCONST char Far efTime[] = "universal time"; -static ZCONST char Far efU8Path[] = "UTF8 path name"; -static ZCONST char Far efU8Commnt[] = "UTF8 entry comment"; -static ZCONST char Far efJLMac[] = "old Info-ZIP Macintosh"; -static ZCONST char Far efMac3[] = "new Info-ZIP Macintosh"; -static ZCONST char Far efZipIt[] = "ZipIt Macintosh"; -static ZCONST char Far efSmartZip[] = "SmartZip Macintosh"; -static ZCONST char Far efZipIt2[] = "ZipIt Macintosh (short)"; -static ZCONST char Far efVMCMS[] = "VM/CMS"; -static ZCONST char Far efMVS[] = "MVS"; -static ZCONST char Far efACL[] = "OS/2 ACL"; -static ZCONST char Far efNTSD[] = "Security Descriptor"; -static ZCONST char Far efAtheOS[] = "AtheOS"; -static ZCONST char Far efBeOS[] = "BeOS"; -static ZCONST char Far efQDOS[] = "SMS/QDOS"; -static ZCONST char Far efAOSVS[] = "AOS/VS"; -static ZCONST char Far efSpark[] = "Acorn SparkFS"; -static ZCONST char Far efMD5[] = "Fred Kantor MD5"; -static ZCONST char Far efASiUnix[] = "ASi Unix"; -static ZCONST char Far efTandem[] = "Tandem NSK"; -static ZCONST char Far efTheos[] = "Theos"; -static ZCONST char Far efUnknown[] = "unknown"; - -static ZCONST char Far OS2EAs[] = ".\n\ - The local extra field has %lu bytes of OS/2 extended attributes.\n\ - (May not match OS/2 \"dir\" amount due to storage method)"; -static ZCONST char Far izVMSdata[] = ". The extra\n\ - field is %s and has %u bytes of VMS %s information%s"; -static ZCONST char Far izVMSstored[] = "stored"; -static ZCONST char Far izVMSrleenc[] = "run-length encoded"; -static ZCONST char Far izVMSdeflat[] = "deflated"; -static ZCONST char Far izVMScunknw[] = "compressed(?)"; -static ZCONST char Far *izVMScomp[4] = - {izVMSstored, izVMSrleenc, izVMSdeflat, izVMScunknw}; -static ZCONST char Far ACLdata[] = ".\n\ - The local extra field has %lu bytes of access control list information"; -static ZCONST char Far NTSDData[] = ".\n\ - The local extra field has %lu bytes of NT security descriptor data"; -static ZCONST char Far UTdata[] = ".\n\ - The local extra field has UTC/GMT %s time%s"; -static ZCONST char Far UTmodification[] = "modification"; -static ZCONST char Far UTaccess[] = "access"; -static ZCONST char Far UTcreation[] = "creation"; -static ZCONST char Far U8PthCmnComplete[] = ".\n\ - The UTF8 data of the extra field (V%u, ASCII name CRC `%.8lx') are:\n "; -static ZCONST char Far U8PthCmnF24[] = ". The first\n\ - 24 UTF8 bytes in the extra field (V%u, ASCII name CRC `%.8lx') are:\n "; -static ZCONST char Far ZipItFname[] = ".\n\ - The Mac long filename is %s"; -static ZCONST char Far Mac3data[] = ".\n\ - The local extra field has %lu bytes of %scompressed Macintosh\n\ - finder attributes"; - /* MacOSdata[] is used by EF_MAC3, EF_ZIPIT, EF_ZIPIT2 and EF_JLEE e. f. */ -static ZCONST char Far MacOSdata[] = ".\n\ - The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'"; -static ZCONST char Far MacOSdata1[] = ".\n\ - The associated file has type code `0x%lx' and creator code `0x%lx'"; -static ZCONST char Far MacOSJLEEflags[] = ".\n File is marked as %s"; -static ZCONST char Far MacOS_RF[] = "Resource-fork"; -static ZCONST char Far MacOS_DF[] = "Data-fork"; -static ZCONST char Far MacOSMAC3flags[] = ".\n\ - File is marked as %s, File Dates are in %d Bit"; -static ZCONST char Far AtheOSdata[] = ".\n\ - The local extra field has %lu bytes of %scompressed AtheOS file attributes"; -static ZCONST char Far BeOSdata[] = ".\n\ - The local extra field has %lu bytes of %scompressed BeOS file attributes"; - /* The associated file has type code `%c%c%c%c' and creator code `%c%c%c%c'" */ -static ZCONST char Far QDOSdata[] = ".\n\ - The QDOS extra field subtype is `%c%c%c%c'"; -static ZCONST char Far AOSVSdata[] = ".\n\ - The AOS/VS extra field revision is %d.%d"; -static ZCONST char Far TandemUnstr[] = "Unstructured"; -static ZCONST char Far TandemRel[] = "Relative"; -static ZCONST char Far TandemEntry[] = "Entry Sequenced"; -static ZCONST char Far TandemKey[] = "Key Sequenced"; -static ZCONST char Far TandemEdit[] = "Edit"; -static ZCONST char Far TandemObj[] = "Object"; -static ZCONST char Far *TandemFileformat[6] = - {TandemUnstr, TandemRel, TandemEntry, TandemKey, TandemEdit, TandemObj}; -static ZCONST char Far Tandemdata[] = ".\n\ - The file was originally a Tandem %s file, with file code %u"; -static ZCONST char Far MD5data[] = ".\n\ - The 128-bit MD5 signature is %s"; -#ifdef CMS_MVS - static ZCONST char Far VmMvsExtraField[] = ".\n\ - The stored file open mode (FLDATA TYPE) is \"%s\""; - static ZCONST char Far VmMvsInvalid[] = "[invalid]"; -#endif /* CMS_MVS */ - -static ZCONST char Far First20[] = ". The first\n 20 are: "; -static ZCONST char Far ColonIndent[] = ":\n "; -static ZCONST char Far efFormat[] = " %02x"; - -static ZCONST char Far lExtraFieldType[] = "\n\ - There %s a local extra field with ID 0x%04x (%s) and\n\ - %u data bytes (%s).\n"; -static ZCONST char Far efIZuid[] = - "GMT modification/access times and Unix UID/GID"; -static ZCONST char Far efIZnouid[] = "GMT modification/access times only"; - - -static ZCONST char Far NoFileComment[] = "\n There is no file comment.\n"; -static ZCONST char Far FileCommBegin[] = "\n\ -------------------------- file comment begins ----------------------------\n"; -static ZCONST char Far FileCommEnd[] = "\ --------------------------- file comment ends -----------------------------\n"; - -/* zi_time() strings */ -static ZCONST char Far BogusFmt[] = "%03d"; -static ZCONST char Far shtYMDHMTime[] = "%02u-%s-%02u %02u:%02u"; -static ZCONST char Far lngYMDHMSTime[] = "%u %s %u %02u:%02u:%02u"; -static ZCONST char Far DecimalTime[] = "%04u%02u%02u.%02u%02u%02u"; -#ifdef USE_EF_UT_TIME - static ZCONST char Far lngYMDHMSTimeError[] = "???? ??? ?? ??:??:??"; -#endif - - - - - -#ifndef WINDLL - -/************************/ -/* Function zi_opts() */ -/************************/ - -int zi_opts(__G__ pargc, pargv) - int *pargc; - char ***pargv; - __GDEF -{ - char **argv, *s; - int argc, c, error=FALSE, negative=0; - int hflag_slmv=TRUE, hflag_2=FALSE; /* diff options => diff defaults */ - int tflag_slm=TRUE, tflag_2v=FALSE; - int explicit_h=FALSE, explicit_t=FALSE; - - -#ifdef MACOS - uO.lflag = LFLAG; /* reset default on each call */ -#endif - G.extract_flag = FALSE; /* zipinfo does not extract to disk */ - argc = *pargc; - argv = *pargv; - - while (--argc > 0 && (*++argv)[0] == '-') { - s = argv[0] + 1; - while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ - switch (c) { - case '-': - ++negative; - break; - case '1': /* shortest listing: JUST filenames */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 1; - break; - case '2': /* just filenames, plus headers if specified */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 2; - break; -#ifndef CMS_MVS - case ('C'): /* -C: match filenames case-insensitively */ - if (negative) - uO.C_flag = FALSE, negative = 0; - else - uO.C_flag = TRUE; - break; -#endif /* !CMS_MVS */ - case 'h': /* header line */ - if (negative) - hflag_2 = hflag_slmv = FALSE, negative = 0; - else { - hflag_2 = hflag_slmv = explicit_h = TRUE; - if (uO.lflag == -1) - uO.lflag = 0; - } - break; - case 'l': /* longer form of "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 5; - break; - case 'm': /* medium form of "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 4; - break; -#ifdef MORE - case 'M': /* send output through built-in "more" */ - if (negative) - G.M_flag = FALSE, negative = 0; - else - G.M_flag = TRUE; - break; -#endif - case 's': /* default: shorter "ls -l" type listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 3; - break; - case 't': /* totals line */ - if (negative) - tflag_2v = tflag_slm = FALSE, negative = 0; - else { - tflag_2v = tflag_slm = explicit_t = TRUE; - if (uO.lflag == -1) - uO.lflag = 0; - } - break; - case ('T'): /* use (sortable) decimal time format */ - if (negative) - uO.T_flag = FALSE, negative = 0; - else - uO.T_flag = TRUE; - break; -#ifdef UNICODE_SUPPORT - case ('U'): /* escape UTF-8, or disable UTF-8 support */ - if (negative) { - uO.U_flag = MAX(uO.U_flag-negative,0); - negative = 0; - } else - uO.U_flag++; - break; -#endif /* UNICODE_SUPPORT */ - case 'v': /* turbo-verbose listing */ - if (negative) - uO.lflag = -2, negative = 0; - else - uO.lflag = 10; - break; -#ifdef WILD_STOP_AT_DIR - case ('W'): /* Wildcard interpretation (stop at '/'?) */ - if (negative) - uO.W_flag = FALSE, negative = 0; - else - uO.W_flag = TRUE; - break; -#endif /* WILD_STOP_AT_DIR */ - case 'z': /* print zipfile comment */ - if (negative) - uO.zflag = negative = 0; - else - uO.zflag = 1; - break; - case 'Z': /* ZipInfo mode: ignore */ - break; - default: - error = TRUE; - break; - } - } - } - if ((argc-- == 0) || error) { - *pargc = argc; - *pargv = argv; - return USAGE(error); - } - -#ifdef MORE - if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func useless */ - G.M_flag = 0; -#endif - - /* if no listing options given (or all negated), or if only -h/-t given - * with individual files specified, use default listing format */ - if ((uO.lflag < 0) || ((argc > 0) && (uO.lflag == 0))) - uO.lflag = LFLAG; - - /* set header and totals flags to default or specified values */ - switch (uO.lflag) { - case 0: /* 0: can only occur if either -t or -h explicitly given; */ - case 2: /* therefore set both flags equal to normally false value */ - uO.hflag = hflag_2; - uO.tflag = tflag_2v; - break; - case 1: /* only filenames, *always* */ - uO.hflag = FALSE; - uO.tflag = FALSE; - uO.zflag = FALSE; - break; - case 3: - case 4: - case 5: - uO.hflag = ((argc > 0) && !explicit_h)? FALSE : hflag_slmv; - uO.tflag = ((argc > 0) && !explicit_t)? FALSE : tflag_slm; - break; - case 10: - uO.hflag = hflag_slmv; - uO.tflag = tflag_2v; - break; - } - - *pargc = argc; - *pargv = argv; - return 0; - -} /* end function zi_opts() */ - -#endif /* !WINDLL */ - - - - - -/*******************************/ -/* Function zi_end_central() */ -/*******************************/ - -void zi_end_central(__G) - __GDEF -{ -/*--------------------------------------------------------------------------- - Print out various interesting things about the zipfile. - ---------------------------------------------------------------------------*/ - - if (uO.lflag > 9) { - /* verbose format */ - Info(slide, 0, ((char *)slide, LoadFarString(EndCentDirRec))); - Info(slide, 0, ((char *)slide, LoadFarString(LineSeparators))); - - Info(slide, 0, ((char *)slide, LoadFarString(ZipFSizeVerbose), - FmZofft(G.ziplen, "11", NULL), - FmZofft(G.ziplen, FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(ActOffsetCentDir), - FmZofft(G.real_ecrec_offset, "11", "u"), - FmZofft(G.real_ecrec_offset, FZOFFT_HEX_DOT_WID, "X"), - FmZofft(G.expect_ecrec_offset, "11", "u"), - FmZofft(G.expect_ecrec_offset, FZOFFT_HEX_DOT_WID, "X"))); - - if (G.ecrec.number_this_disk == 0) { - Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive1), - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"), - (G.ecrec.total_entries_central_dir == 1)? "entry" : "entries", - FmZofft(G.ecrec.size_central_directory, NULL, "u"), - FmZofft(G.ecrec.size_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(SinglePartArchive2), - FmZofft(G.ecrec.offset_start_central_directory, NULL, "u"), - FmZofft(G.ecrec.offset_start_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - } else { - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive1), - (ulg)(G.ecrec.number_this_disk + 1), - (ulg)(G.ecrec.num_disk_start_cdir + 1))); - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive2), - FmZofft(G.ecrec.offset_start_central_directory, NULL, "u"), - FmZofft(G.ecrec.offset_start_central_directory, - FZOFFT_HEX_DOT_WID, "X"), - FmZofft(G.ecrec.size_central_directory, NULL, "u"), - FmZofft(G.ecrec.size_central_directory, - FZOFFT_HEX_DOT_WID, "X"))); - Info(slide, 0, ((char *)slide, LoadFarString(MultiPartArchive3), - FmZofft(G.ecrec.num_entries_centrl_dir_ths_disk, NULL, "u"), - (G.ecrec.num_entries_centrl_dir_ths_disk == 1)? "is" : "are", - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"), - (G.ecrec.total_entries_central_dir == 1) ? "entry" : "entries")); - } - } - else if (uO.hflag) { - /* print zip file size and number of contained entries: */ - Info(slide, 0, ((char *)slide, LoadFarString(ZipInfHeader2), - FmZofft(G.ziplen, NULL, NULL), - FmZofft(G.ecrec.total_entries_central_dir, NULL, "u"))); - } - -} /* end function zi_end_central() */ - - - - - -/************************/ -/* Function zipinfo() */ -/************************/ - -int zipinfo(__G) /* return PK-type error code */ - __GDEF -{ - int do_this_file=FALSE, error, error_in_archive=PK_COOL; - int *fn_matched=NULL, *xn_matched=NULL; - ulg j, members=0L; - zusz_t tot_csize=0L, tot_ucsize=0L; - zusz_t endprev; /* buffers end of previous entry for zi_long()'s check - * of extra bytes */ - - -/*--------------------------------------------------------------------------- - Malloc space for check on unmatched filespecs (no big deal if one or both - are NULL). - ---------------------------------------------------------------------------*/ - - if (G.filespecs > 0 && - (fn_matched=(int *)malloc(G.filespecs*sizeof(int))) != NULL) - for (j = 0; j < G.filespecs; ++j) - fn_matched[j] = FALSE; - - if (G.xfilespecs > 0 && - (xn_matched=(int *)malloc(G.xfilespecs*sizeof(int))) != NULL) - for (j = 0; j < G.xfilespecs; ++j) - xn_matched[j] = FALSE; - -/*--------------------------------------------------------------------------- - Set file pointer to start of central directory, then loop through cen- - tral directory entries. Check that directory-entry signature bytes are - actually there (just a precaution), then process the entry. We know - the entire central directory is on this disk: we wouldn't have any of - this information unless the end-of-central-directory record was on this - disk, and we wouldn't have gotten to this routine unless this is also - the disk on which the central directory starts. In practice, this had - better be the *only* disk in the archive, but maybe someday we'll add - multi-disk support. - ---------------------------------------------------------------------------*/ - - uO.L_flag = FALSE; /* zipinfo mode: never convert name to lowercase */ - G.pInfo = G.info; /* (re-)initialize, (just to make sure) */ - G.pInfo->textmode = 0; /* so one can read on screen (is this ever used?) */ - - /* reset endprev for new zipfile; account for multi-part archives (?) */ - endprev = (G.crec.relative_offset_local_header == 4L)? 4L : 0L; - - - for (j = 1L;; j++) { - if (readbuf(__G__ G.sig, 4) == 0) { - error_in_archive = PK_EOF; - break; - } - if (memcmp(G.sig, central_hdr_sig, 4)) { /* is it a CentDir entry? */ - /* no new central directory entry - * -> is the number of processed entries compatible with the - * number of entries as stored in the end_central record? - */ - if (((j - 1) & - (ulg)(G.ecrec.have_ecr64 ? MASK_ZUCN64 : MASK_ZUCN16)) - == (ulg)G.ecrec.total_entries_central_dir) - { - /* "j modulus 4T/64k" matches the reported 64/16-bit-unsigned - * number of directory entries -> probably, the regular - * end of the central directory has been reached - */ - break; - } else { - Info(slide, 0x401, - ((char *)slide, LoadFarString(CentSigMsg), j)); - Info(slide, 0x401, - ((char *)slide, LoadFarString(ReportMsg))); - error_in_archive = PK_BADERR; /* sig not found */ - break; - } - } - /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag, ...: */ - if ((error = process_cdir_file_hdr(__G)) != PK_COOL) { - error_in_archive = error; /* only PK_EOF defined */ - break; - } - - if ((error = do_string(__G__ G.crec.filename_length, DS_FN)) != - PK_COOL) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > PK_WARN) /* fatal */ - break; - } - - if (!G.process_all_files) { /* check if specified on command line */ - unsigned i; - - if (G.filespecs == 0) - do_this_file = TRUE; - else { /* check if this entry matches an `include' argument */ - do_this_file = FALSE; - for (i = 0; i < G.filespecs; i++) - if (match(G.filename, G.pfnames[i], uO.C_flag WISEP)) { - do_this_file = TRUE; - if (fn_matched) - fn_matched[i] = TRUE; - break; /* found match, so stop looping */ - } - } - if (do_this_file) { /* check if this is an excluded file */ - for (i = 0; i < G.xfilespecs; i++) - if (match(G.filename, G.pxnames[i], uO.C_flag WISEP)) { - do_this_file = FALSE; /* ^-- ignore case in match */ - if (xn_matched) - xn_matched[i] = TRUE; - break; - } - } - } - - /*----------------------------------------------------------------------- - If current file was specified on command line, or if no names were - specified, do the listing for this file. Otherwise, get rid of the - file comment and go back for the next file. - -----------------------------------------------------------------------*/ - - if (G.process_all_files || do_this_file) { - - /* Read the extra field, if any. The extra field info is required - * for resolving the Zip64 sizes/offsets and may be used in more - * analysis of the entry below. - */ - if ((error = do_string(__G__ G.crec.extra_field_length, - EXTRA_FIELD)) != 0) - { - if (G.extra_field != NULL) { - free(G.extra_field); - G.extra_field = NULL; - } - error_in_archive = error; - /* The premature return in case of a "fatal" error (PK_EOF) is - * delayed until we analyze the extra field contents. - * This allows us to display all the other info that has been - * successfully read in. - */ - } - - switch (uO.lflag) { - case 1: - case 2: - fnprint(__G); - SKIP_(G.crec.file_comment_length) - break; - - case 3: - case 4: - case 5: - if ((error = zi_short(__G)) != PK_COOL) { - error_in_archive = error; /* might be warning */ - } - break; - - case 10: - Info(slide, 0, ((char *)slide, - LoadFarString(CentralDirEntry), j)); - if ((error = zi_long(__G__ &endprev, - error_in_archive)) != PK_COOL) { - error_in_archive = error; /* might be warning */ - } - break; - - default: - SKIP_(G.crec.file_comment_length) - break; - - } /* end switch (lflag) */ - if (error > PK_WARN) /* fatal */ - break; - - tot_csize += G.crec.csize; - tot_ucsize += G.crec.ucsize; - if (G.crec.general_purpose_bit_flag & 1) - tot_csize -= 12; /* don't count encryption header */ - ++members; - -#ifdef DLL - if ((G.statreportcb != NULL) && - (*G.statreportcb)(__G__ UZ_ST_FINISH_MEMBER, G.zipfn, - G.filename, (zvoid *)&G.crec.ucsize)) { - /* cancel operation by user request */ - error_in_archive = IZ_CTRLC; - break; - } -#endif -#ifdef MACOS /* MacOS is no preemptive OS, thus call event-handling by hand */ - UserStop(); -#endif - - } else { /* not listing this file */ - SKIP_(G.crec.extra_field_length) - SKIP_(G.crec.file_comment_length) - if (endprev != 0) endprev = 0; - - } /* end if (list member?) */ - - } /* end for-loop (j: member files) */ - -/*--------------------------------------------------------------------------- - Check that we actually found requested files; if so, print totals. - ---------------------------------------------------------------------------*/ - - if ((error_in_archive <= PK_WARN) && uO.tflag) { - char *sgn = ""; - int cfactor = ratio(tot_ucsize, tot_csize); - - if (cfactor < 0) { - sgn = "-"; - cfactor = -cfactor; - } - Info(slide, 0, ((char *)slide, LoadFarString(ZipfileStats), - members, (members==1L)? nullStr:PlurSufx, - FmZofft(tot_ucsize, NULL, "u"), - FmZofft(tot_csize, NULL, "u"), - sgn, cfactor/10, cfactor%10)); - } - -/*--------------------------------------------------------------------------- - Check for unmatched filespecs on command line and print warning if any - found. - ---------------------------------------------------------------------------*/ - - if (fn_matched) { - if (error_in_archive <= PK_WARN) - for (j = 0; j < G.filespecs; ++j) - if (!fn_matched[j]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(FilenameNotMatched), G.pfnames[j])); - free((zvoid *)fn_matched); - } - if (xn_matched) { - if (error_in_archive <= PK_WARN) - for (j = 0; j < G.xfilespecs; ++j) - if (!xn_matched[j]) - Info(slide, 0x401, ((char *)slide, - LoadFarString(ExclFilenameNotMatched), G.pxnames[j])); - free((zvoid *)xn_matched); - } - - - /* Skip the following checks in case of a premature listing break. */ - if (error_in_archive <= PK_WARN) { - -/*--------------------------------------------------------------------------- - Double check that we're back at the end-of-central-directory record. - ---------------------------------------------------------------------------*/ - - if ( (memcmp(G.sig, - (G.ecrec.have_ecr64 ? - end_central64_sig : end_central_sig), - 4) != 0) - && (!G.ecrec.is_zip64_archive) - && (memcmp(G.sig, end_central_sig, 4) != 0) - ) { /* just to make sure again */ - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg))); - error_in_archive = PK_WARN; /* didn't find sig */ - } - - /* Set specific return code when no files have been found. */ - if (members == 0L && error_in_archive <= PK_WARN) - error_in_archive = PK_FIND; - - if (uO.lflag >= 10) - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - } - - return error_in_archive; - -} /* end function zipinfo() */ - - - - - -/************************/ -/* Function zi_long() */ -/************************/ - -static int zi_long(__G__ pEndprev, error_in_archive) - /* return PK-type error code */ - __GDEF - zusz_t *pEndprev; /* for zi_long() check of extra bytes */ - int error_in_archive; /* may signal premature return */ -{ -#ifdef USE_EF_UT_TIME - iztimes z_utime; -#endif - int error; - unsigned hostnum, hostver, extnum, extver, methid, methnum, xattr; - char workspace[12], attribs[22]; - ZCONST char *varmsg_str; - char unkn[16]; - static ZCONST char Far *os[NUM_HOSTS] = { - OS_FAT, OS_Amiga, OS_VMS, OS_Unix, OS_VMCMS, OS_AtariST, OS_HPFS, - OS_Macintosh, OS_ZSystem, OS_CPM, OS_TOPS20, OS_NTFS, OS_QDOS, - OS_Acorn, OS_VFAT, OS_MVS, OS_BeOS, OS_Tandem, OS_Theos, OS_MacDarwin, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - OS_AtheOS - }; - static ZCONST char Far *method[NUM_METHODS] = { - MthdNone, MthdShrunk, MthdRedF1, MthdRedF2, MthdRedF3, MthdRedF4, - MthdImplode, MthdToken, MthdDeflate, MthdDeflat64, MthdDCLImplode, - MthdBZip2, MthdLZMA, MthdTerse, MthdLZ77, MthdWavPack, MthdPPMd - }; - static ZCONST char Far *dtypelng[4] = { - DeflNorm, DeflMax, DeflFast, DeflSFast - }; - - -/*--------------------------------------------------------------------------- - Check whether there's any extra space inside the zipfile. If *pEndprev is - zero, it's probably a signal that OS/2 extra fields are involved (with - unknown compressed size). We won't worry about prepended junk here... - ---------------------------------------------------------------------------*/ - - if (G.crec.relative_offset_local_header != *pEndprev && *pEndprev > 0L) { - /* GRR DEBUG - Info(slide, 0, ((char *)slide, - " [crec.relative_offset_local_header = %lu, endprev = %lu]\n", - G.crec.relative_offset_local_header, *pEndprev)); - */ - Info(slide, 0, ((char *)slide, LoadFarString(ExtraBytesPreceding), - FmZofft((G.crec.relative_offset_local_header - (*pEndprev)), - NULL, NULL))); - } - - /* calculate endprev for next time around (problem: extra fields may - * differ in length between local and central-directory records) */ - *pEndprev = G.crec.relative_offset_local_header + (4L + LREC_SIZE) + - G.crec.filename_length + G.crec.extra_field_length + G.crec.csize; - -/*--------------------------------------------------------------------------- - Print out various interesting things about the compressed file. - ---------------------------------------------------------------------------*/ - - hostnum = (unsigned)(G.pInfo->hostnum); - hostver = (unsigned)(G.pInfo->hostver); - extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); - extver = (unsigned)G.crec.version_needed_to_extract[0]; - methid = (unsigned)G.crec.compression_method; - methnum = find_compr_idx(G.crec.compression_method); - - (*G.message)((zvoid *)&G, (uch *)" ", 2L, 0); fnprint(__G); - - Info(slide, 0, ((char *)slide, LoadFarString(LocalHeaderOffset), - FmZofft(G.crec.relative_offset_local_header, NULL, "u"), - FmZofft(G.crec.relative_offset_local_header, FZOFFT_HEX_DOT_WID, "X"))); - - if (hostnum >= NUM_HOSTS) { - sprintf(unkn, LoadFarString(UnknownNo), - (int)G.crec.version_made_by[1]); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(os[hostnum]); -#ifdef OLD_THEOS_EXTRA - if (hostnum == FS_VFAT_ && hostver == 20) { - /* entry made by old non-official THEOS port zip archive */ - varmsg_str = LoadFarStringSmall(OS_TheosOld); - } -#endif /* OLD_THEOS_EXTRA */ - } - Info(slide, 0, ((char *)slide, LoadFarString(HostOS), varmsg_str)); - Info(slide, 0, ((char *)slide, LoadFarString(EncodeSWVer), hostver/10, - hostver%10)); - - if ((extnum >= NUM_HOSTS) || (os[extnum] == NULL)) { - sprintf(unkn, LoadFarString(UnknownNo), - (int)G.crec.version_needed_to_extract[1]); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(os[extnum]); - } - Info(slide, 0, ((char *)slide, LoadFarString(MinOSCompReq), varmsg_str)); - Info(slide, 0, ((char *)slide, LoadFarString(MinSWVerReq), extver/10, - extver%10)); - - if (methnum >= NUM_METHODS) { - sprintf(unkn, LoadFarString(UnknownNo), G.crec.compression_method); - varmsg_str = unkn; - } else { - varmsg_str = LoadFarStringSmall(method[methnum]); - } - Info(slide, 0, ((char *)slide, LoadFarString(CompressMethod), varmsg_str)); - if (methid == IMPLODED) { - Info(slide, 0, ((char *)slide, LoadFarString(SlideWindowSizeImplode), - (G.crec.general_purpose_bit_flag & 2)? '8' : '4')); - Info(slide, 0, ((char *)slide, LoadFarString(ShannonFanoTrees), - (G.crec.general_purpose_bit_flag & 4)? '3' : '2')); - } else if (methid == DEFLATED || methid == ENHDEFLATED) { - ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); - - Info(slide, 0, ((char *)slide, LoadFarString(CompressSubtype), - LoadFarStringSmall(dtypelng[dnum]))); - } - - Info(slide, 0, ((char *)slide, LoadFarString(FileSecurity), - (G.crec.general_purpose_bit_flag & 1) ? nullStr : "not ")); - Info(slide, 0, ((char *)slide, LoadFarString(ExtendedLocalHdr), - (G.crec.general_purpose_bit_flag & 8) ? "yes" : "no")); - /* print upper 3 bits for amusement? */ - - /* For printing of date & time, a "char d_t_buf[21]" is required. - * To save stack space, we reuse the "char attribs[22]" buffer which - * is not used yet. - */ -# define d_t_buf attribs - - zi_time(__G__ &G.crec.last_mod_dos_datetime, NULL, d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(FileModDate), d_t_buf)); -#ifdef USE_EF_UT_TIME - if (G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, - G.crec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME)) - { - TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ - d_t_buf[0] = (char)0; /* signal "show local time" */ - zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), - d_t_buf, LoadFarStringSmall(LocalTime))); -#ifndef NO_GMTIME - d_t_buf[0] = (char)1; /* signal "show UTC (GMT) time" */ - zi_time(__G__ &G.crec.last_mod_dos_datetime, &(z_utime.mtime), d_t_buf); - Info(slide, 0, ((char *)slide, LoadFarString(UT_FileModDate), - d_t_buf, LoadFarStringSmall(GMTime))); -#endif /* !NO_GMTIME */ - } -#endif /* USE_EF_UT_TIME */ - - Info(slide, 0, ((char *)slide, LoadFarString(CRC32Value), G.crec.crc32)); - Info(slide, 0, ((char *)slide, LoadFarString(CompressedFileSize), - FmZofft(G.crec.csize, NULL, "u"))); - Info(slide, 0, ((char *)slide, LoadFarString(UncompressedFileSize), - FmZofft(G.crec.ucsize, NULL, "u"))); - Info(slide, 0, ((char *)slide, LoadFarString(FilenameLength), - G.crec.filename_length)); - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldLength), - G.crec.extra_field_length)); - Info(slide, 0, ((char *)slide, LoadFarString(FileCommentLength), - G.crec.file_comment_length)); - Info(slide, 0, ((char *)slide, LoadFarString(FileDiskNum), - (ulg)(G.crec.disk_number_start + 1))); - Info(slide, 0, ((char *)slide, LoadFarString(ApparentFileType), - (G.crec.internal_file_attributes & 1)? "text" - : (G.crec.internal_file_attributes & 2)? "ebcdic" - : "binary")); /* changed to accept EBCDIC */ -#ifdef ATARI - printf(" external file attributes (hex): %.8lx\n", - G.crec.external_file_attributes); -#endif - xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); - if (hostnum == VMS_) { - char *p=attribs, *q=attribs+1; - int i, j, k; - - for (k = 0; k < 12; ++k) - workspace[k] = 0; - if (xattr & VMS_IRUSR) - workspace[0] = 'R'; - if (xattr & VMS_IWUSR) { - workspace[1] = 'W'; - workspace[3] = 'D'; - } - if (xattr & VMS_IXUSR) - workspace[2] = 'E'; - if (xattr & VMS_IRGRP) - workspace[4] = 'R'; - if (xattr & VMS_IWGRP) { - workspace[5] = 'W'; - workspace[7] = 'D'; - } - if (xattr & VMS_IXGRP) - workspace[6] = 'E'; - if (xattr & VMS_IROTH) - workspace[8] = 'R'; - if (xattr & VMS_IWOTH) { - workspace[9] = 'W'; - workspace[11] = 'D'; - } - if (xattr & VMS_IXOTH) - workspace[10] = 'E'; - - *p++ = '('; - for (k = j = 0; j < 3; ++j) { /* loop over groups of permissions */ - for (i = 0; i < 4; ++i, ++k) /* loop over perms within a group */ - if (workspace[k]) - *p++ = workspace[k]; - *p++ = ','; /* group separator */ - if (j == 0) - while ((*p++ = *q++) != ',') - ; /* system, owner perms are same */ - } - *p-- = '\0'; - *p = ')'; /* overwrite last comma */ - Info(slide, 0, ((char *)slide, LoadFarString(VMSFileAttributes), xattr, - attribs)); - - } else if (hostnum == AMIGA_) { - switch (xattr & AMI_IFMT) { - case AMI_IFDIR: attribs[0] = 'd'; break; - case AMI_IFREG: attribs[0] = '-'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; - attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; - attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; - attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; - attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; - attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; - attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; - attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; - attribs[9] = 0; /* better dlm the string */ - Info(slide, 0, ((char *)slide, LoadFarString(AmigaFileAttributes), - xattr, attribs)); - - } else if (hostnum == THEOS_) { - ZCONST char Far *fpFtyp; - - switch (xattr & THS_IFMT) { - case THS_IFLIB: fpFtyp = TheosFTypLib; break; - case THS_IFDIR: fpFtyp = TheosFTypDir; break; - case THS_IFREG: fpFtyp = TheosFTypReg; break; - case THS_IFREL: fpFtyp = TheosFTypRel; break; - case THS_IFKEY: fpFtyp = TheosFTypKey; break; - case THS_IFIND: fpFtyp = TheosFTypInd; break; - case THS_IFR16: fpFtyp = TheosFTypR16; break; - case THS_IFP16: fpFtyp = TheosFTypP16; break; - case THS_IFP32: fpFtyp = TheosFTypP32; break; - default: fpFtyp = TheosFTypUkn; break; - } - strcpy(attribs, LoadFarStringSmall(fpFtyp)); - attribs[12] = (xattr & THS_INHID) ? '.' : 'H'; - attribs[13] = (xattr & THS_IMODF) ? '.' : 'M'; - attribs[14] = (xattr & THS_IWOTH) ? '.' : 'W'; - attribs[15] = (xattr & THS_IROTH) ? '.' : 'R'; - attribs[16] = (xattr & THS_IEUSR) ? '.' : 'E'; - attribs[17] = (xattr & THS_IXUSR) ? '.' : 'X'; - attribs[18] = (xattr & THS_IWUSR) ? '.' : 'W'; - attribs[19] = (xattr & THS_IRUSR) ? '.' : 'R'; - attribs[20] = 0; - Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), - xattr, attribs)); - -#ifdef OLD_THEOS_EXTRA - } else if (hostnum == FS_VFAT_ && hostver == 20) { - /* process old non-official THEOS port zip archive */ - ZCONST char Far *fpFtyp; - - switch (xattr & _THS_IFMT) { - case _THS_IFLIB: fpFtyp = TheosFTypLib; break; - case _THS_IFDIR: fpFtyp = TheosFTypDir; break; - case _THS_IFREG: fpFtyp = TheosFTypReg; break; - case _THS_IODRC: fpFtyp = TheosFTypRel; break; - case _THS_IOKEY: fpFtyp = TheosFTypKey; break; - case _THS_IOIND: fpFtyp = TheosFTypInd; break; - case _THS_IOPRG: fpFtyp = TheosFTypR16; break; - case _THS_IO286: fpFtyp = TheosFTypP16; break; - case _THS_IO386: fpFtyp = TheosFTypP32; break; - default: fpFtyp = TheosFTypUkn; break; - } - strcpy(attribs, LoadFarStringSmall(fpFtyp)); - attribs[12] = (xattr & _THS_HIDDN) ? 'H' : '.'; - attribs[13] = (xattr & _THS_IXOTH) ? '.' : 'X'; - attribs[14] = (xattr & _THS_IWOTH) ? '.' : 'W'; - attribs[15] = (xattr & _THS_IROTH) ? '.' : 'R'; - attribs[16] = (xattr & _THS_IEUSR) ? '.' : 'E'; - attribs[17] = (xattr & _THS_IXUSR) ? '.' : 'X'; - attribs[18] = (xattr & _THS_IWUSR) ? '.' : 'W'; - attribs[19] = (xattr & _THS_IRUSR) ? '.' : 'R'; - attribs[20] = 0; - Info(slide, 0, ((char *)slide, LoadFarString(TheosFileAttributes), - xattr, attribs)); -#endif /* OLD_THEOS_EXTRA */ - - } else if ((hostnum != FS_FAT_) && (hostnum != FS_HPFS_) && - (hostnum != FS_NTFS_) && (hostnum != FS_VFAT_) && - (hostnum != ACORN_) && - (hostnum != VM_CMS_) && (hostnum != MVS_)) - { /* assume Unix-like */ - switch ((unsigned)(xattr & UNX_IFMT)) { - case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; - case (unsigned)UNX_IFREG: attribs[0] = '-'; break; - case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; - case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; - case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; - case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; - case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; - attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; - attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; - - attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; - attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; - attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; - - if (xattr & UNX_IXUSR) - attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; - else - attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S = undefined */ - if (xattr & UNX_IXGRP) - attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ - else - attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; - if (xattr & UNX_IXOTH) - attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ - else - attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T = undefined */ - attribs[10] = 0; - - Info(slide, 0, ((char *)slide, LoadFarString(UnixFileAttributes), xattr, - attribs)); - - } else { - Info(slide, 0, ((char *)slide, LoadFarString(NonMSDOSFileAttributes), - G.crec.external_file_attributes >> 8)); - - } /* endif (hostnum: external attributes format) */ - - if ((xattr=(unsigned)(G.crec.external_file_attributes & 0xFF)) == 0) - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributes), - xattr)); - else if (xattr == 1) - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesRO), - xattr)); - else - Info(slide, 0, ((char *)slide, LoadFarString(MSDOSFileAttributesAlpha), - xattr, (xattr&1)? "rdo " : nullStr, - (xattr&2)? "hid " : nullStr, - (xattr&4)? "sys " : nullStr, - (xattr&8)? "lab " : nullStr, - (xattr&16)? "dir " : nullStr, - (xattr&32)? "arc " : nullStr, - (xattr&64)? "lnk " : nullStr, - (xattr&128)? "exe" : nullStr)); - -/*--------------------------------------------------------------------------- - Analyze the extra field, if any, and print the file comment, if any (the - filename has already been printed, above). That finishes up this file - entry... - ---------------------------------------------------------------------------*/ - - if (G.crec.extra_field_length > 0) { - uch *ef_ptr = G.extra_field; - ush ef_len = G.crec.extra_field_length; - ush eb_id, eb_datalen; - ZCONST char Far *ef_fieldname; - - if (error_in_archive > PK_WARN) /* fatal: can't continue */ - /* delayed "fatal error" return from extra field reading */ - return error_in_archive; - if (G.extra_field == (uch *)NULL) - return PK_ERR; /* not consistent with crec length */ - - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFields))); - - while (ef_len >= EB_HEADSIZE) { - eb_id = makeword(&ef_ptr[EB_ID]); - eb_datalen = makeword(&ef_ptr[EB_LEN]); - ef_ptr += EB_HEADSIZE; - ef_len -= EB_HEADSIZE; - - if (eb_datalen > (ush)ef_len) { - Info(slide, 0x421, ((char *)slide, - LoadFarString(ExtraFieldTrunc), eb_id, eb_datalen, ef_len)); - eb_datalen = ef_len; - } - - switch (eb_id) { - case EF_PKSZ64: - ef_fieldname = efPKSZ64; - if ((G.crec.relative_offset_local_header - & (~(zusz_t)0xFFFFFFFFL)) != 0) { - /* Subtract the size of the 64bit local offset from - the local e.f. size, local Z64 e.f. block has no - offset; when only local offset present, the entire - local PKSZ64 block is missing. */ - *pEndprev -= (eb_datalen == 8 ? 12 : 8); - } - break; - case EF_AV: - ef_fieldname = efAV; - break; - case EF_OS2: - ef_fieldname = efOS2; - break; - case EF_ACL: - ef_fieldname = efACL; - break; - case EF_NTSD: - ef_fieldname = efNTSD; - break; - case EF_PKVMS: - ef_fieldname = efPKVMS; - break; - case EF_IZVMS: - ef_fieldname = efIZVMS; - break; - case EF_PKW32: - ef_fieldname = efPKWin32; - break; - case EF_PKUNIX: - ef_fieldname = efPKUnix; - break; - case EF_IZUNIX: - ef_fieldname = efIZUnix; - if (hostnum == UNIX_ && *pEndprev > 0L) - *pEndprev += 4L; /* also have UID/GID in local copy */ - break; - case EF_IZUNIX2: - ef_fieldname = efIZUnix2; - if (*pEndprev > 0L) - *pEndprev += 4L; /* 4 byte UID/GID in local copy */ - break; - case EF_IZUNIX3: - ef_fieldname = efIZUnix3; -#if 0 - if (*pEndprev > 0L) - *pEndprev += 4L; /* 4 byte UID/GID in local copy */ -#endif - break; - case EF_TIME: - ef_fieldname = efTime; - break; - case EF_UNIPATH: - ef_fieldname = efU8Path; - break; - case EF_UNICOMNT: - ef_fieldname = efU8Commnt; - break; - case EF_MAC3: - ef_fieldname = efMac3; - break; - case EF_JLMAC: - ef_fieldname = efJLMac; - break; - case EF_ZIPIT: - ef_fieldname = efZipIt; - break; - case EF_ZIPIT2: - ef_fieldname = efZipIt2; - break; - case EF_VMCMS: - ef_fieldname = efVMCMS; - break; - case EF_MVS: - ef_fieldname = efMVS; - break; - case EF_ATHEOS: - ef_fieldname = efAtheOS; - break; - case EF_BEOS: - ef_fieldname = efBeOS; - break; - case EF_QDOS: - ef_fieldname = efQDOS; - break; - case EF_AOSVS: - ef_fieldname = efAOSVS; - break; - case EF_SPARK: /* from RISC OS */ - ef_fieldname = efSpark; - break; - case EF_MD5: - ef_fieldname = efMD5; - break; - case EF_ASIUNIX: - ef_fieldname = efASiUnix; - break; - case EF_TANDEM: - ef_fieldname = efTandem; - break; - case EF_SMARTZIP: - ef_fieldname = efSmartZip; - break; - case EF_THEOS: -#ifdef OLD_THEOS_EXTRA - case EF_THEOSO: -#endif - ef_fieldname = efTheos; - break; - default: - ef_fieldname = efUnknown; - break; - } - Info(slide, 0, ((char *)slide, LoadFarString(ExtraFieldType), - eb_id, LoadFarStringSmall(ef_fieldname), eb_datalen)); - - /* additional, field-specific information: */ - switch (eb_id) { - case EF_OS2: - case EF_ACL: - if (eb_datalen >= EB_OS2_HLEN) { - if (eb_id == EF_OS2) - ef_fieldname = OS2EAs; - else - ef_fieldname = ACLdata; - Info(slide, 0, ((char *)slide, - LoadFarString(ef_fieldname), makelong(ef_ptr))); - *pEndprev = 0L; /* no clue about csize of local */ - } else { - goto ef_default_display; - } - break; - case EF_NTSD: - if (eb_datalen >= EB_NTSD_C_LEN) { - Info(slide, 0, ((char *)slide, LoadFarString(NTSDData), - makelong(ef_ptr))); - *pEndprev = 0L; /* no clue about csize of local */ - } else { - goto ef_default_display; - } - break; - case EF_IZVMS: - if (eb_datalen >= 8) { - char *p, q[8]; - unsigned compr = makeword(ef_ptr+EB_IZVMS_FLGS) - & EB_IZVMS_BCMASK; - - *q = '\0'; - if (compr > 3) - compr = 3; - switch (makelong(ef_ptr)) { - case 0x42414656: /* "VFAB" */ - p = "FAB"; break; - case 0x4C4C4156: /* "VALL" */ - p = "XABALL"; break; - case 0x43484656: /* "VFHC" */ - p = "XABFHC"; break; - case 0x54414456: /* "VDAT" */ - p = "XABDAT"; break; - case 0x54445256: /* "VRDT" */ - p = "XABRDT"; break; - case 0x4F525056: /* "VPRO" */ - p = "XABPRO"; break; - case 0x59454B56: /* "VKEY" */ - p = "XABKEY"; break; - case 0x56534D56: /* "VMSV" */ - p = "version"; - if (eb_datalen >= 16) { - /* put termitation first, for A_TO_N() */ - q[7] = '\0'; - q[0] = ' '; - q[1] = '('; - strncpy(q+2, - (char *)ef_ptr+EB_IZVMS_HLEN, 4); - A_TO_N(q+2); - q[6] = ')'; - } - break; - default: - p = "unknown"; - } - Info(slide, 0, ((char *)slide, - LoadFarString(izVMSdata), - LoadFarStringSmall(izVMScomp[compr]), - makeword(ef_ptr+EB_IZVMS_UCSIZ), p, q)); - } else { - goto ef_default_display; - } - break; - case EF_TIME: - if (eb_datalen > 0) { - char types[80]; - int num = 0, len; - - *types = '\0'; - if (*ef_ptr & 1) { - strcpy(types, LoadFarString(UTmodification)); - ++num; - } - if (*ef_ptr & 2) { - len = strlen(types); - if (num) - types[len++] = '/'; - strcpy(types+len, LoadFarString(UTaccess)); - ++num; - if (*pEndprev > 0L) - *pEndprev += 4L; - } - if (*ef_ptr & 4) { - len = strlen(types); - if (num) - types[len++] = '/'; - strcpy(types+len, LoadFarString(UTcreation)); - ++num; - if (*pEndprev > 0L) - *pEndprev += 4L; - } - if (num > 0) - Info(slide, 0, ((char *)slide, - LoadFarString(UTdata), types, - num == 1? nullStr : PlurSufx)); - } - break; - case EF_UNIPATH: - case EF_UNICOMNT: - if (eb_datalen >= 5) { - unsigned i, n; - ulg name_crc = makelong(ef_ptr+1); - - if (eb_datalen <= 29) { - Info(slide, 0, ((char *)slide, - LoadFarString(U8PthCmnComplete), - (unsigned)ef_ptr[0], name_crc)); - n = eb_datalen; - } else { - Info(slide, 0, ((char *)slide, - LoadFarString(U8PthCmnF24), - (unsigned)ef_ptr[0], name_crc)); - n = 29; - } - for (i = 5; i < n; ++i) - Info(slide, 0, ((char *)slide, - LoadFarString(efFormat), ef_ptr[i])); - } else { - goto ef_default_display; - } - break; - case EF_MAC3: - if (eb_datalen >= EB_MAC3_HLEN) { - ulg eb_uc = makelong(ef_ptr); - unsigned mac3_flgs = makeword(ef_ptr+EB_FLGS_OFFS); - unsigned eb_is_uc = mac3_flgs & EB_M3_FL_UNCMPR; - - Info(slide, 0, ((char *)slide, LoadFarString(Mac3data), - eb_uc, eb_is_uc ? "un" : nullStr)); - if (eb_is_uc) { - if (*pEndprev > 0L) - *pEndprev += makelong(ef_ptr); - } else { - *pEndprev = 0L; /* no clue about csize of local */ - } - - Info(slide, 0, ((char *)slide, - LoadFarString(MacOSMAC3flags), - LoadFarStringSmall(mac3_flgs & EB_M3_FL_DATFRK ? - MacOS_DF : MacOS_RF), - (mac3_flgs & EB_M3_FL_TIME64 ? 64 : 32))); - zi_showMacTypeCreator(__G__ &ef_ptr[6]); - } else { - goto ef_default_display; - } - break; - case EF_ZIPIT2: - if (eb_datalen >= 5 && - makelong(ef_ptr) == 0x5449505A /* "ZPIT" */) { - - if (eb_datalen >= 12) { - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - } - } else { - goto ef_default_display; - } - break; - case EF_ZIPIT: - if (eb_datalen >= 5 && - makelong(ef_ptr) == 0x5449505A /* "ZPIT" */) { - unsigned fnlen = ef_ptr[4]; - - if ((unsigned)eb_datalen >= fnlen + (5 + 8)) { - uch nullchar = ef_ptr[fnlen+5]; - - ef_ptr[fnlen+5] = '\0'; /* terminate filename */ - A_TO_N(ef_ptr+5); - Info(slide, 0, ((char *)slide, - LoadFarString(ZipItFname), (char *)ef_ptr+5)); - ef_ptr[fnlen+5] = nullchar; - zi_showMacTypeCreator(__G__ &ef_ptr[fnlen+5]); - } - } else { - goto ef_default_display; - } - break; - case EF_JLMAC: - if (eb_datalen >= 40 && - makelong(ef_ptr) == 0x45454C4A /* "JLEE" */) - { - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - - Info(slide, 0, ((char *)slide, - LoadFarString(MacOSJLEEflags), - LoadFarStringSmall(ef_ptr[31] & 1 ? - MacOS_DF : MacOS_RF))); - } else { - goto ef_default_display; - } - break; - case EF_SMARTZIP: - if ((eb_datalen == EB_SMARTZIP_HLEN) && - makelong(ef_ptr) == 0x70695A64 /* "dZip" */) { - char filenameBuf[32]; - zi_showMacTypeCreator(__G__ &ef_ptr[4]); - memcpy(filenameBuf, &ef_ptr[33], 31); - filenameBuf[ef_ptr[32]] = '\0'; - A_TO_N(filenameBuf); - Info(slide, 0, ((char *)slide, - LoadFarString(ZipItFname), filenameBuf)); - } else { - goto ef_default_display; - } - break; -#ifdef CMS_MVS - case EF_VMCMS: - case EF_MVS: - { - char type[100]; - - Info(slide, 0, ((char *)slide, - LoadFarString(VmMvsExtraField), - (getVMMVSexfield(type, ef_ptr-EB_HEADSIZE, - (unsigned)eb_datalen) > 0)? - type : LoadFarStringSmall(VmMvsInvalid))); - } - break; -#endif /* CMS_MVS */ - case EF_ATHEOS: - case EF_BEOS: - if (eb_datalen >= EB_BEOS_HLEN) { - ulg eb_uc = makelong(ef_ptr); - unsigned eb_is_uc = - *(ef_ptr+EB_FLGS_OFFS) & EB_BE_FL_UNCMPR; - - if (eb_id == EF_ATHEOS) - ef_fieldname = AtheOSdata; - else - ef_fieldname = BeOSdata; - Info(slide, 0, ((char *)slide, - LoadFarString(ef_fieldname), - eb_uc, eb_is_uc ? "un" : nullStr)); - if (eb_is_uc) { - if (*pEndprev > 0L) - *pEndprev += makelong(ef_ptr); - } else { - *pEndprev = 0L; /* no clue about csize of local */ - } - } else { - goto ef_default_display; - } - break; - case EF_QDOS: - if (eb_datalen >= 4) { - Info(slide, 0, ((char *)slide, LoadFarString(QDOSdata), - ef_ptr[0], ef_ptr[1], ef_ptr[2], ef_ptr[3])); - } else { - goto ef_default_display; - } - break; - case EF_AOSVS: - if (eb_datalen >= 5) { - Info(slide, 0, ((char *)slide, LoadFarString(AOSVSdata), - ((int)(uch)ef_ptr[4])/10, ((int)(uch)ef_ptr[4])%10)); - } else { - goto ef_default_display; - } - break; - case EF_TANDEM: - if (eb_datalen == 20) { - unsigned type, code; - - type = (ef_ptr[18] & 0x60) >> 5; - code = makeword(ef_ptr); - /* Arrg..., Tandem e.f. uses BigEndian byte-order */ - code = ((code << 8) & 0xff00) | ((code >> 8) & 0x00ff); - if (type == NSK_UNSTRUCTURED) { - if (code == NSK_EDITFILECODE) - type = 4; - else if (code == NSK_OBJECTFILECODE) - type = 5; - } - Info(slide, 0, ((char *)slide, - LoadFarString(Tandemdata), - LoadFarStringSmall(TandemFileformat[type]), - code)); - } else { - goto ef_default_display; - } - break; - case EF_MD5: - if (eb_datalen >= 19) { - char md5[33]; - int i; - - for (i = 0; i < 16; ++i) - sprintf(&md5[i<<1], "%02x", ef_ptr[15-i]); - md5[32] = '\0'; - Info(slide, 0, ((char *)slide, LoadFarString(MD5data), - md5)); - break; - } /* else: fall through !! */ - default: -ef_default_display: - if (eb_datalen > 0) { - unsigned i, n; - - if (eb_datalen <= 24) { - Info(slide, 0, ((char *)slide, - LoadFarString(ColonIndent))); - n = eb_datalen; - } else { - Info(slide, 0, ((char *)slide, - LoadFarString(First20))); - n = 20; - } - for (i = 0; i < n; ++i) - Info(slide, 0, ((char *)slide, - LoadFarString(efFormat), ef_ptr[i])); - } - break; - } - (*G.message)((zvoid *)&G, (uch *)".", 1L, 0); - - ef_ptr += eb_datalen; - ef_len -= eb_datalen; - } - (*G.message)((zvoid *)&G, (uch *)"\n", 1L, 0); - } - - /* high bit == Unix/OS2/NT GMT times (mtime, atime); next bit == UID/GID */ - if ((xattr = (unsigned)((G.crec.external_file_attributes & 0xC000) >> 12)) - & 8) - { - if (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_) - { - Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), - "is", EF_IZUNIX, LoadFarStringSmall(efIZUnix), - (unsigned)(xattr&12), (xattr&4)? efIZuid : efIZnouid)); - if (*pEndprev > 0L) - *pEndprev += (ulg)(xattr&12); - } - else if (hostnum == FS_FAT_ && !(xattr&4)) - Info(slide, 0, ((char *)slide, LoadFarString(lExtraFieldType), - "may be", EF_IZUNIX, LoadFarStringSmall(efIZUnix), 8, - efIZnouid)); - } - - if (!G.crec.file_comment_length) - Info(slide, 0, ((char *)slide, LoadFarString(NoFileComment))); - else { - Info(slide, 0, ((char *)slide, LoadFarString(FileCommBegin))); - if ((error = do_string(__G__ G.crec.file_comment_length, DISPL_8)) != - PK_COOL) - { - error_in_archive = error; /* might be warning */ - if (error > PK_WARN) /* fatal */ - return error; - } - Info(slide, 0, ((char *)slide, LoadFarString(FileCommEnd))); - } - - return error_in_archive; - -} /* end function zi_long() */ - - - - - -/*************************/ -/* Function zi_short() */ -/*************************/ - -static int zi_short(__G) /* return PK-type error code */ - __GDEF -{ -#ifdef USE_EF_UT_TIME - iztimes z_utime; - time_t *z_modtim; -#endif - int k, error, error_in_archive=PK_COOL; - unsigned hostnum, hostver, methid, methnum, xattr; - char *p, workspace[12], attribs[16]; - char methbuf[5]; - static ZCONST char dtype[5]="NXFS"; /* normal, maximum, fast, superfast */ - static ZCONST char Far os[NUM_HOSTS+1][4] = { - "fat", "ami", "vms", "unx", "cms", "atr", "hpf", "mac", "zzz", - "cpm", "t20", "ntf", "qds", "aco", "vft", "mvs", "be ", "nsk", - "ths", "osx", "???", "???", "???", "???", "???", "???", "???", - "???", "???", "???", "ath", "???" - }; -#ifdef OLD_THEOS_EXTRA - static ZCONST char Far os_TheosOld[] = "tho"; -#endif - static ZCONST char Far method[NUM_METHODS+1][5] = { - "stor", "shrk", "re:1", "re:2", "re:3", "re:4", "i#:#", "tokn", - "def#", "d64#", "dcli", "bzp2", "lzma", "ters", "lz77", "wavp", - "ppmd", "u###" - }; - - -/*--------------------------------------------------------------------------- - Print out various interesting things about the compressed file. - ---------------------------------------------------------------------------*/ - - methid = (unsigned)(G.crec.compression_method); - methnum = find_compr_idx(G.crec.compression_method); - hostnum = (unsigned)(G.pInfo->hostnum); - hostver = (unsigned)(G.pInfo->hostver); -/* - extnum = (unsigned)MIN(G.crec.version_needed_to_extract[1], NUM_HOSTS); - extver = (unsigned)G.crec.version_needed_to_extract[0]; - */ - - zfstrcpy(methbuf, method[methnum]); - if (methid == IMPLODED) { - methbuf[1] = (char)((G.crec.general_purpose_bit_flag & 2)? '8' : '4'); - methbuf[3] = (char)((G.crec.general_purpose_bit_flag & 4)? '3' : '2'); - } else if (methid == DEFLATED || methid == ENHDEFLATED) { - ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3); - methbuf[3] = dtype[dnum]; - } else if (methnum >= NUM_METHODS) { /* unknown */ - sprintf(&methbuf[1], "%03u", G.crec.compression_method); - } - - for (k = 0; k < 15; ++k) - attribs[k] = ' '; - attribs[15] = 0; - - xattr = (unsigned)((G.crec.external_file_attributes >> 16) & 0xFFFF); - switch (hostnum) { - case VMS_: - { int i, j; - - for (k = 0; k < 12; ++k) - workspace[k] = 0; - if (xattr & VMS_IRUSR) - workspace[0] = 'R'; - if (xattr & VMS_IWUSR) { - workspace[1] = 'W'; - workspace[3] = 'D'; - } - if (xattr & VMS_IXUSR) - workspace[2] = 'E'; - if (xattr & VMS_IRGRP) - workspace[4] = 'R'; - if (xattr & VMS_IWGRP) { - workspace[5] = 'W'; - workspace[7] = 'D'; - } - if (xattr & VMS_IXGRP) - workspace[6] = 'E'; - if (xattr & VMS_IROTH) - workspace[8] = 'R'; - if (xattr & VMS_IWOTH) { - workspace[9] = 'W'; - workspace[11] = 'D'; - } - if (xattr & VMS_IXOTH) - workspace[10] = 'E'; - - p = attribs; - for (k = j = 0; j < 3; ++j) { /* groups of permissions */ - for (i = 0; i < 4; ++i, ++k) /* perms within a group */ - if (workspace[k]) - *p++ = workspace[k]; - *p++ = ','; /* group separator */ - } - *--p = ' '; /* overwrite last comma */ - if ((p - attribs) < 12) - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - } - break; - - case AMIGA_: - switch (xattr & AMI_IFMT) { - case AMI_IFDIR: attribs[0] = 'd'; break; - case AMI_IFREG: attribs[0] = '-'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & AMI_IHIDDEN)? 'h' : '-'; - attribs[2] = (xattr & AMI_ISCRIPT)? 's' : '-'; - attribs[3] = (xattr & AMI_IPURE)? 'p' : '-'; - attribs[4] = (xattr & AMI_IARCHIVE)? 'a' : '-'; - attribs[5] = (xattr & AMI_IREAD)? 'r' : '-'; - attribs[6] = (xattr & AMI_IWRITE)? 'w' : '-'; - attribs[7] = (xattr & AMI_IEXECUTE)? 'e' : '-'; - attribs[8] = (xattr & AMI_IDELETE)? 'd' : '-'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - case THEOS_: - switch (xattr & THS_IFMT) { - case THS_IFLIB: *attribs = 'L'; break; - case THS_IFDIR: *attribs = 'D'; break; - case THS_IFCHR: *attribs = 'C'; break; - case THS_IFREG: *attribs = 'S'; break; - case THS_IFREL: *attribs = 'R'; break; - case THS_IFKEY: *attribs = 'K'; break; - case THS_IFIND: *attribs = 'I'; break; - case THS_IFR16: *attribs = 'P'; break; - case THS_IFP16: *attribs = '2'; break; - case THS_IFP32: *attribs = '3'; break; - default: *attribs = '?'; break; - } - attribs[1] = (xattr & THS_INHID) ? '.' : 'H'; - attribs[2] = (xattr & THS_IMODF) ? '.' : 'M'; - attribs[3] = (xattr & THS_IWOTH) ? '.' : 'W'; - attribs[4] = (xattr & THS_IROTH) ? '.' : 'R'; - attribs[5] = (xattr & THS_IEUSR) ? '.' : 'E'; - attribs[6] = (xattr & THS_IXUSR) ? '.' : 'X'; - attribs[7] = (xattr & THS_IWUSR) ? '.' : 'W'; - attribs[8] = (xattr & THS_IRUSR) ? '.' : 'R'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - case FS_VFAT_: -#ifdef OLD_THEOS_EXTRA - if (hostver == 20) { - switch (xattr & _THS_IFMT) { - case _THS_IFLIB: *attribs = 'L'; break; - case _THS_IFDIR: *attribs = 'd'; break; - case _THS_IFCHR: *attribs = 'c'; break; - case _THS_IFREG: *attribs = 'S'; break; - case _THS_IODRC: *attribs = 'D'; break; - case _THS_IOKEY: *attribs = 'K'; break; - case _THS_IOIND: *attribs = 'I'; break; - case _THS_IOPRG: *attribs = 'P'; break; - case _THS_IO286: *attribs = '2'; break; - case _THS_IO386: *attribs = '3'; break; - default: *attribs = '?'; break; - } - attribs[1] = (xattr & _THS_HIDDN) ? 'H' : '.'; - attribs[2] = (xattr & _THS_IXOTH) ? '.' : 'X'; - attribs[3] = (xattr & _THS_IWOTH) ? '.' : 'W'; - attribs[4] = (xattr & _THS_IROTH) ? '.' : 'R'; - attribs[5] = (xattr & _THS_IEUSR) ? '.' : 'E'; - attribs[6] = (xattr & _THS_IXUSR) ? '.' : 'X'; - attribs[7] = (xattr & _THS_IWUSR) ? '.' : 'W'; - attribs[8] = (xattr & _THS_IRUSR) ? '.' : 'R'; - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - } /* else: fall through! */ -#endif /* OLD_THEOS_EXTRA */ - - case FS_FAT_: - case FS_HPFS_: - case FS_NTFS_: - case VM_CMS_: - case MVS_: - case ACORN_: - if (hostnum != FS_FAT_ || - (unsigned)(xattr & 0700) != - ((unsigned)0400 | - ((unsigned)!(G.crec.external_file_attributes & 1) << 7) | - ((unsigned)(G.crec.external_file_attributes & 0x10) << 2)) - ) - { - xattr = (unsigned)(G.crec.external_file_attributes & 0xFF); - sprintf(attribs, ".r.-... %u.%u", hostver/10, hostver%10); - attribs[2] = (xattr & 0x01)? '-' : 'w'; - attribs[5] = (xattr & 0x02)? 'h' : '-'; - attribs[6] = (xattr & 0x04)? 's' : '-'; - attribs[4] = (xattr & 0x20)? 'a' : '-'; - if (xattr & 0x10) { - attribs[0] = 'd'; - attribs[3] = 'x'; - } else - attribs[0] = '-'; - if (IS_VOLID(xattr)) - attribs[0] = 'V'; - else if ((p = MBSRCHR(G.filename, '.')) != (char *)NULL) { - ++p; - if (STRNICMP(p, "com", 3) == 0 || - STRNICMP(p, "exe", 3) == 0 || - STRNICMP(p, "btm", 3) == 0 || - STRNICMP(p, "cmd", 3) == 0 || - STRNICMP(p, "bat", 3) == 0) - attribs[3] = 'x'; - } - break; - } /* else: fall through! */ - - default: /* assume Unix-like */ - switch ((unsigned)(xattr & UNX_IFMT)) { - case (unsigned)UNX_IFDIR: attribs[0] = 'd'; break; - case (unsigned)UNX_IFREG: attribs[0] = '-'; break; - case (unsigned)UNX_IFLNK: attribs[0] = 'l'; break; - case (unsigned)UNX_IFBLK: attribs[0] = 'b'; break; - case (unsigned)UNX_IFCHR: attribs[0] = 'c'; break; - case (unsigned)UNX_IFIFO: attribs[0] = 'p'; break; - case (unsigned)UNX_IFSOCK: attribs[0] = 's'; break; - default: attribs[0] = '?'; break; - } - attribs[1] = (xattr & UNX_IRUSR)? 'r' : '-'; - attribs[4] = (xattr & UNX_IRGRP)? 'r' : '-'; - attribs[7] = (xattr & UNX_IROTH)? 'r' : '-'; - attribs[2] = (xattr & UNX_IWUSR)? 'w' : '-'; - attribs[5] = (xattr & UNX_IWGRP)? 'w' : '-'; - attribs[8] = (xattr & UNX_IWOTH)? 'w' : '-'; - - if (xattr & UNX_IXUSR) - attribs[3] = (xattr & UNX_ISUID)? 's' : 'x'; - else - attribs[3] = (xattr & UNX_ISUID)? 'S' : '-'; /* S==undefined */ - if (xattr & UNX_IXGRP) - attribs[6] = (xattr & UNX_ISGID)? 's' : 'x'; /* == UNX_ENFMT */ - else - /* attribs[6] = (xattr & UNX_ISGID)? 'l' : '-'; real 4.3BSD */ - attribs[6] = (xattr & UNX_ISGID)? 'S' : '-'; /* SunOS 4.1.x */ - if (xattr & UNX_IXOTH) - attribs[9] = (xattr & UNX_ISVTX)? 't' : 'x'; /* "sticky bit" */ - else - attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T==undefined */ - - sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10); - break; - - } /* end switch (hostnum: external attributes format) */ - -#ifdef OLD_THEOS_EXTRA - Info(slide, 0, ((char *)slide, "%s %s %s ", attribs, - LoadFarStringSmall(((hostnum == FS_VFAT_ && hostver == 20) ? - os_TheosOld : - os[hostnum])), - FmZofft(G.crec.ucsize, "8", "u"))); -#else - Info(slide, 0, ((char *)slide, "%s %s %s ", attribs, - LoadFarStringSmall(os[hostnum]), - FmZofft(G.crec.ucsize, "8", "u"))); -#endif - Info(slide, 0, ((char *)slide, "%c", - (G.crec.general_purpose_bit_flag & 1)? - ((G.crec.internal_file_attributes & 1)? 'T' : 'B') : /* encrypted */ - ((G.crec.internal_file_attributes & 1)? 't' : 'b'))); /* plaintext */ - k = (G.crec.extra_field_length || - /* a local-only "UX" (old Unix/OS2/NT GMT times "IZUNIX") e.f.? */ - ((G.crec.external_file_attributes & 0x8000) && - (hostnum == UNIX_ || hostnum == FS_HPFS_ || hostnum == FS_NTFS_))); - Info(slide, 0, ((char *)slide, "%c", k? - ((G.crec.general_purpose_bit_flag & 8)? 'X' : 'x') : /* extra field */ - ((G.crec.general_purpose_bit_flag & 8)? 'l' : '-'))); /* no extra field */ - /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ extended local header or not */ - - if (uO.lflag == 4) { - zusz_t csiz = G.crec.csize; - - if (G.crec.general_purpose_bit_flag & 1) - csiz -= 12; /* if encrypted, don't count encryption header */ - Info(slide, 0, ((char *)slide, "%3d%%", - (ratio(G.crec.ucsize,csiz)+5)/10)); - } else if (uO.lflag == 5) - Info(slide, 0, ((char *)slide, " %s", - FmZofft(G.crec.csize, "8", "u"))); - - /* For printing of date & time, a "char d_t_buf[16]" is required. - * To save stack space, we reuse the "char attribs[16]" buffer whose - * content is no longer needed. - */ -# define d_t_buf attribs -#ifdef USE_EF_UT_TIME - z_modtim = G.extra_field && -#ifdef IZ_CHECK_TZ - G.tz_is_valid && -#endif - (ef_scan_for_izux(G.extra_field, G.crec.extra_field_length, 1, - G.crec.last_mod_dos_datetime, &z_utime, NULL) - & EB_UT_FL_MTIME) - ? &z_utime.mtime : NULL; - TIMET_TO_NATIVE(z_utime.mtime) /* NOP unless MSC 7.0 or Macintosh */ - d_t_buf[0] = (char)0; /* signal "show local time" */ -#else -# define z_modtim NULL -#endif - Info(slide, 0, ((char *)slide, " %s %s ", methbuf, - zi_time(__G__ &G.crec.last_mod_dos_datetime, z_modtim, d_t_buf))); - fnprint(__G); - -/*--------------------------------------------------------------------------- - Skip the file comment, if any (the filename has already been printed, - above). That finishes up this file entry... - ---------------------------------------------------------------------------*/ - - SKIP_(G.crec.file_comment_length) - - return error_in_archive; - -} /* end function zi_short() */ - - - - - -/**************************************/ -/* Function zi_showMacTypeCreator() */ -/**************************************/ - -static void zi_showMacTypeCreator(__G__ ebfield) - __GDEF - uch *ebfield; -{ - /* not every Type / Creator character is printable */ - if (isprint(native(ebfield[0])) && isprint(native(ebfield[1])) && - isprint(native(ebfield[2])) && isprint(native(ebfield[3])) && - isprint(native(ebfield[4])) && isprint(native(ebfield[5])) && - isprint(native(ebfield[6])) && isprint(native(ebfield[7]))) { - Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata), - native(ebfield[0]), native(ebfield[1]), - native(ebfield[2]), native(ebfield[3]), - native(ebfield[4]), native(ebfield[5]), - native(ebfield[6]), native(ebfield[7]))); - } else { - Info(slide, 0, ((char *)slide, LoadFarString(MacOSdata1), - (((ulg)ebfield[0]) << 24) + - (((ulg)ebfield[1]) << 16) + - (((ulg)ebfield[2]) << 8) + - ((ulg)ebfield[3]), - (((ulg)ebfield[4]) << 24) + - (((ulg)ebfield[5]) << 16) + - (((ulg)ebfield[6]) << 8) + - ((ulg)ebfield[7]))); - } -} /* end function zi_showMacTypeCreator() */ - - - - - -/************************/ -/* Function zi_time() */ -/************************/ - -static char *zi_time(__G__ datetimez, modtimez, d_t_str) - __GDEF - ZCONST ulg *datetimez; - ZCONST time_t *modtimez; - char *d_t_str; -{ - unsigned yr, mo, dy, hh, mm, ss; - char monthbuf[4]; - ZCONST char *monthstr; - static ZCONST char Far month[12][4] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; -#ifdef USE_EF_UT_TIME - struct tm *t; -#endif - - - -/*--------------------------------------------------------------------------- - Convert the file-modification date and time info to a string of the form - "1991 Feb 23 17:15:00", "23-Feb-91 17:15" or "19910223.171500", depending - on values of lflag and T_flag. If using Unix-time extra fields, convert - to local time or not, depending on value of first character in d_t_str[]. - ---------------------------------------------------------------------------*/ - -#ifdef USE_EF_UT_TIME - if (modtimez != NULL) { -#ifndef NO_GMTIME - /* check for our secret message from above... */ - t = (d_t_str[0] == (char)1)? gmtime(modtimez) : localtime(modtimez); -#else - t = localtime(modtimez); -#endif - if (uO.lflag > 9 && t == (struct tm *)NULL) - /* time conversion error in verbose listing format, - * return string with '?' instead of data - */ - return (strcpy(d_t_str, LoadFarString(lngYMDHMSTimeError))); - } else - t = (struct tm *)NULL; - if (t != (struct tm *)NULL) { - mo = (unsigned)(t->tm_mon + 1); - dy = (unsigned)(t->tm_mday); - yr = (unsigned)(t->tm_year); - - hh = (unsigned)(t->tm_hour); - mm = (unsigned)(t->tm_min); - ss = (unsigned)(t->tm_sec); - } else -#endif /* USE_EF_UT_TIME */ - { - yr = ((unsigned)(*datetimez >> 25) & 0x7f) + 80; - mo = ((unsigned)(*datetimez >> 21) & 0x0f); - dy = ((unsigned)(*datetimez >> 16) & 0x1f); - - hh = (((unsigned)*datetimez >> 11) & 0x1f); - mm = (((unsigned)*datetimez >> 5) & 0x3f); - ss = (((unsigned)*datetimez << 1) & 0x3e); - } - - if (mo == 0 || mo > 12) { - sprintf(monthbuf, LoadFarString(BogusFmt), mo); - monthstr = monthbuf; - } else - monthstr = LoadFarStringSmall(month[mo-1]); - - if (uO.lflag > 9) /* verbose listing format */ - sprintf(d_t_str, LoadFarString(lngYMDHMSTime), yr+1900, monthstr, dy, - hh, mm, ss); - else if (uO.T_flag) - sprintf(d_t_str, LoadFarString(DecimalTime), yr+1900, mo, dy, - hh, mm, ss); - else /* was: if ((uO.lflag >= 3) && (uO.lflag <= 5)) */ - sprintf(d_t_str, LoadFarString(shtYMDHMTime), yr%100, monthstr, dy, - hh, mm); - - return d_t_str; - -} /* end function zi_time() */ - -#endif /* !NO_ZIPINFO */