From 4d8f884e76b9f83b2edd49831b27cde32f101a08 Mon Sep 17 00:00:00 2001 From: ahgamut <41098605+ahgamut@users.noreply.github.com> Date: Thu, 10 Jun 2021 05:30:58 +0530 Subject: [PATCH] Get Info-ZIP's zip to build * removed unnecessary files (like amiga/osdep.h) * makefile has 4 targets: zip, zipnote, zipcloak, zipsplit * added clang-format off at the start of all source files * added necessary headers --- Makefile | 1 + third_party/infozip/infozip.mk | 134 + third_party/infozip/zip/Betas_Readme.txt | 17 - third_party/infozip/zip/acorn/GMakefile | 130 - third_party/infozip/zip/acorn/ReadMe | 85 - .../infozip/zip/acorn/ReadMe.GMakefile | 16 - third_party/infozip/zip/acorn/RunMe1st | 23 - third_party/infozip/zip/acorn/acornzip.c | 592 ---- third_party/infozip/zip/acorn/makefile | 115 - third_party/infozip/zip/acorn/match.s | 217 -- third_party/infozip/zip/acorn/osdep.h | 28 - third_party/infozip/zip/acorn/riscos.c | 394 --- third_party/infozip/zip/acorn/riscos.h | 119 - third_party/infozip/zip/acorn/sendbits.s | 105 - third_party/infozip/zip/acorn/srcrename | Bin 6175 -> 0 bytes third_party/infozip/zip/acorn/swiven.h | 59 - third_party/infozip/zip/acorn/swiven.s | 276 -- third_party/infozip/zip/acorn/zipsfx | 9 - third_party/infozip/zip/acorn/zipup.h | 16 - third_party/infozip/zip/amiga/LMKfile | 117 - third_party/infozip/zip/amiga/README | 1 - third_party/infozip/zip/amiga/amiga.c | 138 - third_party/infozip/zip/amiga/amiga.h | 54 - third_party/infozip/zip/amiga/amigazip.c | 507 --- third_party/infozip/zip/amiga/crc_68.a | 144 - third_party/infozip/zip/amiga/deflate.a | 1053 ------ third_party/infozip/zip/amiga/filedate.c | 599 ---- third_party/infozip/zip/amiga/makefile.azt | 304 -- third_party/infozip/zip/amiga/match.a | 182 -- third_party/infozip/zip/amiga/match_68.a | 273 -- third_party/infozip/zip/amiga/osdep.h | 119 - third_party/infozip/zip/amiga/smakefile | 662 ---- third_party/infozip/zip/amiga/stat.c | 293 -- third_party/infozip/zip/amiga/z-stat.h | 95 - third_party/infozip/zip/amiga/zipup.h | 25 - third_party/infozip/zip/aosvs/aosvs.c | 659 ---- third_party/infozip/zip/aosvs/make.cli | 5 - third_party/infozip/zip/api.c | 1 + third_party/infozip/zip/api.h | 3 +- third_party/infozip/zip/atari/Makefile | 111 - third_party/infozip/zip/atari/README | 5 - third_party/infozip/zip/atari/atari.c | 681 ---- third_party/infozip/zip/atari/make_all.mup | 7 - third_party/infozip/zip/atari/make_zip.mup | 7 - third_party/infozip/zip/atari/osdep.h | 20 - third_party/infozip/zip/atari/zipup.h | 19 - third_party/infozip/zip/atheos/Makefile | 146 - third_party/infozip/zip/atheos/README | 21 - third_party/infozip/zip/atheos/atheos.c | 885 ----- third_party/infozip/zip/atheos/osdep.h | 64 - third_party/infozip/zip/atheos/zipup.h | 24 - third_party/infozip/zip/beos/Contents | 14 - third_party/infozip/zip/beos/Makefile | 182 -- third_party/infozip/zip/beos/README | 31 - third_party/infozip/zip/beos/beos.c | 945 ------ third_party/infozip/zip/beos/osdep.h | 59 - third_party/infozip/zip/beos/zipup.h | 19 - third_party/infozip/zip/bzip2/install.txt | 258 -- third_party/infozip/zip/cmsmvs/README.CMS | 434 --- third_party/infozip/zip/cmsmvs/README.MVS | 92 - third_party/infozip/zip/cmsmvs/README.MVS.LE | 286 -- third_party/infozip/zip/cmsmvs/cczip.exec | 123 - third_party/infozip/zip/cmsmvs/cms.c | 34 - third_party/infozip/zip/cmsmvs/cmsmvs.c | 442 --- third_party/infozip/zip/cmsmvs/cmsmvs.h | 123 - third_party/infozip/zip/cmsmvs/cstat.h | 53 - third_party/infozip/zip/cmsmvs/mc.exec | 95 - third_party/infozip/zip/cmsmvs/mvs.c | 221 -- third_party/infozip/zip/cmsmvs/mvs.h | 40 - third_party/infozip/zip/cmsmvs/mvs.mki | 125 - third_party/infozip/zip/cmsmvs/pipzip.rexx | 27 - third_party/infozip/zip/cmsmvs/zip.exec | 66 - third_party/infozip/zip/cmsmvs/zip.makefile | 21 - third_party/infozip/zip/cmsmvs/zipcloak.exec | 66 - third_party/infozip/zip/cmsmvs/zipmvsc.job | 89 - third_party/infozip/zip/cmsmvs/zipname.conven | 200 -- third_party/infozip/zip/cmsmvs/zipnote.exec | 66 - third_party/infozip/zip/cmsmvs/zipsplit.exec | 66 - third_party/infozip/zip/cmsmvs/zipup.h | 18 - third_party/infozip/zip/cmsmvs/zipvmc.exec | 48 - third_party/infozip/zip/crc32.c | 5 +- third_party/infozip/zip/crc32.h | 1 + third_party/infozip/zip/crypt.c | 12 +- third_party/infozip/zip/crypt.h | 2 +- third_party/infozip/zip/deflate.c | 3 +- third_party/infozip/zip/ebcdic.h | 1 + third_party/infozip/zip/file_id.diz | 15 - third_party/infozip/zip/fileio.c | 16 +- third_party/infozip/zip/globals.c | 3 +- third_party/infozip/zip/human68k/Makefile | 95 - third_party/infozip/zip/human68k/Makefile.gcc | 78 - third_party/infozip/zip/human68k/crc_68.s | 144 - third_party/infozip/zip/human68k/deflate.s | 1076 ------- third_party/infozip/zip/human68k/human68k.c | 371 --- third_party/infozip/zip/human68k/match.s | 163 - third_party/infozip/zip/human68k/osdep.h | 28 - third_party/infozip/zip/human68k/zipup.h | 16 - third_party/infozip/zip/macos/Contents | 63 - third_party/infozip/zip/macos/HISTORY.TXT | 600 ---- third_party/infozip/zip/macos/README.TXT | 569 ---- third_party/infozip/zip/macos/ZipLib.h | 166 - third_party/infozip/zip/macos/ZipSx.h | 167 - third_party/infozip/zip/macos/ZpPrj.hqx | 455 --- third_party/infozip/zip/macos/osdep.h | 118 - third_party/infozip/zip/macos/readme.1st | 16 - .../infozip/zip/macos/source/VolWarn.h | 69 - .../infozip/zip/macos/source/charmap.h | 380 --- .../infozip/zip/macos/source/extrafld.c | 920 ------ third_party/infozip/zip/macos/source/getenv.c | 398 --- .../infozip/zip/macos/source/helpers.c | 479 --- .../infozip/zip/macos/source/helpers.h | 57 - .../infozip/zip/macos/source/macglob.h | 86 - .../infozip/zip/macos/source/macopen.c | 363 --- .../infozip/zip/macos/source/macopen.h | 21 - third_party/infozip/zip/macos/source/macos.c | 1079 ------- .../infozip/zip/macos/source/macstuff.c | 1724 ---------- .../infozip/zip/macos/source/macstuff.h | 18 - .../infozip/zip/macos/source/mactime.c | 451 --- .../infozip/zip/macos/source/mactime.h | 61 - .../infozip/zip/macos/source/pathname.c | 726 ----- .../infozip/zip/macos/source/pathname.h | 64 - .../infozip/zip/macos/source/recurse.c | 442 --- .../infozip/zip/macos/source/recurse.h | 129 - .../infozip/zip/macos/source/unixlike.c | 313 -- .../infozip/zip/macos/source/unixlike.h | 86 - .../infozip/zip/macos/source/zip_rc.hqx | 43 - third_party/infozip/zip/macos/zipup.h | 25 - third_party/infozip/zip/man/zip.1 | 2840 ----------------- third_party/infozip/zip/man/zipcloak.1 | 111 - third_party/infozip/zip/man/zipnote.1 | 85 - third_party/infozip/zip/man/zipsplit.1 | 69 - third_party/infozip/zip/msdos/README.DOS | 132 - third_party/infozip/zip/msdos/crc_i86.asm | 497 --- third_party/infozip/zip/msdos/makebz2.dj2 | 148 - third_party/infozip/zip/msdos/makefile.bor | 197 -- third_party/infozip/zip/msdos/makefile.dj1 | 126 - third_party/infozip/zip/msdos/makefile.dj2 | 136 - third_party/infozip/zip/msdos/makefile.emx | 169 - third_party/infozip/zip/msdos/makefile.msc | 209 -- third_party/infozip/zip/msdos/makefile.tc | 177 - third_party/infozip/zip/msdos/makefile.wat | 256 -- third_party/infozip/zip/msdos/match.asm | 477 --- third_party/infozip/zip/msdos/msdos.c | 1126 ------- third_party/infozip/zip/msdos/osdep.h | 218 -- third_party/infozip/zip/msdos/zipup.h | 16 - third_party/infozip/zip/novell/MAKEINIT | 71 - third_party/infozip/zip/novell/Makefile | 142 - third_party/infozip/zip/novell/Netware.c | 970 ------ third_party/infozip/zip/novell/README | 9 - third_party/infozip/zip/novell/m.cmd | 9 - third_party/infozip/zip/novell/osdep.h | 205 -- third_party/infozip/zip/novell/signal.c | 49 - third_party/infozip/zip/novell/zip.lnk | 25 - third_party/infozip/zip/novell/zipup.h | 16 - third_party/infozip/zip/os2/makefile.os2 | 563 ---- third_party/infozip/zip/os2/match32.asm | 175 - third_party/infozip/zip/os2/os2.c | 481 --- third_party/infozip/zip/os2/os2acl.c | 385 --- third_party/infozip/zip/os2/os2acl.h | 34 - third_party/infozip/zip/os2/os2zip.c | 1213 ------- third_party/infozip/zip/os2/os2zip.h | 84 - third_party/infozip/zip/os2/osdep.h | 173 - third_party/infozip/zip/os2/zip.def | 3 - third_party/infozip/zip/os2/zipup.h | 16 - third_party/infozip/zip/proginfo/3rdparty.bug | 114 - third_party/infozip/zip/proginfo/ZipPorts | 285 -- third_party/infozip/zip/proginfo/algorith.txt | 68 - third_party/infozip/zip/proginfo/ebcdic.msg | 63 - third_party/infozip/zip/proginfo/extrafld.txt | 1372 -------- third_party/infozip/zip/proginfo/fileinfo.cms | 231 -- third_party/infozip/zip/proginfo/infozip.who | 242 -- third_party/infozip/zip/proginfo/ntsd.txt | 111 - third_party/infozip/zip/proginfo/perform.dos | 183 -- third_party/infozip/zip/proginfo/timezone.txt | 85 - third_party/infozip/zip/proginfo/txtvsbin.txt | 112 - third_party/infozip/zip/proginfo/ziplimit.txt | 243 -- third_party/infozip/zip/qdos/IZREADME.SMS | 600 ---- third_party/infozip/zip/qdos/Makefile.qdos | 145 - third_party/infozip/zip/qdos/Makefile.qlzip | 141 - third_party/infozip/zip/qdos/config.s | 153 - third_party/infozip/zip/qdos/crc68.s | 99 - third_party/infozip/zip/qdos/match.s | 138 - third_party/infozip/zip/qdos/osdep.h | 33 - third_party/infozip/zip/qdos/qdos.c | 879 ----- third_party/infozip/zip/qdos/qfileio.c | 233 -- third_party/infozip/zip/qdos/zipup.h | 19 - third_party/infozip/zip/revision.h | 1 + third_party/infozip/zip/tailor.h | 27 +- third_party/infozip/zip/tandem/HISTORY | 97 - third_party/infozip/zip/tandem/README | 95 - third_party/infozip/zip/tandem/commacs | 94 - third_party/infozip/zip/tandem/doit | 21 - third_party/infozip/zip/tandem/macros | 571 ---- third_party/infozip/zip/tandem/make | 130 - third_party/infozip/zip/tandem/tandem.c | 889 ------ third_party/infozip/zip/tandem/tandem.h | 236 -- third_party/infozip/zip/tandem/tannsk.h | 19 - third_party/infozip/zip/tandem/tanzip.c | 723 ----- third_party/infozip/zip/tandem/tanzip.h | 43 - third_party/infozip/zip/tandem/zipup.h | 26 - third_party/infozip/zip/theos/Makefile | 138 - third_party/infozip/zip/theos/README | 34 - third_party/infozip/zip/theos/_chmod.c | 21 - third_party/infozip/zip/theos/_fprintf.c | 26 - third_party/infozip/zip/theos/_isatty.c | 26 - third_party/infozip/zip/theos/_rename.c | 83 - third_party/infozip/zip/theos/_setargv.c | 140 - third_party/infozip/zip/theos/_stat.c | 461 --- third_party/infozip/zip/theos/charconv.h | 93 - third_party/infozip/zip/theos/osdep.h | 58 - third_party/infozip/zip/theos/stat.h | 106 - third_party/infozip/zip/theos/theos.c | 556 ---- third_party/infozip/zip/theos/zipup.h | 19 - third_party/infozip/zip/timezone.c | 9 +- third_party/infozip/zip/timezone.h | 1 + third_party/infozip/zip/tops20/make.mic | 35 - third_party/infozip/zip/tops20/osdep.h | 31 - third_party/infozip/zip/tops20/rename.mic | 6 - third_party/infozip/zip/tops20/tops20.c | 574 ---- third_party/infozip/zip/tops20/zipup.h | 18 - third_party/infozip/zip/trees.c | 5 +- third_party/infozip/zip/ttyio.c | 14 +- third_party/infozip/zip/ttyio.h | 3 +- third_party/infozip/zip/unix/osdep.h | 6 +- third_party/infozip/zip/unix/unix.c | 15 +- third_party/infozip/zip/unix/zipup.h | 1 + third_party/infozip/zip/util.c | 9 +- third_party/infozip/zip/vms/NOTES.TXT | 382 --- third_party/infozip/zip/vms/VMS_ZIP.RNH | 1467 --------- third_party/infozip/zip/vms/build_zip.com | 690 ---- third_party/infozip/zip/vms/bzlib.h | 21 - third_party/infozip/zip/vms/cmdline.c | 1802 ----------- third_party/infozip/zip/vms/collect_deps.com | 89 - third_party/infozip/zip/vms/cvthelp.tpu | 182 -- third_party/infozip/zip/vms/descrip.mms | 358 --- third_party/infozip/zip/vms/descrip_deps.mms | 207 -- .../infozip/zip/vms/descrip_mkdeps.mms | 247 -- third_party/infozip/zip/vms/descrip_src.mms | 373 --- .../infozip/zip/vms/find_bzip2_lib.com | 71 - third_party/infozip/zip/vms/hlp_lib_next.com | 17 - third_party/infozip/zip/vms/install_vms.txt | 158 - third_party/infozip/zip/vms/mod_dep.com | 33 - third_party/infozip/zip/vms/osdep.h | 178 -- third_party/infozip/zip/vms/stream_lf.fdl | 3 - third_party/infozip/zip/vms/unixio_gcc.h | 27 - third_party/infozip/zip/vms/unixlib_gcc.h | 16 - third_party/infozip/zip/vms/vms.c | 1007 ------ third_party/infozip/zip/vms/vms.h | 354 -- third_party/infozip/zip/vms/vms_im.c | 926 ------ third_party/infozip/zip/vms/vms_msg_gen.c | 91 - third_party/infozip/zip/vms/vms_pk.c | 600 ---- third_party/infozip/zip/vms/vmsdefs.h | 320 -- third_party/infozip/zip/vms/vmsmunch.c | 434 --- third_party/infozip/zip/vms/vmsmunch.h | 55 - third_party/infozip/zip/vms/vmszip.c | 1444 --------- third_party/infozip/zip/vms/zip.opt | 1 - third_party/infozip/zip/vms/zip_cli.cld | 168 - third_party/infozip/zip/vms/zip_cli.help | 1636 ---------- third_party/infozip/zip/vms/zip_msg.msg | 57 - third_party/infozip/zip/vms/zipup.h | 56 - third_party/infozip/zip/win32/README.NT | 17 - third_party/infozip/zip/win32/README.TZ | 7 - third_party/infozip/zip/win32/README.txt | 10 - third_party/infozip/zip/win32/crc_i386.asm | 330 -- third_party/infozip/zip/win32/crc_i386.c | 310 -- third_party/infozip/zip/win32/crc_lcc.asm | 166 - third_party/infozip/zip/win32/gvmat64.asm | 513 --- third_party/infozip/zip/win32/lm32_lcc.asm | 174 - third_party/infozip/zip/win32/makefile.a64 | 134 - third_party/infozip/zip/win32/makefile.bor | 189 -- third_party/infozip/zip/win32/makefile.dj | 112 - third_party/infozip/zip/win32/makefile.emx | 304 -- third_party/infozip/zip/win32/makefile.gcc | 159 - third_party/infozip/zip/win32/makefile.ibm | 123 - third_party/infozip/zip/win32/makefile.lcc | 125 - third_party/infozip/zip/win32/makefile.w10 | 197 -- third_party/infozip/zip/win32/makefile.w32 | 224 -- third_party/infozip/zip/win32/makefile.wat | 197 -- third_party/infozip/zip/win32/makenoas.w32 | 219 -- third_party/infozip/zip/win32/match32.asm | 192 -- third_party/infozip/zip/win32/nt.c | 492 --- third_party/infozip/zip/win32/nt.h | 75 - third_party/infozip/zip/win32/osdep.h | 617 ---- third_party/infozip/zip/win32/readme.a64 | 42 - third_party/infozip/zip/win32/rsxntwin.h | 173 - .../infozip/zip/win32/vc6/ReadmeVC.txt | 10 - third_party/infozip/zip/win32/vc6/zip.dsp | 337 -- third_party/infozip/zip/win32/vc6/zip.dsw | 65 - .../infozip/zip/win32/vc6/zipcloak.dsp | 264 -- third_party/infozip/zip/win32/vc6/zipnote.dsp | 248 -- .../infozip/zip/win32/vc6/zipsplit.dsp | 248 -- .../infozip/zip/win32/vc6bz2/ReadVCBZ.txt | 19 - third_party/infozip/zip/win32/vc6bz2/zip.dsp | 381 --- third_party/infozip/zip/win32/vc6bz2/zip.dsw | 65 - third_party/infozip/zip/win32/win32.c | 1488 --------- third_party/infozip/zip/win32/win32i64.c | 115 - third_party/infozip/zip/win32/win32zip.c | 1980 ------------ third_party/infozip/zip/win32/win32zip.h | 42 - third_party/infozip/zip/win32/zip.def | 4 - third_party/infozip/zip/win32/zip.rc | 53 - third_party/infozip/zip/win32/zipup.h | 48 - .../infozip/zip/windll/VBz64/VBZIP.VBP | 33 - .../infozip/zip/windll/VBz64/VBZIP.vbw | 2 - .../infozip/zip/windll/VBz64/VBZipBas.bas | 737 ----- .../infozip/zip/windll/VBz64/Vbzipfrm.frm | 183 -- .../infozip/zip/windll/VBz64/readVB64.txt | 25 - third_party/infozip/zip/windll/Vb/VBZIP.vbw | 2 - .../infozip/zip/windll/Vb/VBZipBas.bas | 458 --- third_party/infozip/zip/windll/Vb/Vbzip.vbp | 34 - .../infozip/zip/windll/Vb/Vbzipfrm.frm | 130 - .../infozip/zip/windll/Vb/readmeVB.txt | 34 - third_party/infozip/zip/windll/contents | 42 - third_party/infozip/zip/windll/example.c | 375 --- third_party/infozip/zip/windll/example.h | 54 - third_party/infozip/zip/windll/structs.h | 30 - .../zip/windll/visualc/dll/zip32z64.dsp | 168 - .../zip/windll/visualc/dll/zip32z64.dsw | 29 - .../zip/windll/visualc/lib/zip32z64.dsp | 158 - .../zip/windll/visualc/lib/zip32z64.dsw | 29 - third_party/infozip/zip/windll/windll.aps | Bin 1652 -> 0 bytes third_party/infozip/zip/windll/windll.c | 176 - third_party/infozip/zip/windll/windll.h | 63 - third_party/infozip/zip/windll/windll.rc | 57 - third_party/infozip/zip/windll/windll.txt | 147 - third_party/infozip/zip/windll/windll16.def | 15 - third_party/infozip/zip/windll/windll32.def | 14 - third_party/infozip/zip/windll/ziplib.def | 15 - third_party/infozip/zip/zbz2err.c | 1 + third_party/infozip/zip/zip.c | 24 +- third_party/infozip/zip/zip.h | 9 +- third_party/infozip/zip/zip.txt | 2027 ------------ third_party/infozip/zip/zip30.ann | 95 - third_party/infozip/zip/zip30f.ann | 61 - third_party/infozip/zip/zip30g.ann | 33 - third_party/infozip/zip/zip30h.ann | 47 - third_party/infozip/zip/zipcloak.c | 17 +- third_party/infozip/zip/zipcloak.txt | 75 - third_party/infozip/zip/ziperr.h | 1 + third_party/infozip/zip/zipfile.c | 18 +- third_party/infozip/zip/zipnote.c | 12 +- third_party/infozip/zip/zipnote.txt | 63 - third_party/infozip/zip/zipsplit.c | 11 +- third_party/infozip/zip/zipsplit.txt | 53 - third_party/infozip/zip/zipup.c | 24 +- third_party/third_party.mk | 1 + 345 files changed, 298 insertions(+), 77763 deletions(-) create mode 100644 third_party/infozip/infozip.mk delete mode 100644 third_party/infozip/zip/Betas_Readme.txt delete mode 100644 third_party/infozip/zip/acorn/GMakefile delete mode 100644 third_party/infozip/zip/acorn/ReadMe delete mode 100644 third_party/infozip/zip/acorn/ReadMe.GMakefile delete mode 100644 third_party/infozip/zip/acorn/RunMe1st delete mode 100644 third_party/infozip/zip/acorn/acornzip.c delete mode 100644 third_party/infozip/zip/acorn/makefile delete mode 100644 third_party/infozip/zip/acorn/match.s delete mode 100644 third_party/infozip/zip/acorn/osdep.h delete mode 100644 third_party/infozip/zip/acorn/riscos.c delete mode 100644 third_party/infozip/zip/acorn/riscos.h delete mode 100644 third_party/infozip/zip/acorn/sendbits.s delete mode 100644 third_party/infozip/zip/acorn/srcrename delete mode 100644 third_party/infozip/zip/acorn/swiven.h delete mode 100644 third_party/infozip/zip/acorn/swiven.s delete mode 100644 third_party/infozip/zip/acorn/zipsfx delete mode 100644 third_party/infozip/zip/acorn/zipup.h delete mode 100644 third_party/infozip/zip/amiga/LMKfile delete mode 100644 third_party/infozip/zip/amiga/README delete mode 100644 third_party/infozip/zip/amiga/amiga.c delete mode 100644 third_party/infozip/zip/amiga/amiga.h delete mode 100644 third_party/infozip/zip/amiga/amigazip.c delete mode 100644 third_party/infozip/zip/amiga/crc_68.a delete mode 100644 third_party/infozip/zip/amiga/deflate.a delete mode 100644 third_party/infozip/zip/amiga/filedate.c delete mode 100644 third_party/infozip/zip/amiga/makefile.azt delete mode 100644 third_party/infozip/zip/amiga/match.a delete mode 100644 third_party/infozip/zip/amiga/match_68.a delete mode 100644 third_party/infozip/zip/amiga/osdep.h delete mode 100644 third_party/infozip/zip/amiga/smakefile delete mode 100644 third_party/infozip/zip/amiga/stat.c delete mode 100644 third_party/infozip/zip/amiga/z-stat.h delete mode 100644 third_party/infozip/zip/amiga/zipup.h delete mode 100644 third_party/infozip/zip/aosvs/aosvs.c delete mode 100644 third_party/infozip/zip/aosvs/make.cli delete mode 100644 third_party/infozip/zip/atari/Makefile delete mode 100644 third_party/infozip/zip/atari/README delete mode 100644 third_party/infozip/zip/atari/atari.c delete mode 100644 third_party/infozip/zip/atari/make_all.mup delete mode 100644 third_party/infozip/zip/atari/make_zip.mup delete mode 100644 third_party/infozip/zip/atari/osdep.h delete mode 100644 third_party/infozip/zip/atari/zipup.h delete mode 100644 third_party/infozip/zip/atheos/Makefile delete mode 100644 third_party/infozip/zip/atheos/README delete mode 100644 third_party/infozip/zip/atheos/atheos.c delete mode 100644 third_party/infozip/zip/atheos/osdep.h delete mode 100644 third_party/infozip/zip/atheos/zipup.h delete mode 100644 third_party/infozip/zip/beos/Contents delete mode 100644 third_party/infozip/zip/beos/Makefile delete mode 100644 third_party/infozip/zip/beos/README delete mode 100644 third_party/infozip/zip/beos/beos.c delete mode 100644 third_party/infozip/zip/beos/osdep.h delete mode 100644 third_party/infozip/zip/beos/zipup.h delete mode 100644 third_party/infozip/zip/bzip2/install.txt delete mode 100644 third_party/infozip/zip/cmsmvs/README.CMS delete mode 100644 third_party/infozip/zip/cmsmvs/README.MVS delete mode 100644 third_party/infozip/zip/cmsmvs/README.MVS.LE delete mode 100644 third_party/infozip/zip/cmsmvs/cczip.exec delete mode 100644 third_party/infozip/zip/cmsmvs/cms.c delete mode 100644 third_party/infozip/zip/cmsmvs/cmsmvs.c delete mode 100644 third_party/infozip/zip/cmsmvs/cmsmvs.h delete mode 100644 third_party/infozip/zip/cmsmvs/cstat.h delete mode 100644 third_party/infozip/zip/cmsmvs/mc.exec delete mode 100644 third_party/infozip/zip/cmsmvs/mvs.c delete mode 100644 third_party/infozip/zip/cmsmvs/mvs.h delete mode 100644 third_party/infozip/zip/cmsmvs/mvs.mki delete mode 100644 third_party/infozip/zip/cmsmvs/pipzip.rexx delete mode 100644 third_party/infozip/zip/cmsmvs/zip.exec delete mode 100644 third_party/infozip/zip/cmsmvs/zip.makefile delete mode 100644 third_party/infozip/zip/cmsmvs/zipcloak.exec delete mode 100644 third_party/infozip/zip/cmsmvs/zipmvsc.job delete mode 100644 third_party/infozip/zip/cmsmvs/zipname.conven delete mode 100644 third_party/infozip/zip/cmsmvs/zipnote.exec delete mode 100644 third_party/infozip/zip/cmsmvs/zipsplit.exec delete mode 100644 third_party/infozip/zip/cmsmvs/zipup.h delete mode 100644 third_party/infozip/zip/cmsmvs/zipvmc.exec delete mode 100644 third_party/infozip/zip/file_id.diz delete mode 100644 third_party/infozip/zip/human68k/Makefile delete mode 100644 third_party/infozip/zip/human68k/Makefile.gcc delete mode 100644 third_party/infozip/zip/human68k/crc_68.s delete mode 100644 third_party/infozip/zip/human68k/deflate.s delete mode 100644 third_party/infozip/zip/human68k/human68k.c delete mode 100644 third_party/infozip/zip/human68k/match.s delete mode 100644 third_party/infozip/zip/human68k/osdep.h delete mode 100644 third_party/infozip/zip/human68k/zipup.h delete mode 100644 third_party/infozip/zip/macos/Contents delete mode 100644 third_party/infozip/zip/macos/HISTORY.TXT delete mode 100644 third_party/infozip/zip/macos/README.TXT delete mode 100644 third_party/infozip/zip/macos/ZipLib.h delete mode 100644 third_party/infozip/zip/macos/ZipSx.h delete mode 100644 third_party/infozip/zip/macos/ZpPrj.hqx delete mode 100644 third_party/infozip/zip/macos/osdep.h delete mode 100644 third_party/infozip/zip/macos/readme.1st delete mode 100644 third_party/infozip/zip/macos/source/VolWarn.h delete mode 100644 third_party/infozip/zip/macos/source/charmap.h delete mode 100644 third_party/infozip/zip/macos/source/extrafld.c delete mode 100644 third_party/infozip/zip/macos/source/getenv.c delete mode 100644 third_party/infozip/zip/macos/source/helpers.c delete mode 100644 third_party/infozip/zip/macos/source/helpers.h delete mode 100644 third_party/infozip/zip/macos/source/macglob.h delete mode 100644 third_party/infozip/zip/macos/source/macopen.c delete mode 100644 third_party/infozip/zip/macos/source/macopen.h delete mode 100644 third_party/infozip/zip/macos/source/macos.c delete mode 100644 third_party/infozip/zip/macos/source/macstuff.c delete mode 100644 third_party/infozip/zip/macos/source/macstuff.h delete mode 100644 third_party/infozip/zip/macos/source/mactime.c delete mode 100644 third_party/infozip/zip/macos/source/mactime.h delete mode 100644 third_party/infozip/zip/macos/source/pathname.c delete mode 100644 third_party/infozip/zip/macos/source/pathname.h delete mode 100644 third_party/infozip/zip/macos/source/recurse.c delete mode 100644 third_party/infozip/zip/macos/source/recurse.h delete mode 100644 third_party/infozip/zip/macos/source/unixlike.c delete mode 100644 third_party/infozip/zip/macos/source/unixlike.h delete mode 100644 third_party/infozip/zip/macos/source/zip_rc.hqx delete mode 100644 third_party/infozip/zip/macos/zipup.h delete mode 100644 third_party/infozip/zip/man/zip.1 delete mode 100644 third_party/infozip/zip/man/zipcloak.1 delete mode 100644 third_party/infozip/zip/man/zipnote.1 delete mode 100644 third_party/infozip/zip/man/zipsplit.1 delete mode 100644 third_party/infozip/zip/msdos/README.DOS delete mode 100644 third_party/infozip/zip/msdos/crc_i86.asm delete mode 100644 third_party/infozip/zip/msdos/makebz2.dj2 delete mode 100644 third_party/infozip/zip/msdos/makefile.bor delete mode 100644 third_party/infozip/zip/msdos/makefile.dj1 delete mode 100644 third_party/infozip/zip/msdos/makefile.dj2 delete mode 100644 third_party/infozip/zip/msdos/makefile.emx delete mode 100644 third_party/infozip/zip/msdos/makefile.msc delete mode 100644 third_party/infozip/zip/msdos/makefile.tc delete mode 100644 third_party/infozip/zip/msdos/makefile.wat delete mode 100644 third_party/infozip/zip/msdos/match.asm delete mode 100644 third_party/infozip/zip/msdos/msdos.c delete mode 100644 third_party/infozip/zip/msdos/osdep.h delete mode 100644 third_party/infozip/zip/msdos/zipup.h delete mode 100644 third_party/infozip/zip/novell/MAKEINIT delete mode 100644 third_party/infozip/zip/novell/Makefile delete mode 100644 third_party/infozip/zip/novell/Netware.c delete mode 100644 third_party/infozip/zip/novell/README delete mode 100644 third_party/infozip/zip/novell/m.cmd delete mode 100644 third_party/infozip/zip/novell/osdep.h delete mode 100644 third_party/infozip/zip/novell/signal.c delete mode 100644 third_party/infozip/zip/novell/zip.lnk delete mode 100644 third_party/infozip/zip/novell/zipup.h delete mode 100644 third_party/infozip/zip/os2/makefile.os2 delete mode 100644 third_party/infozip/zip/os2/match32.asm delete mode 100644 third_party/infozip/zip/os2/os2.c delete mode 100644 third_party/infozip/zip/os2/os2acl.c delete mode 100644 third_party/infozip/zip/os2/os2acl.h delete mode 100644 third_party/infozip/zip/os2/os2zip.c delete mode 100644 third_party/infozip/zip/os2/os2zip.h delete mode 100644 third_party/infozip/zip/os2/osdep.h delete mode 100644 third_party/infozip/zip/os2/zip.def delete mode 100644 third_party/infozip/zip/os2/zipup.h delete mode 100644 third_party/infozip/zip/proginfo/3rdparty.bug delete mode 100644 third_party/infozip/zip/proginfo/ZipPorts delete mode 100644 third_party/infozip/zip/proginfo/algorith.txt delete mode 100644 third_party/infozip/zip/proginfo/ebcdic.msg delete mode 100644 third_party/infozip/zip/proginfo/extrafld.txt delete mode 100644 third_party/infozip/zip/proginfo/fileinfo.cms delete mode 100644 third_party/infozip/zip/proginfo/infozip.who delete mode 100644 third_party/infozip/zip/proginfo/ntsd.txt delete mode 100644 third_party/infozip/zip/proginfo/perform.dos delete mode 100644 third_party/infozip/zip/proginfo/timezone.txt delete mode 100644 third_party/infozip/zip/proginfo/txtvsbin.txt delete mode 100644 third_party/infozip/zip/proginfo/ziplimit.txt delete mode 100644 third_party/infozip/zip/qdos/IZREADME.SMS delete mode 100644 third_party/infozip/zip/qdos/Makefile.qdos delete mode 100644 third_party/infozip/zip/qdos/Makefile.qlzip delete mode 100644 third_party/infozip/zip/qdos/config.s delete mode 100644 third_party/infozip/zip/qdos/crc68.s delete mode 100644 third_party/infozip/zip/qdos/match.s delete mode 100644 third_party/infozip/zip/qdos/osdep.h delete mode 100644 third_party/infozip/zip/qdos/qdos.c delete mode 100644 third_party/infozip/zip/qdos/qfileio.c delete mode 100644 third_party/infozip/zip/qdos/zipup.h delete mode 100644 third_party/infozip/zip/tandem/HISTORY delete mode 100644 third_party/infozip/zip/tandem/README delete mode 100644 third_party/infozip/zip/tandem/commacs delete mode 100644 third_party/infozip/zip/tandem/doit delete mode 100644 third_party/infozip/zip/tandem/macros delete mode 100644 third_party/infozip/zip/tandem/make delete mode 100644 third_party/infozip/zip/tandem/tandem.c delete mode 100644 third_party/infozip/zip/tandem/tandem.h delete mode 100644 third_party/infozip/zip/tandem/tannsk.h delete mode 100644 third_party/infozip/zip/tandem/tanzip.c delete mode 100644 third_party/infozip/zip/tandem/tanzip.h delete mode 100644 third_party/infozip/zip/tandem/zipup.h delete mode 100644 third_party/infozip/zip/theos/Makefile delete mode 100644 third_party/infozip/zip/theos/README delete mode 100644 third_party/infozip/zip/theos/_chmod.c delete mode 100644 third_party/infozip/zip/theos/_fprintf.c delete mode 100644 third_party/infozip/zip/theos/_isatty.c delete mode 100644 third_party/infozip/zip/theos/_rename.c delete mode 100644 third_party/infozip/zip/theos/_setargv.c delete mode 100644 third_party/infozip/zip/theos/_stat.c delete mode 100644 third_party/infozip/zip/theos/charconv.h delete mode 100644 third_party/infozip/zip/theos/osdep.h delete mode 100644 third_party/infozip/zip/theos/stat.h delete mode 100644 third_party/infozip/zip/theos/theos.c delete mode 100644 third_party/infozip/zip/theos/zipup.h delete mode 100644 third_party/infozip/zip/tops20/make.mic delete mode 100644 third_party/infozip/zip/tops20/osdep.h delete mode 100644 third_party/infozip/zip/tops20/rename.mic delete mode 100644 third_party/infozip/zip/tops20/tops20.c delete mode 100644 third_party/infozip/zip/tops20/zipup.h delete mode 100644 third_party/infozip/zip/vms/NOTES.TXT delete mode 100644 third_party/infozip/zip/vms/VMS_ZIP.RNH delete mode 100644 third_party/infozip/zip/vms/build_zip.com delete mode 100644 third_party/infozip/zip/vms/bzlib.h delete mode 100644 third_party/infozip/zip/vms/cmdline.c delete mode 100644 third_party/infozip/zip/vms/collect_deps.com delete mode 100644 third_party/infozip/zip/vms/cvthelp.tpu delete mode 100644 third_party/infozip/zip/vms/descrip.mms delete mode 100644 third_party/infozip/zip/vms/descrip_deps.mms delete mode 100644 third_party/infozip/zip/vms/descrip_mkdeps.mms delete mode 100644 third_party/infozip/zip/vms/descrip_src.mms delete mode 100644 third_party/infozip/zip/vms/find_bzip2_lib.com delete mode 100644 third_party/infozip/zip/vms/hlp_lib_next.com delete mode 100644 third_party/infozip/zip/vms/install_vms.txt delete mode 100644 third_party/infozip/zip/vms/mod_dep.com delete mode 100644 third_party/infozip/zip/vms/osdep.h delete mode 100644 third_party/infozip/zip/vms/stream_lf.fdl delete mode 100644 third_party/infozip/zip/vms/unixio_gcc.h delete mode 100644 third_party/infozip/zip/vms/unixlib_gcc.h delete mode 100644 third_party/infozip/zip/vms/vms.c delete mode 100644 third_party/infozip/zip/vms/vms.h delete mode 100644 third_party/infozip/zip/vms/vms_im.c delete mode 100644 third_party/infozip/zip/vms/vms_msg_gen.c delete mode 100644 third_party/infozip/zip/vms/vms_pk.c delete mode 100644 third_party/infozip/zip/vms/vmsdefs.h delete mode 100644 third_party/infozip/zip/vms/vmsmunch.c delete mode 100644 third_party/infozip/zip/vms/vmsmunch.h delete mode 100644 third_party/infozip/zip/vms/vmszip.c delete mode 100644 third_party/infozip/zip/vms/zip.opt delete mode 100644 third_party/infozip/zip/vms/zip_cli.cld delete mode 100644 third_party/infozip/zip/vms/zip_cli.help delete mode 100644 third_party/infozip/zip/vms/zip_msg.msg delete mode 100644 third_party/infozip/zip/vms/zipup.h delete mode 100644 third_party/infozip/zip/win32/README.NT delete mode 100644 third_party/infozip/zip/win32/README.TZ delete mode 100644 third_party/infozip/zip/win32/README.txt delete mode 100644 third_party/infozip/zip/win32/crc_i386.asm delete mode 100644 third_party/infozip/zip/win32/crc_i386.c delete mode 100644 third_party/infozip/zip/win32/crc_lcc.asm delete mode 100644 third_party/infozip/zip/win32/gvmat64.asm delete mode 100644 third_party/infozip/zip/win32/lm32_lcc.asm delete mode 100644 third_party/infozip/zip/win32/makefile.a64 delete mode 100644 third_party/infozip/zip/win32/makefile.bor delete mode 100644 third_party/infozip/zip/win32/makefile.dj delete mode 100644 third_party/infozip/zip/win32/makefile.emx delete mode 100644 third_party/infozip/zip/win32/makefile.gcc delete mode 100644 third_party/infozip/zip/win32/makefile.ibm delete mode 100644 third_party/infozip/zip/win32/makefile.lcc delete mode 100644 third_party/infozip/zip/win32/makefile.w10 delete mode 100644 third_party/infozip/zip/win32/makefile.w32 delete mode 100644 third_party/infozip/zip/win32/makefile.wat delete mode 100644 third_party/infozip/zip/win32/makenoas.w32 delete mode 100644 third_party/infozip/zip/win32/match32.asm delete mode 100644 third_party/infozip/zip/win32/nt.c delete mode 100644 third_party/infozip/zip/win32/nt.h delete mode 100644 third_party/infozip/zip/win32/osdep.h delete mode 100644 third_party/infozip/zip/win32/readme.a64 delete mode 100644 third_party/infozip/zip/win32/rsxntwin.h delete mode 100644 third_party/infozip/zip/win32/vc6/ReadmeVC.txt delete mode 100644 third_party/infozip/zip/win32/vc6/zip.dsp delete mode 100644 third_party/infozip/zip/win32/vc6/zip.dsw delete mode 100644 third_party/infozip/zip/win32/vc6/zipcloak.dsp delete mode 100644 third_party/infozip/zip/win32/vc6/zipnote.dsp delete mode 100644 third_party/infozip/zip/win32/vc6/zipsplit.dsp delete mode 100644 third_party/infozip/zip/win32/vc6bz2/ReadVCBZ.txt delete mode 100644 third_party/infozip/zip/win32/vc6bz2/zip.dsp delete mode 100644 third_party/infozip/zip/win32/vc6bz2/zip.dsw delete mode 100644 third_party/infozip/zip/win32/win32.c delete mode 100644 third_party/infozip/zip/win32/win32i64.c delete mode 100644 third_party/infozip/zip/win32/win32zip.c delete mode 100644 third_party/infozip/zip/win32/win32zip.h delete mode 100644 third_party/infozip/zip/win32/zip.def delete mode 100644 third_party/infozip/zip/win32/zip.rc delete mode 100644 third_party/infozip/zip/win32/zipup.h delete mode 100644 third_party/infozip/zip/windll/VBz64/VBZIP.VBP delete mode 100644 third_party/infozip/zip/windll/VBz64/VBZIP.vbw delete mode 100644 third_party/infozip/zip/windll/VBz64/VBZipBas.bas delete mode 100644 third_party/infozip/zip/windll/VBz64/Vbzipfrm.frm delete mode 100644 third_party/infozip/zip/windll/VBz64/readVB64.txt delete mode 100644 third_party/infozip/zip/windll/Vb/VBZIP.vbw delete mode 100644 third_party/infozip/zip/windll/Vb/VBZipBas.bas delete mode 100644 third_party/infozip/zip/windll/Vb/Vbzip.vbp delete mode 100644 third_party/infozip/zip/windll/Vb/Vbzipfrm.frm delete mode 100644 third_party/infozip/zip/windll/Vb/readmeVB.txt delete mode 100644 third_party/infozip/zip/windll/contents delete mode 100644 third_party/infozip/zip/windll/example.c delete mode 100644 third_party/infozip/zip/windll/example.h delete mode 100644 third_party/infozip/zip/windll/structs.h delete mode 100644 third_party/infozip/zip/windll/visualc/dll/zip32z64.dsp delete mode 100644 third_party/infozip/zip/windll/visualc/dll/zip32z64.dsw delete mode 100644 third_party/infozip/zip/windll/visualc/lib/zip32z64.dsp delete mode 100644 third_party/infozip/zip/windll/visualc/lib/zip32z64.dsw delete mode 100644 third_party/infozip/zip/windll/windll.aps delete mode 100644 third_party/infozip/zip/windll/windll.c delete mode 100644 third_party/infozip/zip/windll/windll.h delete mode 100644 third_party/infozip/zip/windll/windll.rc delete mode 100644 third_party/infozip/zip/windll/windll.txt delete mode 100644 third_party/infozip/zip/windll/windll16.def delete mode 100644 third_party/infozip/zip/windll/windll32.def delete mode 100644 third_party/infozip/zip/windll/ziplib.def delete mode 100644 third_party/infozip/zip/zip.txt delete mode 100644 third_party/infozip/zip/zip30.ann delete mode 100644 third_party/infozip/zip/zip30f.ann delete mode 100644 third_party/infozip/zip/zip30g.ann delete mode 100644 third_party/infozip/zip/zip30h.ann delete mode 100644 third_party/infozip/zip/zipcloak.txt delete mode 100644 third_party/infozip/zip/zipnote.txt delete mode 100644 third_party/infozip/zip/zipsplit.txt diff --git a/Makefile b/Makefile index 59c725068..28227a103 100644 --- a/Makefile +++ b/Makefile @@ -139,6 +139,7 @@ include third_party/lua/lua.mk include third_party/sqlite3/sqlite3.mk include third_party/quickjs/quickjs.mk include third_party/lz4cli/lz4cli.mk +include third_party/infozip/infozip.mk include tool/build/lib/buildlib.mk include third_party/chibicc/chibicc.mk include third_party/chibicc/test/test.mk diff --git a/third_party/infozip/infozip.mk b/third_party/infozip/infozip.mk new file mode 100644 index 000000000..74a572f12 --- /dev/null +++ b/third_party/infozip/infozip.mk @@ -0,0 +1,134 @@ +#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ +#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ +PKGS += THIRD_PARTY_ZIP + +THIRD_PARTY_ZIP_FILES = $(wildcard third_party/infozip/zip/*) third_party/infozip/zip/unix/unix.c +THIRD_PARTY_ZIP_SRCS_C = $(filter %.c,$(THIRD_PARTY_ZIP_FILES)) +THIRD_PARTY_ZIP = $(THIRD_PARTY_ZIP_COMS) $(THIRD_PARTY_ZIP_COMS:%=%.dbg) + +THIRD_PARTY_ZIP_COMS = \ + o/$(MODE)/third_party/infozip/zip.com \ + o/$(MODE)/third_party/infozip/zipsplit.com \ + o/$(MODE)/third_party/infozip/zipnote.com \ + o/$(MODE)/third_party/infozip/zipcloak.com + +THIRD_PARTY_ZIP_OBJS = $(sort \ + $(THIRD_PARTY_ZIP_COM_OBJS) \ + $(THIRD_PARTY_ZIPCLOAK_OBJS) \ + $(THIRD_PARTY_ZIPNOTE_OBJS) \ + $(THIRD_PARTY_ZIPSPLIT_OBJS) \ + ) + +THIRD_PARTY_ZIP_UTIL_OBJS1 = \ + o/$(MODE)/third_party/infozip/zip/globals.o \ + o/$(MODE)/third_party/infozip/zip/unix/unix_.o \ + o/$(MODE)/third_party/infozip/zip/zipfile_.o \ + o/$(MODE)/third_party/infozip/zip/fileio_.o \ + o/$(MODE)/third_party/infozip/zip/util_.o + +THIRD_PARTY_ZIP_UTIL_OBJS2 = \ + o/$(MODE)/third_party/infozip/zip/crypt_.o \ + o/$(MODE)/third_party/infozip/zip/crc32_.o + +THIRD_PARTY_ZIP_UTIL_OBJS = \ + $(THIRD_PARTY_ZIP_UTIL_OBJS1) \ + $(THIRD_PARTY_ZIP_UTIL_OBJS2) + +THIRD_PARTY_ZIP_COM_OBJS = \ + o/$(MODE)/third_party/infozip/zip/zip.o \ + o/$(MODE)/third_party/infozip/zip/zipfile.o \ + o/$(MODE)/third_party/infozip/zip/zipup.o \ + o/$(MODE)/third_party/infozip/zip/fileio.o \ + o/$(MODE)/third_party/infozip/zip/util.o \ + o/$(MODE)/third_party/infozip/zip/globals.o \ + o/$(MODE)/third_party/infozip/zip/crypt.o \ + o/$(MODE)/third_party/infozip/zip/ttyio.o \ + o/$(MODE)/third_party/infozip/zip/unix/unix.o \ + o/$(MODE)/third_party/infozip/zip/crc32.o \ + o/$(MODE)/third_party/infozip/zip/zbz2err.o \ + o/$(MODE)/third_party/infozip/zip/deflate.o \ + o/$(MODE)/third_party/infozip/zip/trees.o + +THIRD_PARTY_ZIPSPLIT_OBJS = \ + o/$(MODE)/third_party/infozip/zip/zipsplit.o \ + $(THIRD_PARTY_ZIP_UTIL_OBJS1) + +THIRD_PARTY_ZIPNOTE_OBJS = \ + o/$(MODE)/third_party/infozip/zip/zipnote.o \ + $(THIRD_PARTY_ZIP_UTIL_OBJS1) + +THIRD_PARTY_ZIPCLOAK_OBJS = \ + o/$(MODE)/third_party/infozip/zip/zipcloak.o \ + o/$(MODE)/third_party/infozip/zip/ttyio.o \ + $(THIRD_PARTY_ZIP_UTIL_OBJS1) \ + $(THIRD_PARTY_ZIP_UTIL_OBJS2) + +THIRD_PARTY_ZIP_LARGE_OBJS = \ + o/$(MODE)/third_party/infozip/zip/zip.o \ + o/$(MODE)/third_party/infozip/zip/zipsplit.o \ + o/$(MODE)/third_party/infozip/zip/fileio.o \ + o/$(MODE)/third_party/infozip/zip/fileio_.o + +o/$(MODE)/third_party/infozip/zip/%_.o: third_party/infozip/zip/%.c + @$(COMPILE) -AOBJECTIFY.c $(OBJECTIFY.c) $(OUTPUT_OPTION) -DUTIL $< + +$(THIRD_PARTY_ZIP_OBJS): \ + OVERRIDE_CFLAGS += \ + -DUNIX \ + -DMMAP \ + -DUNICODE_SUPPORT \ + -DUSE_EF_UT_TIME \ + -DLARGE_FILE_SUPPORT \ + -DHAVE_DIRENT_H \ + -DHAVE_TERMIOS_H \ + -DNO_BZIP2_SUPPORT + +$(THIRD_PARTY_ZIP_LARGE_OBJS): \ + OVERRIDE_CFLAGS += -DSTACK_FRAME_UNLIMITED + +THIRD_PARTY_ZIP_DIRECTDEPS = \ + LIBC_ERRNO \ + LIBC_LIMITS \ + LIBC_ALG \ + LIBC_FMT \ + LIBC_STR \ + LIBC_MEM \ + LIBC_LOG \ + LIBC_CALLS \ + LIBC_STDIO \ + LIBC_TIME \ + LIBC_UNICODE + +THIRD_PARTY_ZIP_DEPS := \ + $(call uniq,$(foreach x,$(THIRD_PARTY_ZIP_DIRECTDEPS),$($(x)))) + +o/$(MODE)/third_party/infozip/zip.com.dbg: \ + $(THIRD_PARTY_ZIP_DEPS) \ + $(THIRD_PARTY_ZIP_COM_OBJS) \ + $(CRT) \ + $(APE) + @$(APELINK) + +o/$(MODE)/third_party/infozip/zipsplit.com.dbg: \ + $(THIRD_PARTY_ZIP_DEPS) \ + $(THIRD_PARTY_ZIPSPLIT_OBJS) \ + $(CRT) \ + $(APE) + @$(APELINK) + +o/$(MODE)/third_party/infozip/zipnote.com.dbg: \ + $(THIRD_PARTY_ZIP_DEPS) \ + $(THIRD_PARTY_ZIPNOTE_OBJS) \ + $(CRT) \ + $(APE) + @$(APELINK) + +o/$(MODE)/third_party/infozip/zipcloak.com.dbg: \ + $(THIRD_PARTY_ZIP_DEPS) \ + $(THIRD_PARTY_ZIPCLOAK_OBJS) \ + $(CRT) \ + $(APE) + @$(APELINK) + +.PHONY: o/$(MODE)/third_party/infozip +o/$(MODE)/third_party/infozip: $(THIRD_PARTY_ZIP) diff --git a/third_party/infozip/zip/Betas_Readme.txt b/third_party/infozip/zip/Betas_Readme.txt deleted file mode 100644 index 26e965ecc..000000000 --- a/third_party/infozip/zip/Betas_Readme.txt +++ /dev/null @@ -1,17 +0,0 @@ -Betas are works in progress. When a beta has a seemingly stable set -of features, we may post a public beta so outside developers can see -where the code is going and make contributions or comment. - -A Release Candidate is a beta that we believe has the full feature -set that will be released. It's still being tested, and things can -still change, but we thought it close when we posted it. - -We take suggestions, bug fixes, and patches at any time, so send them in. - -We make no guarantees as to the state of betas so use at your own risk. -All code, including releases, are released under the Info-ZIP license. - -Enjoy! - -Ed Gordon -20 April 2008 diff --git a/third_party/infozip/zip/acorn/GMakefile b/third_party/infozip/zip/acorn/GMakefile deleted file mode 100644 index 01842c4c2..000000000 --- a/third_party/infozip/zip/acorn/GMakefile +++ /dev/null @@ -1,130 +0,0 @@ -# Makefile for Zip, ZipNote, ZipCloak and ZipSplit - -# add -g to CC to debug -# add -d to BIND to debug -CC = gcc -mlibscl -BIND = $(CC) -AS = $(CC) -c -ASM = AS -SQUEEZE = squeeze -v -E = - -# flags -# CFLAGS flags for C compile -# LFLAGS1 flags after output file spec, before obj file list -# LFLAGS2 flags after obj file list (libraries, etc) -# -LIB = -CFLAGS = -O2 -mthrowback -DASMV -ASMFLAGS = -throwback -objasm -upper -LFLAGS1 = -LFLAGS2 = $(LIB) - -# Uncomment the following line to enable support for Unix -# Extra Field (Timezone) -#CFLAGS = $(CFLAGS) -DUSE_EF_UT_TIME - -# object file lists -OBJZ = o.zip o.zipfile o.zipup o.fileio o.util o.globals o.crc32 \ - o.crypt o.ttyio o.riscos o.acornzip o.swiven - -OBJI = o.deflate o.trees -OBJA = o.match o.sendbits -OBJU = o.zipfile_ o.fileio_ o.util_ o.globals o.riscos o.acornzip_ o.swiven -OBJN = o.zipnote $(OBJU) -OBJC = o.zipcloak $(OBJU) o.crc32_ o.crypt_ o.ttyio -OBJS = o.zipsplit $(OBJU) - -ZIP_H = h.zip h.ziperr h.tailor acorn.h.osdep acorn.h.riscos acorn.h.swiven - -all: zip zipnote zipsplit zipcloak - -install: %.zip %.zipnote %.zipsplit %.zipcloak %.acorn.zipsfx \ - zip zipnote zipsplit zipcloak acorn.zipsfx - $(SQUEEZE) zip %.zip - $(SQUEEZE) zipnote %.zipnote - $(SQUEEZE) zipsplit %.zipsplit - $(SQUEEZE) zipcloak %.zipcloak - copy acorn.zipsfx %.zipsfx ~CVF - -# rules for zip, zipnote, zipcloak and zipsplit - -o.api: c.api - $(CC) $(CFLAGS) -c c.api -o o.api -o.crc32: c.crc32 $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -c c.crc32 -o o.crc32 -o.crypt: c.crypt $(ZIP_H) h.crypt h.crc32 h.ttyio - $(CC) $(CFLAGS) -c c.crypt -o o.crypt -o.deflate: c.deflate $(ZIP_H) - $(CC) $(CFLAGS) -c c.deflate -o o.deflate -o.fileio: c.fileio $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -c c.fileio -o o.fileio -o.globals: c.globals $(ZIP_H) - $(CC) $(CFLAGS) -c c.globals -o o.globals -o.mktime: c.mktime - $(CC) $(CFLAGS) -c c.mktime -o o.mktime -o.trees: c.trees $(ZIP_H) - $(CC) $(CFLAGS) -c c.trees -o o.trees -o.ttyio: c.ttyio $(ZIP_H) h.crypt - $(CC) $(CFLAGS) -c c.ttyio -o o.ttyio -o.util: c.util $(ZIP_H) - $(CC) $(CFLAGS) -c c.util -o o.util -o.zip: c.zip $(ZIP_H) h.crc32 h.crypt h.revision h.ttyio - $(CC) $(CFLAGS) -c c.zip -o o.zip -o.zipcloak: c.zipcloak $(ZIP_H) h.crc32 h.crypt h.revision h.ttyio - $(CC) $(CFLAGS) -c c.zipcloak -o o.zipcloak -o.zipfile: c.zipfile $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -c c.zipfile -o o.zipfile -o.zipnote: c.zipnote $(ZIP_H) h.revision - $(CC) $(CFLAGS) -c c.zipnote -o o.zipnote -o.zipsplit: c.zipsplit $(ZIP_H) h.revision - $(CC) $(CFLAGS) -c c.zipsplit -o o.zipsplit -o.zipup: c.zipup $(ZIP_H) h.crc32 h.crypt h.revision - $(CC) $(CFLAGS) -c c.zipup -o o.zipup - -o.crc32_: c.crc32 $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -DUTIL -c c.crc32 -o o.crc32_ -o.crypt_: c.crypt $(ZIP_H) h.crypt h.crc32 h.ttyio - $(CC) $(CFLAGS) -DUTIL -c c.crypt -o o.crypt_ -o.util_: c.util $(ZIP_H) - $(CC) $(CFLAGS) -DUTIL -c c.util -o o.util_ -o.fileio_: c.fileio $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -DUTIL -c c.fileio -o o.fileio_ -o.zipfile_: c.zipfile $(ZIP_H) h.crc32 - $(CC) $(CFLAGS) -DUTIL -c c.zipfile -o o.zipfile_ -o.acornzip_: acorn.c.acornzip $(ZIP_H) - $(CC) $(CFLAGS) -I@ -DUTIL -c acorn.c.acornzip -o o.acornzip_ - -o.riscos: acorn.c.riscos acorn.h.riscos $(ZIP_H) - $(CC) $(CFLAGS) -I@ -c acorn.c.riscos -o o.riscos - -o.acornzip: acorn.c.acornzip $(ZIP_H) - $(CC) $(CFLAGS) -I@ -c acorn.c.acornzip -o o.acornzip - -o.match: acorn.s.match - $(ASM) $(ASMFLAGS) -I@ acorn.s.match -o o.match - -o.sendbits: acorn.s.sendbits - $(ASM) $(ASMFLAGS) -I@ acorn.s.sendbits -o o.sendbits - -o.swiven: acorn.s.swiven - $(ASM) $(ASMFLAGS) -I@ acorn.s.swiven -o o.swiven - -zip: $(OBJZ) $(OBJI) $(OBJA) - $(BIND) -o zip$(E) $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) -zipnote: $(OBJN) - $(BIND) -o zipnote$(E) $(LFLAGS1) $(OBJN) $(LFLAGS2) -zipcloak: $(OBJC) - $(BIND) -o zipcloak$(E) $(LFLAGS1) $(OBJC) $(LFLAGS2) -zipsplit: $(OBJS) - $(BIND) -o zipsplit$(E) $(LFLAGS1) $(OBJS) $(LFLAGS2) - -clean: - remove zip - remove zipcloak - remove zipsplit - remove zipnote - create o.!fake! 0 - wipe o.* ~cf - -# end of Makefile diff --git a/third_party/infozip/zip/acorn/ReadMe b/third_party/infozip/zip/acorn/ReadMe deleted file mode 100644 index 41c37a5d0..000000000 --- a/third_party/infozip/zip/acorn/ReadMe +++ /dev/null @@ -1,85 +0,0 @@ -Acorn-specific compile instructions ------------------------------------ - -Use the "RunMe1st" file (it is an Obey file) to convert all the files from -"filename/[chs]" to "[chs].filename" (so that zip could be easily compiled -under RISC OS). It will also set the correct makefile. - -To compile just set the CSD to the main zip directory and run 'amu'. - -Currently only the Acorn C V5 compiler has been tested but probably also -Acorn C V4 and the Acorn Assembler V2 will be able to compile zip. - -The default makefile is configured without the support for the -Extended Timestamp Extra Field. If you wan to enable it you have to -add "-DUSE_EF_UT_TIME" to CFLAGS (see makefile). Without the Extended -Timestamp Field support, zipfiles created by zip are identical to the -zipfiles created by SparkFS. However, the Extended Timestamp Field can -be useful if you are going to unzip your zipfiles on a non-RISC OS machine -since the correct time stamp will be preserved across different timezones. -Note that in this case, both the SparkFS Extra Field and the Extended -Timestamp Extra Field will be used, so the zipfiles will still be fully -compatible with SparkFS and with the RISC OS version of unzip. - -The executables-only distributions will be compiled without the support for -the Extended Timestamp Extra Field. If you need it but you can't compile zip -yourself, you can contact the authors at the Info-ZIP address who will do it -for you. - - -Acorn-specific usage instructions ---------------------------------- - -An extra option ('I') has been added to the Acorn port: if it is specified -zip will not consider Image files (eg. DOS partitions or Spark archives when -SparkFS is loaded) as directories but will store them as single files. This -means that if you have, say, SparkFS loaded, zipping a Spark archive will -result in a zipfile containing a directory (and its content) while using the -'I' option will result in a zipfile containing a Spark archive. Obviously -this second case will also be obtained (without the 'I' option) if SparkFS -isn't loaded. - -When adding files to a zipfile; to maintain FileCore compliance, all -files named "file/ext" will be added to the archive as "file.ext". -This presents no problem if you wish to use unzip to extract them on any -other machine, as the files are correctly named. This also presents no -problem if you use unzip for RISC OS, as the files are converted back to -"file/ext" format. The only problem appears when you use SparkFS to -decompress the files, as a file called "file.ext" will be extracted as -"file_ext", not what it was added as. You must be careful about this. - -Case Specific. Depending on how you type the command, files will be added -exactly as named; in this example: -*zip new/zip newfile -*zip new/zip NewFile -*zip new/zip NEWFILE -will create an archive containing 3 copies of the same Risc OS file 'newfile' -called 'newfile', 'NewFile' and 'NEWFILE'. Please be careful. - -The Acorn port conserves file attributes, including filetype, so if you -zip on an Acorn, and unzip on another Acorn, filetypes will be maintained -precisely as if you used uncompressed files. If you de-archive on another -machine (PC, Mac, Unix etc..), filetypes will be ignored, but the files -will be identical despite this. This feature is fully compatible with -SparkFS, so zipfiles created by zip will be correctly uncompressed (including -filetype, etc.) by SparkFS. - -An additional feature went into this port to cope better with C-code -and extensions. This allows the acorn files "c.foo" to be added to the -archive as "foo/c", eventually appearing in the archive as "foo.c", allowing -for better handling of C or C++ code. Example: -*Set Zip$Exts "dir1:dir2:dir3" -*zip new/zip dir1.file -*zip new/zip dir2.help -*zip new/zip dir3.textfile -Creates a zipfile new/zip, with entries file.dir1, help.dir2, textfile.dir3. -The usual settings for Zip$Exts are "h:o:s:c", allowing C code to be added -to the archive in standard form. - -A final note about the Acorn port regards the use of the 'n' option: this is -used to specify a list of suffixes that will not be compressed (eg. .ZIP, -since it is already a compressed file). Since RISC OS uses filetypes instead -of suffixes, this list of suffixes is actually considered as a list of -filetypes (3 hex digit format). By default, zip doesn't compress filetypes -DDC (Archive, Spark or Zip), D96 (CFS files) and 68E (PackDir). - diff --git a/third_party/infozip/zip/acorn/ReadMe.GMakefile b/third_party/infozip/zip/acorn/ReadMe.GMakefile deleted file mode 100644 index 8762cdb3e..000000000 --- a/third_party/infozip/zip/acorn/ReadMe.GMakefile +++ /dev/null @@ -1,16 +0,0 @@ -GMakefile is for use with Acorn RISC OS and the forthcoming -post-Acorn RISC OS for the compilation of both the current release and -development versions of zip. - -It is recommended that you use gcc 2.95.4 or higher and you will need a -suitable 'make' utility. Both are available from -. - -You will need the files gcc.zip and cc1.zip for the C compiler with the -documentation available in the gccdoc.zip archive. GNU make can be -found in the utils.zip archive, although most versions of 'make' should be -fine. - -When using gcc, check RunMe1st for two lines which need uncommenting. - - diff --git a/third_party/infozip/zip/acorn/RunMe1st b/third_party/infozip/zip/acorn/RunMe1st deleted file mode 100644 index a330adb8e..000000000 --- a/third_party/infozip/zip/acorn/RunMe1st +++ /dev/null @@ -1,23 +0,0 @@ -| This Obey file prepares the zip port for a Desktop C re-compile. -| Run it and it will copy all the needed files into the correct -| place. - -| Set the correct type of 'srcrename' so that the only requirement -| for the user is to set 'RunMe1st' to Obey -SetType .srcrename FF8 - -| Run 'srcrename' on the main zip directory with recursion enabled -/.srcrename -r -e c:h:s:o .^ - -| Create the 'o' directory -CDir .^.o - -| Put the Makefile in its correct place and set the correct filetype -Copy .makefile .^.makefile ~C ~V F - -| Uncomment the following lines if you're using gcc -|| Put the Makefile in its correct place and set the correct filetype -|Copy .GMakefile .^.makefile ~C~VF - -SetType .^.makefile FE1 -SetType .zipsfx Obey diff --git a/third_party/infozip/zip/acorn/acornzip.c b/third_party/infozip/zip/acorn/acornzip.c deleted file mode 100644 index 40debc092..000000000 --- a/third_party/infozip/zip/acorn/acornzip.c +++ /dev/null @@ -1,592 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -#include -#include -#include "zip.h" - -#ifndef UTIL - -#define PAD 0 -#define PATH_END '/' - - -local int wild_recurse(char *whole, char *wildtail); -local int uxtime2acornftime(unsigned *pexadr, unsigned *pldadr, time_t ut); - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -char *readd(DIR *d) -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return (e == NULL ? (char *) NULL : e->d_name); -} - -/* What we have here is a mostly-generic routine using opend()/readd() and */ -/* isshexp()/MATCH() to find all the files matching a multi-part filespec */ -/* using the portable pattern syntax. It shouldn't take too much fiddling */ -/* to make it usable for any other platform that has directory hierarchies */ -/* but no shell-level pattern matching. It works for patterns throughout */ -/* the pathname, such as "foo:*.?/source/x*.[ch]". */ - -/* whole is a pathname with wildcards, wildtail points somewhere in the */ -/* middle of it. All wildcards to be expanded must come AFTER wildtail. */ - -local int wild_recurse(whole, wildtail) char *whole; char *wildtail; -{ - DIR *dir; - char *subwild, *name, *newwhole = NULL, *glue = NULL, plug = 0, plug2; - ush newlen, amatch = 0; - struct stat statb; - int disk_not_mounted=0; - int e = ZE_MISS; - - if (!isshexp(wildtail)) { - if (stat(whole,&statb)==0 && (statb.st_mode & S_IREAD)!=0) { - return procname(whole, 0); - } else - return ZE_MISS; /* woops, no wildcards! */ - } - - /* back up thru path components till existing dir found */ - do { - name = wildtail + strlen(wildtail) - 1; - for (;;) - if (name-- <= wildtail || *name == '.') { - subwild = name + 1; - plug2 = *subwild; - *subwild = 0; - break; - } - if (glue) - *glue = plug; - glue = subwild; - plug = plug2; - dir = opendir(whole); - } while (!dir && !disk_not_mounted && subwild > wildtail); - wildtail = subwild; /* skip past non-wild components */ - - if ((subwild = strchr(wildtail + 1, '.')) != NULL) { - /* this "+ 1" dodges the ^^^ hole left by *glue == 0 */ - *(subwild++) = 0; /* wildtail = one component pattern */ - newlen = strlen(whole) + strlen(subwild) + 32; - } else - newlen = strlen(whole) + 31; - if (!dir || !(newwhole = malloc(newlen))) { - if (glue) - *glue = plug; - e = dir ? ZE_MEM : ZE_MISS; - goto ohforgetit; - } - strcpy(newwhole, whole); - newlen = strlen(newwhole); - if (glue) - *glue = plug; /* repair damage to whole */ - if (!isshexp(wildtail)) { - e = ZE_MISS; /* non-wild name not found */ - goto ohforgetit; - } - - while (name = readd(dir)) { - if (MATCH(wildtail, name, 0)) { - strcpy(newwhole + newlen, name); - if (subwild) { - name = newwhole + strlen(newwhole); - *(name++) = '.'; - strcpy(name, subwild); - e = wild_recurse(newwhole, name); - } else - e = procname(newwhole, 0); - newwhole[newlen] = 0; - if (e == ZE_OK) - amatch = 1; - else if (e != ZE_MISS) - break; - } - } - - ohforgetit: - if (dir) closedir(dir); - if (subwild) *--subwild = '.'; - if (newwhole) free(newwhole); - if (e == ZE_MISS && amatch) - e = ZE_OK; - return e; -} - -int wild(p) -char *p; -{ - char *path; - int toret; - - /* special handling of stdin request */ - if (strcmp(p, "-") == 0) /* if compressing stdin */ - return newname(p, 0, 0); - - path=p; - if (strchr(p, ':')==NULL && *p!='@') { - if (!(path=malloc(strlen(p)+3))) { - return ZE_MEM; - } - strcpy(path,"@."); - strcat(path,p); - } - - toret=wild_recurse(path, path); - - if (path!=p) { - free(path); - } - return toret; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '.') - strcpy(a, "."); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - char *tmp; - int dosflag; - char *lastlastdir=NULL; /* pointer to 2 dirs before... */ - char *lastdir=NULL; /* pointer to last dir... */ - - /* Malloc space for internal name and copy it */ - if ((tmp = malloc(strlen(x) + 1)) == NULL) - return NULL; - strcpy(tmp, x); - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - for(t=tmp;*t;t++) { - if (*t=='/') { - *t='.'; - } - else if (*t=='.') { - *t='/'; - lastlastdir=lastdir; - lastdir=t+1; - } - } - - t=strchr(tmp,'$'); /* skip FS name */ - if (t!=NULL) - t+=2; /* skip '.' after '$' */ - else - t=tmp; - if (*t=='@') /* skip @. at the beginning of filenames */ - t+=2; - - /* Make changes, if any, to the copied name (leave original intact) */ - - /* return a pointer to '\0' if the file is a directory with the same - same name as an extension to swap (eg. 'c', 'h', etc.) */ - if (isdir && exts2swap!=NULL) { - if (lastlastdir==NULL) - lastlastdir=t; - if (checkext(lastlastdir)) { - free((void *)tmp); - n=malloc(1); - if (n!=NULL) - *n='\0'; - return n; - } - } - - if (exts2swap!=NULL && lastdir!=NULL) { - if (lastlastdir==NULL) - lastlastdir=t; - if (checkext(lastlastdir)) { - if (swapext(lastlastdir,lastdir-1)) { - free((void *)tmp); - return NULL; - } - } - } - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) { - free((void *)tmp); - return NULL; - } - strcpy(n, t); - - free((void *)tmp); - - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - char *t; /* scans name */ - char *lastext=NULL; /* pointer to last extension */ - char *lastdir=NULL; /* pointer to last dir */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - - for(t=x;*t;t++) { - if (*t=='.') { - *t='/'; - lastext=t+1; - } - else if (*t=='/') { - *t='.'; - lastdir=t+1; - } - } - - if (exts2swap!=NULL && (int)lastext>(int)lastdir) { - if (lastdir==NULL) - lastdir=x; - if (checkext(lastext)) { - if (swapext(lastdir,lastext-1)) { - free((void *)x); - return NULL; - } - } - } - - return x; -} - -local int uxtime2acornftime(unsigned *pexadr, unsigned *pldadr, time_t ut) -{ - unsigned timlo; /* 3 lower bytes of acorn file-time plus carry byte */ - unsigned timhi; /* 2 high bytes of acorn file-time */ - - timlo = ((unsigned)ut & 0x00ffffffU) * 100 + 0x00996a00U; - timhi = ((unsigned)ut >> 24); - timhi = timhi * 100 + 0x0000336eU + (timlo >> 24); - if (timhi & 0xffff0000U) - return 1; /* calculation overflow, do not change time */ - - /* insert the five time bytes into loadaddr and execaddr variables */ - *pexadr = (timlo & 0x00ffffffU) | ((timhi & 0x000000ffU) << 24); - *pldadr = (*pldadr & 0xffffff00U) | ((timhi >> 8) & 0x000000ffU); - - return 0; /* subject to future extension to signal overflow */ -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - time_t m_time; - unsigned int loadaddr, execaddr; - int attr; - - /* Convert DOS time to time_t format in m_time */ - m_time = dos2unixtime(d); - - /* set the file's modification time */ - SWI_OS_File_5(f,NULL,&loadaddr,NULL,NULL,&attr); - - if (uxtime2acornftime(&execaddr, &loadaddr, m_time) != 0) - return; - - SWI_OS_File_1(f,loadaddr,execaddr,attr); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - unsigned int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '.') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (strcmp(f, "-") == 0) { - /* forge stat values for stdin since Amiga and RISCOS have no fstat() */ - s.st_mode = (S_IREAD|S_IWRITE|S_IFREG); - s.st_size = -1; - s.st_mtime = time(&s.st_mtime); - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - if ((s.st_mode & S_IFDIR) != 0) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime((time_t *) &s.st_mtime); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; -{ -#ifdef USE_EF_UT_TIME - char *eb_ptr; -#endif /* USE_EF_UT_TIME */ - char *name; - extra_block *block; - -#define EB_SPARK_LEN 20 -#define EB_SPARK_SIZE (EB_HEADSIZE+EB_SPARK_LEN) -#ifdef USE_EF_UT_TIME -# ifdef IZ_CHECK_TZ -# define EB_UTTIME_SIZE (zp_tz_is_valid ? EB_HEADSIZE+EB_UT_LEN(1) : 0) -# else -# define EB_UTTIME_SIZE (EB_HEADSIZE+EB_UT_LEN(1)) -# endif -#else -# define EB_UTTIME_SIZE 0 -#endif -#define EF_SPARK_TOTALSIZE (EB_SPARK_SIZE + EB_UTTIME_SIZE) - - if ((name=(char *)malloc(strlen(z->name)+1))==NULL) { - fprintf(stderr," set_extra_field: not enough memory for directory name\n"); - return ZE_MEM; - } - - strcpy(name,z->name); - - if (name[strlen(name)-1]=='.') { /* remove the last '.' in directory names */ - name[strlen(name)-1]=0; - } - - z->extra=(char *)malloc(EF_SPARK_TOTALSIZE); - if (z->extra==NULL) { - fprintf(stderr," set_extra_field: not enough memory\n"); - free(name); - return ZE_MEM; - } - z->cextra = z->extra; - z->cext = z->ext = EF_SPARK_TOTALSIZE; - - block=(extra_block *)z->extra; - block->ID=SPARKID; - block->size=EB_SPARK_LEN; - block->ID_2=SPARKID_2; - block->zero=0; - - if (SWI_OS_File_5(name,NULL,&block->loadaddr,&block->execaddr, - NULL,&block->attr) != NULL) { - fprintf(stderr," OS error while set_extra_field of %s\n",name); - } - - free(name); - -#ifdef USE_EF_UT_TIME -# ifdef IZ_CHECK_TZ - if (zp_tz_is_valid) { -# endif - eb_ptr = z->extra + EB_SPARK_SIZE; - - eb_ptr[0] = 'U'; - eb_ptr[1] = 'T'; - eb_ptr[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - eb_ptr[3] = 0; - eb_ptr[4] = EB_UT_FL_MTIME; - eb_ptr[5] = (char)(z_utim->mtime); - eb_ptr[6] = (char)(z_utim->mtime >> 8); - eb_ptr[7] = (char)(z_utim->mtime >> 16); - eb_ptr[8] = (char)(z_utim->mtime >> 24); -# ifdef IZ_CHECK_TZ - } -# endif -#endif /* USE_EF_UT_TIME */ - - return ZE_OK; -} - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; - - printf(CompiledWith, -#ifdef __GNUC__ - "gcc ", __VERSION__, -#else -# ifdef __CC_NORCROFT - "Norcroft ", "cc", -# else - "cc", "", -# endif -#endif - - "RISC OS", - - " (Acorn Computers Ltd)", - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/acorn/makefile b/third_party/infozip/zip/acorn/makefile deleted file mode 100644 index 323ffca7c..000000000 --- a/third_party/infozip/zip/acorn/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# Makefile for Zip, ZipNote, ZipCloak and ZipSplit - -# add -g to CC to debug -# add -d to BIND to debug -CC = cc -BIND = link -AS = $(CC) -c -ASM = objasm -SQUEEZE = squeeze -v -E = - -# flags -# CFLAGS flags for C compile -# LFLAGS1 flags after output file spec, before obj file list -# LFLAGS2 flags after obj file list (libraries, etc) -# -LIB = -CBASE = -throwback -wn -DASMV -apcs 3/26 -CFLAGS = $(CBASE) -IC:,@. -ASMFLAGS = -Throwback -Stamp -NoCache -CloseExec -quit -apcs 3/26 -LFLAGS1 = -LFLAGS2 = $(LIB) C:o.Stubs - -# Uncomment the following line to enable support for Unix -# Extra Field (Timezone) -#CFLAGS = $(CFLAGS) -DUSE_EF_UT_TIME - -# object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crc32.o \ - crypt.o ttyio.o riscos.o acornzip.o swiven.o - -OBJI = deflate.o trees.o -OBJA = match.o sendbits.o -OBJU = zipfile_.o fileio_.o util_.o globals.o riscos.o acornzip_.o swiven.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h acorn/osdep.h acorn/riscos.h acorn/swiven.h - -all: zip zipnote zipsplit zipcloak - - -install: %.zip %.zipnote %.zipsplit %.zipcloak %.zipsfx \ - zip zipnote zipsplit zipcloak zipsfx - $(SQUEEZE) zip %.zip - $(SQUEEZE) zipnote %.zipnote - $(SQUEEZE) zipsplit %.zipsplit - $(SQUEEZE) zipcloak %.zipcloak - copy acorn.zipsfx %.zipsfx ~CVF - -# suffix rules -.SUFFIXES: _.o .o .c -.c_.o: - $(CC) $(CFLAGS) -DUTIL -c $*.c -o $*_.o -.c.o: - $(CC) $(CFLAGS) -c $< -.s.o: - $(ASM) $(ASMFLAGS) -from @*.s -to @*.o - -# rules for zip, zipnote, zipcloak and zipsplit -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h - -crc32_.o: crc32.c - $(CC) $(CFLAGS) -DUTIL -c c.crc32 -o o.crc32_ -crypt_.o: crypt.c - $(CC) $(CFLAGS) -DUTIL -c c.crypt -o o.crypt_ -util_.o: util.c - $(CC) $(CFLAGS) -DUTIL -c c.util -o o.util_ -fileio_.o: fileio.c - $(CC) $(CFLAGS) -DUTIL -c c.fileio -o o.fileio_ -zipfile_.o: zipfile.c - $(CC) $(CFLAGS) -DUTIL -c c.zipfile -o o.zipfile_ -acornzip_.o: acorn/acornzip.c $(ZIP_H) - $(CC) $(CFLAGS) -DUTIL -c acorn/acornzip.c -o o.acornzip_ - -riscos.o: acorn/riscos.c acorn/riscos.h - $(CC) $(CFLAGS) -c acorn/riscos.c - -acornzip.o: acorn/acornzip.c $(ZIP_H) - $(CC) $(CFLAGS) -c acorn/acornzip.c - -match.o: acorn/match.s - $(ASM) $(ASMFLAGS) -from acorn.s.match -to o.match - -sendbits.o: acorn/sendbits.s - $(ASM) $(ASMFLAGS) -from acorn.s.sendbits -to o.sendbits - -swiven.o: acorn/swiven.s - $(ASM) $(ASMFLAGS) -from acorn.s.swiven -to o.swiven - -zip: $(OBJZ) $(OBJI) $(OBJA) - $(BIND) -o zip$(E) $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) -zipnote: $(OBJN) - $(BIND) -o zipnote$(E) $(LFLAGS1) $(OBJN) $(LFLAGS2) -zipcloak: $(OBJC) - $(BIND) -o zipcloak$(E) $(LFLAGS1) $(OBJC) $(LFLAGS2) -zipsplit: $(OBJS) - $(BIND) -o zipsplit$(E) $(LFLAGS1) $(OBJS) $(LFLAGS2) - -clean: ;remove zip; remove zipcloak; - remove zipsplit; remove zipnote; - create o.!fake! 0 - wipe o.* ~cf - -# end of Makefile diff --git a/third_party/infozip/zip/acorn/match.s b/third_party/infozip/zip/acorn/match.s deleted file mode 100644 index ee68ce665..000000000 --- a/third_party/infozip/zip/acorn/match.s +++ /dev/null @@ -1,217 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; match.s for ARM by Sergio Monesi. - -r0 RN 0 -r1 RN 1 -r2 RN 2 -r3 RN 3 -r4 RN 4 -r5 RN 5 -r6 RN 6 -r7 RN 7 -r8 RN 8 -r9 RN 9 -sl RN 10 -fp RN 11 -ip RN 12 -sp RN 13 -lr RN 14 -pc RN 15 - -MAX_DIST EQU 32506 -WMASK EQU 32767 -MAX_MATCH EQU 258 - - AREA |C$$code|, CODE, READONLY - - -; r1 = chain_lenght -; r2 = scan -; r3 = match -; r4 = len (tmp) -; r5 = best_len -; r6 = limit -; r7 = strend -; r8 = scan_end1 -; r9 = scan_end -; lr = window -; fp = prev - -|__max_chain_length| - IMPORT max_chain_length - DCD max_chain_length -|__window| - IMPORT window - DCD window -|__prev| - IMPORT prev - DCD prev -|__prev_length| - IMPORT prev_length - DCD prev_length -|__strstart| - IMPORT strstart - DCD strstart -|__good_match| - IMPORT good_match - DCD good_match -|__nice_match| - IMPORT nice_match - DCD nice_match -|__match_start| - IMPORT match_start - DCD match_start - - DCB "longest_match" - DCB &00,&00,&00 - DCD &ff000010 - - EXPORT longest_match -longest_match - STMFD sp!, {r4-r9,fp,lr} - - LDR fp, [pc, #|__prev|-.-8] - - LDR r1, [pc, #|__max_chain_length|-.-8] - LDR r1, [r1] - LDR lr, [pc, #|__window|-.-8] - - LDR ip, [pc, #|__strstart|-.-8] - LDR ip, [ip] - ADD r2, lr, ip - LDR r5, [pc, #|__prev_length|-.-8] - LDR r5, [r5] - SUBS ip, ip, #MAX_DIST-250 ; if r6 > MAX_DIST - SUBCSS r6, ip, #250 ; r6 = r6 - MAXDIST - MOVLS r6, #0 ; else r6 = 0 - - ADD r7, r2, #MAX_MATCH-256 - ADD r7, r7, #256 ; r7 = r2 + MAX_MATCH (=258); - - SUB ip, r5, #1 - LDRB r8, [r2, ip] - LDRB r9, [r2, r5] - - LDR ip, [pc, #|__good_match|-.-8] - LDR ip, [ip] - CMP r5, ip - MOVCS r1, r1, LSR #2 - -cycle - ADD r3, lr, r0 - - LDRB ip, [r3, r5] - CMP ip, r9 - BNE cycle_end - - SUB ip, r5, #1 - LDRB ip, [r3, ip] - CMP ip, r8 - BNE cycle_end - - LDRB ip, [r2] - LDRB r4, [r3] - CMP ip, r4 - BNE cycle_end - - LDRB ip, [r3, #1] - LDRB r4, [r2, #1] - CMP ip, r4 - BNE cycle_end - - ADD r2, r2, #2 - ADD r3, r3, #2 - -inn_cycle - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - LDRB ip, [r2, #1]! - LDRB r4, [r3, #1]! - CMP ip, r4 - BNE exit_inn_cycle - - CMP r2, r7 - BCC inn_cycle - -exit_inn_cycle - SUB r4, r2, r7 ; len = MAX_MATCH - (int)(strend - scan); - ADD r4, r4, #MAX_MATCH-256 - ADD r4, r4, #256 - - SUB r2, r2, r4 ; scan = strend - MAX_MATCH - - CMP r4, r5 ; if (len > best_len) { - BLE cycle_end - - LDR ip, [pc, #|__match_start|-.-8] ; match_start = cur_match; - STR r0, [ip] - MOV r5, r4 ; best_len = len; - - LDR ip, [pc, #|__nice_match|-.-8] ; if (len >= nice_match) - LDR ip, [ip] - CMP r4, ip - BGE exit_match ; break; - - SUB ip, r5, #1 ; scan_end1 = scan[best_len-1]; - LDRB r8, [r2, ip] - LDRB r9, [r2, r5] ; scan_end = scan[best_len]; - -cycle_end - MOV ip, r0, LSL #17 ; cur_match & WMASK - MOV ip, ip, LSR #17 - - LDR r0, [fp, ip, ASL #1] ; cur_match = prev[cur_match & WMASK] - MOV r0, r0, ASL #16 - MOV r0, r0, LSR #16 - - CMP r0, r6 ; cur_match > limit - BLS exit_match - SUBS r1, r1, #1 ; --chain_length - BNE cycle ; chain_length != 0 - -exit_match - MOV r0, r5 - - LDMFD sp!, {r4-r9,fp,pc}^ - - END diff --git a/third_party/infozip/zip/acorn/osdep.h b/third_party/infozip/zip/acorn/osdep.h deleted file mode 100644 index 9f7783ebb..000000000 --- a/third_party/infozip/zip/acorn/osdep.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-4 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 -*/ -#include "riscos.h" - -#define RISCOS -#define NO_SYMLINKS -#define NO_FCNTL_H -#define NO_UNISTD_H -#define NO_MKTEMP - -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#define isatty(a) 1 -#define fseek(f,o,t) riscos_fseek((f),(o),(t)) - -#define localtime riscos_localtime -#define gmtime riscos_gmtime - -#ifdef ZCRYPT_INTERNAL -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */ -#endif diff --git a/third_party/infozip/zip/acorn/riscos.c b/third_party/infozip/zip/acorn/riscos.c deleted file mode 100644 index 84dd2d3d4..000000000 --- a/third_party/infozip/zip/acorn/riscos.c +++ /dev/null @@ -1,394 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -/* riscos.c */ - -#include -#include -#include -#include "zip.h" -#include "riscos.h" - -#define MAXEXT 256 - -/* External globals */ -extern int scanimage; - -/* Local globals (!?!?) */ -char *exts2swap = NULL; /* Extensions to swap (actually, directory names) */ - -int stat(char *filename,struct stat *res) -{ - int attr; /* object attributes */ - unsigned int load; /* load address */ - unsigned int exec; /* exec address */ - int type; /* type: 0 not found, 1 file, 2 dir, 3 image */ - - if (!res) - return -1; - - if (SWI_OS_File_5(filename,&type,&load,&exec,(int *)&res->st_size,&attr)!=NULL) - return -1; - - if (type==0) - return -1; - - res->st_dev=0; - res->st_ino=0; - res->st_nlink=0; - res->st_uid=1; - res->st_gid=1; - res->st_rdev=0; - res->st_blksize=1024; - - res->st_mode = ((attr & 0001) << 8) | ((attr & 0002) << 6) | - ((attr & 0020) >> 2) | ((attr & 0040) >> 4); - - switch (type) { - case 1: /* File */ - res->st_mode |= S_IFREG; - break; - case 2: /* Directory */ - res->st_mode |= S_IFDIR | 0700; - break; - case 3: /* Image file */ - if (scanimage) - res->st_mode |= S_IFDIR | 0700; - else - res->st_mode |= S_IFREG; - break; - } - - if ((((unsigned int) load) >> 20) == 0xfff) { /* date stamped file */ - unsigned int t1, t2, tc; - - t1 = (unsigned int) (exec); - t2 = (unsigned int) (load & 0xff); - - tc = 0x6e996a00U; - if (t1 < tc) - t2--; - t1 -= tc; - t2 -= 0x33; /* 00:00:00 Jan. 1 1970 = 0x336e996a00 */ - - t1 = (t1 / 100) + (t2 * 42949673U); /* 0x100000000 / 100 = 42949672.96 */ - t1 -= (t2 / 25); /* compensate for .04 error */ - - res->st_atime = res->st_mtime = res->st_ctime = t1; - } - else - res->st_atime = res->st_mtime = res->st_ctime = 0; - - return 0; -} - -#ifndef SFX - -DIR *opendir(char *dirname) -{ - DIR *thisdir; - int type; - int attr; - os_error *er; - - thisdir=(DIR *)malloc(sizeof(DIR)); - if (thisdir==NULL) - return NULL; - - thisdir->dirname=(char *)malloc(strlen(dirname)+1); - if (thisdir->dirname==NULL) { - free(thisdir); - return NULL; - } - - strcpy(thisdir->dirname,dirname); - if (thisdir->dirname[strlen(thisdir->dirname)-1]=='.') - thisdir->dirname[strlen(thisdir->dirname)-1]=0; - - if (er=SWI_OS_File_5(thisdir->dirname,&type,NULL,NULL,NULL,&attr),er!=NULL || - type<=1 || (type==3 && !scanimage)) - { - free(thisdir->dirname); - free(thisdir); - return NULL; - } - - thisdir->buf=malloc(DIR_BUFSIZE); - if (thisdir->buf==NULL) { - free(thisdir->dirname); - free(thisdir); - return NULL; - } - - thisdir->size=DIR_BUFSIZE; - thisdir->offset=0; - thisdir->read=0; - - return thisdir; -} - -struct dirent *readdir(DIR *d) -{ - static struct dirent dent; - - if (d->read==0) { /* no more objects read in the buffer */ - if (d->offset==-1) { /* no more objects to read */ - return NULL; - } - - d->read=255; - if (SWI_OS_GBPB_9(d->dirname,d->buf,&d->read,&d->offset,DIR_BUFSIZE,NULL)!=NULL) - return NULL; - - if (d->read==0) { - d->offset=-1; - return NULL; - } - d->read--; - d->act=(char *)d->buf; - } - else { /* some object is ready in buffer */ - d->read--; - d->act=(char *)(d->act+strlen(d->act)+1); - } - - strcpy(dent.d_name,d->act); - dent.d_namlen=strlen(dent.d_name); - - return &dent; -} - -void closedir(DIR *d) -{ - if (d->buf!=NULL) - free(d->buf); - if (d->dirname!=NULL) - free(d->dirname); - free(d); -} - -int unlink(f) -char *f; /* file to delete */ -/* Delete the file *f, returning non-zero on failure. */ -{ - os_error *er; - char canon[256]; - int size=255; - - er=SWI_OS_FSControl_37(f,canon,&size); - if (er==NULL) { - er=SWI_OS_FSControl_27(canon,0x100); - } - else { - er=SWI_OS_FSControl_27(f,0x100); - } - return (int)er; -} - -int deletedir(char *d) -{ - int objtype; - char *s; - int len; - os_error *er; - - len = strlen(d); - if ((s = malloc(len + 1)) == NULL) - return -1; - - strcpy(s,d); - if (s[len-1]=='.') - s[len-1]=0; - - if (er=SWI_OS_File_5(s,&objtype,NULL,NULL,NULL,NULL),er!=NULL) { - free(s); - return -1; - } - if (objtype<2 || (!scanimage && objtype==3)) { - /* this is a file or it doesn't exist */ - free(s); - return -1; - } - - if (er=SWI_OS_File_6(s),er!=NULL) { - /* maybe this is a problem with the DDEUtils module, try to canonicalise the path */ - char canon[256]; - int size=255; - - if (er=SWI_OS_FSControl_37(s,canon,&size),er!=NULL) { - free(s); - return -1; - } - if (er=SWI_OS_File_6(canon),er!=NULL) { - free(s); - return -1; - } - } - free(s); - return 0; -} - -#endif /* !SFX */ - -int chmod(char *file, int mode) -{ -/*************** NOT YET IMPLEMENTED!!!!!! ******************/ -/* I don't know if this will be needed or not... */ - file=file; - mode=mode; - return 0; -} - -void setfiletype(char *fname,int ftype) -{ - char str[256]; - sprintf(str,"SetType %s &%3.3X",fname,ftype); - SWI_OS_CLI(str); -} - -void getRISCOSexts(char *envstr) -{ - char *envptr; /* value returned by getenv */ - - envptr = getenv(envstr); - if (envptr == NULL || *envptr == 0) return; - - exts2swap=malloc(1+strlen(envptr)); - if (exts2swap == NULL) - return; - - strcpy(exts2swap, envptr); -} - -int checkext(char *suff) -{ - register char *extptr=exts2swap; - register char *suffptr; - register int e,s; - - if (extptr != NULL) while(*extptr) { - suffptr=suff; - e=*extptr; s=*suffptr; - while (e && e!=':' && s && s!='.' && s!='/' && e==s) { - e=*++extptr; s=*++suffptr; - } - if (e==':') e=0; - if (s=='.' || s=='/') s=0; - if (!e && !s) { - return 1; - } - while(*extptr!=':' && *extptr!='\0') /* skip to next extension */ - extptr++; - if (*extptr!='\0') - extptr++; - } - return 0; -} - -int swapext(char *name, char *exptr) -{ - char *ext; - char *p1=exptr; - char *p2; - int extchar=*exptr; - unsigned int i=0; - - while(*++p1 && *p1!='.' && *p1!='/') - ; - ext=malloc(i=p1-exptr); - if (!ext) - return 1; - memcpy(ext, exptr+1, i); - p2=exptr-1; - p1=exptr+i-1; - while(p2 >= name) - *p1--=*p2--; - strcpy(name,ext); - *p1=(extchar=='/'?'.':'/'); - free(ext); - return 0; -} - -void remove_prefix(void) -{ - SWI_DDEUtils_Prefix(NULL); -} - -void set_prefix(void) -{ - char *pref; - int size=0; - - if (SWI_OS_FSControl_37("@",pref,&size)!=NULL) - return; - - size=1-size; - - if (pref=malloc(size),pref!=NULL) { - if (SWI_OS_FSControl_37("@",pref,&size)!=NULL) { - free(pref); - return; - } - - if (SWI_DDEUtils_Prefix(pref)==NULL) { - atexit(remove_prefix); - } - - free(pref); - } -} - -#ifdef localtime -# undef localtime -#endif - -#ifdef gmtime -# undef gmtime -#endif - -/* Acorn's implementation of localtime() and gmtime() - * doesn't consider the timezone offset, so we have to - * add it before calling the library functions - */ - -struct tm *riscos_localtime(const time_t *timer) -{ - time_t localt=*timer; - - localt+=SWI_Read_Timezone()/100; - - return localtime(&localt); -} - -struct tm *riscos_gmtime(const time_t *timer) -{ - time_t localt=*timer; - - localt+=SWI_Read_Timezone()/100; - - return gmtime(&localt); -} - - -int riscos_fseek(FILE *fd, long offset, int whence) -{ - int ret; - switch (whence) - { - case SEEK_END: - ret = (fseek) (fd, 0, SEEK_END); - if (ret) - return ret; - /* fall through */ - case SEEK_CUR: - offset += ftell (fd); - /* fall through */ - default: /* SEEK_SET */ - return (fseek) (fd, offset < 0 ? 0 : offset, SEEK_SET); - } -} diff --git a/third_party/infozip/zip/acorn/riscos.h b/third_party/infozip/zip/acorn/riscos.h deleted file mode 100644 index c45a148bd..000000000 --- a/third_party/infozip/zip/acorn/riscos.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -/* riscos.h */ - -#ifndef __riscos_h -#define __riscos_h - -#include -#include - -typedef struct { - int errnum; - char errmess[252]; -} os_error; - -#ifndef __swiven_h -# include "swiven.h" -#endif - -#define MAXPATHLEN 256 -#define MAXFILENAMELEN 64 /* should be 11 for ADFS, 13 for DOS, 64 seems a sensible value... */ -#define DIR_BUFSIZE 1024 /* this should be enough to read a whole E-Format directory */ - -struct stat { - unsigned int st_dev; - int st_ino; - unsigned int st_mode; - int st_nlink; - unsigned short st_uid; - unsigned short st_gid; - unsigned int st_rdev; - unsigned int st_size; - unsigned int st_blksize; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - -typedef struct { - char *dirname; - void *buf; - int size; - char *act; - int offset; - int read; -} DIR; - -#define dstrm DIR - -struct dirent { - unsigned int d_off; /* offset of next disk directory entry */ - int d_fileno; /* file number of entry */ - size_t d_reclen; /* length of this record */ - size_t d_namlen; /* length of d_name */ - char d_name[MAXFILENAMELEN]; /* name */ -}; - -typedef struct { - unsigned int load_addr; - unsigned int exec_addr; - int lenght; - int attrib; - int objtype; - char name[13]; -} riscos_direntry; - -#define SPARKID 0x4341 /* = "AC" */ -#define SPARKID_2 0x30435241 /* = "ARC0" */ - -typedef struct { - short ID; - short size; - int ID_2; - unsigned int loadaddr; - unsigned int execaddr; - int attr; - int zero; -} extra_block; - - -#define S_IFMT 0770000 - -#define S_IFDIR 0040000 -#define S_IFREG 0100000 /* 0200000 in UnixLib !?!?!?!? */ - -#ifndef S_IEXEC -# define S_IEXEC 0000100 -# define S_IWRITE 0000200 -# define S_IREAD 0000400 -#endif - -extern char *exts2swap; /* Extensions to swap */ - -int stat(char *filename,struct stat *res); -DIR *opendir(char *dirname); -struct dirent *readdir(DIR *d); -char *readd(DIR *d); -void closedir(DIR *d); -int unlink(char *f); -int chmod(char *file, int mode); -void setfiletype(char *fname,int ftype); -void getRISCOSexts(char *envstr); -int checkext(char *suff); -int swapext(char *name, char *exptr); -void remove_prefix(void); -void set_prefix(void); -struct tm *riscos_localtime(const time_t *timer); -struct tm *riscos_gmtime(const time_t *timer); - -int riscos_fseek(FILE *fd, long offset, int whence); -/* work around broken assumption that fseek() is OK with -ve file offsets */ - -#endif /* !__riscos_h */ diff --git a/third_party/infozip/zip/acorn/sendbits.s b/third_party/infozip/zip/acorn/sendbits.s deleted file mode 100644 index f12921a7f..000000000 --- a/third_party/infozip/zip/acorn/sendbits.s +++ /dev/null @@ -1,105 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; sendbits.s for ARM by Sergio Monesi and Darren Salt. - -r0 RN 0 -r1 RN 1 -r2 RN 2 -r3 RN 3 -r4 RN 4 -r5 RN 5 -r6 RN 6 -r7 RN 7 -r8 RN 8 -r9 RN 9 -sl RN 10 -fp RN 11 -ip RN 12 -sp RN 13 -lr RN 14 -pc RN 15 - - AREA |Asm$$Code|, CODE, READONLY - - = "send_bits",0 - ALIGN - & &FF00000C - - IMPORT __rt_stkovf_split_small - IMPORT flush_outbuf - - IMPORT bi_valid - IMPORT bi_buf - IMPORT out_size - IMPORT out_offset - IMPORT out_buf - - EXPORT send_bits -send_bits - MOV ip,sp - STMDB sp!,{r4,r5,fp,ip,lr,pc} - SUB fp,ip,#4 - LDR r5,=bi_buf - LDR r3,=bi_valid - LDR r4,[r5] - LDR r2,[r3] - ORR r4,r4,r0,LSL r2 ; |= value<= out_size-1 - LDRHS r0,=out_buf - LDRHS r0,[r0] - BLHS flush_outbuf ; then flush the buffer - LDR r0,=out_buf - LDR r1,=out_offset - LDR r0,[r0] - LDR r2,[r1] - MOV r5,r4,LSR #8 - STRB r4,[r0,r2]! ; store 'old' bi_buf - STRB r5,[r0,#1] - ADD r2,r2,#2 - STR r2,[r1] - - LDMDB fp,{r4,r5,fp,sp,pc}^ - - -ptr_bi & bi_valid - & bi_buf - - - = "bi_reverse",0 - ALIGN - & &FF00000C - - EXPORT bi_reverse -bi_reverse - MOV r2,#0 -loop MOVS r0,r0,LSR #1 - ADCS r2,r2,r2 - SUBS r1,r1,#1 - BNE loop - MOV r0,r2 - MOVS pc,lr - - - END diff --git a/third_party/infozip/zip/acorn/srcrename b/third_party/infozip/zip/acorn/srcrename deleted file mode 100644 index 7bd6119e291f551a9b24d460104cd55253ccb360..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6175 zcma)Ad0Z1$*FF=%5=@2=5EK=0!(GuLDpf&6T&t*PT>=3YT!Nx#TNG5ROSM?Vx=scZ zm#P^c6E-o-L~%FHP-AVa7_0#oa6!YO0s?t&!1sN>f4<-M@td1F_sqTLJm)!Q&b`b! zdw2toQ7#5}v%?YIxB|TI)E&SFgSNk}UD|s{ZtuOm4FB6@l)DtqG>eN5m^~rwm9%(9 z1r+ZyW2hm$&p?Wr4{Cm>LHIM=l5yV!vZ|!P;T4~)*4K0G;dMv3N^wLVW3Nx1ZrUDi ziW2^%kS^nhjY`|9ifabDcK|}{P>cetXtTQ$B z2TF2UmFH};ZKoIbGflZH$+N~S`hK6wHVs#Q-I3}QNR17kx*u0R?LmFDi^?BIZT+5_ z{v(y9pt4UjjYG^>AIM!mbKTJ=d?`-iHaMxA_(TIfXWoJ)CE ztIxfpYU+qCHR|=T)O(|9d5yZJo|s>w{_7x>C!u^S>QgL*RQ>aeI>p$~EjdkXDWm+e zsoBS<-utNY6r~a&KilzQ{tVyDC8|uHjae5;rS#>??!cPBy!)=)Q^BIlRO#p2>P|yPrEuPj6=*ZZ;ItWla9{%=HT zrzgMBBt2huIfwXelxed!^K?ClOwBg5aU|Ba`e%ksX97F3i#Fi&nrtQJjaJVYuTmV<$8^xQ z_-7hdFH5?{vfWY_N<`5~hfO*;o-(yqXf+ zQvJG;p+XsWY#RTJv7X{zOl7u~GaLRg(MP{nOdniwkS4XMY|a54JTTBP)j3dbeJ=)zB}V+i-&Yd7LTy1V4Rw34Mb7`yX9hIG5O$ z`Jsz`>1b2>FD1+7m8E~fn`yGv$i>C7KlV?fSFx*;3=RfH;>ggk?CLv)?KFAm9(zho z=#q395yZ<(0>x|3FVx%x6!}K=T}EXIbxd?7`dneGl<{5A!i|xSu`Pb2NGLJR#p>!U8z;VwU)} zB#|Y_0B-(yQ|Lh(rp3qGFs)~Qz0rorU%w`R**njMY1F?lb^fcY({%ONDY}J!nijO< zd0sliQy;%T$C_AUg-)=p|ikNfT$NK!jhH(7fO<9j7QtmrcisSkiXMK}@ zrt}-mZ#_TsHJ9ek4hb(|D%eF!h;8x2q9QVJ0})M=`glSbU|zn4i(r2$F$~$mo;^cce?t@wB;!5wQ?9apyVz>W-OFb7X}RIVC35U8e!wpF?H8z)t|{Ej0p!Q+9NV9CturQKT4BP9r(v@`RxqJs@O+I4A*FK&!MtX zntZ*QnPTK>XRymB^Fbcz&wk-FG--UM3r*t%y-PYTWa-)Z1H8d*PD!VQ?2Z0p`nTNu z$!xc&WjWW$Z!ZyR))DCkxX^fxKER%QV%U#J$Y5QK26_X#ev4uBd-hBm8$YWgA*^I@ zH!glXYaGNry2UoQribjNLO-hiOr)+0bf*s+z7_Jl;yLyO`|FQs7g+M)MPgAHx9<|! z*qdPgXgYU35cF*7#-iPT+dJ&+ppQ_q^F#g}zUV2y+ML$~<6hwRc^q8>#Xe%GP0KWTD<8=pdxZ`boS2MoHnM1Bf#pnH0{k}@r(JngB(P(wTR$)`=q z!_4}@{GfP*okQ4_4eG_|l)Z@x?W__X;XX#QedOHELuKZrd>l)zT1cP(-@8RFnayoO zjBjM8j%Fg`(n7OJ?>yoVyq1}&p1Uc*9My^j^=>?w zSaPm6-+c==*SF;NLFBAi94aM9)u}l4&ZLruhxoiaGH`_sDZIFw68~gl(cOjGhU?z> z@bkR+jy=kr|H9FiNYgXjv^3tKJzXZ+(#0|4|CKJkw55ytz5k}mX_PMGOA;o0NtZ`A zzU0a_532kKl_olLoqTqh-$HZreqH_r;*X2OhK{ykvtu-uftCi9Bm|e->}I17h2JBD zI`b`6HJPdqQi4*|EiL)26aSwSSn0yA8TWsuz?kf^v27`E=;oLB_i{}a8M)G8w#>EU zuPbEUBX)#A$C_F1B*T`utVj1UZxeUL#Lf5B)Bmu6Nd{DQ)b3f<$sQ&*)_DoI^;QpX6W)gnqBWMN{OLD=czS% zYG!BkH!W(bF$wJL=FeQ(?xe5!B7m+^9kC-GH zJ&fpPM|2rVbQMh)PlQY)x`{-o-l7hv(4BBf^$|Iz_7FLy0t_2U4fms_iN2iYMUZMQ zg5IgVeTaU2i2?nIK?8{)gNclcEC(txn)2;Sb#oSDvVP+3c(=|HcU-c(AZY8|L!%-D zQdeor=g3A}-Wn}fip#@g=#qKJA}_3oTC%U_fFZsf-X31w9udpr#^LfPZ(nbGNZ^nt zh;WYrMOS=LOuf7q$MMKVh23M%=UxxGU3fK+9(PfHZSrj&HZM}fTYqiym zOK>r56~fV!L6`=jF59O<-O&4>1)odS-#cT8;=u_DIR4ayjG1xTKpS<&-I}F{EVy7quY4}+X*@*>WiA0PG zBrb05zQg4iZe?SaK6+iP>)}>#*`=VC&YGq9*Z{vAOaW{~0uH~{4|UL3tssOrz%`C$ zWes4`O2~5zqZ??YOxXY*%^5J6Mtonlt_5t02K{GMs@jS{)y8OqVO_otTuF(DlFh%sPd~G!_6v>T;c|Yy({D&0g<3JWAlDXwc+0#7vbp zXq_;P_(M)@3$3%Rp1RCIWA`b#S)1DwrfDijlPNyZ61xaXglGw-ZE4h2381v-oN(2s zggZrFJ!Ec9diZrN*w5@BfR>sZ08^0*rmO=?b00f+U26cJm6J|5!_#*Xtg?$M+`M`V z(+a>7swP+fK4l;wJWw#iCcMu50gU z*#a;yy&UvChr%Uo7T^#PKGpt8FCL6TJ_*3(qXoO%WCxvVyaiC_TIqC0(pMv>UEu`K znh8*g!W8W!zg!cPRVbRHan@wi(fJPAun)P7Vkmr43x)GLYpoKvl%<7tW9AgL2sF+u zpv~68(z)bki#?vx42q^A=O!pJWW)NNYrU737xd2g`}iwn`KnxfRxT#V9X&>2r!5rZ zNG=~A8SN@>&=l$E&{4~pmp9Wl&O_iN3L-m16fWui(X&2}vDbtbLiwCp7*Npg?qXhR z4q&kGaw|ZSLl&r@?sCz%eBt=~4!EYKm39`;A5p$o6xJ9Ko%aDI*?+>|?`sI^s5*74 zMo`CoaLsM01_xm#MA*F(7G1N3E^~xNQ6{|8G~~?t9Bqkkqu(^q&b2YM+K*U{_h&5U z^Jf4_HbgqSx3p+PtVUOpH+gQ(#~K=!SKah{TzY%WFeiR^}gUs0tECflFSY zW!co|!nuVaOODV^S*>xd*E%`CTN^~zm$}uBxz3Kc!cTOb6AhR)3^dJ+S|>-Xt{z4H z4dhzvmRSp~WXr>~ts$Vf&42}hVFn5+*a=#&JiEHp0@!C9+z(b3zXLcv)D;6eqrySb zc}XDTH(Fhw4$WP1sekwI$VPuTIamIVe8DhzN>};!ePMjq$DFzbjI|zUZORWHh zm)0#p_ya9kkuGn7)CU<3&@#)4fd|qG6*j{nX|TN({4|h}glSu?T1*-XxtKIfkmX!n z7vzFUjHa3PAU~kE(JjR^W~Bwe8oOc)nylwhx%g~#K@Ai00zkbMhl}-A+6gR;R(lua zM>{d5{Detl=#6p}C_f2Y(a2T|lnoMT^w`MarA=a`HP$YrwWGdn+dk0X$x!EV0JKrX zsM=gS^WKZLbeG|@JV;3_lpoY|HKVsJAEF*YssxvBRPK@}TO?#lEJ~`>Sdb?wciB*O zhs1J?ov{n;27zRQ=Ft_~Z~hg!tBZqDY^GtIOj|!Ru>n;w4-fkJP{A|Vi#hM3JEWop`Ms3vsAe`-2NX{+m zH2_S$f<9wK@A@+Pyp9c5E3HqgRskw~eOVbYU}AiDN5#ICftahfv$E1%`7sGF z!~v@J*vOPWsv%fzO~I0oqT=^RhWveNXViy7M3Q_#gg9cIJS#GMd5EI-0C{tyQ)K>t zh{N(5(Wz?=N1a_3wzOUm7ClH&9NAT#q39|<8+{>yRZ5lXB9_JWW)lW$o8wxVpW=uu zrzlPRHarPvCqyXV@&sJD5iy6$yl`AD_fR%u?orkwPI37GA>_n_7J=JzsO*&Hj@ z)GLr>87_~-J#b~RZ3dWe8Sde=2v_ctC&&_$HTCy!T!tnj?o>8wz=#is1!c4Hxki{u zHpluP+4GZRvsb%)8v?XJA;c(8X-gb}v`?z3QlvD~or3WR6J#FV${9VqeLcnvQO3sl zD{sUKz2rNUN%ABQB|Bfa0IhRMw&hHNRfd?*pib6PQ?*TF*(TGvOE02*==l4jm0EWT zz4Lu66rhc_Ax_ir6#Zrh14eK{);b7K`Gj2cy!O1Ub!d zD8Px<#|{cjlQqX-9olKoK_C^H)d2rW={+8?IZT}@Ez>x@pYirINv@JZ&!abk}s5RpU};tfRPxtQ!_6@#-ETUnA?=Z?YSle{F>*Z+T^iyj<+k(W8fC zq+H=6c7vg)koCDZ-vNGV{N#dy0dG)=xrDyW(j5S{pc9))*nVm|gSyYcjAub^zdsWK z_F@pss(_%>D(8$~vnX|%*(rIid2if-3MZIf?i7`gBbKI^vGu#n&S4ql5S;PM!3Xtz z=4Y68aYcWCB24<%b7z=c;RZkf%zow!;Dy0o&uwx{m|Wi0J0+LfzUQKQAtp}7z;B0H z=(qcMHTtHDX{VbpZAt~^x1+))!=$rq-+J%9M9<_%ADXL0@_bY>i!{iN!xx+2w7p$7 zvhiq)$Evx{La{Gc7cm+d`OKEZL!g#c}a*1C&Wwq(xpBlhWPn8`}q6|FB6WV diff --git a/third_party/infozip/zip/acorn/swiven.h b/third_party/infozip/zip/acorn/swiven.h deleted file mode 100644 index c860d7dbc..000000000 --- a/third_party/infozip/zip/acorn/swiven.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* swiven.h */ - -#ifndef __swiven_h -#define __swiven_h - -os_error *SWI_OS_FSControl_26(char *source, char *dest, int actionmask); -/* copy */ - -os_error *SWI_OS_FSControl_27(char *filename, int actionmask); -/* wipe */ - -os_error *SWI_OS_GBPB_9(char *dirname, void *buf, int *number, - int *offset, int size, char *match); -/* read dir */ - -os_error *SWI_OS_File_1(char *filename, unsigned int loadaddr, - unsigned int execaddr, int attrib); -/* write file attributes */ - -os_error *SWI_OS_File_5(char *filename, int *objtype, unsigned int *loadaddr, - unsigned int *execaddr, int *length, int *attrib); -/* read file info */ - -os_error *SWI_OS_File_6(char *filename); -/* delete */ - -os_error *SWI_OS_File_7(char *filename, int loadaddr, int execaddr, int size); -/* create an empty file */ - -os_error *SWI_OS_CLI(char *cmd); -/* execute a command */ - -int SWI_OS_ReadC(void); -/* get a key from the keyboard buffer */ - -os_error *SWI_OS_ReadVarVal(char *var, char *buf, int len, int *bytesused); -/* reads an OS varibale */ - -os_error *SWI_OS_FSControl_54(char *buffer, int dir, char *fsname, int *size); -/* reads the path of a specified directory */ - -os_error *SWI_OS_FSControl_37(char *pathname, char *buffer, int *size); -/* canonicalise path */ - -os_error *SWI_DDEUtils_Prefix(char *dir); -/* sets the 'prefix' directory */ - -int SWI_Read_Timezone(void); -/* returns the timezone offset (centiseconds) */ - -#endif /* !__swiven_h */ diff --git a/third_party/infozip/zip/acorn/swiven.s b/third_party/infozip/zip/acorn/swiven.s deleted file mode 100644 index 163012437..000000000 --- a/third_party/infozip/zip/acorn/swiven.s +++ /dev/null @@ -1,276 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; SWI veneers used by Zip/Unzip -; - -r0 RN 0 -r1 RN 1 -r2 RN 2 -r3 RN 3 -r4 RN 4 -r5 RN 5 -r6 RN 6 -r7 RN 7 -r8 RN 8 -r9 RN 9 -r10 RN 10 -r11 RN 11 -r12 RN 12 -sp RN 13 -lr RN 14 -pc RN 15 - -sl RN 10 -fp RN 11 -ip RN 12 - - -XOS_Bit EQU &020000 - -OS_GBPB EQU &00000C -OS_File EQU &000008 -OS_FSControl EQU &000029 -OS_CLI EQU &000005 -OS_ReadC EQU &000004 -OS_ReadVarVal EQU &000023 -DDEUtils_Prefix EQU &042580 -Territory_ReadCurrentTimeZone EQU &043048 - - MACRO - STARTCODE $name - EXPORT $name -$name - MEND - - - AREA |C$$code|, CODE, READONLY - -; os_error *SWI_OS_FSControl_26(char *source, char *dest, int actionmask); - - STARTCODE SWI_OS_FSControl_26 - - MOV ip, lr - - MOV r3, r2 - MOV r2, r1 - MOV r1, r0 - MOV r0, #26 - - SWI OS_FSControl + XOS_Bit - - MOVVC r0, #0 - - MOVS pc, ip - - -; os_error *SWI_OS_FSControl_27(char *filename, int actionmask); - - STARTCODE SWI_OS_FSControl_27 - - MOV ip, lr - - MOV r3, r1 - MOV r1, r0 - MOV r0, #27 - - SWI OS_FSControl + XOS_Bit - - MOVVC r0, #0 - - MOVS pc, ip - - -; os_error *SWI_OS_GBPB_9(char *dirname, void *buf, int *number, -; int *offset, int size, char *match); - - STARTCODE SWI_OS_GBPB_9 - - MOV ip, sp - STMFD sp!, {r2-r6,lr} - LDMIA ip, {r5,r6} - LDR r4, [r3] - LDR r3, [r2] - MOV r2, r1 - MOV r1, r0 - MOV r0, #9 - SWI OS_GBPB + XOS_Bit - LDMVSFD sp!, {r2-r6,pc}^ - MOV r0, #0 - LDMFD sp, {r5,r6} - STR r3, [r5] - STR r4, [r6] - LDMFD sp!, {r2-r6,pc}^ - - -; os_error *SWI_OS_File_1(char *filename, int loadaddr, int execaddr, int attrib); - - STARTCODE SWI_OS_File_1 - - STMFD sp!, {r5,lr} - MOV r5, r3 - MOV r3, r2 - MOV r2, r1 - MOV r1, r0 - MOV r0, #1 - SWI OS_File + XOS_Bit - MOVVC r0, #0 - LDMFD sp!, {r5,pc}^ - - - -; os_error *SWI_OS_File_5(char *filename, int *objtype, int *loadaddr, -; int *execaddr, int *length, int *attrib); - - STARTCODE SWI_OS_File_5 - - STMFD sp!, {r1-r5,lr} - MOV r1, r0 - MOV r0, #5 - SWI OS_File + XOS_Bit - LDMVSFD sp!, {r1-r5,pc}^ - LDR lr, [sp] - TEQ lr, #0 - STRNE r0, [lr] - LDR lr, [sp, #4] - TEQ lr ,#0 - STRNE r2, [lr] - LDR lr, [sp, #8] - TEQ lr, #0 - STRNE r3, [lr] - LDR lr, [sp ,#24] - TEQ lr, #0 - STRNE r4, [lr] - LDR lr, [sp ,#28] - TEQ lr, #0 - STRNE r5, [lr] - MOV r0, #0 - LDMFD sp!, {r1-r5,pc}^ - - -; os_error *SWI_OS_File_6(char *filename); - - STARTCODE SWI_OS_File_6 - - STMFD sp!, {r4-r5,lr} - MOV r1, r0 - MOV r0, #6 - SWI OS_File + XOS_Bit - MOVVC r0, #0 - LDMFD sp!, {r4-r5,pc}^ - - -; os_error *SWI_OS_File_7(char *filename, int loadaddr, int execaddr, int size); - - STARTCODE SWI_OS_File_7 - - STMFD sp!, {r4-r5,lr} - MOV r5, r3 - MOV r4, #0 - MOV r3, r2 - MOV r2, r1 - MOV r1, r0 - MOV r0, #7 - SWI OS_File + XOS_Bit - MOVVC r0, #0 - LDMFD sp!, {r4-r5,pc}^ - - -; os_error *SWI_OS_CLI(char *cmd); - - STARTCODE SWI_OS_CLI - - MOV ip, lr - SWI OS_CLI + XOS_Bit - MOVVC r0, #0 - MOVS pc, ip - - -; int SWI_OS_ReadC(void); - - STARTCODE SWI_OS_ReadC - - MOV ip, lr - SWI OS_ReadC + XOS_Bit - MOVS pc, ip - - -; os_error *SWI_OS_ReadVarVal(char *var, char *buf, int len, int *bytesused); - - STARTCODE SWI_OS_ReadVarVal - - STMFD sp!, {r4,lr} - MOV ip, r3 - MOV r3, #0 - MOV r4, #0 - SWI OS_ReadVarVal + XOS_Bit - LDMVSFD sp!, {r4,pc}^ - TEQ ip, #0 - STRNE r2, [ip] - MOV r0, #0 - LDMFD sp!, {r4,pc}^ - - -; os_error *SWI_OS_FSControl_54(char *buffer, int dir, char *fsname, int *size); - - STARTCODE SWI_OS_FSControl_54 - - STMFD sp!, {r3-r6,lr} - LDR r5, [r3] - MOV r3, r2 - MOV r2, r1 - MOV r1, r0 - MOV r0, #54 - SWI OS_FSControl + XOS_Bit - LDMVSFD sp!, {r3-r6,pc}^ - MOV r0, #0 - LDMFD sp!, {r3} - STR r5, [r3] - LDMFD sp!, {r4-r6,pc}^ - - -; os_error *SWI_OS_FSControl_37(char *pathname, char *buffer, int *size); - - STARTCODE SWI_OS_FSControl_37 - - STMFD sp!, {r2,r3-r5,lr} - LDR r5, [r2] - MOV r3, #0 - MOV r4, #0 - MOV r2, r1 - MOV r1, r0 - MOV r0, #37 - SWI OS_FSControl + XOS_Bit - LDMVSFD sp!, {r2,r3-r5,pc}^ - MOV r0, #0 - LDMFD sp!, {r2} - STR r5, [r2] - LDMFD sp!, {r3-r5,pc}^ - - -; os_error *SWI_DDEUtils_Prefix(char *dir); - - STARTCODE SWI_DDEUtils_Prefix - - MOV ip, lr - SWI DDEUtils_Prefix + XOS_Bit - MOVVC r0, #0 - MOVS pc, ip - -; int SWI_Read_Timezone(void); - - STARTCODE SWI_Read_Timezone - - MOV ip, lr - SWI Territory_ReadCurrentTimeZone + XOS_Bit - MOVVC r0, r1 - MOVVS r0, #0 - MOVS pc, ip - - - END diff --git a/third_party/infozip/zip/acorn/zipsfx b/third_party/infozip/zip/acorn/zipsfx deleted file mode 100644 index 7d63492af..000000000 --- a/third_party/infozip/zip/acorn/zipsfx +++ /dev/null @@ -1,9 +0,0 @@ -| zipsfx 0.1 -| Written by Darren Salt -| Assumes that unzipsfx is on Run$Path (eg. in !Boot.Library) -| Assumes that IfThere is available as either *command or utility - -If "%1" = "" Then Error 220 Syntax: zipsfx | | -If "%0" = "" Then Error 220 Syntax: zipsfx | | -Copy Run:unzipsfx %1 A~C~D~F~L~N~R~S~T~V -Print %0 { >> %1 } \ No newline at end of file diff --git a/third_party/infozip/zip/acorn/zipup.h b/third_party/infozip/zip/acorn/zipup.h deleted file mode 100644 index 47c353601..000000000 --- a/third_party/infozip/zip/acorn/zipup.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow "r" -#define fbad (NULL) -typedef FILE *ftype; -#define zopen(n,p) fopen(n,p) -#define zread(f,b,n) fread((b),1,(n),(FILE*)(f)) -#define zclose(f) fclose(f) -#define zerr(f) (k==(extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/amiga/LMKfile b/third_party/infozip/zip/amiga/LMKfile deleted file mode 100644 index 8c838ea16..000000000 --- a/third_party/infozip/zip/amiga/LMKfile +++ /dev/null @@ -1,117 +0,0 @@ -# Makefile for Zip, ZipNote, ZipCloak and ZipSplit, Amiga SAS/C 5.10b -# See the master Makefile under the top level Zip/Unzip source directory -# for more information on compiler macros and flags for this version. -# Last update: Jan 07, 2007 -# -John Bush, , - - -####################### -# MACROBE DEFINITIONS # -####################### - -# Compiler and loader debug flags. Omit comments as req'd. -# Do not set when building production version. -# CDBG = -d3 -# LDBG = ADDSYM - -DEFINES = -DNO_MKTEMP -CC = lc -OPT = -O -CFLAGS = $(OPT) $(DEFINES) $(CDBG) -v -mat -cuisf -b0 -j85i86i87i100i - -LD = blink -LDSTART = LIB:c.o -LDFLAGS = LIB LIB:lc.lib+LIB:amiga.lib - -TMPFILE = ram:MakeZip.tmp - -############################################### -# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES # -############################################### - -# default C rules -.c.o: - $(CC) $(CFLAGS) -o$@ $*.c - -# Alternate rules for routines containing entries needed by utilities -.c.oo: - $(CC) $(CFLAGS) -DUTIL -o$*.oo $*.c - -# object file macrough lists - -HFILES = zip.h ziperr.h tailor.h revision.h crc32.h crypt.h ttyio.h \ - amiga/amiga.h amiga/zipup.h amiga/osdep.h - -OBJA = zipfile.o zipup.o fileio.o util.o globals.o crc32.o crypt.o \ - timezone.o ttyio.o amiga.o amigazip.o filedate.o -OBJI = deflate.o trees.o -OBJU = zipfile.oo fileio.oo util.oo globals.o timezone.o \ - amiga.o amigazip.oo filedate.o - -OBJZ = zip.o $(OBJA) $(OBJI) - -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32.oo crypt.oo ttyio.o -OBJS = zipsplit.o $(OBJU) - -ZIPS = zip zipnote zipcloak zipsplit - -all: Message $(ZIPS) - -Message: - -echo " " - -echo "WARNING: Lattice 5.x HAS NOT BEEN TESTED WITH THIS ZIP VERSION" - -echo "Report problems to " - -echo " " - -zip: $(OBJZ) $(HFILES) - -echo "$(OBJZ)" > $(TMPFILE) - $(LD) TO Zip FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG) - -delete $(TMPFILE) Zip.info - -zipnote: $(OBJN) $(HFILES) - -echo "$(OBJN)" > $(TMPFILE) - $(LD) TO ZipNote FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG) - -delete $(TMPFILE) ZipNote.info - -zipcloak: $(OBJC) $(HFILES) - -echo "$(OBJC)" > $(TMPFILE) - $(LD) TO ZipCloak FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG) - -delete $(TMPFILE) ZipCloak.info - -zipsplit: $(OBJS) $(HFILES) - -echo "$(OBJS)" > $(TMPFILE) - $(LD) TO ZipSplit FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG) - -delete $(TMPFILE) ZipSplit.info - -clean: - -delete $(OBJZ) all quiet force >nil: - -delete $(OBJU) all quiet force >nil: - -delete $(OBJA) all quiet force >nil: - -delete $(OBJI) all quiet force >nil: - -delete $(OBJN) all quiet force >nil: - -delete $(OBJC) all quiet force >nil: - -delete $(OBJS) all quiet force >nil: - -zip.o: zip.c $(HFILES) -zipnote.o: zipnote.c $(HFILES) -zipcloak.o: zipcloak.c $(HFILES) -crypt.o: crypt.c $(HFILES) -ttyio.o: ttyio.c $(HFILES) -zipsplit.o: zipsplit.c $(HFILES) -deflate.o: deflate.c $(HFILES) -trees.o: trees.c $(HFILES) -zipfile.o: zipfile.c $(HFILES) -zipup.o: zipup.c $(HFILES) -fileio.o: fileio.c $(HFILES) -util.o: util.c $(HFILES) -timezone.o: timezone.c $(HFILES) timezone.h -crc32.o: crc32.c $(HFILES) -crctab.o: crctab.c $(HFILES) -globals.o: globals.c $(HFILES) - -# Amiga specific objects -amiga.o: amiga/amiga.c $(HFILES) -amigazip.o: amiga/amigazip.c $(HFILES) - -# end of Makefile diff --git a/third_party/infozip/zip/amiga/README b/third_party/infozip/zip/amiga/README deleted file mode 100644 index 861ff8569..000000000 --- a/third_party/infozip/zip/amiga/README +++ /dev/null @@ -1 +0,0 @@ -the -A option currently does not work for the amiga. diff --git a/third_party/infozip/zip/amiga/amiga.c b/third_party/infozip/zip/amiga/amiga.c deleted file mode 100644 index 797d6d8e6..000000000 --- a/third_party/infozip/zip/amiga/amiga.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright (c) 1990-2005 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 -*/ -/* OS specific routines for AMIGA platform. - * - * John Bush BIX: jbush - * Paul Kienitz - * - * History: - * - * Date DoBee Comments - * ------- -------- ----------------------------------------------- - * 21Jan93 JBush Original coding. - * Incorporated filedate.c (existing routine). - * - * 31Jan93 JBush Made filedate.c include unconditional. - * - * 18Jul93 PaulK Moved Aztec _abort() here from stat.c because we - * can't share the same one between Zip and UnZip. - * Added close_leftover_open_dirs() call to it. - * - * 17Apr95 PaulK Added Amiga internal version string so that - * installer programs can compare the version being - * installed to see if the copy the user already has - * is older or newer. Added Prestart_Hook to support - * debug tracing in deflate.a. - * - * 6May95 PaulK Added GetComment() for filenote support. - * - * 12Nov95 PaulK Added #define ZIP in front of filedate.c, for - * new options in there; removed declare of set_con() - * since echon() no longer expands to it (or anything). - * - * 12Feb96 PaulK Removed call of echon() entirely. - * - * 12Jul97 PaulK Made both Aztec and SAS define USE_TIME_LIB for filedate.c - * - * 26Aug97 PaulK Added ClearIOErr_exit() - * - * 2Jan98 HWalt Adapted for SAS/C using stat.c replacement functions - * - * 6Jun00 PaulK Removed references to time_lib, since new filedate.c - * supercedes it - */ - -#include -#ifdef AZTEC_C -# include -# include -# include -# include -# include -# include -#else -# include -# include -#endif -#include -#include "ziperr.h" -void ziperr(int c, const char *h); - -#define ZIP -#if !defined(UTIL) -# define NO_MKTIME -#endif - -#ifdef AZTEC_C - -/* ============================================================= */ -/* filedate.c is an external file, since it's shared with UnZip. */ -/* Aztec includes it here, but SAS/C now compiles it separately. */ -# include "amiga/filedate.c" - -/* the same applies to stat.c */ -# include "amiga/stat.c" - -# define setenv BOGUS_INCOMPATIBLE_setenv -# include -# undef setenv -# ifdef DEBUG -# define PRESTART_HOOK -# endif -#endif - -extern void close_leftover_open_dirs(void); - - -/* the following handles cleanup when a ^C interrupt happens: */ - -void _abort(void) /* called when ^C is pressed */ -{ - close_leftover_open_dirs(); - ziperr(ZE_ABORT, "^C"); -} - -void ClearIOErr_exit(int e) /* EXIT is defined as this */ -{ - if (!e) - ((struct Process *) FindTask(NULL))->pr_Result2 = 0; - /* we clear IoErr() since we are successful, in a 1.x-compatible way */ - exit(e); -} - - -/* Make sure the version number here matches the number in revision.h */ -/* as closely as possible in strict decimal "#.#" form: */ -const char version_id[] = "\0$VER: Zip 2.3 (" -# include "env:VersionDate" -")\r\n"; - -/* call this with an arg of NULL to free storage: */ - -char *GetComment(char *filename) -{ - BPTR lk; - static struct FileInfoBlock *fib = NULL; - - if (!filename) { - if (fib) FreeMem(fib, sizeof(*fib)); - fib = NULL; - return NULL; - } - if (!fib) { - if (!(fib = AllocMem(sizeof(*fib), MEMF_PUBLIC))) - ziperr(ZE_MEM, "was checking filenotes"); - } - if (!(lk = Lock(filename, ACCESS_READ))) - return NULL; - if (!Examine(lk, fib)) - fib->fib_Comment[0] = '\0'; - UnLock(lk); - return fib->fib_Comment[0] ? &fib->fib_Comment[0] : NULL; -} diff --git a/third_party/infozip/zip/amiga/amiga.h b/third_party/infozip/zip/amiga/amiga.h deleted file mode 100644 index a1461d8b0..000000000 --- a/third_party/infozip/zip/amiga/amiga.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef __amiga_amiga_h -#define __amiga_amiga_h - -/* amiga.h - * - * Globular definitions that affect all of AmigaDom. - * - * Originally included in unzip.h, extracted for simplicity and eeze of - * maintenance by John Bush. - * - * This version is for use with Zip. It is not globally included, but used - * only by functions in amiga/amigazip.c. Much material that was needed for - * UnZip is absent here. - * - */ - -#include /* O_BINARY for open() w/o CR/LF translation */ -#include "amiga/z-stat.h" /* substitute for and */ -#define direct dirent - -#ifndef MODERN -# define MODERN -#endif - -#ifdef AZTEC_C /* Manx Aztec C, 5.0 or newer only */ -# include -# include /* do inline dos.library calls */ -# define O_BINARY 0 -#endif /* AZTEC_C */ - - -#ifdef __SASC -# include -# include -# define disk_not_mounted 0 -# if ( (!defined(O_BINARY)) && defined(O_RAW)) -# define O_BINARY O_RAW -# endif -#endif /* SASC */ - - -/* Funkshine Prough Toe Taipes */ - -LONG FileDate (char *, time_t[]); - -#endif /* __amiga_amiga_h */ diff --git a/third_party/infozip/zip/amiga/amigazip.c b/third_party/infozip/zip/amiga/amigazip.c deleted file mode 100644 index 4e69d6208..000000000 --- a/third_party/infozip/zip/amiga/amigazip.c +++ /dev/null @@ -1,507 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include "zip.h" -#include "amiga/amiga.h" - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#define utime FileDate - -#define PAD 0 -#define PATH_END '/' - -/* Local globals (kinda like "military intelligence" or "broadcast quality") */ - -extern char *label; /* still declared in fileio.c */ -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Local functions */ -local char *readd OF((DIR *)); -local int wild_recurse OF((char *, char *)); - - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - - -/* What we have here is a mostly-generic routine using opendir()/readd() and */ -/* isshexp()/MATCH() to find all the files matching a multi-part filespec */ -/* using the portable pattern syntax. It shouldn't take too much fiddling */ -/* to make it usable for any other platform that has directory hierarchies */ -/* but no shell-level pattern matching. It works for patterns throughout */ -/* the pathname, such as "foo:*.?/source/x*.[ch]". */ - -#define ONENAMELEN 30 -/* the length of one filename component on the Amiga */ - -/* whole is a pathname with wildcards, wildtail points somewhere in the */ -/* middle of it. All wildcards to be expanded must come AFTER wildtail. */ - -local int wild_recurse(whole, wildtail) char *whole; char *wildtail; -{ - DIR *dir; - char *subwild, *name, *newwhole = NULL, *glue = NULL, plug = 0, plug2; - ush newlen, amatch = 0; - BPTR lok; - int e = ZE_MISS; - - if (!isshexp(wildtail)) - if (lok = Lock(whole, ACCESS_READ)) { /* p exists? */ - UnLock(lok); - return procname(whole, 0); - } else - return ZE_MISS; /* woops, no wildcards! */ - - /* back up thru path components till existing dir found */ - do { - name = wildtail + strlen(wildtail) - 1; - for (;;) - if (name-- <= wildtail || *name == PATH_END) { - subwild = name + 1; - plug2 = *subwild; - *subwild = 0; - break; - } - if (glue) - *glue = plug; - glue = subwild; - plug = plug2; - dir = opendir(whole); - } while (!dir && !disk_not_mounted && subwild > wildtail); - wildtail = subwild; /* skip past non-wild components */ - - if ((subwild = strchr(wildtail + 1, PATH_END)) != NULL) { - /* this "+ 1" dodges the ^^^ hole left by *glue == 0 */ - *(subwild++) = 0; /* wildtail = one component pattern */ - newlen = strlen(whole) + strlen(subwild) + (ONENAMELEN + 2); - } else - newlen = strlen(whole) + (ONENAMELEN + 1); - if (!dir || !(newwhole = malloc(newlen))) { - if (glue) - *glue = plug; - - e = dir ? ZE_MEM : ZE_MISS; - goto ohforgetit; - } - strcpy(newwhole, whole); - newlen = strlen(newwhole); - if (glue) - *glue = plug; /* repair damage to whole */ - if (!isshexp(wildtail)) { - e = ZE_MISS; /* non-wild name not found */ - goto ohforgetit; - } - - while (name = readd(dir)) { - if (MATCH(wildtail, name, 0)) { - strcpy(newwhole + newlen, name); - if (subwild) { - name = newwhole + strlen(newwhole); - *(name++) = PATH_END; - strcpy(name, subwild); - e = wild_recurse(newwhole, name); - } else - e = procname(newwhole, 0); - newwhole[newlen] = 0; - if (e == ZE_OK) - amatch = 1; - else if (e != ZE_MISS) - break; - } - } - - ohforgetit: - if (dir) closedir(dir); - if (subwild) *--subwild = PATH_END; - if (newwhole) free(newwhole); - if (e == ZE_MISS && amatch) - e = ZE_OK; - return e; -} - -int wild(p) char *p; -{ - char *use; - - /* special handling of stdin request */ - if (strcmp(p, "-") == 0) /* if compressing stdin */ - return newname(p, 0, 0); - - /* wild_recurse() can't handle colons in wildcard part: */ - if (use = strchr(p, ':')) { - if (strchr(++use, ':')) - return ZE_PARMS; - } else - use = p; - - return wild_recurse(p, use); -} - - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - strcpy(p, n); - a = p + strlen(p); - if (*p && a[-1] != '/' && a[-1] != ':') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - if ((t = strrchr(x, ':')) != NULL) /* reject ":" */ - t++; - else - t = x; - { /* reject "//" */ - char *tt = t; - while (tt = strchr(tt, '/')) - while (*++tt == '/') - t = tt; - } - while (*t == '/') /* reject leading "/" on what's left */ - t++; - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (dosify) - msname(n); - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - return x; -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - time_t u[2]; /* argument for utime() */ - - /* Convert DOS time to time_t format in u */ - u[0] = u[1] = dos2unixtime(d); - - /* Set updated and accessed times of f */ - utime(f, u); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) - error("fstat(stdin)"); - } else if (SSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - if ((s.st_mode & S_IFDIR) != 0) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime(&s.st_mtime); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ -{ -#ifdef USE_EF_UT_TIME -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(1))) == NULL) - return ZE_MEM; - - z->extra[0] = 'U'; - z->extra[1] = 'T'; - z->extra[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - z->extra[3] = 0; - z->extra[4] = EB_UT_FL_MTIME; - z->extra[5] = (char)(z_utim->mtime); - z->extra[6] = (char)(z_utim->mtime >> 8); - z->extra[7] = (char)(z_utim->mtime >> 16); - z->extra[8] = (char)(z_utim->mtime >> 24); - - z->cextra = z->extra; - z->cext = z->ext = (EB_HEADSIZE+EB_UT_LEN(1)); - - return ZE_OK; -#else /* !USE_EF_UT_TIME */ - return (int)(z-z); -#endif /* ?USE_EF_UT_TIME */ -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). - */ -{ - return rmdir(d); -} - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - - -/* NOTE: the following include depends upon the environment - * variable $Workbench to be set correctly. (Set by - * default, by Version command in Startup-sequence.) - */ -int WBversion = (int) -#include "ENV:Workbench" -; - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s under %s%s%s%s.\n\n"; - -/* Define buffers. */ - - char buf1[16]; /* compiler name */ - char buf2[16]; /* revstamp */ - char buf3[16]; /* OS */ - char buf4[16]; /* Date */ -/* char buf5[16]; /* Time */ - -/* format "with" name strings */ - -#ifdef AMIGA -# ifdef __SASC - strcpy(buf1,"SAS/C "); -# else -# ifdef LATTICE - strcpy(buf1,"Lattice C "); -# else -# ifdef AZTEC_C - strcpy(buf1,"Manx Aztec C "); -# else - strcpy(buf1,"UNKNOWN "); -# endif -# endif -# endif -/* "under" */ - sprintf(buf3,"AmigaDOS v%d",WBversion); -#else - strcpy(buf1,"Unknown compiler "); - strcpy(buf3,"Unknown OS"); -#endif - -/* Define revision, date, and time strings. - * NOTE: Do not calculate run time, be sure to use time compiled. - * Pass these strings via your makefile if undefined. - */ - -#if defined(__VERSION__) && defined(__REVISION__) - sprintf(buf2,"version %d.%d",__VERSION__,__REVISION__); -#else -# ifdef __VERSION__ - sprintf(buf2,"version %d",__VERSION__); -# else - sprintf(buf2,"unknown version"); -# endif -#endif - -#ifdef __DATE__ - sprintf(buf4," on %s",__DATE__); -#else - strcpy(buf4," unknown date"); -#endif - -/****** -#ifdef __TIME__ - sprintf(buf5," at %s",__TIME__); -#else - strcpy(buf5," unknown time"); -#endif -******/ - -/* Print strings using "CompiledWith" mask defined above. - * ("Compiled with %s%s under %s%s%s%s.") - */ - - printf(CompiledWith, - buf1, - buf2, - buf3, - buf4, - /* buf5, */ "", - "" ); /* buf6 not used */ - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/amiga/crc_68.a b/third_party/infozip/zip/amiga/crc_68.a deleted file mode 100644 index 4cc2a259e..000000000 --- a/third_party/infozip/zip/amiga/crc_68.a +++ /dev/null @@ -1,144 +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 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 -;=========================================================================== -; crc_68 created by Paul Kienitz, last modified 04 Jan 96. -; -; Return an updated 32 bit CRC value, given the old value and a block of data. -; The CRC table used to compute the value is gotten by calling get_crc_table(). -; This replaces the older updcrc() function used in Zip and fUnZip. The -; prototype of the function is: -; -; ulg crc32(ulg crcval, uch *text, extent textlen); -; -; On the Amiga, type extent is always unsigned long, not unsigned int, because -; int can be short or long at whim, but size_t is long. -; -; If using this source on a non-Amiga 680x0 system, note that we treat -; a0/a1/d0/d1 as scratch registers not preserved across function calls. -; We do not bother to support registerized arguments for crc32() -- the -; textlen parm is usually large enough so that savings outside the loop -; are pointless. -; -; Define NO_UNROLLED_LOOPS to use a simple short loop which might be more -; efficient on certain machines with dinky instruction caches ('020?), or for -; processing short strings. If loops are unrolled, the textlen parm must be -; less than 512K; if not unrolled, it must be less than 64K. - - xdef _crc32 ; (ulg val, uch *buf, extent bufsize) - -DO_CRC0 MACRO - moveq #0,ltemp - move.b (textbuf)+,ltemp - eor.b crcval,ltemp - lsl.w #2,ltemp - move.l (crc_table,ltemp.w),ltemp - lsr.l #8,crcval - eor.l ltemp,crcval - ENDM - - machine mc68020 - -DO_CRC2 MACRO - move.b (textbuf)+,btemp - eor.b crcval,btemp - lsr.l #8,crcval - move.l (crc_table,btemp.w*4),ltemp - eor.l ltemp,crcval - ENDM - -crc_table equr a0 array of unsigned long -crcval equr d0 unsigned long initial value -textbuf equr a1 array of unsigned char -textbufsize equr d1 unsigned long (count of bytes in textbuf) -btemp equr d2 -ltemp equr d3 - - - xref _get_crc_table ; ulg *get_crc_table(void) - - NOLIST - INCLUDE 'exec/execbase.i' - LIST - xref _SysBase ; struct ExecBase * - - -_crc32: - move.l 8(sp),d0 - bne.s valid - moveq #0,d0 - rts -valid: movem.l btemp/ltemp,-(sp) - jsr _get_crc_table - move.l d0,ltemp - move.l 12(sp),crcval - move.l 16(sp),textbuf - move.l 20(sp),textbufsize - not.l crcval - move.l _SysBase,crc_table - move.w AttnFlags(crc_table),btemp - move.l ltemp,crc_table - btst #AFB_68020,btemp - bne twenty - - IFD NO_UNROLLED_LOOPS - - bra.s decr -loop: DO_CRC0 -decr: dbra textbufsize,loop - bra.s done - -twenty: moveq #0,btemp - bra.s decr2 -loop2: DO_CRC2 -decr2: dbra textbufsize,loop2 - - ELSE ; !NO_UNROLLED_LOOPS - - move.l textbufsize,btemp - lsr.l #3,textbufsize - bra decr8 -loop8: DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 -decr8: dbra textbufsize,loop8 - and.w #7,btemp - bra.s decr1 -loop1: DO_CRC0 -decr1: dbra btemp,loop1 - bra done - -twenty: moveq #0,btemp - move.l textbufsize,-(sp) - lsr.l #3,textbufsize - bra decr82 -loop82: DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 -decr82: dbra textbufsize,loop82 - move.l (sp)+,textbufsize - and.w #7,textbufsize - bra.s decr12 -loop12: DO_CRC2 -decr12: dbra textbufsize,loop12 - - ENDC ; ?NO_UNROLLED_LOOPS - -done: movem.l (sp)+,btemp/ltemp - not.l crcval -;;;;; move.l crcval,d0 ; crcval already is d0 - rts diff --git a/third_party/infozip/zip/amiga/deflate.a b/third_party/infozip/zip/amiga/deflate.a deleted file mode 100644 index b21adaea3..000000000 --- a/third_party/infozip/zip/amiga/deflate.a +++ /dev/null @@ -1,1053 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; This is a 680x0 assembly language translation of the Info-ZIP source file -; deflate.c, by Paul Kienitz. The function longest_match is based in part -; on match.a by Carsten Steger, which in turn is partly based on match.s -; for 386 by Jean-loup Gailly and Kai Uwe Rommel. Mostly, however, this -; material is based on deflate.c, by Gailly, Rommel, and Igor Mandrichenko. -; This code is not commented very much; see deflate.c for comments that explain -; what the functions are doing. -; -; The symbols that can be used to select different versions are as follows: -; -; CPU020 if defined, use 68020 instructions always. -; -; CPUTEST if defined, check at runtime for CPU type. Another symbol -; specifying the platform-specific test must be used with this. -; If neither of these is defined, use 68000 instructions only. -; Runtime test is nonportable; it is different for each OS. -; -; AMIGA use Amiga-specific test for 68020, if CPUTEST defined. Also -; tells it that registers d0/a0/d1/a1 are not preserved by -; function calls. At present, if AMIGA is not defined, it -; causes functions to preserve all registers. ALL OF THIS CODE -; CURRENTLY ASSUMES THAT REGISTERS D2-D7/A2-A6 WILL BE PRESERVED -; BY ANY FUNCTIONS THAT IT CALLS. -; -; DYN_ALLOC should be defined here if it is defined for C source; tells us -; that big arrays are allocated instead of static. -; -; WSIZE must be defined as the same number used for WSIZE in the C -; source, and must be a power of two <= 32768. As elsewhere, -; the default value is 32768. -; -; INT16 define this if ints are 16 bits; otherwise 32 bit ints assumed. -; -; SMALL_MEM define this if it is defined in the C source; otherwise it uses -; the MEDIUM_MEM model. BIG_MEM and MMAP are *not* supported. -; The FULL_SEARCH option in deflate.c is also not supported. -; -; DEBUG activates some tracing output, as in the C source. -; -; QUADLONG this selects a different version of the innermost longest_match -; loop code for 68020 operations, comparing bytes four at a time -; instead of two at a time. It seems to be a tiny bit faster on -; average, but it's slower often enough that one can't generalize. -; -; This code currently assumes that function results are returned in D0 for -; all platforms. It assumes that args to functions are pushed onto the stack, -; last arg first. It also currently assumes that all C symbols have an -; underscore prepended when referenced from assembly. - - IFND CPU020 - IFND CPUTEST -CPU000 equ 1 - ENDC - ENDC - -; Use these macros for accessing variables of type int: - IFD INT16 -MOVINT MACRO - move.w \1,\2 - ENDM -CLRINT MACRO - clr.w \1 - ENDM -INTSIZE equ 2 - ELSE ; !INT16 -MOVINT MACRO - move.l \1,\2 - ENDM -CLRINT MACRO - clr.l \1 - ENDM -INTSIZE equ 4 - ENDC - - IFD DYN_ALLOC -BASEPTR MACRO - move.l \1,\2 - ENDM - ELSE -BASEPTR MACRO - lea \1,\2 - ENDM - ENDC - -; constants we use, many of them adjustable: - -MAX_MATCH equ 258 -MIN_MATCH equ 3 -TOO_FAR equ 4096 - IFND WSIZE -WSIZE equ 32768 - ENDC -WMASK equ WSIZE-1 -MAX_DIST equ WSIZE-MAX_MATCH-MIN_MATCH-1 -MIN_LOOKAHEAD equ MAX_MATCH+MIN_MATCH+1 -; IFD BIG_MEM ; NOT supported -- type Pos needs to be 32 bits -;HASH_BITS equ 15 -; ELSE - IFD SMALL_MEM -HASH_BITS equ 13 - ELSE -HASH_BITS equ 14 ; default -- MEDIUM_MEM - ENDC -; ENDC ; BIG_MEM -HASH_SIZE equ 1< - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b -1(Window,Strst.l),d0 - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally - addq #2*INTSIZE,sp - tst.w d0 - beq.s skipliteral - FLUSH_B #0 - move.l Strst,_block_start -skipliteral: - addq.w #1,Strst - subq.w #1,Look - -refill: - cmp.w #MIN_LOOKAHEAD,Look - bhs look_loop - bsr fill_window - bra look_loop - -last_tally: - tst.w Avail - beq last_flush - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b -1(Window,Strst.l),d0 - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally - addq #2*INTSIZE,sp -last_flush: - FLUSH_B #1 - bra deflate_exit - -; ================== This is another version used for low compression levels: - -deflate_fast: - moveq #0,MatchL - moveq #MIN_MATCH-1,PrevL -flook_loop: - tst.w Look - beq flast_flush - - IN_STR a0,d0 - tst.w Head - beq.s fno_new_match - move.w Strst,d0 - sub.w Head,d0 - cmp.w #MAX_DIST,d0 - bhi.s fno_new_match - move.w PrevL,prev_length ; longest_match reads these variables - MOVINT Strst,_strstart - MOVINT Head,d0 ; parm for longest_match - bsr longest_match ; sets match_start - cmp.w Look,d0 ; does length exceed valid data? - bls.s fstml - move.w Look,d0 -fstml: move.w d0,MatchL ; valid length of match - -fno_new_match: - cmp.w #MIN_MATCH,MatchL - blo fliteral - ; CHECK_MATCH Strst,match_start,MatchL - MOVINT Strst,_strstart ; ct_tally reads this variable - move.l MatchL,d0 - subq.w #MIN_MATCH,d0 - MOVINT d0,-(sp) - move.l Strst,d0 - sub.w match_start,d0 - MOVINT d0,-(sp) - jsr _ct_tally ; sets d0 true if we have to flush - addq #2*INTSIZE,sp - sub.w MatchL,Look - cmp.w max_lazy_match,MatchL - bhi ftoolong - subq.w #2,MatchL -finsertmatch: - addq.w #1,Strst - IN_STR a0,d1 ; preserve d0 - dbra MatchL,finsertmatch - moveq #0,MatchL ; not needed? - addq.w #1,Strst - bra.s flushfill - -ftoolong: - add.w MatchL,Strst - moveq #0,MatchL - moveq #0,d1 ; preserve d0 - move.b (Window,Strst.l),d1 - move.w d1,ins_h -; My assembler objects to passing <1(Window,Strst.l)> directly to UP_HASH... - move.b 1(Window,Strst.l),Avail ; Avail is not used in deflate_fast - UP_HASH d1,Avail ; preserve d0 - IFNE MIN_MATCH-3 - FAIL needs to UP_HASH another MIN_MATCH-3 times, but with what arg? - ENDC - bra.s flushfill - -fliteral: - TRACE_C <(Window,Strst.l)> - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b (Window,Strst.l),d0 - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally ; d0 set if we need to flush - addq #2*INTSIZE,sp - addq.w #1,Strst - subq.w #1,Look - -flushfill: - tst.w d0 - beq.s frefill - FLUSH_B #0 - move.l Strst,_block_start -frefill: - cmp.w #MIN_LOOKAHEAD,Look - bhs flook_loop - bsr fill_window - bra flook_loop - -flast_flush: - FLUSH_B #1 ; sets our return value - -deflate_exit: - MOVINT Strst,_strstart ; save back cached values - move.w PrevL,prev_length - move.w Look,lookahead - movem.l (sp)+,DEFREGS - rts - - -; ========================================================================= -; void fill_window(void) calls the input function to refill the sliding -; window that we use to find substring matches in. - -More equr Head ; local variable in fill_window -WindTop equr Prev ; local variable used for sliding -SlidIx equr PrevL ; local variable used for sliding - - IFD AMIGA -FWREGS reg d2-d5/a2-a6 ; does NOT include Look and Strst - ELSE -FWREGS reg d1-d5/a0-a6 ; likewise - ENDC -; all registers available to be clobbered by the sliding operation: -; we exclude More, WindTop, SlidIx, Look, Strst, Window, a4 and a7. -SPAREGS reg d0-d3/a0-a1/a5-a6 -SPCOUNT equ 8 ; number of registers in SPAREGS - - -_fill_window: ; C-callable entry point - movem.l Strst/Look,-(sp) - IFD INT16 - moveq #0,Strst ; Strst must be valid as a long - ENDC - MOVINT _strstart,Strst - move.w lookahead,Look - BASEPTR _window,Window - bsr.s fill_window - MOVINT Strst,_strstart - move.w Look,lookahead - movem.l (sp)+,Strst/Look - rts - -; strstart, lookahead, and window must be cached in Strst, Look, and Window: -fill_window: ; asm-callable entry point - movem.l FWREGS,-(sp) - tst.w eofile ; we put this up here for speed - bne fwdone - and.l #$FFFF,Look ; make sure Look is valid as long -fw_refill: - move.l _window_size,More ; <= 64K - sub.l Look,More - sub.l Strst,More ; Strst is already valid as long - cmp.w #EOF,More - bne.s notboundary - subq.w #1,More - bra checkend - -notboundary: - tst.w sliding - beq checkend - cmp.w #WSIZE+MAX_DIST,Strst - blo checkend - IFGT 32768-WSIZE - lea WSIZE(Window),WindTop ; WindTop is aligned when Window is - ELSE - move.l Window,WindTop - add.l #WSIZE,WindTop - ENDC - move.l Window,d0 - and.w #3,d0 - beq.s isaligned - subq.w #1,d0 -align: move.b (WindTop)+,(Window)+ ; copy up to a longword boundary - dbra d0,align -isaligned: -; This is faster than a simple move.l (WindTop)+,(Window)+ / dbra loop: - move.w #(WSIZE-1)/(4*SPCOUNT),SlidIx -slide: movem.l (WindTop)+,SPAREGS ; copy, 32 bytes at a time! - movem.l SPAREGS,(Window) ; a slight overshoot doesn't matter. - lea 4*SPCOUNT(Window),Window ; can't use (aN)+ as movem.l dest - dbra SlidIx,slide - BASEPTR _window,Window ; restore cached value - sub.w #WSIZE,match_start - sub.w #WSIZE,Strst - sub.l #WSIZE,_block_start - add.w #WSIZE,More - BASEPTR _head,a0 - move.w #HASH_SIZE-1,d0 -fixhead: - move.w (a0),d1 - sub.w #WSIZE,d1 - bpl.s headok - moveq #0,d1 -headok: move.w d1,(a0)+ - dbra d0,fixhead - BASEPTR _prev,a0 - move.w #WSIZE-1,d0 -fixprev: - move.w (a0),d1 - sub.w #WSIZE,d1 - bpl.s prevok - moveq #0,d1 -prevok: move.w d1,(a0)+ - dbra d0,fixprev - TRACE_C #'.' - -checkend: ; assert eofile is false - MOVINT More,-(sp) ; assert More's upper word is zero - move.l Strst,d0 - add.w Look,d0 - add.l Window,d0 - move.l d0,-(sp) - move.l _read_buf,a0 - jsr (a0) ; refill the upper part of the window - addq #4+INTSIZE,sp - tst.w d0 - beq.s iseof - cmp.w #EOF,d0 - beq.s iseof - add.w d0,Look - cmp.w #MIN_LOOKAHEAD,Look - blo fw_refill ; eofile is still false - - bra.s fwdone -iseof: move.w #1,eofile -fwdone: movem.l (sp)+,FWREGS - rts - - -; ========================================================================= -; void lm_free(void) frees dynamic arrays in the DYN_ALLOC version. - - xdef _lm_free ; the entry point - -_lm_free: - IFD DYN_ALLOC - move.l _window,d0 - beq.s lf_no_window - move.l d0,-(sp) - jsr _free - addq #4,sp - clr.l _window -lf_no_window: - move.l _prev,d0 - beq.s lf_no_prev - move.l d0,-(sp) - jsr _free - move.l _head,(sp) ; reuse the same stack arg slot - jsr _free - addq #4,sp - clr.l _prev - clr.l _head -lf_no_prev: - ENDC - rts - -; ============================================================================ -; void lm_init(int pack_level, unsigned short *flags) allocates dynamic arrays -; if any, and initializes all variables so that deflate() is ready to go. - - xdef _lm_init ; the entry point - -Level equr d2 -;Window equr a2 ; as in deflate() - IFD AMIGA -INIREGS reg d2/a2 - ELSE -INIREGS reg d0-d2/a0-a1 - ENDC - -_lm_init: - MOVINT 4(sp),d0 - move.l 4+INTSIZE(sp),a0 - movem.l INIREGS,-(sp) - move.w d0,Level - cmp.w #1,Level - blt.s levelerr - bgt.s try9 - bset.b #B_FAST,1(a0) -try9: cmp.w #9,Level - bgt.s levelerr - blt.s levelok - bset.b #B_SLOW,1(a0) - bra.s levelok -levelerr: - pea level_message - jsr _error ; never returns -levelok: - clr.w sliding - tst.l _window_size - bne.s gotawindowsize - move.w #1,sliding - move.l #2*WSIZE,_window_size -gotawindowsize: - - BASEPTR _window,Window - IFD DYN_ALLOC - move.l Window,d0 ; fake tst.l - bne.s gotsomewind - CAL_SH WSIZE - move.l d0,Window - move.l d0,_window - bne.s gotsomewind - pea window_message - MOVINT #ZE_MEM,-(sp) - jsr _ziperr ; never returns -gotsomewind: - tst.l _prev - bne.s gotsomehead - CAL_SH WSIZE - move.l d0,_prev - beq.s nohead - CAL_SH HASH_SIZE - move.l d0,_head - bne.s gotfreshhead ; newly calloc'd memory is zeroed -nohead: pea hash_message - MOVINT #ZE_MEM,-(sp) - jsr _ziperr ; never returns -gotsomehead: - ENDC ; DYN_ALLOC - - move.w #(HASH_SIZE/2)-1,d0 ; two shortwords per loop - BASEPTR _head,a0 -wipeh: clr.l (a0)+ - dbra d0,wipeh -gotfreshhead: - move.l Level,d0 - IFEQ Sizeof_config-8 - asl.l #3,d0 - ELSE - mulu #Sizeof_config,d0 - ENDC - lea config_table,a0 - add.l d0,a0 - move.w Max_lazy(a0),max_lazy_match - move.w Good_length(a0),good_match - move.w Nice_length(a0),nice_match - move.w Max_chain(a0),max_chain_len - CLRINT _strstart - clr.l _block_start - bsr match_init - - clr.w eofile - MOVINT #WSIZE,-(sp) ; We read only 32K because lookahead is short - move.l Window,-(sp) ; even when int size is long, as if deflate.c - move.l _read_buf,a0 ; were compiled with MAXSEG_64K defined. - jsr (a0) - addq #4+INTSIZE,sp - move.w d0,lookahead - beq.s noread - cmp.w #EOF,d0 - bne.s irefill -noread: move.w #1,eofile - clr.w lookahead - bra.s init_done - -irefill: - move.w lookahead,d0 - cmp.w #MIN_LOOKAHEAD,d0 - bhs.s hashify - bsr _fill_window ; use the C-callable version -hashify: - clr.w ins_h - moveq #MIN_MATCH-2,d0 -hash1: move.b (Window)+,d1 - UP_HASH Level,d1 - dbra d0,hash1 - -init_done: - movem.l (sp)+,INIREGS - rts - -; strings for error messages: -hash_message dc.b 'hash table allocation',0 -window_message dc.b 'window allocation',0 -level_message dc.b 'bad pack level',0 - - end diff --git a/third_party/infozip/zip/amiga/filedate.c b/third_party/infozip/zip/amiga/filedate.c deleted file mode 100644 index 9ccbdda38..000000000 --- a/third_party/infozip/zip/amiga/filedate.c +++ /dev/null @@ -1,599 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -/* Low-level Amiga routines shared between Zip and UnZip. - * - * Contains: FileDate() - * getenv() [replaces inadequate standard library version] - * setenv() [SAS/C only, replaces standard library version] - * set_TZ() [SAS/C only] - * GetPlatformLocalTimezone() [callback from timezone.c tzset()] - * time() - * sendpkt() - * Agetch() - * - * The first five are used by most Info-ZIP programs except fUnZip. - * The last two are used by all except the non-CRYPT version of fUnZip. - * Probably some of the stuff in here is unused by ZipNote and ZipSplit too... - * sendpkt() is used by Agetch() and FileDate(), and by screensize() in - * amiga/amiga.c (UnZip); time() is used only by Zip. - */ - - -/* HISTORY/CHANGES - * 2 Sep 92, Greg Roelofs, Original coding. - * 6 Sep 92, John Bush, Incorporated into UnZip 5.1 - * 6 Sep 92, John Bush, Interlude "FileDate()" defined, which calls or - * redefines SetFileDate() depending upon AMIGADOS2 definition. - * 11 Oct 92, John Bush, Eliminated AMIGADOS2 switch by determining - * revision via OpenLibrary() call. Now only one version of - * the program runs on both platforms (1.3.x vs. 2.x) - * 11 Oct 92, John Bush, Merged with Zip version and changed arg passing - * to take time_t input instead of struct DateStamp. - * Arg passing made to conform with utime(). - * 22 Nov 92, Paul Kienitz, fixed includes for Aztec and cleaned up some - * lint-ish errors; simplified test for AmigaDOS version. - * 11 Nov 95, Paul Kienitz, added Agetch() for crypt password input and - * UnZip's "More" prompt -- simplifies crypt.h and avoids - * use of library code redundant with sendpkt(). Made it - * available to fUnZip, which does not use FileDate(). - * 22 Nov 95, Paul Kienitz, created a new tzset() that gets the current - * timezone from the Locale preferences. These exist only under - * AmigaDOS 2.1 and up, but it is probably correctly set on more - * Amigas than the TZ environment variable is. We check that - * only if TZ is not validly set. We do not parse daylight - * savings syntax except to check for presence vs. absence of a - * DST part; United States rules are assumed. This is better - * than the tzset()s in the Amiga compilers' libraries do. - * 15 Jan 96, Chr. Spieler, corrected the logic when to select low level - * sendpkt() (when FileDate(), Agetch() or windowheight() is used), - * and AMIGA's Agetch() (CRYPT, and UnZip(SFX)'s UzpMorePause()). - * 10 Feb 96, Paul Kienitz, re-fiddled that selection logic again, moved - * stuff around for clarity. - * 16 Mar 96, Paul Kienitz, created a replacement localtime() to go with the - * new tzset(), because Aztec's is hopelessly broken. Also - * gmtime(), which localtime() calls. - * 12 Apr 96, Paul Kienitz, daylight savings was being handled incorrectly. - * 21 Apr 96, Paul Kienitz, had to replace time() as well, Aztec's returns - * local time instead of GMT. That's why their localtime() was bad, - * because it assumed time_t was already local, and gmtime() was - * the one that checked TZ. - * 23 Apr 96, Chr. Spieler, deactivated time() replacement for UnZip stuff. - * Currently, the UnZip sources do not make use of time() (and do - * not supply the working mktime() replacement, either!). - * 29 Apr 96, Paul Kienitz, created a replacement getenv() out of code that - * was previously embedded in tzset(), for reliable global test - * of whether TZ is set or not. - * 19 Jun 96, Haidinger Walter, re-adapted for current SAS/C compiler. - * 7 Jul 96, Paul Kienitz, smoothed together compiler-related changes. - * 4 Feb 97, Haidinger Walter, added set_TZ() for SAS/C. - * 23 Apr 97, Paul Kienitz, corrected Unix->Amiga DST error by adding - * mkgmtime() so localtime() could be used. - * 28 Apr 97, Christian Spieler, deactivated mkgmtime() definition for ZIP; - * the Zip sources supply this function as part of util.c. - * 24 May 97, Haidinger Walter, added time_lib support for SAS/C and moved - * set_TZ() to time_lib.c. - * 12 Jul 97, Paul Kienitz, adapted time_lib stuff for Aztec. - * 26 Jul 97, Chr. Spieler, old mkgmtime() fixed (ydays[] def, sign vs unsign). - * 30 Dec 97, Haidinger Walter, adaptation for SAS/C using z-stat.h functions. - * 19 Feb 98, Haidinger Walter, removed alloc_remember, more SAS.C fixes. - * 23 Apr 98, Chr. Spieler, removed mkgmtime(), changed FileDate to convert to - * Amiga file-time directly. - * 24 Apr 98, Paul Kienitz, clip Unix dates earlier than 1978 in FileDate(). - * 02 Sep 98, Paul Kienitz, C. Spieler, always include zip.h to get a defined - * header inclusion sequence that resolves all header dependencies. - * 06 Jun 00, Paul Kienitz, removed time_lib.c due to its incompatible license, - * moved set_TZ() back here, replaced minimal tzset() and localtime() - * with new versions derived from GNU glibc source. Gave locale_TZ() - * reasonable European defaults for daylight savings. - * 17 Jun 00, Paul Kienitz, threw out GNU code because of objections to the GPL - * virus, replaced with similar functions based on the public domain - * timezone code at ftp://elsie.nci.nih.gov/pub. As with the GNU - * stuff, support for timezone files and leap seconds was removed. - * 23 Aug 00, Paul Kienitz, moved timezone code out from here into separate - * platform-independent module 'timezone.c'. - * 31 Dec 00, Christian Spieler, moved system-specific timezone help funcions - * back in here, from 'timezone.c'. - * 07 Jan 01, Paul Kienitz, Chr. Spieler, added missing #include "timezone.h" - * and "symbolic" preprocessor constants for time calculations. - * 15 Jan 02, Paul Kienitz, excluded all time handling code from compilation - * for Zip utilities (when "defined(UTIL)") - */ - -#ifndef __amiga_filedate_c -#define __amiga_filedate_c - - -#include "zip.h" -#include -#include - -#include -#include -#include -#include - -#ifdef AZTEC_C -# include -# include -# include -# include -# include -# include -# include -# include -# define ESRCH ENOENT -# define EOSERR EIO -#endif - -#ifdef __SASC -# include -# if (defined(_M68020) && (!defined(__USE_SYSBASE))) - /* on 68020 or higher processors it is faster */ -# define __USE_SYSBASE /* to use the pragma libcall instead of syscall */ -# endif /* to access functions of the exec.library */ -# include /* see SAS/C manual:part 2,chapter 2,pages 6-7 */ -# include -# include -# ifdef DEBUG -# include -# endif -# ifdef MWDEBUG -# include /* include both before memwatch.h again just */ -# include /* to be safe */ -# include "memwatch.h" -# endif /* MWDEBUG */ -#endif /* __SASC */ - -#include "crypt.h" /* just so we can tell if CRYPT is supported */ - - -#if (!defined(FUNZIP) && !defined(UTIL)) - -#include "timezone.h" /* for AMIGA-specific timezone callbacks */ - -#ifndef SUCCESS -# define SUCCESS (-1L) -# define FAILURE 0L -#endif - -#define ReqVers 36L /* required library version for SetFileDate() */ -#define ENVSIZE 100 /* max space allowed for an environment var */ - -extern struct ExecBase *SysBase; - -#ifndef min -# define min(a, b) ((a) < (b) ? (a) : (b)) -# define max(a, b) ((a) < (b) ? (b) : (a)) -#endif - -#if defined(ZIP) || defined(HAVE_MKTIME) -static const unsigned short ydays[] = - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; -#else -extern const unsigned short ydays[]; /* in unzip's fileio.c */ -#endif - -#define LEAP(y) (((y) % 4 == 0 && (y) % 100 != 0) || (y) % 400 == 0) -#define YDAYS(m, y) (ydays[m] + (m > 1 && LEAP(y))) -/* Number of leap years from 1978 to `y' (not including `y' itself). */ -#define ANLEAP(y) (((y) - 1977) / 4 - ((y) - 1901) / 100 + ((y) - 1601) / 400) -#define SECSPERMIN 60 -#define MINSPERHOUR 60 -#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -#define SECSPERDAY 86400L - -/* prototypes */ -char *getenv(const char *var); -#ifdef __SASC -/* XXX !! We have really got to find a way to operate without these. */ -int setenv(const char *var, const char *value, int overwrite); -void set_TZ(long time_zone, int day_light); -#endif - -LONG FileDate(char *filename, time_t u[]); -LONG sendpkt(struct MsgPort *pid, LONG action, LONG *args, LONG nargs); -int Agetch(void); - -/* =============================================================== */ - -/***********************/ -/* Function filedate() */ -/***********************/ - -/* FileDate() (originally utime.c), by Paul Wells. Modified by John Bush - * and others (see also sendpkt() comments, below); NewtWare SetFileDate() - * clone cheaply ripped off from utime(). - */ - -/* DESCRIPTION - * This routine chooses between 2 methods to set the file date on AMIGA. - * Since AmigaDOS 2.x came out, SetFileDate() was available in ROM (v.36 - * and higher). Under AmigaDOS 1.3.x (less than v.36 ROM), SetFileDate() - * must be accomplished by constructing a message packet and sending it - * to the file system handler of the file to be stamped. - * - * The system's ROM version is extracted from the external system Library - * base. - * - * NOTE: although argument passing conforms with utime(), note the - * following differences: - * - Return value is boolean success/failure. - * - If a structure or array is passed, only the first value - * is used, which *may* correspond to date accessed and not - * date modified. - */ - -LONG FileDate(filename, u) - char *filename; - time_t u[]; -{ - LONG SetFileDate(UBYTE *filename, struct DateStamp *pDate); - LONG sendpkt(struct MsgPort *pid, LONG action, LONG *args, LONG nargs); - struct MsgPort *taskport; - BPTR dirlock, lock; - struct FileInfoBlock *fib; - LONG pktargs[4]; - UBYTE *ptr; - long ret; - - struct DateStamp pDate; - struct tm *ltm; - int years; - - tzset(); - /* Amiga file date is based on 01-Jan-1978 00:00:00 (local time): - * 8 years and 2 leapdays difference from Unix time. - */ - ltm = localtime(&u[0]); - years = ltm->tm_year + 1900; - if (years < 1978) - pDate.ds_Days = pDate.ds_Minute = pDate.ds_Tick = 0; - else { - pDate.ds_Days = (years - 1978) * 365L + (ANLEAP(years)) + - YDAYS(ltm->tm_mon, years) + (ltm->tm_mday - 1); - pDate.ds_Minute = ltm->tm_hour * 60 + ltm->tm_min; - pDate.ds_Tick = ltm->tm_sec * TICKS_PER_SECOND; - } - - if (SysBase->LibNode.lib_Version >= ReqVers) - { - return (SetFileDate(filename,&pDate)); /* native routine at 2.0+ */ - } - else /* !(SysBase->lib_Version >=ReqVers) */ - { - if( !(taskport = (struct MsgPort *)DeviceProc(filename)) ) - { - errno = ESRCH; /* no such process */ - return FAILURE; - } - - if( !(lock = Lock(filename,SHARED_LOCK)) ) - { - errno = ENOENT; /* no such file */ - return FAILURE; - } - - if( !(fib = (struct FileInfoBlock *)AllocMem( - (long)sizeof(struct FileInfoBlock),MEMF_PUBLIC|MEMF_CLEAR)) ) - { - errno = ENOMEM; /* insufficient memory */ - UnLock(lock); - return FAILURE; - } - - if( Examine(lock,fib)==FAILURE ) - { - errno = EOSERR; /* operating system error */ - UnLock(lock); - FreeMem(fib,(long)sizeof(*fib)); - return FAILURE; - } - - dirlock = ParentDir(lock); - ptr = (UBYTE *)AllocMem(64L,MEMF_PUBLIC); - strcpy((ptr+1),fib->fib_FileName); - *ptr = strlen(fib->fib_FileName); - FreeMem(fib,(long)sizeof(*fib)); - UnLock(lock); - - /* now fill in argument array */ - - pktargs[0] = 0; - pktargs[1] = (LONG)dirlock; - pktargs[2] = (LONG)&ptr[0] >> 2; - pktargs[3] = (LONG)&pDate; - - errno = ret = sendpkt(taskport,ACTION_SET_DATE,pktargs,4L); - - FreeMem(ptr,64L); - UnLock(dirlock); - - return SUCCESS; - } /* ?(SysBase->lib_Version >= ReqVers) */ -} /* FileDate() */ - - -char *getenv(const char *var) /* not reentrant! */ -{ - static char space[ENVSIZE]; - struct Process *me = (void *) FindTask(NULL); - void *old_window = me->pr_WindowPtr; - char *ret = NULL; - - me->pr_WindowPtr = (void *) -1; /* suppress any "Please insert" popups */ - if (SysBase->LibNode.lib_Version >= ReqVers) { - if (GetVar((char *) var, space, ENVSIZE - 1, /*GVF_GLOBAL_ONLY*/ 0) > 0) - ret = space; - } else { /* early AmigaDOS, get env var the crude way */ - BPTR hand, foot, spine; - int z = 0; - if (foot = Lock("ENV:", ACCESS_READ)) { - spine = CurrentDir(foot); - if (hand = Open((char *) var, MODE_OLDFILE)) { - z = Read(hand, space, ENVSIZE - 1); - Close(hand); - } - UnLock(CurrentDir(spine)); - } - if (z > 0) { - space[z] = '\0'; - ret = space; - } - } - me->pr_WindowPtr = old_window; - return ret; -} - -#ifdef __SASC -int setenv(const char *var, const char *value, int overwrite) -{ - struct Process *me = (void *) FindTask(NULL); - void *old_window = me->pr_WindowPtr; - int ret = -1; - - me->pr_WindowPtr = (void *) -1; /* suppress any "Please insert" popups */ - if (SysBase->LibNode.lib_Version >= ReqVers) - ret = !SetVar((char *)var, (char *)value, -1, GVF_GLOBAL_ONLY | LV_VAR); - else { - BPTR hand, foot, spine; - long len = value ? strlen(value) : 0; - if (foot = Lock("ENV:", ACCESS_READ)) { - spine = CurrentDir(foot); - if (len) { - if (hand = Open((char *) var, MODE_NEWFILE)) { - ret = Write(hand, (char *) value, len + 1) >= len; - Close(hand); - } - } else - ret = DeleteFile((char *) var); - UnLock(CurrentDir(spine)); - } - } - me->pr_WindowPtr = old_window; - return ret; -} - -/* Stores data from timezone and daylight to ENV:TZ. */ -/* ENV:TZ is required to exist by some other SAS/C library functions, */ -/* like stat() or fstat(). */ -void set_TZ(long time_zone, int day_light) -{ - char put_tz[MAXTIMEZONELEN]; /* string for putenv: "TZ=aaabbb:bb:bbccc" */ - int offset; - void *exists; /* dummy ptr to see if global envvar TZ already exists */ - exists = (void *)getenv(TZ_ENVVAR); - /* see if there is already an envvar TZ_ENVVAR. If not, create it */ - if (exists == NULL) { - /* create TZ string by pieces: */ - sprintf(put_tz, "GMT%+ld", time_zone / 3600L); - if (time_zone % 3600L) { - offset = (int) labs(time_zone % 3600L); - sprintf(put_tz + strlen(put_tz), ":%02d", offset / 60); - if (offset % 60) - sprintf(put_tz + strlen(put_tz), ":%02d", offset % 60); - } - if (day_light) - strcat(put_tz,"DST"); - setenv(TZ_ENVVAR, put_tz, 1); - } -} -#endif /* __SASC */ - -/* set state as well as possible from settings found in locale.library */ -int GetPlatformLocalTimezone(sp, fill_tzstate_from_rules) - 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); -{ - struct Library *LocaleBase; - struct Locale *ll; - struct Process *me = (void *) FindTask(NULL); - void *old_window = me->pr_WindowPtr; - BPTR eh; - int z, valid = FALSE; - - /* read timezone from locale.library if TZ envvar missing */ - me->pr_WindowPtr = (void *) -1; /* suppress any "Please insert" popups */ - if (LocaleBase = OpenLibrary("locale.library", 0)) { - if (ll = OpenLocale(NULL)) { - z = ll->loc_GMTOffset; /* in minutes */ - if (z == -300) { - if (eh = Lock("ENV:sys/locale.prefs", ACCESS_READ)) { - UnLock(eh); - valid = TRUE; - } else - z = 300; /* bug: locale not initialized, default bogus! */ - } else - valid = TRUE; - if (valid) { - struct rule startrule, stoprule; - - sp->timecnt = 0; - sp->typecnt = 1; - sp->charcnt = 2; - sp->chars[0] = sp->chars[1] = '\0'; - sp->ttis[0].tt_abbrind = 0; - sp->ttis[1].tt_abbrind = 1; - sp->ttis[0].tt_gmtoff = -z * MINSPERHOUR; - sp->ttis[1].tt_gmtoff = -z * MINSPERHOUR + SECSPERHOUR; - sp->ttis[0].tt_isdst = 0; - sp->ttis[1].tt_isdst = 1; - stoprule.r_type = MONTH_NTH_DAY_OF_WEEK; - stoprule.r_day = 0; - stoprule.r_week = 5; - stoprule.r_mon = 10; - stoprule.r_time = 2 * SECSPERHOUR; - startrule = stoprule; - startrule.r_mon = 4; - startrule.r_week = 1; - if (z >= -180 && z < 150) { - /* At this point we make a really gratuitous assumption: */ - /* if the time zone could be Europe, we use the European */ - /* Union rules without checking what country we're in. */ - /* The AmigaDOS locale country codes do not, at least in */ - /* 2.x versions of the OS, recognize very many countries */ - /* outside of Europe and North America. */ - sp->typecnt = 2; - startrule.r_mon = 3; /* one week earlier than US DST */ - startrule.r_week = 5; - } else if (z >= 150 && z <= 480 && - /* no DST in alaska, hawaii */ - (ll->loc_CountryCode == 0x55534100 /*"USA"*/ || - ll->loc_CountryCode == 0x43414E00 /*"CAN"*/)) - sp->typecnt = 2; - /* We check the country code for U.S. or Canada because */ - /* most of Latin America has no DST. Even in these two */ - /* countries there are some exceptions... */ - /* else if... Feel free to add more cases here! */ - - if (sp->typecnt > 1) - (*fill_tzstate_from_rules)(sp, &startrule, &stoprule); - } - CloseLocale(ll); - } - CloseLibrary(LocaleBase); - } - me->pr_WindowPtr = old_window; - return valid; -} - -#ifdef ZIP -time_t time(time_t *tp) -{ - time_t t; - struct DateStamp ds; - DateStamp(&ds); - t = ds.ds_Tick / TICKS_PER_SECOND + ds.ds_Minute * 60 - + (ds.ds_Days + 2922) * SECSPERDAY; - t = mktime(gmtime(&t)); - /* gmtime leaves ds in the local timezone, mktime converts it to GMT */ - if (tp) *tp = t; - return t; -} -#endif /* ZIP */ - -#endif /* !FUNZIP && !UTIL */ - - -#if CRYPT || !defined(FUNZIP) - -/* sendpkt.c - * by A. Finkel, P. Lindsay, C. Sheppner - * returns Res1 of the reply packet - */ -/* -#include -#include -#include -#include -#include -#include -*/ - -LONG sendpkt(struct MsgPort *pid, LONG action, LONG *args, LONG nargs); - -LONG sendpkt(pid,action,args,nargs) -struct MsgPort *pid; /* process identifier (handler message port) */ -LONG action, /* packet type (desired action) */ - *args, /* a pointer to argument list */ - nargs; /* number of arguments in list */ -{ - - struct MsgPort *replyport, *CreatePort(UBYTE *, long); - void DeletePort(struct MsgPort *); - struct StandardPacket *packet; - LONG count, *pargs, res1; - - replyport = CreatePort(NULL,0L); - if( !replyport ) return(0); - - packet = (struct StandardPacket *)AllocMem( - (long)sizeof(struct StandardPacket),MEMF_PUBLIC|MEMF_CLEAR); - if( !packet ) - { - DeletePort(replyport); - return(0); - } - - packet->sp_Msg.mn_Node.ln_Name = (char *)&(packet->sp_Pkt); - packet->sp_Pkt.dp_Link = &(packet->sp_Msg); - packet->sp_Pkt.dp_Port = replyport; - packet->sp_Pkt.dp_Type = action; - - /* copy the args into the packet */ - pargs = &(packet->sp_Pkt.dp_Arg1); /* address of 1st argument */ - for( count=0; countsp_Pkt.dp_Res1; - - FreeMem((char *)packet,(long)sizeof(*packet)); - DeletePort(replyport); - - return(res1); - -} /* sendpkt() */ - -#endif /* CRYPT || !FUNZIP */ - - -#if CRYPT || (defined(UNZIP) && !defined(FUNZIP)) - -/* Agetch() reads one raw keystroke -- uses sendpkt() */ - -int Agetch(void) -{ - LONG sendpkt(struct MsgPort *pid, LONG action, LONG *args, LONG nargs); - struct Task *me = FindTask(NULL); - struct CommandLineInterface *cli = BADDR(((struct Process *) me)->pr_CLI); - BPTR fh = cli->cli_StandardInput; /* this is immune to < redirection */ - void *conp = ((struct FileHandle *) BADDR(fh))->fh_Type; - char longspace[8]; - long *flag = (long *) ((ULONG) &longspace[4] & ~3); /* LONGWORD ALIGNED! */ - UBYTE c; - - *flag = 1; - sendpkt(conp, ACTION_SCREEN_MODE, flag, 1); /* assume success */ - Read(fh, &c, 1); - *flag = 0; - sendpkt(conp, ACTION_SCREEN_MODE, flag, 1); - if (c == 3) /* ^C in input */ - Signal(me, SIGBREAKF_CTRL_C); - return c; -} - -#endif /* CRYPT || (UNZIP && !FUNZIP) */ - -#endif /* __amiga_filedate_c*/ diff --git a/third_party/infozip/zip/amiga/makefile.azt b/third_party/infozip/zip/amiga/makefile.azt deleted file mode 100644 index d9390c8f2..000000000 --- a/third_party/infozip/zip/amiga/makefile.azt +++ /dev/null @@ -1,304 +0,0 @@ -# Makefile for Zip, ZipNote, ZipCloak, ZipSplit for Aztec C 5.2 -# Also ZipLM, a version of Zip that needs much less free memory -# -- Paul Kienitz, last updated 07 Jan 2007 - -# Make sure platform is defined correctly, and select memory usage options: -DEFINES = -d AMIGA -d DYN_ALLOC -d ASM_CRC - -CC = cc -AS = as -LD = ln -LDLIBS = -lc16 - - -# -------- RELEASE VERSION: -CFLAGS = -psb0e -sabfmnpu -wcr0u $(DEFINES) -# -pbs means unsigned chars and short ints, -sabfmnpu is various small -# optimizations, -wcr0u adjusts type checking strictness -ASOPTS = -n -eAMIGA -eDYN_ALLOC -eCPUTEST -eINT16 -LDFLAGS = -m +q - -# -------- DEBUG VERSION: -CFLAGD = -bs -psb0e -s0f0n -wcr0u $(DEFINES) -# -bs is include source debugging info, -s0f0n is avoid hard-to-debug -# optimizations -LDFLAGD = -m +q -g -w - -# -------- MINIMUM MEMORY USAGE RELEASE VERSION: -WSIZ = WSIZE=4096 -LOWFLAGS = $(CFLAGS) -d $(WSIZ) -d SMALL_MEM -LOWASOPTS = $(ASOPTS) -e$(WSIZ) -eSMALL_MEM -# Options used for assembling amiga/deflate.a; must generally match the -# settings in DEFINES. - -# -------- MINIMUM MEMORY USAGE DEBUG VERSION: -LOWFLAGD = $(CFLAGD) -d $(WSIZ) -d SMALL_MEM - -# the directory where we stick all the object files: -O = obA/ - - -# default C rules -.c.o : - $(CC) $(CFLAGS) -o $@ $*.c - -# rules for routines containing entries needed by utilities -.c.oo : - $(CC) $(CFLAGS) -d UTIL -o $@ $*.c - -# rules for the low-memory version: - -.c.ol : - $(CC) $(LOWFLAGS) -o $@ $*.c - -# default C rules for debugging -.c.od : - $(CC) $(CFLAGD) -o $@ $*.c - -# debugging rules for routines containing entries needed by utilities -.c.dd : - $(CC) $(CFLAGD) -d UTIL -o $@ $*.c - -# rules for the debugging low-memory version: - -.c.dl : - $(CC) $(LOWFLAGD) -o $@ $*.c - - -# object file lists - -ZIP_H = zip.h ziperr.h tailor.h amiga/osdep.h amiga/z-stat.h - - -OBJZ = $(O)zip.o $(O)deflate.o \ - $(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)util.o $(O)timezone.o \ - $(O)fileio.o $(O)globals.o $(O)crc32.o $(O)crypt.o $(O)ttyio.o \ - $(O)amiga.o $(O)amigazip.o $(O)crc_68.o - -OBJL = $(O)zip.ol $(O)deflate.ol \ - $(O)trees.ol $(O)zipfile.ol $(O)zipup.ol $(O)util.ol $(O)timezone.ol \ - $(O)fileio.ol $(O)globals.ol $(O)crc32.ol $(O)crypt.ol $(O)ttyio.ol \ - $(O)amiga.ol $(O)amigazip.ol $(O)crc_68.o - -OBJU = $(O)zipfile.oo $(O)fileio.oo \ - $(O)util.oo $(O)globals.o $(O)amiga.oo $(O)amigazip.oo -OBJN = $(O)zipnote.o $(OBJU) -OBJC = $(O)zipcloak.o $(OBJU) $(O)crc32.oo \ - $(O)crypt.oo $(O)ttyio.o -OBJS = $(O)zipsplit.o $(OBJU) - -# These are the debuggable versions: - -DBJZ = $(O)zip.od $(O)deflate.od \ - $(O)trees.od $(O)zipfile.od $(O)zipup.od $(O)util.od $(O)timezone.od \ - $(O)fileio.od $(O)globals.od $(O)crc32.od $(O)crypt.od $(O)ttyio.od \ - $(O)amiga.od $(O)amigazip.od $(O)crc_68.o - -DBJL = $(O)zip.dl $(O)deflate.dl \ - $(O)trees.dl $(O)zipfile.dl $(O)zipup.dl $(O)util.dl $(O)timezone.dl \ - $(O)fileio.dl $(O)globals.dl $(O)crc32.dl $(O)crypt.dl $(O)ttyio.dl \ - $(O)amiga.dl $(O)amigazip.dl $(O)crc_68.o - -DBJU = $(O)zipfile.dd $(O)fileio.dd \ - $(O)util.dd $(O)globals.od $(O)amiga.dd $(O)amigazip.dd -DBJN = $(O)zipnote.od $(DBJU) -DBJC = $(O)zipcloak.od $(DBJU) $(O)crc32.dd \ - $(O)crypt.dd $(O)ttyio.od -DBJS = $(O)zipsplit.od $(DBJU) - - -# HERE WE GO: - -all : Zip ZipNote ZipSplit ZipCloak ZipLM - -z : Zip - -n : ZipNote - -s : ZipSplit - -c : ZipCloak - -l : ZipLM - -# Debug versions: - -dall : Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg - -dz : Zip.dbg - -dn : ZipNote.dbg - -ds : ZipSplit.dbg - -dc : ZipCloak.dbg - -dl : ZipLM.dbg - - -Zip : $(OBJZ) $(ZIP_H) - $(LD) $(LDFLAGS) -o $@ $(OBJZ) $(LDLIBS) - -@delete Zip.dbg - -ZipNote : $(OBJN) $(ZIP_H) - $(LD) $(LDFLAGS) -o $@ $(OBJN) $(LDLIBS) - -@delete ZipNote.dbg - -ZipSplit : $(OBJS) $(ZIP_H) - $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) - -@delete ZipSplit.dbg - -ZipCloak : $(OBJC) $(ZIP_H) - $(LD) $(LDFLAGS) -o $@ $(OBJC) $(LDLIBS) - -@delete ZipCloak.dbg - -ZipLM : $(OBJL) $(ZIP_H) - $(LD) $(LDFLAGS) -o $@ $(OBJL) $(LDLIBS) - -@delete ZipLM.dbg - - -Zip.dbg : $(DBJZ) $(ZIP_H) - $(LD) $(LDFLAGD) -o Zip $(DBJZ) $(LDLIBS) - -ZipNote.dbg : $(DBJN) $(ZIP_H) - $(LD) $(LDFLAGD) -o ZipNote $(DBJN) $(LDLIBS) - -ZipSplit.dbg : $(DBJS) $(ZIP_H) - $(LD) $(LDFLAGD) -o ZipSplit $(DBJS) $(LDLIBS) - -ZipCloak.dbg : $(DBJC) $(ZIP_H) - $(LD) $(LDFLAGD) -o ZipCloak $(DBJC) $(LDLIBS) - -ZipLM.dbg : $(DBJL) $(ZIP_H) - $(LD) $(LDFLAGD) -o ZipLM $(DBJL) $(LDLIBS) - - -clean : bugclean - -delete quiet $(OBJZ) - -delete quiet $(OBJL) - -delete quiet $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o \ - $(O)crypt.oo $(OBJU) - -bugclean : - -delete quiet $(DBJZ) - -delete quiet $(DBJL) - -delete quiet $(O)zipnote.od $(O)zipcloak.od $(O)zipsplit.od \ - $(O)crypt.dd $(DBJU) - -cleaner : clean - -delete quiet Zip ZipNote ZipSplit ZipCloak ZipLM - -delete quiet Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg - - -# header dependencies: - -$(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)crypt.o $(O)ttyio.o \ - $(O)deflate.o $(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)fileio.o $(O)util.o \ - $(O)timezone.o $(O)crc32.o $(O)globals.o $(O)amiga.o : $(ZIP_H) - -$(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol $(O)crypt.ol \ - $(O)ttyio.ol $(O)deflate.ol $(O)trees.ol $(O)zipfile.ol $(O)zipup.ol \ - $(O)fileio.ol $(O)util.ol $(O)timezone.ol $(O)crc32.ol $(O)globals.ol \ - $(O)amiga.ol : $(ZIP_H) - -$(O)crc32.oo $(O)crypt.oo $(O)zipfile.oo $(O)fileio.oo $(O)util.oo : $(ZIP_H) - -$(O)amigazip.o $(O)amigazip.ol $(O)amigazip.oo : amiga/amiga.h $(ZIP_H) - -$(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)zipup.o \ - $(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol \ - $(O)zipup.ol : revision.h - -$(O)amiga.o $(O)amiga.ol : crypt.h - -$(O)crc32.o $(O)crc32.oo $(O)crc32.ol $(O)crypt.o $(O)crypt.oo $(O)crypt.ol \ - $(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \ - $(O)zipup.o $(O)zipup.ol \ - $(O)zipfile.o $(O)zipfile.oo $(O)zipfile.ol \ - $(O)fileio.o $(O)fileio.oo $(O)fileio.ol : crc32.h - -$(O)crypt.o $(O)crypt.oo $(O)crypt.ol $(O)ttyio.o $(O)ttyio.ol \ - $(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \ - $(O)zipup.o $(O)zipup.ol : crypt.h ttyio.h - -$(O)timezone.o $(O)timezone.ol $(O)timezone.od $(O)timezone.dl \ - $(O)amiga.o $(O)amiga.ol $(O)amiga.oo : timezone.h - -$(O)zipup.o $(O)zipup.ol : amiga/zipup.h - - -# SPECIAL CASES: - -# -mr changes expression parsing; avoids a bogus "expression too complex" error: -$(O)trees.o : trees.c - $(CC) $(CFLAGS) -mr -o $@ trees.c - -$(O)trees.ol : trees.c - $(CC) $(LOWFLAGS) -mr -o $@ trees.c - -$(O)trees.od : trees.c - $(CC) $(CFLAGD) -mr -o $@ trees.c - -$(O)trees.ld : trees.c - $(CC) $(LOWFLAGD) -mr -o $@ trees.c - -# Substitute the assembly version of deflate.c: (but not in debug version) -$(O)deflate.o : amiga/deflate.a - $(AS) $(ASOPTS) -o $@ amiga/deflate.a - -$(O)deflate.ol : amiga/deflate.a - $(AS) $(LOWASOPTS) -o $@ amiga/deflate.a - -# The assembly CRC function: -$(O)crc_68.o : amiga/crc_68.a - $(AS) -n -o $@ amiga/crc_68.a - -# Put the Amiga internal version data with today's date into amiga.c: -$(O)amiga.o : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(CFLAGS) -o $@ amiga/amiga.c - delete env:VersionDate - -$(O)amiga.ol : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(LOWFLAGS) -o $@ amiga/amiga.c - delete env:VersionDate - -$(O)amiga.od : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(CFLAGD) -o $@ amiga/amiga.c - delete env:VersionDate - -$(O)amiga.ld : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(LOWFLAGD) -o $@ amiga/amiga.c - delete env:VersionDate - -$(O)amiga.oo : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(CFLAGS) -d UTIL -o $@ amiga/amiga.c - delete env:VersionDate - -$(O)amiga.dd : amiga/amiga.c amiga/filedate.c amiga/stat.c - rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" - $(CC) $(CFLAGD) -d UTIL -o $@ amiga/amiga.c - delete env:VersionDate - -# Put the compiler version number into amigazip.c: -$(O)amigazip.o : amiga/amigazip.c - $(CC) $(CFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c - -$(O)amigazip.ol : amiga/amigazip.c - $(CC) $(LOWFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c - -$(O)amigazip.od : amiga/amigazip.c - $(CC) $(CFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c - -$(O)amigazip.ld : amiga/amigazip.c - $(CC) $(LOWFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c - -$(O)amigazip.oo : amiga/amigazip.c - $(CC) $(CFLAGS) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c - -$(O)amigazip.dd : amiga/amigazip.c - $(CC) $(CFLAGD) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c diff --git a/third_party/infozip/zip/amiga/match.a b/third_party/infozip/zip/amiga/match.a deleted file mode 100644 index ec5bcf0ec..000000000 --- a/third_party/infozip/zip/amiga/match.a +++ /dev/null @@ -1,182 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; match.a -- optional optimized asm version of longest match in deflate.c -; Written by Jean-loup Gailly -; Adapted for the Amiga by Carsten Steger -; using the code in match.S. -; The major change in this code consists of removing all unaligned -; word accesses, because they cause 68000-based Amigas to crash. -; For maximum speed, UNALIGNED_OK can be defined in Makefile.sasc. -; The program will then only run on 68020-based Amigas, though. -; If you have reduced WSIZE in zip.h, then make sure this is -; assembled with an equivalent -dWSIZE=. -; -; This code will run with registerized parameters too, unless SAS -; changes parameter passing conventions between new releases of SAS/C. - - -Cur_Match reg d0 ; Must be in d0! -Best_Len reg d1 -Loop_Counter reg d2 -Scan_Start reg d3 -Scan_End reg d4 -Limit reg d5 -Chain_Length reg d6 -Scan_Test reg d7 -Scan reg a0 -Match reg a1 -Prev_Address reg a2 -Scan_Ini reg a3 -Match_Ini reg a4 - -MAX_MATCH equ 258 -MIN_MATCH equ 3 - ifnd WSIZE -WSIZE equ 32768 - endc -MAX_DIST equ WSIZE-MAX_MATCH-MIN_MATCH-1 - - - xref _max_chain_length - xref _prev_length - xref _prev - xref _window - xref _strstart - xref _good_match - xref _match_start - xref _nice_match - - - section match,code - - xdef _match_init - xdef @match_init - xdef _longest_match - xdef @longest_match - - -_match_init: -@match_init: - rts - - -_longest_match: - move.l 4(sp),Cur_Match -@longest_match: - ifd UNALIGNED_OK - movem.l d2-d6/a2-a4,-(sp) - else - movem.l d2-d7/a2-a4,-(sp) - endc - move.l _max_chain_length,Chain_Length - move.l _prev_length,Best_Len - lea _prev,Prev_Address - lea _window+MIN_MATCH,Match_Ini - move.l _strstart,Limit - move.l Match_Ini,Scan_Ini - add.l Limit,Scan_Ini - subi.w #MAX_DIST,Limit - bhi.b limit_ok - moveq #0,Limit -limit_ok: - cmp.l _good_match,Best_Len - bcs.b length_ok - lsr.l #2,Chain_Length -length_ok: - subq.l #1,Chain_Length - - ifd UNALIGNED_OK - - move.w -MIN_MATCH(Scan_Ini),Scan_Start - move.w -MIN_MATCH-1(Scan_Ini,Best_Len.L),Scan_End - - else - - move.b -MIN_MATCH(Scan_Ini),Scan_Start - lsl.w #8,Scan_Start - move.b -MIN_MATCH+1(Scan_Ini),Scan_Start - move.b -MIN_MATCH-1(Scan_Ini,Best_Len.L),Scan_End - lsl.w #8,Scan_End - move.b -MIN_MATCH(Scan_Ini,Best_Len.L),Scan_End - - endc - - bra.b do_scan - -long_loop: - - ifd UNALIGNED_OK - - move.w -MIN_MATCH-1(Scan_Ini,Best_Len.L),Scan_End - - else - - move.b -MIN_MATCH-1(Scan_Ini,Best_Len.L),Scan_End - lsl.w #8,Scan_End - move.b -MIN_MATCH(Scan_Ini,Best_Len.L),Scan_End - - endc - -short_loop: - lsl.w #1,Cur_Match - move.w 0(Prev_Address,Cur_Match.L),Cur_Match - cmp.w Limit,Cur_Match - dbls Chain_Length,do_scan - bra.b return - -do_scan: - move.l Match_Ini,Match - add.l Cur_Match,Match - - ifd UNALIGNED_OK - - cmp.w -MIN_MATCH-1(Match,Best_Len.L),Scan_End - bne.b short_loop - cmp.w -MIN_MATCH(Match),Scan_Start - bne.b short_loop - - else - - move.b -MIN_MATCH-1(Match,Best_Len.L),Scan_Test - lsl.w #8,Scan_Test - move.b -MIN_MATCH(Match,Best_Len.L),Scan_Test - cmp.w Scan_Test,Scan_End - bne.b short_loop - move.b -MIN_MATCH(Match),Scan_Test - lsl.w #8,Scan_Test - move.b -MIN_MATCH+1(Match),Scan_Test - cmp.w Scan_Test,Scan_Start - bne.b short_loop - - endc - - move.w #(MAX_MATCH-MIN_MATCH),Loop_Counter - move.l Scan_Ini,Scan -scan_loop: - cmpm.b (Match)+,(Scan)+ - dbne Loop_Counter,scan_loop - - sub.l Scan_Ini,Scan - addq.l #(MIN_MATCH-1),Scan - cmp.l Best_Len,Scan - bls.b short_loop - move.l Scan,Best_Len - move.l Cur_Match,_match_start - cmp.l _nice_match,Best_Len - bcs.b long_loop -return: - move.l Best_Len,d0 - ifd UNALIGNED_OK - movem.l (sp)+,d2-d6/a2-a4 - else - movem.l (sp)+,d2-d7/a2-a4 - endc - rts - - end diff --git a/third_party/infozip/zip/amiga/match_68.a b/third_party/infozip/zip/amiga/match_68.a deleted file mode 100644 index d1a6c39a3..000000000 --- a/third_party/infozip/zip/amiga/match_68.a +++ /dev/null @@ -1,273 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; This is a 68000 assembly language version of the Zip function -; longest_match(). It is written for any 680x0 based computer, but at this -; time the feature for runtime testing of CPU type is only supported for the -; Amiga. Hopefully a similar test for the Macintosh is possible, and for any -; other system that supports both 68000 and 68020+ CPUs. This is written by -; Paul Kienitz, partially derived from a simpler version by Carsten Steger, -; derived in turn from a 386 assembly function by Jean-loup Gailly and Kai Uwe -; Rommel... but also based directly on the C original. -; -; The main difference of this from other longest_match() implementations is -; that it includes both byte based and word based versions of the function, -; and various symbols can be defined to select whether to use one routine or -; the other, or to do a platform-specific test at runtime. The symbols that -; can be used to select behavior are as follows: -; -; CPU020 if defined, use 68020 instructions always -; CPUTEST if defined, check at runtime for CPU type. Another symbol -; specifying the platform-specific test must be used with this. -; If neither of these is defined, use 68000 instructions only. -; AMIGA use Amiga-specific test for 68020, if CPUTEST defined. Also -; tells it to let a0/a1/d1 be clobbered by functions. -; ATSIGN define entry symbols in @foo form as well as _foo, with -; @longest_match taking its parm in d0 instead of on the stack. -; WSIZE if defined, determines the sliding window size for deflate; -; the default is 32K. If you have reduced WSIZE for the C code, -; make sure that this module is assembled with an equivalent -; "-dWSIZE=" (or "-e...") switch. -; -; NOTE: no provision is made for 16 bit ints. All external int variables are -; treated as 32 bit values. This also assumes that longest_match's result is -; returned in D0. - - IFND CPU020 - IFND CPUTEST -CPU000 equ 1 - ENDC - ENDC - -; global variables: - xref _max_chain_length ; unsigned int - xref _prev_length ; unsigned int - xref _match_start ; unsigned int - xref _strstart ; unsigned int - xref _good_match ; signed int - xref _nice_match ; signed int - xref _window ; array of unsigned char - xref _prev ; array of unsigned short - -; our entry points: - xdef _match_init ; void match_init(void); - xdef _longest_match ; int longest_match(unsigned cur_match); - IFD ATSIGN - xdef @match_init ; for SAS assembler - xdef @longest_match ; ditto - ENDC - -; flag variable for remembering CPU type: - IFD CPUTEST - section cpuflag,data -is020: ds.w 1 - ENDC - - - section match,code -_match_init: - IFD ATSIGN -@match_init: - ENDC - - IFD CPUTEST ; now check for platform type - IFD AMIGA ; Amiga specific test for '020 CPU: - - xref _SysBase - - NOLIST - INCLUDE 'exec/execbase.i' - LIST - - clr.w is020 ; default value is 68000 - move.l _SysBase,a0 - btst #AFB_68020,AttnFlags+1(a0) - beq.s cheap - move.w #1,is020 - -cheap: - ELSE ; !AMIGA - - !! Write an '020-detector for your system here! - - ENDC ; AMIGA - ENDC ; CPUTEST - rts ; match_init consists only of rts if CPUTEST unset - - - IFD AMIGA -SAVEREGS reg d3-d7/a2/a3/a5 ; don't protect d0/d1/a0/a1 - ELSE -SAVEREGS reg d1/d3-d7/a0-a3/a5 ; protect all but d0 return val - ENDC - -Cur_Match equr d0 ; Must be in d0! -Best_Len equr d1 -Scan_Start equr d3 -Scan_End equr d4 -Limit equr d5 -Chain_Length equr d6 -Scan_Test equr d7 -Scan equr a0 -Match equr a1 -Prev_Address equr a2 -Scan_Ini equr a3 -Match_Ini equr a5 - - -MAX_MATCH equ 258 -MIN_MATCH equ 3 - IFND WSIZE -WSIZE equ 32768 - ENDC -MAX_DIST equ WSIZE-MAX_MATCH-MIN_MATCH-1 - -_longest_match: - move.l 4(sp),Cur_Match ; stack arg to register - IFD ATSIGN -@longest_match: - ENDC - movem.l SAVEREGS,-(sp) - -; setup steps common to byte and word versions: - move.l _max_chain_length,Chain_Length - move.l _prev_length,Best_Len - lea _prev,Prev_Address - lea _window,Match_Ini - move.l _strstart,Limit - move.l Match_Ini,Scan_Ini - addq #MIN_MATCH,Match_Ini - add.l Limit,Scan_Ini - subi.w #MAX_DIST,Limit - bhi.s limit_ok - moveq #0,Limit -limit_ok: - cmp.l _good_match,Best_Len - bcs.s length_ok - lsr.l #2,Chain_Length -length_ok: - subq.l #1,Chain_Length - - IFD CPUTEST - tst.w is020 ; can we use '020 stuff today? - bne WORD_match - ENDC - - IFND CPU020 - -; for 68000 or 68010, use byte operations: - moveq #0,Scan_Start ; clear 2nd and 4th bytes, use 1st & 3rd - moveq #0,Scan_End - moveq #0,Scan_Test - move.b (Scan_Ini),Scan_Start - swap Scan_Start - move.b 1(Scan_Ini),Scan_Start - move.b -1(Scan_Ini,Best_Len),Scan_End - swap Scan_End - move.b 0(Scan_Ini,Best_Len),Scan_End - bra.s bdo_scan - -blong_loop: - move.b -1(Scan_Ini,Best_Len),Scan_End - swap Scan_End - move.b 0(Scan_Ini,Best_Len),Scan_End - -bshort_loop: - add.w Cur_Match,Cur_Match - move.w 0(Prev_Address,Cur_Match.l),Cur_Match - cmp.l Limit,Cur_Match - dbls Chain_Length,bdo_scan - bra return - -bdo_scan: - move.l Match_Ini,Match - add.l Cur_Match,Match - move.b -MIN_MATCH-1(Match,Best_Len),Scan_Test - swap Scan_Test - move.b -MIN_MATCH(Match,Best_Len),Scan_Test - cmp.l Scan_Test,Scan_End - bne.s bshort_loop - move.b -MIN_MATCH(Match),Scan_Test - swap Scan_Test - move.b -MIN_MATCH+1(Match),Scan_Test - cmp.l Scan_Test,Scan_Start - bne.s bshort_loop - move.w #(MAX_MATCH-MIN_MATCH),Scan_Test - lea MIN_MATCH(Scan_Ini),Scan - -bscan_loop: - cmpm.b (Match)+,(Scan)+ - dbne Scan_Test,bscan_loop - subq #1,Scan - - sub.l Scan_Ini,Scan - cmp.l Best_Len,Scan - bls.s bshort_loop - move.l Scan,Best_Len - move.l Cur_Match,_match_start - cmp.l _nice_match,Best_Len - bcs.s blong_loop - IFD CPUTEST - bra return - ENDC - - ENDC ; !CPU020 - - IFND CPU000 - -; for 68020 or higher, use word operations even on odd addresses: -WORD_match: - move.w (Scan_Ini),Scan_Start - move.w -1(Scan_Ini,Best_Len),Scan_End - bra.s wdo_scan - -wlong_loop: - move.w -1(Scan_Ini,Best_Len),Scan_End - -wshort_loop: - add.w Cur_Match,Cur_Match - move.w (Prev_Address,Cur_Match.l),Cur_Match - cmp.l Limit,Cur_Match - dbls Chain_Length,wdo_scan - bra.s return - -wdo_scan: - move.l Match_Ini,Match - add.l Cur_Match,Match - cmp.w -MIN_MATCH-1(Match,Best_Len),Scan_End - bne.s wshort_loop - cmp.w -MIN_MATCH(Match),Scan_Start - bne.s wshort_loop - moveq #((MAX_MATCH-MIN_MATCH)/2),Scan_Test ; value = 127 - lea MIN_MATCH(Scan_Ini),Scan - -wscan_loop: - cmpm.w (Match)+,(Scan)+ - dbne Scan_Test,wscan_loop - subq #2,Scan - move.b -MIN_MATCH+1(Match),Scan_Test - cmp.b (Scan),Scan_Test - bne steven - addq #1,Scan -steven: - sub.l Scan_Ini,Scan - cmp.l Best_Len,Scan - bls.s wshort_loop - move.l Scan,Best_Len - move.l Cur_Match,_match_start - cmp.l _nice_match,Best_Len - bcs.s wlong_loop - - ENDC ; !CPU000 - -return: - move.l Best_Len,d0 ; function return value - movem.l (sp)+,SAVEREGS - rts - - end diff --git a/third_party/infozip/zip/amiga/osdep.h b/third_party/infozip/zip/amiga/osdep.h deleted file mode 100644 index c573cf83d..000000000 --- a/third_party/infozip/zip/amiga/osdep.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (c) 1990-2005 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 -*/ -#ifndef __amiga_osdep_h -#define __amiga_osdep_h - -/* default to MEDIUM_MEM, but allow makefile override */ -#if ( (!defined(BIG_MEM)) && (!defined(SMALL_MEM))) -# define MEDIUM_MEM -#endif - -/* check that TZ environment variable is defined before using UTC times */ -#if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ)) -# define IZ_CHECK_TZ -#endif - -#ifndef IZTZ_GETLOCALETZINFO -# define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone -#endif - -/* AmigaDOS can't even support disk partitions over 4GB, let alone files */ -#define NO_LARGE_FILE_SUPPORT -#ifdef LARGE_FILE_SUPPORT -# undef LARGE_FILE_SUPPORT -#endif - -#define USE_CASE_MAP -#define USE_EF_UT_TIME -#define HANDLE_AMIGA_SFX -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) -#define EXIT(e) ClearIOErr_exit(e) -void ClearIOErr_exit(int e); - -#include "amiga/z-stat.h" - -#ifdef __SASC -# include -# include -# if (defined(_M68020) && (!defined(__USE_SYSBASE))) - /* on 68020 or higher processors it is faster */ -# define __USE_SYSBASE /* to use the pragma libcall instead of syscall */ -# endif /* to access functions of the exec.library */ -# include /* see SAS/C manual:part 2,chapter 2,pages 6-7 */ -# include -# if (defined(_M68020) && !defined(UNALIGNED_OK)) -# define UNALIGNED_OK -# endif -# ifndef REENTRANT -# define REENTRANT -# endif -# if (defined(_NEAR_DATA) && !defined(DYN_ALLOC)) -# define DYN_ALLOC -# endif -# ifdef DEBUG -# include /* profiler header file */ -# endif -# ifndef IZTZ_SETLOCALTZINFO - /* XXX !! We have really got to find a way to operate without these. */ -# define IZTZ_SETLOCALTZINFO -# endif - -/* - A word on short-integers and SAS/C (a bug of [mc]alloc?) - Using short integers (i.e. compiling with option SHORT-INTEGERS) is - *not* recommended. To get maximum compression ratio the window size stored - in WSIZE should be 32k (0x8000). However, since the size of the window[] - array is 2*WSIZE, 65536 bytes must be allocated. The calloc function can - only allocate UINT_MAX (defined in limits.h) bytes which is one byte short - (65535) of the maximum window size if you are compiling with short-ints. - You'll get an error message "Out of memory (window allocation)" whenever - you try to deflate. Note that the compiler won't produce any warning. - The maximum window size with short-integers is therefore 32768 bytes. - The following is only implemented to allow the use of short-integers but - it is once again not recommended because of a loss in compression ratio. -*/ -# if (defined(_SHORTINT) && !defined(WSIZE)) -# define WSIZE 0x4000 /* only half of maximum window size */ -# endif /* possible with short-integers */ -#endif /* __SASC */ -/* - With Aztec C, using short integers imposes no size limits and makes - the program run faster, even with 32 bit CPUs, so it's recommended. -*/ -#ifdef AZTEC_C -# define NO_UNISTD_H -# define NO_RMDIR -# define BROKEN_FSEEK -# ifndef IZTZ_DEFINESTDGLOBALS -# define IZTZ_DEFINESTDGLOBALS -# endif -#endif - -extern int real_timezone_is_set; -void tzset(void); -#define VALID_TIMEZONE(tempvar) (tzset(), real_timezone_is_set) - -#ifdef ZCRYPT_INTERNAL -# ifndef CLIB_EXEC_PROTOS_H - void *FindTask(void *); -# endif -# define ZCR_SEED2 (unsigned)(ulg)FindTask(NULL) -#endif - -int Agetch(void); /* getch() like function, in amiga/filedate.c */ -char *GetComment(char *); - -#define FOPR "rb" -#define FOPM "rb+" -#define FOPW "wb" -/* prototype for ctrl-C trap function */ -void _abort(void); - -#endif /* !__amiga_osdep_h */ diff --git a/third_party/infozip/zip/amiga/smakefile b/third_party/infozip/zip/amiga/smakefile deleted file mode 100644 index ce1317d77..000000000 --- a/third_party/infozip/zip/amiga/smakefile +++ /dev/null @@ -1,662 +0,0 @@ -#=========================================================================== -# Makefile for Zip, ZipNote, ZipCloak, ZipSplit AMIGA SAS/C Version 6.58 -# Version: 2.3 last revised: 07 Jan 2007 -#=========================================================================== -# -John Bush, -# or: - -# updated for SAS/C Version 6.56+ and AmigaDOS 3.1 (V40) -# by Haidinger Walter, - -# additional supplements and maintenance by Paul Kienitz - -# This makefile should work with at least AmigaDOS 2.04 (V37) (not tested) -# and will probably not work with AmigaDOS 1.3 (V34) - -# If you have any improvements, critics or else please feel free to mail. -# Any response is appreciated. Haidinger Walter - -# Available targets: -# all builds all executeables below -# zip builds zip executeable -# zipsplit builds zipsplit executeable -# zipcloak builds zipcloak executeable -# zipnote builds zipnote executeable -# ziplm builds low memory version of zip executable -# clean remove all files created by the compilation -# spotless like clean target but removes binaries too - - -########################## -# USER MACRO DEFINITIONS # -########################## - -# *** NOTE *** -# The assembly version is not implemented yet. -# (Un)commenting the assembler macros has no effect unless the -# file dependencies are changed too. -# Most of the amiga/*.a files do not assmble with 68000 instructions. -# Any help is appreciated, of course. - -# Set the processor to generate code for. -# Compiler: ANY 68000 68010 68020 68030 68040 68060 -# Assembler: 0 0 1 2 3 4 n/a -# Defaults: ANY and 0 -# -CUSECPU = ANY -AUSECPU = 0 - -# UNCOMMENT to use 68020 instructions in the assembly version of deflate.o -# Only use if code is generated for 68020 or higher processors above. -# Note: You could use CPUTEST too to enable runtime cpu detection. -# However, it is not recommended since both 68000 and 68020 code will be -# included which would be an unnecessary increase in size. -# (see amiga/deflate.a for more information) -# -#AUSE020 = CPU020 - -# To disable the assembler replacements and use the standard C source, -# you have to change the Zip and ZipLM dependencies. See below for details. -# (remember that assembler use is *not* implemented yet) - -# Uncomment both CUTIL and LUTIL to make use of utility.library of OS 2.04+ -# The utility.library is *not* used for UnZipSFX to ensure maximum portability -# between the different Amiga systems (minimal config: 68000 and OS 1.2). -# You can change this by adding the $(LUTIL) macro in the UnZipSFX linking -# rules (See below: Final output targets, UnZipSFX:). -# WARNINGS when using the utility library: -# 1. All Executables will *only* work with AmigaDOS 2.04 (v37) or higher. -# 2. You *need not* compile/link with short-integers using the -# utility.library. It will crash your machine. See Libraries below. -# -# Default: commented (not used) -# -#CUTIL = UTILLIB DEFINE=_UTILLIB -#LUTIL = WITH SC:LIB/utillib.with # include necessary linker defines -# Choose one stack-handling method (default=faster) -# StackExtend: Dynamic runtime stack extension. You won't notice stack overflows. -# StackCheck: On a stack overflow a requester appears which allows you to exit. -# Note that either stack watching will slow down your executable because of the -# extra code run on each function entry. On the other hand, you won't crash -# anymore due to stack overflows. However, you should not have *any* stack -# problems with Info-ZIP programs if you raise your stack to 10000 (which I'd -# recommend as a minimum default stack for all applications) or more using the -# shell stack command. Type 'Stack 20000' or add it to your S:Shell-Startup. -# BTW: Typing 'Stack' prints your current stack size. -# -CSTACK = NOSTACKCHECK STACKEXTEND # slow, but always works -#CSTACK = STACKCHECK NOSTACKEXTEND # slow, requester & graceful exit -#CSTACK = NOSTACKCHECK NOSTACKEXTEND # faster but relies on larger stack (>=10K) - - -# -# LIBRARIES -# --------- - -# Choose one DATAOPTS , SASLIB , ASMOPTS and LSTARTUP -# Always comment/uncomment all macros of a set. - -# Library to use with near data and 2-byte integers -# Notes: o slower than 4-byte integers with 68000 cpu -# o *not* recommended due to poor overall performance -# o see comment in amiga/osdep.h -#DATAOPTS = DATA=NEAR SHORTINTEGERS DEF=_NEAR_DATA -#SASLIB = scs -#ASMOPTS = -dINT16 -#LSTARTUP = cres.o - -# Library to use with near data and 4-byte integers (DEFAULT) -# *** use this with the utility.library *** -DATAOPTS = DATA=NEAR DEF=_NEAR_DATA -SASLIB = sc -ASMOPTS = -LSTARTUP = cres.o - -# Library to use with far data and 2-byte integers -# use if DYN_ALLOC is not defined -# old default - far data always works but is slower -#DATAOPTS = DATA=FAR SHORTINTEGERS DEF=_FAR_DATA -#SASLIB = scsnb -#ASMOPTS = -dINT16 -#LSTARTUP = c.o - -# Library to use with far data and 4-byte integers -# if everything else fails: try this -#DATAOPTS = DATA=FAR DEF=_FAR_DATA -#SASLIB = scnb -#ASMOPTS = -#LSTARTUP = c.o - - -# -# DEBUGGING -# --------- - -# Default: No debugging information added. -# The three macros below will be overwritten if you choose to add -# debug info, therefore no need to comment. - -CDBG = NODEBUG NOPROFILE NOCOVERAGE # default: no debug info -ADBG = -LDBG = STRIPDEBUG # default: no debug info - -# Compiler and loader debug flags. Uncomment as needed. Recomment when done. -# Optimization disabled for faster compilation (by using NOOPT) - -#CDBG1 = DEF=DEBUG DEF=DEBUG_TIME # enables Info-Zip's debug output - -# Enable profiling and coverage when desired. Option COVERAGE commented -# seperately because running coverage may corrupt your drive in case of a -# system crash since a file 'cover.dat' is created in your working directory. -# Note that the use of COVERAGE forces the use of the c.o startup module. - -#CDBG2 = PROFILE -#CDBG3 = COVERAGE # must use c.o startup code: -#LSTARTUP = c.o # Uncomment *only* when you use COVERAGE - -# *Uncomment* here macros CDBG, ADBG and LDBG to include debugging information - -#CDBG = $(CDBG1) $(CDBG2) $(CDBG3) ADDSYM DEBUG=FULLFLUSH STACKCHECK NOOPT -#ADBG = DEBUG -#LDBG = ADDSYM - -# Optional use of memwatch.library which can be found in your -# sc:extras/memlib directory. Please read the short docs (memlib.doc). -# Note that memwatch.library has a small bug: MWTerm() displays always -# the first entry. -# Get the latest version from aminet (dev/debug/memlib.lha) or -# contact me to get the patch. Uncomment all macros to use. -#CMEMLIB = DEFINE=MWDEBUG=1 # define to enable library -#LMEMLIB = SC:LIB/memwatch.lib # path to library -#LSTARTUP = c.o # must use c.o with memlib! - - -# -# MAPPING -# ------- - -# Map filenames used when mapping (no need to comment) -# -MAPFZ = zip.map # Zip map filename -MAPFN = zipnote.map # ZipNote map filename -MAPFC = zipcloak.map # ZipCloak map filename -MAPFS = zipsplit.map # ZipSplit map filename -MAPFL = ziplm.map # Zip low memory version map filename - -# Map file output: Uncomment to highlight and bold headings. -# -#MAPFSTYLE = FANCY - -# Map flags for each EXECUTABLE. Uncomment to enable mapping. -# For map options please refer to: -# SAS/C v6 manual, volume 1: user's guide, chapter 8, page 136: map -# Default: all options enabled: f,h,l,o,s,x -# |-> options start here -#LMAPZ = $(MAPFSTYLE) MAP $(MAPFZ) f,h,l,o,s,x # Zip maps -#LMAPN = $(MAPFSTYLE) MAP $(MAPFN) f,h,l,o,s,x # ZipNote maps -#LMAPC = $(MAPFSTYLE) MAP $(MAPFC) f,h,l,o,s,x # ZipCloak maps -#LMAPS = $(MAPFSTYLE) MAP $(MAPFS) f,h,l,o,s,x # ZipSplit maps -#LMAPL = $(MAPFSTYLE) MAP $(MAPFL) f,h,l,o,s,x # Zip lowmem maps - -# -# LISTINGS -# -------- - -# Listfile-extensions for each executable (enter *with* dot) -# -LISTEXTZ = .lst # extension for Zip listfiles -LISTEXTU = .ulst # extension for utility listfiles (ZipNote,ZipCloak,ZipSplit) -LISTEXTL = .llst # extension for Zip low memory listfiles - - -# List files and cross references for each OBJECT. -# Add/remove flags as needed. Not all listed by default. -# Use LISTINCLUDES to determine the dependencies for smake -# -CLISTOPT = LISTHEADERS LISTMACROS # LISTSYSTEM LISTINCLUDES -CXREFOPT = XHEAD XSYS -# -# Uncomment to enable listing (default: commented) -# *** WARNING: List files require *lots* of disk space! -# -#CLIST = LIST $(CLISTOPT) -#CXREF = XREF $(CXREFOPT) - - -# -# SUPPRESSED COMPILER WARNINGS -# ---------------------------- - -# Compiler warnings to ignore -# -# Warning 105 : module does not define any externally-known symbols -# Warning 304 : Dead assignment eliminated... -# Note 306 : ...function inlined... -# Warning 317 : possibly uninitialized variable... -# Comment to enable. -# -CIGNORE = IGNORE=105,304,306,317 - - -# -# OBJECT EXTENSIONS -# - -# Extensions used for objects of each executeable. -# Transformation rules require unique extensions. -# Enter *with* dot. -# -O = .o # extension for Zip objects -OU = .uo # extension for utility objects (ZipNote, ZipSplit and ZipCloak) -OL = .lo # extension for low memory Zip objects - - -# Filename used to store converted options from environment variable -# LOCAL_ZIP. Default: scoptions_local_zip -# -CWITHOPT = scoptions_local_zip - - -# Filenames to store compiler options to prevent command line overflow -# -# Common options file for Zip and other executables -CFILE = scoptions-zip - - -# Temp filenames for object lists to load using linker "WITH" command. -OBJLISTZ = zip_objlist.with # Zip object list -OBJLISTN = zipnote_objlist.with # ZipNote object list -OBJLISTC = zipcloak_objlist.with # ZipCloak object list -OBJLISTS = zipsplit_objlist.with # ZipSplit object list -OBJLISTL = ziplm_objlist.with # Zip low-mem object list - - -# Filenames to store linker options -# -LWITHZ = zip.lnk # zip linker options -LWITHN = zipnote.lnk # zipnote linker options -LWITHC = zipcloak.lnk # zipcloak linker options -LWITHS = zipsplit.lnk # zipsplit linker options -LWITHL = ziplm.lnk # zip low-mem linker options - - -# Define AMIGA_BETA to print "Beta Notice" up front. See tailor.h. -# Undefine AMIGA_BETA when building a released version. -#CDEFBETA = DEF=AMIGA_BETA - -##################################### -# NOTHING TO CHANGE BEYOND HERE ... # -##################################### -# (except for C/asm dependencies) - -# Define MEDIUM_MEM for production release (per Paul Kienitz). -# This reduces runtime memory requirement but not speed or compression. -# Note: Do *not* use BIG_MEM or MMAP since it isn't yet supported by the - assembler version of deflate.c : amiga/deflate.a -CUSEMEM = DEF=MEDIUM_MEM -AUSEMEM = -DMEDIUM_MEM # for asm deflate.o, must match above - - -# Defines for building low-memory use version of Zip -WSIZEL = WSIZE=4096 # deflate.c window size for low-mem version -CLOWMEM = DEF=SMALL_MEM DEF=$(WSIZEL) -ALOWMEM = -DSMALL_MEM -D$(WSIZEL) # for asm deflate.o, must match above - - -# Compiler definitions -# -CC = sc -# -# Optimizer flags -# -OPTPASSES = 6 # set number of global optimizer passes -# -OPT1 = OPT OPTINL OPTINLOCAL OPTTIME OPTLOOP OPTSCHED -OPT2 = OPTCOMP=$(OPTPASSES) OPTDEP=$(OPTPASSES) OPTRDEP=$(OPTPASSES) -OPT = $(OPT1) $(OPT2) - - -# Compiler flags -# -CDEFINES = $(CMEMLIB) $(CDEFBETA) DEF=AMIGA -COPTIONS = $(DATAOPTS) CODE=NEAR CPU=$(CUSECPU) VERBOSE PARAMETERS=BOTH NOMINC -COPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE MEMSIZE=HUGE $(CLIST) $(CXREF) -COPTIONS = $(COPTIONS) $(CSTACK) $(CUTIL) STRICT UNSCHAR NOICONS STRINGMERGE -CFLAGS = $(CDEFINES) $(COPTIONS) $(OPT) $(CDBG) $(CIGNORE) - - -# Linker definitions -# See SASLIB definition above -# -LD = slink -# special linker flags for pure (i.e. resident) binary. -LDFLAGSS = FROM SC:LIB/$(LSTARTUP) -# common linker flags for all other executeables -LDFLAGSC = FROM SC:LIB/c.o -LDFLAGS2 = NOICONS $(LDBG) -LIBFLAGS = LIB $(LMEMLIB) SC:LIB/$(SASLIB).lib SC:LIB/amiga.lib - - -# Assembler definitions -# -ASM = asm -# -# Options used for assembling amiga/deflate.a -# Must match defines in C-Source. -# -AFLAGS0 = -d__SASC -dSASC -dAMIGA -AFLAGS1 = $(AUSE020) $(ASMOPTS) $(ADBG) -AFLAGS2 = -m$(AUSECPU) -jm -iINCLUDE: -AFLAGS = $(AFLAGS0) $(AFLAGS1) $(AFLAGS2) -ASMOPTSZ = $(AFLAGS) $(AUSEMEM) -dDYN_ALLOC # Zip asm flags -ASMOPTSL = $(AFLAGS) $(ALOWMEM) # Zip low-mem version asm flags - - -################## -# TARGET OBJECTS # -################## - - -# Zip objects -OBJZ1 = zip$(O) zipfile$(O) zipup$(O) fileio$(O) util$(O) globals$(O) -OBJZ2 = crc32$(O) crypt$(O) timezone$(O) ttyio$(O) -OBJZI = deflate$(O) trees$(O) -OBJZA = amiga$(O) amigazip$(O) stat$(O) filedate$(O) -OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZI) $(OBJZA) - -# Shared utility objects for ZipNote, ZipCloak and ZipSplit -OBJU1 = globals$(O) -OBJUU = zipfile$(OU) fileio$(OU) timezone$(O) util$(OU) -OBJUA = amigazip$(OU) amiga$(O) stat$(O) filedate$(O) -OBJU = $(OBJU1) $(OBJUU) $(OBJUA) - -# ZipNote objects -OBJN1 = zipnote$(O) -OBJN = $(OBJN1) $(OBJU) - -# ZipCloak objects -OBJC1 = zipcloak$(O) -OBJCU = $(OBJU) crypt$(OU) -OBJCS = crc32$(OU) ttyio$(O) -OBJC = $(OBJC1) $(OBJCU) $(OBJCS) - -#ZipSplit objects -OBJS1 = zipsplit$(O) -OBJS = $(OBJS1) $(OBJU) - -# ZipLM objects -OBJL1 = zip$(OL) zipfile$(OL) zipup$(OL) fileio$(OL) util$(OL) globals$(OL) -OBJL2 = crc32$(OL) crypt$(OL) timezone$(OL) ttyio$(OL) -OBJLI = deflate$(OL) trees$(OL) -OBJLA = amiga$(OL) amigazip$(OL) stat$(OL) filedate$(OL) -OBJL = $(OBJL1) $(OBJL2) $(OBJLI) $(OBJLA) - -# Common header files -ZIP_H1 = zip.h ziperr.h tailor.h -ZIP_HA = amiga/osdep.h amiga/z-stat.h -ZIP_H = $(ZIP_H1) $(ZIP_HA) - -# Output targets -ZIPS = Zip ZipNote ZipCloak ZipSplit ZipLM - - -# Temp filenames for object lists to load using linker "WITH" command. -OBJLISTZ = zip_objlist.with # Zip object list -OBJLISTN = zipnote_objlist.with # ZipNote object list -OBJLISTC = zipcloak_objlist.with # ZipCloak object list -OBJLISTS = zipsplit_objlist.with # ZipSplit object list -OBJLISTL = ziplm_objlist.with # Zip low-mem object list - -####################################### -# DEFAULT TARGET AND PROCESSING RULES # -####################################### - -all: request flush $(ZIPS) - -# Zip transformation rules -# -.c$(O): - $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c - -# Zip low-memory version transformation rules -# -.c$(OL): - $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c - -# Utilities (ZipNote, ZipCloak and ZipSplit) transformation rules -# -.c$(OU): - $(CC) WITH=$(CFILE) $(CUSEMEM) DEF=UTIL LISTFILE=$>$(LISTEXTU) OBJNAME=$@ $*.c - - -######################### -# Final output targets. # -######################### - - -zip: local_zip CommonFlags $(OBJZ) - @Echo "$(OBJZ)" > $(OBJLISTZ) - Type $(OBJLISTZ) - @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTZ) $(LIBFLAGS)" \ - "$(LDFLAGS2) $(LMAPZ)" >$(LWITHZ) - Type $(LWITHZ) - $(LD) TO Zip WITH $(LWITHZ) - -zipnote: local_zip CommonFlags $(OBJN) - @Echo "$(OBJN)" > $(OBJLISTN) - Type $(OBJLISTN) - @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTN) $(LIBFLAGS) " \ - "$(LDFLAGS2) $(LMAPN)" >$(LWITHN) - Type $(LWITHN) - $(LD) TO ZipNote WITH $(LWITHN) - -zipcloak: local_zip CommonFlags $(OBJC) - @Echo "$(OBJC)" > $(OBJLISTC) - Type $(OBJLISTC) - @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTC) $(LIBFLAGS) " \ - "$(LDFLAGS2) $(LMAPC)" >$(LWITHC) - Type $(LWITHC) - $(LD) TO ZipCloak WITH $(LWITHC) - -zipsplit: local_zip CommonFlags $(OBJS) - @Echo "$(OBJS)" > $(OBJLISTS) - Type $(OBJLISTS) - @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTS) $(LIBFLAGS) " \ - "$(LDFLAGS2) $(LMAPS)" >$(LWITHS) - Type $(LWITHS) - $(LD) TO ZipSplit WITH $(LWITHS) - -ziplm: local_zip CommonFlags $(OBJL) - @Echo "$(OBJL)" > $(OBJLISTL) - Type $(OBJLISTL) - @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTL) $(LIBFLAGS) " \ - "$(LDFLAGS2) $(LMAPL)" >$(LWITHL) - Type $(LWITHL) - $(LD) TO ZipLM WITH $(LWITHL) - - -clean: - -Delete >nil: $(OBJZ) quiet - -Delete >nil: $(OBJN) quiet - -Delete >nil: $(OBJC) quiet - -Delete >nil: $(OBJS) quiet - -Delete >nil: $(OBJL) quiet - -Delete >nil: $(OBJLISTZ) $(OBJLISTL) $(OBJLISTN) $(OBJLISTS) $(OBJLISTC) quiet - -Delete >nil: $(MAPFZ) $(MAPFN) $(MAPFC) $(MAPFS) $(MAPFL) quiet - -Delete >nil: \#?$(LISTEXTZ) \#?$(LISTEXTU) \#?$(LISTEXTL) quiet - -Delete >nil: $(CWITHOPT) $(CFILE) quiet - -Delete >nil: $(LWITHZ) $(LWITHN) $(LWITHC) $(LWITHS) $(LWITHL) quiet - -Delete >nil: env:VersionDate quiet - -Delete >nil: \#?.q.?? \#?.tmp \#?.cov quiet - -spotless: clean - -Delete >nil: $(ZIPS) quiet - - -################ -# DEPENDENCIES # -################ - -# To change between the assembler and C sources, you have to comment/uncomment -# the approprite lines. C sources are marked by #C-src and assembler sources -# #asm-src at the end. -# Zip dependencies: -# - -zip$(O): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipup$(O): zipup.c $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h -zipfile$(O): zipfile.c $(ZIP_H) revision.h crc32.h -crypt$(O): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -ttyio$(O): ttyio.c $(ZIP_H) crypt.h ttyio.h -deflate$(O): deflate.c $(ZIP_H) #C-src -trees$(O): trees.c $(ZIP_H) -fileio$(O): fileio.c $(ZIP_H) crc32.h -util$(O): util.c $(ZIP_H) -crc32$(O): crc32.c $(ZIP_H) crc32.h -globals$(O): globals.c $(ZIP_H) -timezone$(O): timezone.c $(ZIP_H) timezone.h -# Amiga specific objects -stat$(O): amiga/stat.c amiga/z-stat.h -filedate$(O): amiga/filedate.c crypt.h timezone.h -amiga$(O): amiga/amiga.c ziperr.h -amigazip$(O): amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench -# Substitute assembly version of deflate.c: -#deflate$(O): amiga/deflate.a #asm-src -# $(ASM) $(ASMOPTSZ) -o$@ $*.a #asm-src - - -# Utility (ZipNote, ZipCloak, ZipSplit) dependencies: -# -zipnote$(O): zipnote.c $(ZIP_H) revision.h -zipcloak$(O): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipsplit$(O): zipsplit.c $(ZIP_H) revision.h -zipfile$(OU): zipfile.c $(ZIP_H) revision.h crc32.h -fileio$(OU): fileio.c $(ZIP_H) crc32.h -util$(OU): util.c $(ZIP_H) -crc32$(OU): crc32.c $(ZIP_H) crc32.h -crypt$(OU): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -# Amiga specific objects -amigazip$(OU): amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench - -# ZipLM dependencies: -# -zip$(OL): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipup$(OL): zipup.c $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h -zipfile$(OL): zipfile.c $(ZIP_H) revision.h crc32.h -crypt$(OL): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -ttyio$(OL): ttyio.c $(ZIP_H) crypt.h ttyio.h -deflate$(OL): deflate.c $(ZIP_H) -trees$(OL): trees.c $(ZIP_H) -fileio$(OL): fileio.c $(ZIP_H) crc32.h -util$(OL): util.c $(ZIP_H) -crc32$(OL): crc32.c $(ZIP_H) -globals$(OL): globals.c $(ZIP_H) -timezone$(OL): timezone.c $(ZIP_H) timezone.h -# Amiga specific objects -stat$(OL): amiga/stat.c amiga/z-stat.h -filedate$(OL): amiga/filedate.c crypt.h timezone.h -amiga$(OL): amiga/amiga.c ziperr.h -# Substitute assembly version of deflate.c: -#deflate$(OL): amiga/deflate.a -# $(ASM) $(ASMOPTSL) -o$@ $*.a - - -######################## -# DEPENDECIES END HERE # -######################## - -# flush all libraries to provide more mem for compilation -flush: - @Avail flush >nil: - -# write common compiler flags to file and echo to user -CommonFlags: - @Echo "$(CFLAGS)" >$(CFILE) - @Type "$(CWITHOPT)" >>$(CFILE) - -Type $(CFILE) - - -# special rules for adding Amiga internal version number to amiga/amiga.c -amiga$(O): - rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'" - $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c - -Delete env:VersionDate - -amiga$(OL): - rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'" - $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c - -Delete env:VersionDate - - -# needed in amiga/amigazip.c -# should be set in startup-sequence, but just in case: -# (only works with OS 2.0 and above) - -env\:WorkBench: - @Execute < < (Workbench_smk.tmp) - FailAt 21 - If not exists ENV:Workbench - Version >nil: - SetEnv Workbench $$Workbench - Endif - < - - -# Read environment variable LOCAL_ZIP and convert options to SAS format -# -# e.g.: to define FOO_ONE and FOO_TWO enter: -# -# SetEnv LOCAL_ZIP "-DFOO_ONE -DFOO_TWO" -# -# Put the statement into your startup-sequence or (for AmigaDOS 2.0 or higher -# only) make sure LOCAL_ZIP is stored in the ENVARC: directory -# ( Copy ENV:LOCAL_ZIP ENVARC: ) -# - -local_zip: - @Execute < < (Local_Zip_smk.tmp) - Failat 21 - If exists ENV:LOCAL_ZIP - Echo "Using environment variable LOCAL_ZIP !" - Copy >NIL: ENV:LOCAL_ZIP SASCOPTS - Else - Echo "You could use envvar ZIP_OPT to set your special compilation options." - Delete >nil: SASCOPTS quiet - Endif - ; Do not remove the lctosc command! If LOCAL_ZIP is unset, an - ; empty file is created which needed by CommonFlags ! - lctosc >$(CWITHOPT) - < - - - -# Echo request to the user -# -request: - @Echo "" - @Echo " This makefile is for use with SAS/C version 6.58." - @Echo " If you still have an older version, please upgrade!" - @Echo " Patches are available on the Aminet under biz/patch/sc\#?." - @Echo "" - @Echo " Just a simple request..." - @Echo " Please give me a mail that you compiled whether you encounter any errors" - @Echo " or not. I'd just like to know how many Amiga users actually make use of" - @Echo " this makefile." - @Echo " If you mail me, I'll put you on my mailing-list and notify you whenever" - @Echo " new versions of Info-Zip are released." - @Echo " Have a look at the makefile for changes like CPU type, UtilLib, etc." - @Echo " Feel free to mail comments, suggestions, etc." - @Echo " Enjoy Info-Zip !" - @Echo " Haidinger Walter, " - @Echo "" - - -# Echo help in case of an error -# -.ONERROR: - @Echo "" - @Echo "[sigh] An error running this makefile was detected." - @Echo "This message may also appear if you interrupted smake by pressing CTRL-C." - @Echo "Contact Info-Zip authors at Zip-Bugs@lists.wku.edu or me for help." - @Echo "Haidinger Walter, " - diff --git a/third_party/infozip/zip/amiga/stat.c b/third_party/infozip/zip/amiga/stat.c deleted file mode 100644 index 6075c21d8..000000000 --- a/third_party/infozip/zip/amiga/stat.c +++ /dev/null @@ -1,293 +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 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 -*/ -/* Here we have a handmade stat() function because Aztec's c.lib stat() */ -/* does not support an st_mode field, which we need... also a chmod(). */ - -/* This stat() is by Paul Wells, modified by Paul Kienitz. */ -/* Originally for use with Aztec C >= 5.0 and Lattice C <= 4.01 */ -/* Adapted for SAS/C 6.5x by Haidinger Walter */ - -/* POLICY DECISION: We will not attempt to remove global variables from */ -/* this source file for Aztec C. These routines are essentially just */ -/* augmentations of Aztec's c.lib, which is itself not reentrant. If */ -/* we want to produce a fully reentrant UnZip, we will have to use a */ -/* suitable startup module, such as purify.a for Aztec by Paul Kienitz. */ - -#ifndef __amiga_stat_c -#define __amiga_stat_c - -#include -#include -#include "amiga/z-stat.h" /* fake version of stat.h */ -#include - -#ifdef AZTEC_C -# include -# include -# include -# include -# include -# include -#endif -#ifdef __SASC -# include /* SAS/C dir function prototypes */ -# include -# include -# include -#endif - -#ifndef SUCCESS -# define SUCCESS (-1) -# define FAILURE (0) -#endif - - -void close_leftover_open_dirs(void); /* prototype */ - -static DIR *dir_cleanup_list = NULL; /* for resource tracking */ - -/* CALL THIS WHEN HANDLING CTRL-C OR OTHER UNEXPECTED EXIT! */ -void close_leftover_open_dirs(void) -{ - while (dir_cleanup_list) - closedir(dir_cleanup_list); -} - - -unsigned short disk_not_mounted; - -extern int stat(const char *file, struct stat *buf); - -stat(file,buf) -const char *file; -struct stat *buf; -{ - - struct FileInfoBlock *inf; - BPTR lock; - time_t ftime; - struct tm local_tm; - - if( (lock = Lock((char *)file,SHARED_LOCK))==0 ) - /* file not found */ - return(-1); - - if( !(inf = (struct FileInfoBlock *)AllocMem( - (long)sizeof(struct FileInfoBlock),MEMF_PUBLIC|MEMF_CLEAR)) ) - { - UnLock(lock); - return(-1); - } - - if( Examine(lock,inf)==FAILURE ) - { - FreeMem((char *)inf,(long)sizeof(*inf)); - UnLock(lock); - return(-1); - } - - /* fill in buf */ - buf->st_dev = - buf->st_nlink = - buf->st_uid = - buf->st_gid = - buf->st_rdev = 0; - buf->st_ino = inf->fib_DiskKey; - buf->st_blocks = inf->fib_NumBlocks; - buf->st_size = inf->fib_Size; - - /* now the date. AmigaDOS has weird datestamps--- - * ds_Days is the number of days since 1-1-1978; - * however, as Unix wants date since 1-1-1970... - */ - - ftime = - (inf->fib_Date.ds_Days * 86400 ) + - (inf->fib_Date.ds_Minute * 60 ) + - (inf->fib_Date.ds_Tick / TICKS_PER_SECOND ) + - (86400 * 8 * 365 ) + - (86400 * 2 ); /* two leap years */ - - /* tzset(); */ /* this should be handled by mktime(), instead */ - /* ftime += timezone; */ - local_tm = *gmtime(&ftime); - local_tm.tm_isdst = -1; - ftime = mktime(&local_tm); - - buf->st_ctime = - buf->st_atime = - buf->st_mtime = ftime; - - buf->st_mode = (inf->fib_DirEntryType < 0 ? S_IFREG : S_IFDIR); - - /* lastly, throw in the protection bits */ - buf->st_mode |= ((inf->fib_Protection ^ 0xF) & 0xFF); - - FreeMem((char *)inf, (long)sizeof(*inf)); - UnLock((BPTR)lock); - - return(0); - -} - -int fstat(int handle, struct stat *buf) -{ - /* fake some reasonable values for stdin */ - buf->st_mode = (S_IREAD|S_IWRITE|S_IFREG); - buf->st_size = -1; - buf->st_mtime = time(&buf->st_mtime); - return 0; -} - - -/* opendir(), readdir(), closedir(), rmdir(), and chmod() by Paul Kienitz. */ - -DIR *opendir(const char *path) -{ - DIR *dd = AllocMem(sizeof(DIR), MEMF_PUBLIC); - if (!dd) return NULL; - if (!(dd->d_parentlock = Lock((char *)path, MODE_OLDFILE))) { - disk_not_mounted = IoErr() == ERROR_DEVICE_NOT_MOUNTED; - FreeMem(dd, sizeof(DIR)); - return NULL; - } else - disk_not_mounted = 0; - if (!Examine(dd->d_parentlock, &dd->d_fib) || dd->d_fib.fib_EntryType < 0) { - UnLock(dd->d_parentlock); - FreeMem(dd, sizeof(DIR)); - return NULL; - } - dd->d_cleanuplink = dir_cleanup_list; /* track them resources */ - if (dir_cleanup_list) - dir_cleanup_list->d_cleanupparent = &dd->d_cleanuplink; - dd->d_cleanupparent = &dir_cleanup_list; - dir_cleanup_list = dd; - return dd; -} - -void closedir(DIR *dd) -{ - if (dd) { - if (dd->d_cleanuplink) - dd->d_cleanuplink->d_cleanupparent = dd->d_cleanupparent; - *(dd->d_cleanupparent) = dd->d_cleanuplink; - if (dd->d_parentlock) - UnLock(dd->d_parentlock); - FreeMem(dd, sizeof(DIR)); - } -} - -struct dirent *readdir(DIR *dd) -{ - return (ExNext(dd->d_parentlock, &dd->d_fib) ? (struct dirent *)dd : NULL); -} - - -#ifdef AZTEC_C - -int rmdir(const char *path) -{ - return (DeleteFile((char *)path) ? 0 : IoErr()); -} - -int chmod(const char *filename, int bits) /* bits are as for st_mode */ -{ - long protmask = (bits & 0xFF) ^ 0xF; - return !SetProtection((char *)filename, protmask); -} - - -/* This here removes unnecessary bulk from the executable with Aztec: */ -void _wb_parse(void) { } - -/* fake a unix function that does not apply to amigados: */ -int umask(void) { return 0; } - - -# include - -/* C library signal() messes up debugging yet adds no actual usefulness */ -typedef void (*__signal_return_type)(int); -__signal_return_type signal() { return SIG_ERR; } - - -/* The following replaces Aztec's argv-parsing function for compatibility with -Unix-like syntax used on other platforms. It also fixes the problem the -standard _cli_parse() has of accepting only lower-ascii characters. */ - -int _argc, _arg_len; -char **_argv, *_arg_lin; - -void _cli_parse(struct Process *pp, long alen, register UBYTE *aptr) -{ - register UBYTE *cp; - register struct CommandLineInterface *cli; - register short c; - register short starred = 0; -# ifdef PRESTART_HOOK - void Prestart_Hook(void); -# endif - - cli = (struct CommandLineInterface *) (pp->pr_CLI << 2); - cp = (UBYTE *) (cli->cli_CommandName << 2); - _arg_len = cp[0] + alen + 2; - if (!(_arg_lin = AllocMem((long) _arg_len, 0L))) - return; - c = cp[0]; - strncpy(_arg_lin, cp + 1, c); - _arg_lin[c] = 0; - for (cp = _arg_lin + c + 1; alen && (*aptr < '\n' || *aptr > '\r'); alen--) - *cp++ = *aptr++; - *cp = 0; - aptr = cp = _arg_lin + c + 1; - for (_argc = 1; ; _argc++) { - while (*cp == ' ' || *cp == '\t') - cp++; - if (!*cp) - break; - if (*cp == '"') { - cp++; - while (c = *cp++) { - if (c == '"' && !starred) { - *aptr++ = 0; - starred = 0; - break; - } else if (c == '\\' && !starred) - starred = 1; - else { - *aptr++ = c; - starred = 0; - } - } - } else { - while ((c = *cp++) && c != ' ' && c != '\t') - *aptr++ = c; - *aptr++ = 0; - } - if (c == 0) - --cp; - } - *aptr = 0; - if (!(_argv = AllocMem((_argc + 1) * sizeof(*_argv), 0L))) { - _argc = 0; - return; - } - for (c = 0, cp = _arg_lin; c < _argc; c++) { - _argv[c] = cp; - cp += strlen(cp) + 1; - } - _argv[c] = NULL; -# ifdef PRESTART_HOOK - Prestart_Hook(); -# endif -} - -#endif /* AZTEC_C */ - -#endif /* __amiga_stat_c */ diff --git a/third_party/infozip/zip/amiga/z-stat.h b/third_party/infozip/zip/amiga/z-stat.h deleted file mode 100644 index 53d6cd1d6..000000000 --- a/third_party/infozip/zip/amiga/z-stat.h +++ /dev/null @@ -1,95 +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 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 -*/ -#ifndef __amiga_z_stat_h -#define __amiga_z_stat_h - -/* Since older versions of the Lattice C compiler for Amiga, and all current */ -/* versions of the Manx Aztec C compiler for Amiga, either provide no stat() */ -/* function or provide one inadequate for unzip (Aztec's has no st_mode */ -/* field), we provide our own stat() function in stat.c by Paul Wells, and */ -/* this fake stat.h file by Paul Kienitz. Paul Wells originally used the */ -/* Lattice stat.h but that does not work for Aztec and is not distributable */ -/* with this package, so I made a separate one. This has to be pulled into */ -/* unzip.h when compiling an Amiga version, as "amiga/z-stat.h". */ - -/* We also provide here a "struct dirent" for use with opendir() & readdir() */ -/* functions included in amiga/stat.c. If you use amiga/stat.c, this must */ -/* be included wherever you use either readdir() or stat(). */ - -#ifdef AZTEC_C -# define __STAT_H -#else /* __SASC */ -/* do not include the following header, replacement definitions are here */ -# define _STAT_H /* do not include SAS/C */ -# define _DIRENT_H /* do not include SAS/C */ -# define _SYS_DIR_H /* do not include SAS/C */ -# define _COMMIFMT_H /* do not include SAS/C */ -# include -#endif -#include -#include - - -struct stat { - unsigned short st_mode; - time_t st_ctime, st_atime, st_mtime; - long st_size; - long st_ino; - long st_blocks; - short st_attr, st_dev, st_nlink, st_uid, st_gid, st_rdev; -}; - -#define S_IFDIR (1<<11) -#define S_IFREG (1<<10) - -#if 0 - /* these values here are totally random: */ -# define S_IFLNK (1<<14) -# define S_IFSOCK (1<<13) -# define S_IFCHR (1<<8) -# define S_IFIFO (1<<7) -# define S_IFMT (S_IFDIR|S_IFREG|S_IFCHR|S_IFLNK) -#else -# define S_IFMT (S_IFDIR|S_IFREG) -#endif - -#define S_IHIDDEN (1<<7) -#define S_ISCRIPT (1<<6) -#define S_IPURE (1<<5) -#define S_IARCHIVE (1<<4) -#define S_IREAD (1<<3) -#define S_IWRITE (1<<2) -#define S_IEXECUTE (1<<1) -#define S_IDELETE (1<<0) - -int stat(const char *name, struct stat *buf); -int fstat(int handle, struct stat *buf); /* returns dummy values */ - -typedef struct dirent { - struct dirent *d_cleanuplink, - **d_cleanupparent; - BPTR d_parentlock; - struct FileInfoBlock d_fib; -} DIR; -#define d_name d_fib.fib_FileName - -extern unsigned short disk_not_mounted; /* flag set by opendir() */ - -DIR *opendir(const char *); -void closedir(DIR *); -void close_leftover_open_dirs(void); /* call this if aborted in mid-run */ -struct dirent *readdir(DIR *); -int umask(void); - -#ifdef AZTEC_C -int rmdir(const char *); -int chmod(const char *filename, int bits); -#endif - -#endif /* __amiga_z_stat_h */ diff --git a/third_party/infozip/zip/amiga/zipup.h b/third_party/infozip/zip/amiga/zipup.h deleted file mode 100644 index c9316f4f9..000000000 --- a/third_party/infozip/zip/amiga/zipup.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef __amiga_zipup_h -#define __amiga_zipup_h - -#ifndef O_RAW -# define O_RAW 0 -#endif -#define fhow (O_RDONLY | O_RAW) -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 - -#endif /* __amiga_zipup_h */ - diff --git a/third_party/infozip/zip/aosvs/aosvs.c b/third_party/infozip/zip/aosvs/aosvs.c deleted file mode 100644 index f944ad1f4..000000000 --- a/third_party/infozip/zip/aosvs/aosvs.c +++ /dev/null @@ -1,659 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include -#include - -#include "zip.h" -#include /* parameter definitions */ -#include /* AOS/VS system call interface */ -#include /* AOS/VS ?FSTAT packet defs */ - -#ifndef UTIL /* AOS/VS specific fileio code not needed for UTILs */ - -#define PAD 0 -#define PATH_END ':' - -/* - * could probably avoid the union - - * all are same size & we're going to assume this - */ -typedef union zvsfstat_stru -{ - P_FSTAT norm_fstat_packet; /* normal fstat packet */ - P_FSTAT_DIR dir_fstat_packet; /* DIR/CPD fstat packet */ - P_FSTAT_UNIT unit_fstat_packet; /* unit (device) fstat packet */ - P_FSTAT_IPC ipc_fstat_packet; /* IPC file fstat packet */ -} ZVSFSTAT_STRU; - -typedef struct zextrafld -{ - char extra_header_id[2]; /* set to VS - in theory, an int */ - char extra_data_size[2]; /* size of rest, in Intel little-endian order */ - char extra_sentinel[4]; /* set to FCI w/ trailing null */ - unsigned char extra_rev; /* set to 10 for rev 1.0 */ - ZVSFSTAT_STRU fstat_packet; /* the fstat packet */ - char aclbuf[$MXACL]; /* raw ACL, or link-resolution name */ -} ZEXTRAFLD; - -#define ZEXTRA_HEADID "VS" -#define ZEXTRA_SENTINEL "FCI" -#define ZEXTRA_REV (unsigned char) 10 - -local ZEXTRAFLD zzextrafld; /* buffer for extra field containing - ?FSTAT packet & ACL buffer */ -local char zlinkres[$MXPL]; /* buf for link resolution contents */ -local char znamebuf[$MXPL]; /* buf for AOS/VS filename */ -static char vsnamebuf[$MXPL]; -static char uxnamebuf[FNMAX]; -static P_FSTAT vsfstatbuf; - -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Local functions */ -local char *readd OF((DIR *)); - -char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *strlower(s) -char *s; /* string to convert */ -/* Convert all uppercase letters to lowercase in string s */ -{ - char *p; /* scans string */ - - for (p = s; *p; p++) - if (*p >= 'A' && *p <= 'Z') - *p += 'a' - 'A'; - return s; -} - -char *strupper(s) -char *s; /* string to convert */ -/* Convert all lowercase letters to uppercase in string s */ -{ - char *p; /* scans string */ - - for (p = s; *p; p++) - if (*p >= 'a' && *p <= 'z') - *p -= 'a' - 'A'; - return s; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - for (t = x; *t == '/'; t++) - ; - - if (*t == '=') /* AOS/VS for ./ */ - t++; - else if (*t == ':') /* AOS/VS for / */ - t++; - - if (!pathput) - t = last(t, PATH_END); - - if (*t == '^') /* AOS/VS for ../ */ - { - if ((n = malloc(strlen(t) + 3)) == NULL) - return NULL; - strcpy(n, "../"); - strcpy(n + 3, t + 1); - } - else if (*t == '@') /* AOS/VS for :PER:, kind of like /dev/ */ - { - if ((n = malloc(strlen(t) + 5)) == NULL) - return NULL; - strcpy(n, "/PER/"); - strcpy(n + 5, t + 1); - } - else - { - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - } - /* now turn AOS/VS dir separators (colons) into slashes */ - for (t = n; *t != '\0'; t++) - if (*t == ':') - *t = '/'; - /* - * Convert filename to uppercase (for correct matching). - * (It may make more sense to patch the matching code, since - * we may want those filenames in uppercase on the target system, - * but this seems better at present. If we're converting, uppercase - * also seems to make sense.) - */ - strupper(n); - - - if (dosify) - msname(n); - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - - return x; -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - time_t u[2]; /* argument for utime() */ - - /* Convert DOS time to time_t format in u */ - u[0] = u[1] = dos2unixtime(d); - utime(f, u); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) - error("fstat(stdin)"); - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - if ((s.st_mode & S_IFDIR) != 0) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime(&s.st_ctime); -} - -int deletedir(d) -char *d; -{ - return rmdir(d); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ - /* NOTE: this AOS/VS version assumes the pathname in z->name is an - * AOS/VS pathname, not a unix-style one. Since you can zip up using - * unix-style pathnames, this may create problems occasionally. - * We COULD add code to parse back to AOS/VS format ... - * (This might also fail for other reasons such as access denied, but - * that should already have occurred.) - * We set the central-dir extra fld pointer & length here to the same data. - */ -{ - int aclend = 0; -/* - * use this to simplify because different calls depending on - * whether links are resolved - */ - unsigned short errc; - - z->ext = 0; /* init to no extra field */ -/* get the ?FSTAT info & the acl - if no errors, get memory & store. - * (first, we have to cut off the trailing slash that was added if - * it's a dir, since AOS/VS doesn't accept that kind of thing) - */ - strncpy(znamebuf, z->name, $MXPL); - znamebuf[$MXPL-1] = '\0'; - if (znamebuf[strlen(znamebuf)-1] == '/') - znamebuf[strlen(znamebuf)-1] = '\0'; - if (linkput) - errc = sys_fstat(znamebuf, BIT1, &(zzextrafld.fstat_packet)); - else - errc = sys_fstat(znamebuf, 0, &(zzextrafld.fstat_packet)); - if (errc) - { - fprintf(stderr, - "\n Warning: can't get ?FSTAT info & acl of %s - error %d\n ", - znamebuf, errc); - perror("sys_fstat()"); - } - else - { - /* store the ACL - or, if a link (no ACL!), store the resolution name */ - if (zzextrafld.fstat_packet.norm_fstat_packet.styp_type != $FLNK) - { - if ((errc = sys_gacl(znamebuf, zzextrafld.aclbuf)) != 0) - { - fprintf(stderr, "\n Warning: can't get acl of %s - error %d\n ", - z->name, errc); - perror("sys_gacl()"); - } - else - { - /* find length of ACL - ends with double-null */ - while (aclend++ < $MXACL && - (zzextrafld.aclbuf[aclend - 1] != '\0' || - zzextrafld.aclbuf[aclend] != '\0')) - /* EMPTY LOOP */ ; - if ((z->cextra = z->extra = - malloc(sizeof(ZEXTRAFLD) - $MXACL + aclend + 4)) != NULL) - { - strncpy(zzextrafld.extra_header_id, ZEXTRA_HEADID, - sizeof(zzextrafld.extra_header_id)); - strncpy(zzextrafld.extra_sentinel, ZEXTRA_SENTINEL, - sizeof(zzextrafld.extra_sentinel)); - zzextrafld.extra_rev = ZEXTRA_REV; /* this is a char, no need - to worry about byte order */ - /* set size (Intel (little-endian)) 2-byte int, which we've set - as array to make it easier */ - errc = (unsigned short) (sizeof(ZEXTRAFLD) - $MXACL + aclend + 4 - - sizeof(zzextrafld.extra_header_id) - - sizeof(zzextrafld.extra_data_size)); - zzextrafld.extra_data_size[0] = errc & 0xFF; /* low-order byte */ - zzextrafld.extra_data_size[1] = errc >> 8; /* high-order byte */ - memcpy((char *) z->extra, (char *) &zzextrafld, - sizeof(ZEXTRAFLD) - $MXACL + aclend + 4); - z->cext = z->ext = sizeof(ZEXTRAFLD) - $MXACL + aclend + 4; - } - } - } - else /* a link */ - { - if ((errc = sys_glink(z->name, zzextrafld.aclbuf)) != 0) - { - fprintf(stderr, - "\n Warning: can't get link-resolution of %s - error %d\n ", - z->name, errc); - perror("sys_glink()"); - } - else - { - aclend = strlen(zzextrafld.aclbuf) + 1; - if ((z->extra = malloc(sizeof(ZEXTRAFLD) - $MXACL + aclend + 4)) - != NULL) - { - strncpy(zzextrafld.extra_header_id, ZEXTRA_HEADID, - sizeof(zzextrafld.extra_header_id)); - strncpy(zzextrafld.extra_sentinel, ZEXTRA_SENTINEL, - sizeof(zzextrafld.extra_sentinel)); - zzextrafld.extra_rev = ZEXTRA_REV; /* this is a char, no need - to worry about byte order */ - /* set size (Intel (little-endian)) 2-byte int, which we've set - as array to make it easier */ - errc = (unsigned short) (sizeof(ZEXTRAFLD) - $MXACL + aclend + 4 - - sizeof(zzextrafld.extra_header_id) - - sizeof(zzextrafld.extra_data_size)); - zzextrafld.extra_data_size[0] = errc & 0xFF; /* low-order byte */ - zzextrafld.extra_data_size[1] = errc >> 8; /* high-order byte */ - memcpy((char *) z->extra, (char *) &zzextrafld, - sizeof(ZEXTRAFLD) - $MXACL + aclend + 4); - z->ext = sizeof(ZEXTRAFLD) - $MXACL + aclend + 4; - } - } - } - } - return ZE_OK; -} - -#endif /* !UTIL */ - -void version_local() -{ - printf("Compiled with %s under %s.\n", - "a C compiler", - "AOS/VS" - ); -} - - -/* - * This file defines for AOS/VS two Unix functions relating to links; - * the calling code should have the following defines: - * - * #define lstat(path,buf) zvs_lstat(path,buf) - * #define readlink(path,buf,nbytes) zvs_readlink(path,buf,nbytes) - * - * For these functions, I'm going to define yet 2 MORE filename buffers - * and also insert code to change pathnames to Unix & back. This is - * easier than changing all the other places this kind of thing happens to - * be efficient. This is a kludge. I'm also going to put the functions - * here for my immediate convenience rather than somewhere else for - * someone else's. - * - * WARNING: the use of static buffers means that you'd better get your - * data out of these buffers before the next call to any of these functions! - * - */ - -/* ========================================================================= - * ZVS_LSTAT() - get (or simulate) stat information WITHOUT following symlinks - * This is intended to look to the outside like the unix lstat() - * function. We do a quick-&-dirty filename conversion. - * - * If the file is NOT a symbolic link, we can just do a stat() on it and - * that should be fine. But if it IS a link, we have to set the elements - * of the stat struct ourselves, since AOS/VS doesn't have a built-in - * lstat() function. - * - * RETURNS: 0 on success, or -1 otherwise - * - */ - -int zvs_lstat(char *path, struct stat *buf) -{ - char *cp_vs = vsnamebuf; - char *cp_ux = path; - int mm, dd, yy; - - /* - * Convert the Unix pathname to an AOS/VS pathname. - * This is quick & dirty; it won't handle (for instance) pathnames with - * ../ in the middle of them, and may choke on other Unixisms. We hope - * they're unlikely. - */ - if (!strncmp(cp_ux, "../", 3)) - { - *cp_vs++ = '^'; /* AOS/VS for ../ */ - cp_ux += 3; - } - else if (!strncmp(cp_ux, "./", 2)) - { - *cp_vs++ = '='; /* AOS/VS for ./ */ - cp_ux += 2; - } - - do - { - if (*cp_ux == '/') - { - *cp_vs++ = ':'; - } - else - { - *cp_vs++ = (char) toupper(*cp_ux); - } - - } while (*cp_ux++ != '\0' && cp_vs - vsnamebuf < sizeof(vsnamebuf)); - - /* If Unix name was too long for our buffer, return an error return */ - if (cp_vs - vsnamebuf >= sizeof(vsnamebuf) && *(cp_vs - 1) != '\0') - return (-1); /* error */ - - /* Make AOS/VS ?FSTAT call that won't follow links & see if we find - * anything. If not, we return error. - */ - if (sys_fstat(vsnamebuf, - BIT1, /* BIT1 says to not resolve links */ - &vsfstatbuf)) - return (-1); /* error */ - - /* If we DID find the file but it's not a link, - * call stat() and return its value. - */ - if (vsfstatbuf.styp_type != $FLNK) - return (stat(path, buf)); /* call with Unix pathname ... */ - - /* Otherwise, we have to kludge up values for the stat structure */ - memset((char *) buf, 0, sizeof(*buf)); /* init to nulls (0 values) */ - buf->st_mode = S_IFLNK | 0777; /* link and rwxrwxrwx */ - buf->st_uid = -1; /* this is what we get on AOS/VS - anyway (maybe unless we set up - a dummy password file?) */ - buf->st_nlink = 1; - /* The DG date we've got is days since 12/31/67 and seconds/2. So we - * need to subtract 732 days (if that's not negative), convert to seconds, - * and add adjusted seconds. - */ - if (vsfstatbuf.stch.short_time[0] < 732) - buf->st_ctime = buf->st_mtime = buf->st_atime = 0L; - else - { - buf->st_ctime = buf->st_mtime = buf->st_atime = - ((long) vsfstatbuf.stch.short_time[0] - 732L) * 24L * 3600L + - 2L * (long) vsfstatbuf.stch.short_time[1]; - } - - /* And we need to get the filename linked to and use its length as - * the file size. We'll use the Unix pathname buffer for this - hope - * it's big enough. (We won't overwrite anything, but we could get a - * truncated path.) If there's an error, here's our last chance to - * say anything. - */ - if ((buf->st_size = zvs_readlink(vsnamebuf, uxnamebuf, FNMAX)) < 0) - return (-1); - else - return (0); - -} /* end zvs_lstat() */ - -/* ========================================================================= - * ZVS_READLINK() - get pathname pointed to by an AOS/VS link file - * This is intended to look to the outside like the unix readlink() - * function. We do a quick-&-dirty filename conversion. - * - * RETURNS: the length of the output path (in bytes), or -1 if an error - * - */ - -int zvs_readlink(char *path, char *buf, int nbytes) -{ - char *cp_vs = vsnamebuf; - char *cp_ux = buf; - - /* This is called with z->name, the filename the user gave, so we'll get - * the link-resolution name on the assumption that it's a valid AOS/VS - * name. We're also assuming a reasonable value (> 5) for nbytes. - */ - if (sys_glink(path, vsnamebuf)) - return (-1); /* readlink() is supposed to return -1 on error */ - - /* Now, convert the AOS/VS pathname to a Unix pathname. - * Note that sys_glink(), unlike readlink(), does add a null. - */ - if (*cp_vs == '^') /* AOS/VS for ../ */ - { - strncpy(cp_ux, "../", 3); - cp_ux += 3; - cp_vs++; - } - else if (*cp_vs == '@') /* AOS/VS for :PER:, kind of like /dev/ */ - { - strncpy(cp_ux, "/PER/", 5); - cp_ux += 5; - cp_vs++; - } - else if (*cp_vs == '=') /* AOS/VS for ./ */ - { - strncpy(cp_ux, "./", 2); - cp_ux += 2; - cp_vs++; - } - while (*cp_vs != '\0' && cp_ux - buf < nbytes) - { - if (*cp_vs == ':') - { - *cp_ux++ = '/'; - } - else - { - *cp_ux++ = (char) toupper(*cp_vs); - } - cp_vs++; - } - - return (cp_ux - buf); /* # characters in Unix path (no trailing null) */ - -} /* end zvs_readlink() */ diff --git a/third_party/infozip/zip/aosvs/make.cli b/third_party/infozip/zip/aosvs/make.cli deleted file mode 100644 index 32b262416..000000000 --- a/third_party/infozip/zip/aosvs/make.cli +++ /dev/null @@ -1,5 +0,0 @@ -push -prompt pop -sea :c_4.10 :c_4.10:lang_rt [!sea] -cc%0/%/link/NOUNX AOS_VS/DEFINE NODIR/DEFINE .C -pop diff --git a/third_party/infozip/zip/api.c b/third_party/infozip/zip/api.c index b6f57e7f8..8a013e5bb 100644 --- a/third_party/infozip/zip/api.c +++ b/third_party/infozip/zip/api.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* api.c - Zip 3 diff --git a/third_party/infozip/zip/api.h b/third_party/infozip/zip/api.h index f6096336d..fccd4b80f 100644 --- a/third_party/infozip/zip/api.h +++ b/third_party/infozip/zip/api.h @@ -1,3 +1,4 @@ +/* clang-format off */ /* api.h - Zip 3 @@ -12,7 +13,7 @@ #ifndef _ZIPAPI_H #define _ZIPAPI_H -#include "zip.h" +#include "third_party/infozip/zip/zip.h" #ifdef WIN32 # ifndef PATH_MAX diff --git a/third_party/infozip/zip/atari/Makefile b/third_party/infozip/zip/atari/Makefile deleted file mode 100644 index 2c8619685..000000000 --- a/third_party/infozip/zip/atari/Makefile +++ /dev/null @@ -1,111 +0,0 @@ -# Makefile for Zip, ZipNote, ZipCloak and ZipSplit - -MAKE = make -SHELL = /bin/sh - -# (to use the Gnu compiler, change cc to gcc in CC and BIND) -CC = cc -BIND = $(CC) -AS = $(CC) -c -E = -CPP = /lib/cpp - -# probably can change this to 'install' if you have it -INSTALL = cp - -# target directories - where to install executables and man pages to -BINDIR = /usr/local/bin -manext=1 -MANDIR = /usr/local/man/man$(manext) - -# flags -# CFLAGS flags for C compile -# LFLAGS1 flags after output file spec, before obj file list -# LFLAGS2 flags after obj file list (libraries, etc) -CFLAGS = -O -LFLAGS1 = -LFLAGS2 = -s - -# object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o crc32.o globals.o \ - crypt.o ttyio.o atari.o - -OBJI = deflate.o trees.o -OBJA = -OBJU = zipfile_.o fileio_.o util_.o globals.o atari_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h atari/osdep.h - -# suffix rules -.SUFFIXES: -.SUFFIXES: _.o .o .c .doc .1 -.c_.o: - rm -f $*_.c; ln $< $*_.c - $(CC) $(CFLAGS) -DUTIL -c $*_.c - rm -f $*_.c -.c.o: - $(CC) $(CFLAGS) -c $< - -.1.doc: - nroff -man $< | col -b | uniq > $@ - -# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL. -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h -zipup.o: atari/zipup.h - -match.o: match.s - $(CPP) match.s > _match.s - $(AS) _match.s - mv _match.o match.o - rm -f _match.s - -ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E - -zips: $(ZIPS) -zipsman: $(ZIPS) $(ZIPMANUAL) - -zip$E: $(OBJZ) $(OBJI) $(OBJA) - $(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) -zipnote$E: $(OBJN) - $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2) -zipcloak$E: $(OBJC) - $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2) -zipsplit$E: $(OBJS) - $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2) - -$(ZIPMANUAL): man/zip.1 - nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL) - -# install -install: $(ZIPS) - $(INSTALL) $(ZIPS) $(BINDIR) - $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext) - -uninstall: - -cd $(BINDIR); rm -f $(ZIPS) - -cd $(MANDIR); rm -f zip.$(manext) - -dist: $(ZIPMANUAL) - zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \ - -e s/[.]//g -e q revision.h` \ - `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents` - -# ATARI version (gcc 2.5.8 and Mintlibs PL46) -atari: - $(MAKE) zips CFLAGS="-O -DATARI" OBJA=atari/atari.o CC=gcc E=.ttp - -# clean up after making stuff and installing it -clean: - rm -f *.o $(ZIPS) flags diff --git a/third_party/infozip/zip/atari/README b/third_party/infozip/zip/atari/README deleted file mode 100644 index cce42061c..000000000 --- a/third_party/infozip/zip/atari/README +++ /dev/null @@ -1,5 +0,0 @@ -From: harry@hal.westfalen.de (Harald Denker) - -The old zip ATARI port is based on TurboC which is no more -supported (for more than 3 years). I used the GNU gcc 2.5.8 and -MiNTlibs PL46. diff --git a/third_party/infozip/zip/atari/atari.c b/third_party/infozip/zip/atari/atari.c deleted file mode 100644 index ce5196cf2..000000000 --- a/third_party/infozip/zip/atari/atari.c +++ /dev/null @@ -1,681 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include "zip.h" - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#include -#include -#include -#include -#include -#include - - -#define PAD 0 -#define PATH_END '/' - -extern char *label; /* defined in fileio.c */ - -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -local char *getVolumeLabel(drive, vtime, vmode, utim) - int drive; /* drive name: 'A' .. 'Z' or '\0' for current drive */ - ulg *vtime; /* volume label creation time (DOS format) */ - ulg *vmode; /* volume label file mode */ - time_t utim;/* volume label creation time (UNIX format) */ - -/* If a volume label exists for the given drive, return its name and - set its time and mode. The returned name must be static data. */ -{ - static char vol[14]; - _DTA *dtaptr; - - if (drive) { - vol[0] = (char)drive; - strcpy(vol+1, ":/"); - } else { - strcpy(vol, "/"); - } - strcat(vol, "*.*"); - if (Fsfirst(vol, FA_LABEL) == 0) { - dtaptr = Fgetdta(); - strncpy(vol, dtaptr->dta_name, sizeof(vol)-1); - *vtime = ((ulg)dtaptr->dta_date << 16) | - ((ulg)dtaptr->dta_time & 0xffff); - *vmode = (ulg)dtaptr->dta_attribute; - return vol; - } - return NULL; -} - -char GetFileMode(char *name) -{ - struct stat sb; - - sb.st_attr = 0; - Fxattr(linkput ? 1 : 0, name, &sb); - if (errno == EINVAL) { - _DTA *dtaptr, *old; - old = Fgetdta(); - Fsfirst(name, FA_RDONLY+FA_HIDDEN+FA_SYSTEM+FA_DIR); - dtaptr = Fgetdta(); - sb.st_attr = dtaptr->dta_attribute; - Fsetdta(old); - } - return sb.st_attr & 0x3f; -} - - -int wild2(w) -char *w; /* path/pattern to match */ -/* If not in exclude mode, expand the pattern based on the contents of the - file system. Return an error code in the ZE_ class. */ -{ - DIR *d; /* stream for reading directory */ - char *e; /* name found in directory */ - int r; /* temporary variable */ - char *n; /* constructed name from directory */ - int f; /* true if there was a match */ - char *a; /* alloc'ed space for name */ - char *p; /* path */ - char *q; /* name */ - char v[5]; /* space for device current directory */ - - if (volume_label == 1) { - volume_label = 2; - label = getVolumeLabel(w[1] == ':' ? to_up(w[0]) : '\0', - &label_time, &label_mode, &label_utim); - if (label != NULL) { - newname(label, 0, 0); - } - if (w[1] == ':' && w[2] == '\0') return ZE_OK; - /* "zip -$ foo a:" can be used to force drive name */ - } - - /* special handling of stdin request */ - if (strcmp(w, "-") == 0) /* if compressing stdin */ - return newname(w, 0, 0); - - /* Allocate and copy pattern */ - if ((p = a = malloc(strlen(w) + 1)) == NULL) - return ZE_MEM; - strcpy(p, w); - - /* Normalize path delimiter as '/'. */ - for (q = p; *q; q++) /* use / consistently */ - if (*q == '\\') - *q = '/'; - - /* Only name can have special matching characters */ - if ((q = isshexp(p)) != NULL && - (strrchr(q, '/') != NULL || strrchr(q, ':') != NULL)) - { - free((zvoid *)a); - return ZE_PARMS; - } - - /* Separate path and name into p and q */ - if ((q = strrchr(p, '/')) != NULL && (q == p || q[-1] != ':')) - { - *q++ = '\0'; /* path/name -> path, name */ - if (*p == '\0') /* path is just / */ - p = strcpy(v, "/."); - } - else if ((q = strrchr(p, ':')) != NULL) - { /* has device and no or root path */ - *q++ = '\0'; - p = strcat(strcpy(v, p), ":"); /* copy device as path */ - if (*q == '/') /* -> device:/., name */ - { - strcat(p, "/"); - q++; - } - strcat(p, "."); - } - else if (recurse && (strcmp(p, ".") == 0 || strcmp(p, "..") == 0)) - { /* current or parent directory */ - /* I can't understand Mark's code so I am adding a hack here to get - * "zip -r foo ." to work. Allow the dubious "zip -r foo .." but - * reject "zip -rm foo ..". - */ - if (dispose && strcmp(p, "..") == 0) - ziperr(ZE_PARMS, "cannot remove parent directory"); - q = "*.*"; - } - else /* no path or device */ - { - q = p; - p = strcpy(v, "."); - } - if (recurse && *q == '\0') { - q = "*.*"; - } - /* Search that level for matching names */ - if ((d = opendir(p)) == NULL) - { - free((zvoid *)a); - return ZE_MISS; - } - if ((r = strlen(p)) > 1 && - (strcmp(p + r - 2, ":.") == 0 || strcmp(p + r - 2, "/.") == 0)) - *(p + r - 1) = '\0'; - f = 0; - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..") && MATCH(q, e, 0)) - { - f = 1; - if (strcmp(p, ".") == 0) { /* path is . */ - r = procname(e, 0); /* name is name */ - if (r) { - f = 0; - break; - } - } else - { - if ((n = malloc(strlen(p) + strlen(e) + 2)) == NULL) - { - free((zvoid *)a); - closedir(d); - return ZE_MEM; - } - n = strcpy(n, p); - if (n[r = strlen(n) - 1] != '/' && n[r] != ':') - strcat(n, "/"); - r = procname(strcat(n, e), 0); /* name is path/name */ - free((zvoid *)n); - if (r) { - f = 0; - break; - } - } - } - } - closedir(d); - - /* Done */ - free((zvoid *)a); - return f ? ZE_OK : ZE_MISS; -} - - -#include -#include - -void regerror( char ZCONST *msg ) { - perror( msg ); -} - -static int ret; -static regexp *regptr; -static short is_w, ind_w; -static char fullpath[FILENAME_MAX], file_arg[FILENAME_MAX]; - -#define FTW_F 0 -#define FTW_D 1 -#define FTW_DNR 2 -#define FTW_NS 3 - -static int ftwfunc( struct stat *stats, int ftw_status ) -{ - char *path = &fullpath[0]; - - if (strncmp(path, "./", 2) == 0) path += 2; - switch (ftw_status) { - case FTW_NS: - zipwarn("can't stat file: ", path); - ret = ZE_MISS; - return 0; - case FTW_F: - if (!is_w || regexec(regptr, path, 1)) { -#if 0 - char fn[FILENAME_MAX]; - int k; - if (S_ISLNK(stats->st_mode) && - (k = readlink(path, fn, FILENAME_MAX)) > 0) { - int l = strlen(path); - fn[k] = '\0'; - strcat(strcat(path, " -> "), fn); - ret = newname(path, 0, 0); /* procname(path, 0); */ - path[l] = '\0'; - } else -#endif - ret = newname(path, 0, 0); /* procname(path, 0); */ - } - return 0; - case FTW_DNR: - zipwarn("can't open directory: ", path); - ret = ZE_MISS; - return 0; - case FTW_D: - if (strcmp(path, ".") == 0) return 0; - if (is_w && ind_w > 0 && strncmp(path, file_arg, ind_w) != 0) - return 4; - } - return 0; -} - -static int myftw( int depth ) -{ - register DIR *dirp; - struct dirent *entp; - struct stat stats; - register char *p,*q; - register long i; - - if (LSSTAT(fullpath, &stats) < 0) - return ftwfunc(&stats, FTW_NS); - - if (!S_ISDIR(stats.st_mode)) - return ftwfunc(&stats, FTW_F); - - if ((dirp = opendir(fullpath)) == NULL) - return ftwfunc(&stats, FTW_DNR); - - if (i = ftwfunc(&stats, FTW_D)) { - closedir(dirp); - return (i == 4 ? 0 : (int)i); - } - i = strlen(fullpath); - p = &fullpath[i]; - *p++ = '/'; *p = '\0'; - if (dirnames && i > 1) { - q = (strncmp(fullpath, "./", 2) == 0 ? &fullpath[2] : &fullpath[0]); - ret = newname(q, 1, 0); - } - i = 0; - while (depth > 0 && (entp = readdir(dirp)) != 0) - if (strcmp(entp->d_name,".") != 0 && strcmp(entp->d_name,"..") != 0) { - strcpy(p, entp->d_name); - if (i = myftw(depth-1)) - depth = 0; /* force User's finish */ - } - closedir(dirp); - return (int)i; -} - -int wild( char *p ) -{ - char *d; - - ret = ZE_OK; - if (p == NULL) p = "*"; - - if (strcmp(p, "-") == 0) /* if compressing stdin */ - ret = newname(p, 0, 0); - - strcpy(fullpath, p); - /* now turning UNIX-Wildcards into basic regular expressions */ - for (is_w = ind_w = 0, d = &file_arg[0]; *p; d++, p++) - switch (*p) { - case '*': *d++ = '.'; *d = *p; is_w = 1; break; - case '?': *d = '.'; is_w = 1; break; - case '[': *d = *p; - if (*(p+1) == '!') { - *++d = '^'; p++; - } is_w = 1; break; - case '.': *d++ = '\\'; *d = *p; break; - default : *d = *p; - if (!is_w) ind_w++; - } - *++d = '\0'; - if (is_w) { - strcat( file_arg, "$" ); /* to get things like *.[ch] work */ - if ((regptr = regcomp( file_arg )) == NULL) - return ZE_MEM; - strcpy( fullpath, "." ); - myftw( recurse ? 99 : 1 ); - free(regptr); - } else if (recurse) { - myftw( 99 ); - } else - myftw( 1 ); /* ret = procname( fullpath, 0 ); */ - return ret; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - for (p = n; *p; p++) /* use / consistently */ - if (*p == '\\') - *p = '/'; - if (!S_ISDIR(s.st_mode)) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t, *p; /* shortened name */ - int dosflag; - - dosflag = 0; - - /* Find starting point in name before doing malloc */ - t = *x && *(x + 1) == ':' ? x + 2 : x; - while (*t == '/' || *t == '\\') - t++; - - /* Make changes, if any, to the copied name (leave original intact) */ - for (n = t; *n; n++) - if (*n == '\\') - *n = '/'; - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); -#if 0 - if (p = strstr(t, " -> ")) /* shorten "link -> data" to "link" */ - *p = '\0'; -#endif - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - return x; -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - struct utimbuf u; /* argument for utime() const ?? */ - - /* Convert DOS time to time_t format in u[0] and u[1] */ - u.actime = u.modtime = dos2unixtime(d); - - /* Set updated and accessed times of f */ - utime(f, &u); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) { - free(name); - error("fstat(stdin)"); - } - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - - if (a != NULL) { -/* *a = ((ulg)s.st_mode << 16) | (ulg)GetFileMode(name); */ - *a = ((ulg)s.st_mode << 16) | (ulg)s.st_attr; - } - free(name); - if (n != NULL) - *n = S_ISREG(s.st_mode) ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime(&s.st_mtime); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ -{ -#ifdef USE_EF_UT_TIME -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(2))) == NULL) - return ZE_MEM; - if ((z->cextra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(1))) == NULL) - return ZE_MEM; - - z->extra[0] = 'U'; - z->extra[1] = 'T'; - z->extra[2] = EB_UT_LEN(2); /* length of data part of e.f. */ - z->extra[3] = 0; - z->extra[4] = EB_UT_FL_MTIME | EB_UT_FL_ATIME; - z->extra[5] = (char)(z_utim->mtime); - z->extra[6] = (char)(z_utim->mtime >> 8); - z->extra[7] = (char)(z_utim->mtime >> 16); - z->extra[8] = (char)(z_utim->mtime >> 24); - z->extra[9] = (char)(z_utim->atime); - z->extra[10] = (char)(z_utim->atime >> 8); - z->extra[11] = (char)(z_utim->atime >> 16); - z->extra[12] = (char)(z_utim->atime >> 24); - - z->ext = (EB_HEADSIZE+EB_UX_LEN(2)); - - memcpy(z->cextra, z->extra, (EB_HEADSIZE+EB_UT_LEN(1))); - z->cextra[EB_LEN] = EB_UT_LEN(1); - z->cext = (EB_HEADSIZE+EB_UX_LEN(1)); - - return ZE_OK; -#else /* !USE_EF_UT_TIME */ - return (int)(z-z); -#endif /* ?USE_EF_UT_TIME */ -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). - */ -{ - return rmdir(d); -} - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; -#ifdef __TURBOC__ - char buf[40]; -#endif - - printf(CompiledWith, - -#ifdef __GNUC__ - "gcc ", __VERSION__, -#else -# if 0 - "cc ", (sprintf(buf, " version %d", _RELEASE), buf), -# else -# ifdef __TURBOC__ - "Turbo C", (sprintf(buf, " (0x%04x = %d)", __TURBOC__, __TURBOC__), buf), -# else - "unknown compiler", "", -# endif -# endif -#endif - -#ifdef __MINT__ - "Atari TOS/MiNT", -#else - "Atari TOS", -#endif - - " (Atari ST/TT/Falcon030)", - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/atari/make_all.mup b/third_party/infozip/zip/atari/make_all.mup deleted file mode 100644 index 5f8c4dc18..000000000 --- a/third_party/infozip/zip/atari/make_all.mup +++ /dev/null @@ -1,7 +0,0 @@ -rm -f *.o *.sym *.ttp -make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-O -DATARI" E=.ttp OBJA=atari.o zips -#make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-g -D__NO_INLINE__ -DATARI" E=.ttp OBJA=atari.o zip.ttp -#make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-g -D__NO_INLINE__ -DATARI" E=.sym OBJA=atari.o zip.sym LFLAGS2="-B/bin/sym-" -#make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-O -DATARI" E=.ttp OBJA=atari.o -n zips > make_all.mup -#fixstk 32K pgp.ttp -prgflags 017 007 *.ttp diff --git a/third_party/infozip/zip/atari/make_zip.mup b/third_party/infozip/zip/atari/make_zip.mup deleted file mode 100644 index 4ea4c31cb..000000000 --- a/third_party/infozip/zip/atari/make_zip.mup +++ /dev/null @@ -1,7 +0,0 @@ -#rm -f *.o *.sym *.ttp -#make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-O -DATARI" E=.ttp OBJA=atari.o zips -make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-g -D__NO_INLINE__ -DATARI" E=.ttp OBJA=atari.o zip.ttp -make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-g -D__NO_INLINE__ -DATARI" E=.sym OBJA=atari.o zip.sym LFLAGS2="-B/bin/sym-" -#make370 SHELL=/bin/mupfel.ttp CC=gcc CFLAGS="-O -DATARI" E=.ttp OBJA=atari.o -n zips > make_all.mup -#fixstk 32K pgp.ttp -prgflags 017 007 *.ttp diff --git a/third_party/infozip/zip/atari/osdep.h b/third_party/infozip/zip/atari/osdep.h deleted file mode 100644 index 46387b604..000000000 --- a/third_party/infozip/zip/atari/osdep.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define FOPR "rb" -#define FOPM "r+b" -#define FOPW "wb" - -#define DIRENT -#define NO_TERMIO -#define USE_CASE_MAP -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#include -#include diff --git a/third_party/infozip/zip/atari/zipup.h b/third_party/infozip/zip/atari/zipup.h deleted file mode 100644 index 1de3f6172..000000000 --- a/third_party/infozip/zip/atari/zipup.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef O_RDONLY -# define O_RDONLY 0 -#endif -#define fhow O_RDONLY -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/atheos/Makefile b/third_party/infozip/zip/atheos/Makefile deleted file mode 100644 index 91df1c895..000000000 --- a/third_party/infozip/zip/atheos/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -###################################################################### -# -# Makefile for Info-ZIP's zip, zipcloak, zipnote, and zipsplit on AtheOS -# -# Copyright (C) 1999-2007 Info-ZIP -# Chris Herborth (chrish@pobox.com) -# Ruslan Nickolaev (nruslan@hotbox.ru) -# -###################################################################### -# Things that don't change: - -# Punish people who don't have SMP hardware. -MAKE = make -j 4 -f atheos/Makefile -SHELL = /bin/sh - -LN = ln -s -RM = rm -f - -BIND = $(CC) -AS = as - -INSTALL = install - -# Target directories -prefix = /usr -BINDIR = $(prefix)/bin -manext = 1 -MANDIR = $(prefix)/man/man$(manext) -ZIPMANUAL = MANUAL - -VERSION = Version 2.3 of __DATE__ - -###################################################################### - -CC:=gcc -CFLAGS:=-O3 -march=i586 -Wall -I. -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN -DASMV -DASM_CRC -LFLAGS1:= -LFLAGS2:= -TARGET=$(ZIPS) - -###################################################################### -# Helpful targets -all: - $(MAKE) CC=$(CC) CFLAGS="$(CFLAGS)" \ - LFLAGS1="$(LFLAGS1)" LFLAGS2="$(LFLAGS2)" \ - $(TARGET) - -###################################################################### -# Object file lists and other build goodies - -# Object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crc32.o crypt.o \ - ttyio.o atheos.o -OBJI = deflate.o trees.o -OBJA = match.o crc_i386.o -OBJU = zipfile_.o fileio_.o util_.o globals.o atheos_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -# Headers -ZIP_H = zip.h ziperr.h tailor.h atheos/osdep.h - -# What to build? -ZIPS = zip zipnote zipsplit zipcloak - -# suffix rules -.SUFFIXES: -.SUFFIXES: _.o .o .c .doc .1 -.c_.o: - $(RM) $*_.c; $(LN) $< $*_.c - $(CC) -c $(CFLAGS) -DUTIL $*_.c - $(RM) $*_.c - -.c.o: - $(CC) -c $(CFLAGS) $< - -.1.doc: - groff -man -Tascii $< > $@ - -# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL. -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h -zipup.o: atheos/zipup.h - -match.o: match.S - $(CC) -E match.S > matchs.s - $(AS) -o $@ matchs.s - $(RM) matchs.s - -crc_i386.o: crc_i386.S - $(CC) -E crc_i386.S > crc_i386s.s - $(AS) -o $@ crc_i386s.s - $(RM) crc_i386s.s - -atheos.o: atheos/atheos.c - $(CC) -c $(CFLAGS) atheos/atheos.c - -atheos_.o: atheos/atheos.c - $(RM) $*_.c; $(LN) atheos/atheos.c $*_.c - $(CC) -c $(CFLAGS) -DUTIL $*_.c - $(RM) $*_.c - -zips: $(ZIPS) -zipsman: $(ZIPS) $(ZIPMANUAL) - -zip: $(OBJZ) $(OBJI) $(OBJA) - $(BIND) -o zip $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) -zipnote: $(OBJN) - $(BIND) -o zipnote $(LFLAGS1) $(OBJN) $(LFLAGS2) -zipcloak: $(OBJC) - $(BIND) -o zipcloak $(LFLAGS1) $(OBJC) $(LFLAGS2) -zipsplit: $(OBJS) - $(BIND) -o zipsplit $(LFLAGS1) $(OBJS) $(LFLAGS2) - -$(ZIPMANUAL): man/zip.1 - groff -man -Tascii man/zip.1 > $(ZIPMANUAL) - -# install -install: $(ZIPS) - $(INSTALL) -m755 $(ZIPS) $(BINDIR) - mkdir -p $(MANDIR) - $(INSTALL) -m644 man/zip.1 $(MANDIR)/zip.$(manext) - -uninstall: - -cd $(BINDIR); $(RM) $(ZIPS) - -cd $(MANDIR); $(RM) zip.$(manext) - -dist: $(ZIPMANUAL) - zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \ - -e s/[.]//g -e q revision.h` \ - `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents` - -# clean up after making stuff and installing it -clean: - $(RM) *.o $(ZIPS) flags - -# end of Makefile diff --git a/third_party/infozip/zip/atheos/README b/third_party/infozip/zip/atheos/README deleted file mode 100644 index a96fffcd2..000000000 --- a/third_party/infozip/zip/atheos/README +++ /dev/null @@ -1,21 +0,0 @@ -Info-ZIP's zip for AtheOS/Syllable - -FEATURES - stores AtheOS/Syllable file attributes, compressing them if possible - -TODO ----- -There is only one thing to be fixed: - write_attr() should return count of writed bytes. However that's bug related with AFS only. - -Please report any bugs to Info-ZIP at www.info-zip.org. -If this bug related with AtheOS/Syllable only, you can mail me directly: nruslan@hotbox.ru. - -Visit the Info-ZIP web site (http://www.info-zip.org) for all the -latest zip and unzip information, FAQs, source code and ready-to-run -executables. - -- Ruslan Nickolaev (nruslan@hotbox.ru) - Sep 06/2004 - -(updated 12 November 2004) diff --git a/third_party/infozip/zip/atheos/atheos.c b/third_party/infozip/zip/atheos/atheos.c deleted file mode 100644 index 6f1c91573..000000000 --- a/third_party/infozip/zip/atheos/atheos.c +++ /dev/null @@ -1,885 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html - - This AtheOS - specific file is based on unix.c and beos.c; - changes by Ruslan Nickolaev (nruslan@hotbox.ru) -*/ - -#include "zip.h" - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -#define PAD 0 -#define PATH_END '/' - -/* Library functions not in (most) header files */ - -#ifdef _POSIX_VERSION -# include -#else - int utime OF((char *, time_t *)); -#endif - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Local functions */ -local char *readd OF((DIR *)); -local int get_attr_dir( const char *, char **, off_t * ); -local int add_UT_ef( struct zlist far * ); -local int add_Ux_ef( struct zlist far * ); -local int add_At_ef( struct zlist far * ); - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if ((s.st_mode & S_IFREG) == S_IFREG || - (s.st_mode & S_IFLNK) == S_IFLNK) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } - else if ((s.st_mode & S_IFDIR) == S_IFDIR) - { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) */ - else - zipwarn("ignoring special file: ", n); - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t = NULL; /* shortened name */ - int dosflag; - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - /* Strip "//host/share/" part of a UNC name */ - if (!strncmp(x,"//",2) && (x[2] != '\0' && x[2] != '/')) { - n = x + 2; - while (*n != '\0' && *n != '/') - n++; /* strip host name */ - if (*n != '\0') { - n++; - while (*n != '\0' && *n != '/') - n++; /* strip `share' name */ - } - if (*n != '\0') - t = n + 1; - } else - t = x; - while (*t == '/') - t++; /* strip leading '/' chars to get a relative path */ - while (*t == '.' && t[1] == '/') - t += 2; /* strip redundant leading "./" sections */ - - /* Make changes, if any, to the copied name (leave original intact) */ - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (isdir == 42) return n; /* avoid warning on unused variable */ - - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - return x; -} - -/* - * XXX use ztimbuf in both POSIX and non POSIX cases ? - */ -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ -#ifdef _POSIX_VERSION - struct utimbuf u; /* argument for utime() const ?? */ -#else - time_t u[2]; /* argument for utime() */ -#endif - - /* Convert DOS time to time_t format in u */ -#ifdef _POSIX_VERSION - u.actime = u.modtime = dos2unixtime(d); - utime(f, &u); -#else - u[0] = u[1] = dos2unixtime(d); - utime(f, u); -#endif - -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) { - free(name); - error("fstat(stdin)"); - } - } - else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { -#ifndef OS390 - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); -#else -/* -** The following defines are copied from the unizip source and represent the -** legacy Unix mode flags. These fixed bit masks are no longer required -** by XOPEN standards - the S_IS### macros being the new recommended method. -** The approach here of setting the legacy flags by testing the macros should -** work under any _XOPEN_SOURCE environment (and will just rebuild the same bit -** mask), but is required if the legacy bit flags differ from legacy Unix. -*/ -#define UNX_IFDIR 0040000 /* Unix directory */ -#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_IFCHR 0020000 /* Unix character special (not Amiga) */ -#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ - { - mode_t legacy_modes; - - /* Initialize with permission bits - which are not implementation optional */ - legacy_modes = s.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); - if (S_ISDIR(s.st_mode)) - legacy_modes |= UNX_IFDIR; - if (S_ISREG(s.st_mode)) - legacy_modes |= UNX_IFREG; - if (S_ISLNK(s.st_mode)) - legacy_modes |= UNX_IFLNK; - if (S_ISBLK(s.st_mode)) - legacy_modes |= UNX_IFBLK; - if (S_ISCHR(s.st_mode)) - legacy_modes |= UNX_IFCHR; - if (S_ISFIFO(s.st_mode)) - legacy_modes |= UNX_IFIFO; - if (S_ISSOCK(s.st_mode)) - legacy_modes |= UNX_IFSOCK; - *a = ((ulg)legacy_modes << 16) | !(s.st_mode & S_IWRITE); - } -#endif - if ((s.st_mode & S_IFMT) == S_IFDIR) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = t->mtime; /* best guess, (s.st_ctime: last status change!!) */ - } - return unix2dostime(&s.st_mtime); -} - -/* ---------------------------------------------------------------------- - -Return a malloc()'d buffer containing all of the attributes and their names -for the file specified in name. You have to free() this yourself. The length -of the buffer is also returned. - -If get_attr_dir() fails, the buffer will be NULL, total_size will be 0, -and an error will be returned: - - EOK - no errors occurred - EINVAL - attr_buff was pointing at a buffer - ENOMEM - insufficient memory for attribute buffer - -Other errors are possible (whatever is returned by the fs_attrib.h functions). - -PROBLEMS: - -- pointers are 32-bits; attributes are limited to ssize_t in size so it's - possible to overflow... in practice, this isn't too likely... your - machine will thrash like hell before that happens - -*/ - -#define INITIAL_BUFF_SIZE 65536 - -int get_attr_dir( const char *name, char **attr_buff, off_t *total_size ) -{ - int retval = EOK; - int fd; - DIR *fa_dir; - struct dirent *fa_ent; - off_t attrs_size = 0; - size_t entname_size; - char *ptr; - struct attr_info fa_info; - - *total_size = 0; - - /* ----------------------------------------------------------------- */ - /* Sanity-check. */ - if( *attr_buff != NULL ) { - return EINVAL; - } - - /* ----------------------------------------------------------------- */ - /* Can we open the file/directory? */ - /* */ - /* linkput is a zip global; it's set to 1 if we're storing symbolic */ - /* links as symbolic links (instead of storing the thing the link */ - /* points to)... if we're storing the symbolic link as a link, we'll */ - /* want the link's file attributes, otherwise we want the target's. */ - - fd = open( name, linkput ? O_RDONLY | O_NOTRAVERSE : O_RDONLY ); - if( fd < 0 ) { - return errno; - } - - /* ----------------------------------------------------------------- */ - /* Allocate an initial buffer; 64k should usually be enough. */ - *attr_buff = (char *)malloc( INITIAL_BUFF_SIZE ); - ptr = *attr_buff; - if( ptr == NULL ) { - close( fd ); - - return ENOMEM; - } - - /* ----------------------------------------------------------------- */ - /* Open the attributes directory for this file. */ - fa_dir = open_attrdir( fd ); - if( fa_dir == NULL ) { - close( fd ); - - free( ptr ); - *attr_buff = NULL; - - return retval; - } - - /* ----------------------------------------------------------------- */ - /* Read all the attributes; the buffer could grow > 64K if there are */ - /* many and/or they are large. */ - while( ( fa_ent = read_attrdir( fa_dir ) ) != NULL ) { - retval = stat_attr( fd, fa_ent->d_name, &fa_info ); - /* TODO: check retval != EOK */ - - entname_size = strlen( fa_ent->d_name ) + 1; - attrs_size += entname_size + sizeof( struct attr_info ) + fa_info.ai_size; - - if( attrs_size > INITIAL_BUFF_SIZE ) { - unsigned long offset = ptr - *attr_buff; - - *attr_buff = (char *)realloc( *attr_buff, attrs_size ); - if( *attr_buff == NULL ) { - retval = close_attrdir( fa_dir ); - /* TODO: check retval != EOK */ - close( fd ); - return ENOMEM; - } - - ptr = *attr_buff + offset; - } - - /* Now copy the data for this attribute into the buffer. */ - strcpy( ptr, fa_ent->d_name ); - ptr += entname_size; - - memcpy( ptr, &fa_info, sizeof( struct attr_info ) ); - ptr += sizeof( struct attr_info ); - - if( fa_info.ai_size > 0 ) { - ssize_t read_bytes = read_attr( fd, fa_ent->d_name, fa_info.ai_type, ptr, 0, fa_info.ai_size ); - if( read_bytes != fa_info.ai_size ) { - /* print a warning about mismatched sizes */ - char buff[80]; - sprintf( buff, "read %d, expected %d", read_bytes, (ssize_t)fa_info.ai_size ); - zipwarn( "attribute size mismatch: ", buff ); - } - - ptr += fa_info.ai_size; - } - } - - /* ----------------------------------------------------------------- */ - /* Close the attribute directory. */ - retval = close_attrdir( fa_dir ); - /* TODO: check retval != EOK */ - - /* ----------------------------------------------------------------- */ - /* If the buffer is too big, shrink it. */ - if( attrs_size < INITIAL_BUFF_SIZE ) { - *attr_buff = (char *)realloc( *attr_buff, attrs_size ); - if( *attr_buff == NULL ) { - close( fd ); - return ENOMEM; - } - } - - *total_size = attrs_size; - - close( fd ); - - return EOK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'UT' extra field to the zlist data pointed to by z. */ - -#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(2)) -#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) - -local int add_UT_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - struct stat s; - -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) - return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - /* We can't work if there's no entry to work on. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_UT_SIZE > USHRT_MAX || - z->cext + EB_C_UT_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* stat() the file (or the symlink) to get the data; if we can't get */ - /* the data, there's no point in trying to fill out the fields. */ - if(LSSTAT( z->name, &s ) ) { - return ZE_OPEN; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_UT_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_UT_SIZE ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UT_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_UT_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'U'; - *l_ef++ = 'T'; - *l_ef++ = (char)(EB_UT_LEN(2)); /* length of data in local EF */ - *l_ef++ = (char)0; - *l_ef++ = (char)(EB_UT_FL_MTIME | EB_UT_FL_ATIME); - *l_ef++ = (char)(s.st_mtime); - *l_ef++ = (char)(s.st_mtime >> 8); - *l_ef++ = (char)(s.st_mtime >> 16); - *l_ef++ = (char)(s.st_mtime >> 24); - *l_ef++ = (char)(s.st_atime); - *l_ef++ = (char)(s.st_atime >> 8); - *l_ef++ = (char)(s.st_atime >> 16); - *l_ef++ = (char)(s.st_atime >> 24); - - z->ext += EB_L_UT_SIZE; - - /* Now add the central version. */ - memcpy(c_ef, l_ef-EB_L_UT_SIZE, EB_C_UT_SIZE); - c_ef[EB_LEN] = (char)(EB_UT_LEN(1)); /* length of data in central EF */ - - z->cext += EB_C_UT_SIZE; - - return ZE_OK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'Ux' extra field to the zlist data pointed to by z. */ - -#define EB_L_UX2_SIZE (EB_HEADSIZE + EB_UX2_MINLEN) -#define EB_C_UX2_SIZE (EB_HEADSIZE) - -local int add_Ux_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - struct stat s; - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_UX2_SIZE > USHRT_MAX || - z->cext + EB_C_UX2_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* stat() the file (or the symlink) to get the data; if we can't get */ - /* the data, there's no point in trying to fill out the fields. */ - if(LSSTAT( z->name, &s ) ) { - return ZE_OPEN; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_UX2_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_UX2_SIZE ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UX2_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_UX2_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'U'; - *l_ef++ = 'x'; - *l_ef++ = (char)(EB_UX2_MINLEN); - *l_ef++ = (char)(EB_UX2_MINLEN >> 8); - *l_ef++ = (char)(s.st_uid); - *l_ef++ = (char)(s.st_uid >> 8); - *l_ef++ = (char)(s.st_gid); - *l_ef++ = (char)(s.st_gid >> 8); - - z->ext += EB_L_UX2_SIZE; - - /* Now add the central version of the field. */ - *c_ef++ = 'U'; - *c_ef++ = 'x'; - *c_ef++ = 0; - *c_ef++ = 0; - - z->cext += EB_C_UX2_SIZE; - - return ZE_OK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'At' extra field to the zlist data pointed to by z. */ - -#define EB_L_AT_SIZE (EB_HEADSIZE + EB_L_AT_LEN) /* + attr size */ -#define EB_C_AT_SIZE (EB_HEADSIZE + EB_C_AT_LEN) - -#define MEMCOMPRESS_HEADER 6 /* ush compression type, ulg CRC */ -#define DEFLAT_WORSTCASE_ADD 5 /* byte blocktype, 2 * ush blocklength */ -#define MEMCOMPRESS_OVERHEAD (MEMCOMPRESS_HEADER + DEFLAT_WORSTCASE_ADD) - -local int add_At_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - char *attrbuff = NULL; - off_t attrsize = 0; - char *compbuff = NULL; - ush compsize = 0; - uch flags = 0; - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_AT_SIZE > USHRT_MAX || - z->cext + EB_C_AT_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* Attempt to load up a buffer full of the file's attributes. */ - { - if (get_attr_dir( z->name, &attrbuff, &attrsize) != EOK ) { - return ZE_OPEN; - } - if (attrsize == 0) { - return ZE_OK; - } - if (attrbuff == NULL) { - return ZE_LOGIC; - } - - /* Check for way too much data. */ - if (attrsize > (off_t)ULONG_MAX) { - zipwarn( "uncompressed attributes truncated", "" ); - attrsize = (off_t)(ULONG_MAX - MEMCOMPRESS_OVERHEAD); - } - } - - if (verbose) { - printf( "\t[in=%lu]", (unsigned long)attrsize ); - } - - /* Try compressing the data */ - compbuff = (char *)malloc( (size_t)attrsize + MEMCOMPRESS_OVERHEAD ); - if( compbuff == NULL ) { - return ZE_MEM; - } - compsize = memcompress( compbuff, - (size_t)attrsize + MEMCOMPRESS_OVERHEAD, - attrbuff, - (size_t)attrsize ); - if (verbose) { - printf( " [out=%u]", compsize ); - } - - /* Attempt to optimise very small attributes. */ - if (compsize > attrsize) { - free( compbuff ); - compsize = (ush)attrsize; - compbuff = attrbuff; - - flags = EB_AT_FL_NATURAL; - } - - /* Check to see if we really have enough room in the EF for the data. */ - if( ( z->ext + compsize + EB_L_AT_LEN ) > USHRT_MAX ) { - compsize = USHRT_MAX - EB_L_AT_LEN - z->ext; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_AT_SIZE + compsize ); - } else { - l_ef = (char *)malloc( EB_L_AT_SIZE + compsize ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_AT_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_AT_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'A'; - *l_ef++ = 't'; - *l_ef++ = (char)(compsize + EB_L_AT_LEN); - *l_ef++ = (char)((compsize + EB_L_AT_LEN) >> 8); - *l_ef++ = (char)((unsigned long)attrsize); - *l_ef++ = (char)((unsigned long)attrsize >> 8); - *l_ef++ = (char)((unsigned long)attrsize >> 16); - *l_ef++ = (char)((unsigned long)attrsize >> 24); - *l_ef++ = flags; - memcpy( l_ef, compbuff, (size_t)compsize ); - - z->ext += EB_L_AT_SIZE + compsize; - - /* And the central version. */ - *c_ef++ = 'A'; - *c_ef++ = 't'; - *c_ef++ = (char)(EB_C_AT_LEN); - *c_ef++ = (char)(EB_C_AT_LEN >> 8); - *c_ef++ = (char)compsize; - *c_ef++ = (char)(compsize >> 8); - *c_ef++ = (char)(compsize >> 16); - *c_ef++ = (char)(compsize >> 24); - *c_ef++ = flags; - - z->cext += EB_C_AT_SIZE; - - return ZE_OK; -} - -/* Extra field info: - - 'UT' - UNIX time extra field - - 'Ux' - UNIX uid/gid extra field - - 'At' - AtheOS file attributes extra field - - This is done the same way ../unix/unix.c stores the 'UT'/'Ux' fields - (full data in local header, only modification time in central header), - with the 'At' field added to the end and the size of the 'At' field - in the central header. - - See the end of atheos/osdep.h for a simple explanation of the 'At' EF - layout. - */ -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* store full data in local header but just modification time stamp info - in central header */ -{ - int retval; - - /* Check to make sure z is valid. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - retval = add_UT_ef(z); - if( retval != ZE_OK ) { - return retval; - } - - retval = add_Ux_ef(z); - if( retval != ZE_OK ) { - return retval; - } - - return add_At_ef(z); /* last function; we can use return value directly */ -} - -/* ---------------------------------------------------------------------- */ -/* Set a file's MIME type. */ -void setfiletype(const char *file, const char *type) -{ - int fd; - off_t nLen; - ssize_t nError; - - fd = open( file, O_RDWR ); - - if (fd < 0) { - zipwarn( "can't open zipfile to write file type", "" ); - } - - else - { - nLen = strlen( type ); - /* FIXME: write_attr() should return count of writed bytes */ - nError = write_attr( fd, "os::MimeType", O_TRUNC, ATTR_TYPE_STRING, type, 0, nLen ); - if (nError < 0) { - zipwarn( "couldn't write complete file type", "" ); - } - close( fd ); - } -} - -#endif /* !UTIL */ - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; - - printf(CompiledWith, - -#ifdef __GNUC__ - "gcc ", __VERSION__, -#else - "(unknown compiler)", "", -#endif - - "Syllable", - -#if defined(i486) || defined(__i486) || defined(__i486__) || defined(i386) || defined(__i386) || defined(__i386__) - " (x86)", -#else - " (unknown platform)", -#endif - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/atheos/osdep.h b/third_party/infozip/zip/atheos/osdep.h deleted file mode 100644 index 0869f941d..000000000 --- a/third_party/infozip/zip/atheos/osdep.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ - -#ifndef _OSDEP_H_ -#define _OSDEP_H_ - -#include -#include -#include - -#define USE_EF_UT_TIME /* Enable use of "UT" extra field time info */ - -#define EB_L_AT_LEN 5 /* min size is an unsigned long and flag */ -#define EB_C_AT_LEN 5 /* Length of data in local EF and flag. */ - -#define EB_AT_FL_NATURAL 0x01 /* data is 'natural' (not compressed) */ -#define EB_AT_FL_BADBITS 0xfe /* bits currently undefined */ - -#ifndef ZP_NEED_MEMCOMPR - define ZP_NEED_MEMCOMPR -#endif - -#define deletedir(d) rmdir(d); - -/* Set a file's MIME type. */ -void setfiletype( const char *file, const char *type ); - -/* -'At' extra-field layout: - -'At' - signature -ef_size - size of data in this EF (little-endian unsigned short) -full_size - uncompressed data size (little-endian unsigned long) -flag - flags (byte) - flags & EB_AT_FL_NATURAL = the data is not compressed - flags & EB_AT_FL_BADBITS = the data is corrupted or we - can't handle it properly -data - compressed or uncompressed file attribute data - -If flag & EB_AT_FL_NATURAL, the data is not compressed; this optimisation is -necessary to prevent wasted space for files with small attributes. In this -case, there should be ( ef_size - EB_L_AT_LEN ) bytes of data, and full_size -should equal ( ef_size - EB_L_AT_LEN ). - -If the data is compressed, there will be ( ef_size - EB_L_AT_LEN ) bytes of -compressed data, and full_size bytes of uncompressed data. - -If a file has absolutely no attributes, there will not be a 'At' extra field. - -The uncompressed data is arranged like this: - -attr_name\0 - C string -struct attr_info (little-endian) -attr_data (length in attr_info.ai_size) -*/ - -#endif - diff --git a/third_party/infozip/zip/atheos/zipup.h b/third_party/infozip/zip/atheos/zipup.h deleted file mode 100644 index d3d39a3a9..000000000 --- a/third_party/infozip/zip/atheos/zipup.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef _ZIPUP_H_ -#define _ZIPUP_H_ - -#ifndef O_RDONLY -# include -#endif -#define fhow O_RDONLY -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 - -#endif /* _ZIPUP_H_ */ diff --git a/third_party/infozip/zip/beos/Contents b/third_party/infozip/zip/beos/Contents deleted file mode 100644 index 939a53535..000000000 --- a/third_party/infozip/zip/beos/Contents +++ /dev/null @@ -1,14 +0,0 @@ -Contents of the "beos" sub-directory for Zip 2.2 and later: - - Contents this file - README Notes from the author of the BeOS port - Makefile makefile for building (sorry, no project files) - beos.c BeOS-specific routines (similar to the UNIX ones) - osdep.h BeOS-specific includes and whatnot - zipup.h Definitions for zip routines - -This port supports both Metrowerks CodeWarrior and GNU C as the compiler, -and PowerPC and x86 architectures. - -- Chris Herborth (chrish@pobox.com) - June 24, 1998 diff --git a/third_party/infozip/zip/beos/Makefile b/third_party/infozip/zip/beos/Makefile deleted file mode 100644 index 1b9e61375..000000000 --- a/third_party/infozip/zip/beos/Makefile +++ /dev/null @@ -1,182 +0,0 @@ -###################################################################### -# -# Makefile for Info-ZIP's zip, zipcloak, zipnote, and zipsplit on BeOS -# -# Copyright © 1999 Info-ZIP -# Chris Herborth (chrish@pobox.com) -# -# This is the new New and Improved Makefile for BeOS; it automatically -# detects your platform and uses the appropriate compiler and compiler -# flags. - -###################################################################### -# Things that don't change: - -# Punish people who don't have SMP hardware. -MAKE = make -j 4 -f beos/Makefile -SHELL = /bin/sh - -LN = ln -s - -BIND = $(CC) -AS = $(CC) -c -CPP = $(CC) -E - -INSTALL = install - -# Target directories -prefix = /boot/home/config -BINDIR = $(prefix)/bin -manext = 1 -MANDIR = $(prefix)/man/man$(manext) -ZIPMANUAL = MANUAL - -VERSION = Version 2.3 of __DATE__ - -###################################################################### -# Things that change: - -# PowerPC system -ifeq "$(BE_HOST_CPU)" "ppc" - -CC:=mwcc - -ifeq "$(shell uname -r)" "4.0" - -CFLAGS:=-O7 -opt schedule604 -rostr -w9 \ - -I. -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN -LFLAGS1:=-warn - -else - -CFLAGS:=-O7 -proc 604e -w9 -I. -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN -LFLAGS1:=-nodup - -endif - -LFLAGS2:=-L/boot/develop/lib/ppc -lbe -lroot -OBJA = -TARGET=$(ZIPS) - -# x86 system -else - -CC:=gcc - -# Removed -Wconversion and -Wshadow because of the unnecessary warnings -# they generate. - Sept. 28, 1999 -CFLAGS:=-O3 -mpentiumpro \ - -Wall -Wno-multichar -Wno-ctor-dtor-privacy \ - -Wbad-function-cast -Woverloaded-virtual \ - -I. -I/boot/develop/headers/be/support \ - -I/boot/develop/headers/be/storage \ - -DHAVE_DIRENT_H -DPASSWD_FROM_STDIN # -DASMV -LFLAGS1:= -LFLAGS2:=-L/boot/develop/lib/x86 -lbe -lroot -OBJA = #match.o -TARGET=$(ZIPS) - -endif - -###################################################################### -# Helpful targets -all: - $(MAKE) CC=$(CC) CFLAGS="$(CFLAGS)" \ - LFLAGS1="$(LFLAGS1)" LFLAGS2="$(LFLAGS2)" \ - $(TARGET) - -###################################################################### -# Object file lists and other build goodies - -# Object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \ - beos.o crc32.o -OBJI = deflate.o trees.o -# OBJA moved into ifeq block above; we'll use assembly for x86 -OBJU = zipfile_.o fileio_.o util_.o globals.o beos_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -# Headers -ZIP_H = zip.h ziperr.h tailor.h beos/osdep.h - -# What to build? -ZIPS = zip zipnote zipsplit zipcloak - -# suffix rules -.SUFFIXES: -.SUFFIXES: _.o .o .c .doc .1 -.c_.o: - rm -f $*_.c; $(LN) $< $*_.c - $(CC) -c $(CFLAGS) -DUTIL $*_.c - rm -f $*_.c - -.c.o: - $(CC) -c $(CFLAGS) $< - -.1.doc: - groff -man -Tascii $< > $@ - -# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL. -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h -zipup.o: beos/zipup.h - -match.o: match.S - $(CPP) match.S > _match.s - $(AS) _match.s - mv -f _match.o match.o - rm -f _match.s - -beos.o: beos/beos.c - $(CC) -c $(CFLAGS) beos/beos.c - -beos_.o: beos/beos.c - rm -f $*_.c; $(LN) beos/beos.c $*_.c - $(CC) -c $(CFLAGS) -DUTIL $*_.c - rm -f $*_.c - -zips: $(ZIPS) -zipsman: $(ZIPS) $(ZIPMANUAL) - -zip: $(OBJZ) $(OBJI) $(OBJA) - $(BIND) -o zip $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) -zipnote: $(OBJN) - $(BIND) -o zipnote $(LFLAGS1) $(OBJN) $(LFLAGS2) -zipcloak: $(OBJC) - $(BIND) -o zipcloak $(LFLAGS1) $(OBJC) $(LFLAGS2) -zipsplit: $(OBJS) - $(BIND) -o zipsplit $(LFLAGS1) $(OBJS) $(LFLAGS2) - -$(ZIPMANUAL): man/zip.1 - groff -man -Tascii man/zip.1 > $(ZIPMANUAL) - -# install -install: $(ZIPS) - $(INSTALL) -m755 $(ZIPS) $(BINDIR) - mkdir -p $(MANDIR) - $(INSTALL) -m644 man/zip.1 $(MANDIR)/zip.$(manext) - -uninstall: - -cd $(BINDIR); rm -f $(ZIPS) - -cd $(MANDIR); rm -f zip.$(manext) - -dist: $(ZIPMANUAL) - zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \ - -e s/[.]//g -e q revision.h` \ - `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents` - -# clean up after making stuff and installing it -clean: - rm -f *.o $(ZIPS) flags - -# end of Makefile diff --git a/third_party/infozip/zip/beos/README b/third_party/infozip/zip/beos/README deleted file mode 100644 index b985ea080..000000000 --- a/third_party/infozip/zip/beos/README +++ /dev/null @@ -1,31 +0,0 @@ -Info-ZIP's zip for BeOS - -KNOWN BUGS - -- None! (as of zip 2.21) - -- building on x86 BeOS generates a hell of a lot of bugs; I'm not going to - worry about them until Be fixes their headers though... - -FEATURES - -- stores BeOS file attributes, compressing them if possible (as of 2.21, - this works properly for symbolic links, too; as of 2.3, this works - properly for symbolic links whether you're storing them as links or not) - -- zip files are created with the correct file type (application/zip) - -- supports both Metrowerks CodeWarrior (PowerPC platform) and GNU C - (x86 platform), automatically picking the default compiler for each - architecture - -Please report any bugs to the Zip-Bugs mailing list; our email address is -zip-bugs@lists.wku.edu. If it's something BeOS-specific, you could email -me directly. - -Visit the Info-ZIP web site (http://www.cdrom.com/pub/infozip/) for all the -latest zip and unzip information, FAQs, source code and ready-to-run -executables. - -- Chris Herborth (chrish@pobox.com) - April 2/1999 diff --git a/third_party/infozip/zip/beos/beos.c b/third_party/infozip/zip/beos/beos.c deleted file mode 100644 index d8d16df93..000000000 --- a/third_party/infozip/zip/beos/beos.c +++ /dev/null @@ -1,945 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -/* - - This BeOS-specific file is based on unix.c in the unix directory; changes - by Chris Herborth (chrish@pobox.com). - -*/ - -#include "zip.h" - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - - -#define PAD 0 -#define PATH_END '/' - -/* Library functions not in (most) header files */ - -#ifdef _POSIX_VERSION -# include -#else - int utime OF((char *, time_t *)); -#endif - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Local functions */ -local char *readd OF((DIR *)); -local int get_attr_dir( const char *, char **, off_t * ); -local int add_UT_ef( struct zlist far * ); -local int add_Ux_ef( struct zlist far * ); -local int add_Be_ef( struct zlist far * ); - - -#ifdef NO_DIR /* for AT&T 3B1 */ -#include -#ifndef dirent -# define dirent direct -#endif -typedef FILE DIR; -/* -** Apparently originally by Rich Salz. -** Cleaned up and modified by James W. Birdsall. -*/ - -#define opendir(path) fopen(path, "r") - -struct dirent *readdir(dirp) -DIR *dirp; -{ - static struct dirent entry; - - if (dirp == NULL) - return NULL; - for (;;) - if (fread (&entry, sizeof (struct dirent), 1, dirp) == 0) - return NULL; - else if (entry.d_ino) - return (&entry); -} /* end of readdir() */ - -#define closedir(dirp) fclose(dirp) -#endif /* NO_DIR */ - - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - for (t = x; *t == '/'; t++) - ; /* strip leading '/' chars to get a relative path */ - while (*t == '.' && t[1] == '/') - t += 2; /* strip redundant leading "./" sections */ - - /* Make changes, if any, to the copied name (leave original intact) */ - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (isdir == 42) return n; /* avoid warning on unused variable */ - - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - return x; -} - -/* - * XXX use ztimbuf in both POSIX and non POSIX cases ? - */ -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ -#ifdef _POSIX_VERSION - struct utimbuf u; /* argument for utime() const ?? */ -#else - time_t u[2]; /* argument for utime() */ -#endif - - /* Convert DOS time to time_t format in u */ -#ifdef _POSIX_VERSION - u.actime = u.modtime = dos2unixtime(d); - utime(f, &u); -#else - u[0] = u[1] = dos2unixtime(d); - utime(f, u); -#endif - -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNAMX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) { - free(name); - error("fstat(stdin)"); - } - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - if ((s.st_mode & S_IFMT) == S_IFDIR) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_mtime; /* best guess (s.st_ctime: last status change!) */ - } - - return unix2dostime(&s.st_mtime); -} - -/* ---------------------------------------------------------------------- - -Return a malloc()'d buffer containing all of the attributes and their names -for the file specified in name. You have to free() this yourself. The length -of the buffer is also returned. - -If get_attr_dir() fails, the buffer will be NULL, total_size will be 0, -and an error will be returned: - - EOK - no errors occurred - EINVAL - attr_buff was pointing at a buffer - ENOMEM - insufficient memory for attribute buffer - -Other errors are possible (whatever is returned by the fs_attr.h functions). - -PROBLEMS: - -- pointers are 32-bits; attributes are limited to off_t in size so it's - possible to overflow... in practice, this isn't too likely... your - machine will thrash like hell before that happens - -*/ - -#define INITIAL_BUFF_SIZE 65536 - -int get_attr_dir( const char *name, char **attr_buff, off_t *total_size ) -{ - int retval = EOK; - int fd; - DIR *fa_dir; - struct dirent *fa_ent; - off_t attrs_size; - off_t this_size; - char *ptr; - struct attr_info fa_info; - struct attr_info big_fa_info; - - retval = EOK; - attrs_size = 0; /* gcc still says this is used uninitialized... */ - *total_size = 0; - - /* ----------------------------------------------------------------- */ - /* Sanity-check. */ - if( *attr_buff != NULL ) { - return EINVAL; - } - - /* ----------------------------------------------------------------- */ - /* Can we open the file/directory? */ - /* */ - /* linkput is a zip global; it's set to 1 if we're storing symbolic */ - /* links as symbolic links (instead of storing the thing the link */ - /* points to)... if we're storing the symbolic link as a link, we'll */ - /* want the link's file attributes, otherwise we want the target's. */ - if( linkput ) { - fd = open( name, O_RDONLY | O_NOTRAVERSE ); - } else { - fd = open( name, O_RDONLY ); - } - if( fd < 0 ) { - return errno; - } - - /* ----------------------------------------------------------------- */ - /* Allocate an initial buffer; 64k should usually be enough. */ - *attr_buff = (char *)malloc( INITIAL_BUFF_SIZE ); - ptr = *attr_buff; - if( ptr == NULL ) { - close( fd ); - - return ENOMEM; - } - - /* ----------------------------------------------------------------- */ - /* Open the attributes directory for this file. */ - fa_dir = fs_fopen_attr_dir( fd ); - if( fa_dir == NULL ) { - close( fd ); - - free( ptr ); - *attr_buff = NULL; - - return retval; - } - - /* ----------------------------------------------------------------- */ - /* Read all the attributes; the buffer could grow > 64K if there are */ - /* many and/or they are large. */ - fa_ent = fs_read_attr_dir( fa_dir ); - while( fa_ent != NULL ) { - retval = fs_stat_attr( fd, fa_ent->d_name, &fa_info ); - /* TODO: check retval != EOK */ - - this_size = strlen( fa_ent->d_name ) + 1; - this_size += sizeof( struct attr_info ); - this_size += fa_info.size; - - attrs_size += this_size; - - if( attrs_size > INITIAL_BUFF_SIZE ) { - unsigned long offset = ptr - *attr_buff; - - *attr_buff = (char *)realloc( *attr_buff, attrs_size ); - if( *attr_buff == NULL ) { - retval = fs_close_attr_dir( fa_dir ); - /* TODO: check retval != EOK */ - close( fd ); - - return ENOMEM; - } - - ptr = *attr_buff + offset; - } - - /* Now copy the data for this attribute into the buffer. */ - strcpy( ptr, fa_ent->d_name ); - ptr += strlen( fa_ent->d_name ); - *ptr++ = '\0'; - - /* We need to put a big-endian version of the fa_info data into */ - /* the archive. */ - big_fa_info.type = B_HOST_TO_BENDIAN_INT32( fa_info.type ); - big_fa_info.size = B_HOST_TO_BENDIAN_INT64( fa_info.size ); - memcpy( ptr, &big_fa_info, sizeof( struct attr_info ) ); - ptr += sizeof( struct attr_info ); - - if( fa_info.size > 0 ) { - ssize_t read_bytes; - - read_bytes = fs_read_attr( fd, fa_ent->d_name, fa_info.type, 0, - ptr, fa_info.size ); - if( read_bytes != fa_info.size ) { - /* print a warning about mismatched sizes */ - char buff[80]; - - sprintf( buff, "read %ld, expected %ld", - (ssize_t)read_bytes, (ssize_t)fa_info.size ); - zipwarn( "attribute size mismatch: ", buff ); - } - - /* Wave my magic wand... this swaps all the Be types to big- */ - /* endian automagically. */ - (void)swap_data( fa_info.type, ptr, fa_info.size, - B_SWAP_HOST_TO_BENDIAN ); - - ptr += fa_info.size; - } - - fa_ent = fs_read_attr_dir( fa_dir ); - } - - /* ----------------------------------------------------------------- */ - /* Close the attribute directory. */ - retval = fs_close_attr_dir( fa_dir ); - /* TODO: check retval != EOK */ - - /* ----------------------------------------------------------------- */ - /* If the buffer is too big, shrink it. */ - if( attrs_size < INITIAL_BUFF_SIZE ) { - *attr_buff = (char *)realloc( *attr_buff, attrs_size ); - if( *attr_buff == NULL ) { - /* This really shouldn't happen... */ - close( fd ); - - return ENOMEM; - } - } - - *total_size = attrs_size; - - close( fd ); - - return EOK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'UT' extra field to the zlist data pointed to by z. */ - -#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(2)) -#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) - -local int add_UT_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - struct stat s; - -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) - return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - /* We can't work if there's no entry to work on. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_UT_SIZE > USHRT_MAX || - z->cext + EB_C_UT_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* stat() the file (or the symlink) to get the data; if we can't get */ - /* the data, there's no point in trying to fill out the fields. */ - if(LSSTAT( z->name, &s ) ) { - return ZE_OPEN; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_UT_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_UT_SIZE ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UT_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_UT_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'U'; - *l_ef++ = 'T'; - *l_ef++ = (char)(EB_UT_LEN(2)); /* length of data in local EF */ - *l_ef++ = (char)0; - *l_ef++ = (char)(EB_UT_FL_MTIME | EB_UT_FL_ATIME); - *l_ef++ = (char)(s.st_mtime); - *l_ef++ = (char)(s.st_mtime >> 8); - *l_ef++ = (char)(s.st_mtime >> 16); - *l_ef++ = (char)(s.st_mtime >> 24); - *l_ef++ = (char)(s.st_atime); - *l_ef++ = (char)(s.st_atime >> 8); - *l_ef++ = (char)(s.st_atime >> 16); - *l_ef++ = (char)(s.st_atime >> 24); - - z->ext += EB_L_UT_SIZE; - - /* Now add the central version. */ - memcpy(c_ef, l_ef-EB_L_UT_SIZE, EB_C_UT_SIZE); - c_ef[EB_LEN] = (char)(EB_UT_LEN(1)); /* length of data in central EF */ - - z->cext += EB_C_UT_SIZE; - - return ZE_OK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'Ux' extra field to the zlist data pointed to by z. */ - -#define EB_L_UX2_SIZE (EB_HEADSIZE + EB_UX2_MINLEN) -#define EB_C_UX2_SIZE (EB_HEADSIZE) - -local int add_Ux_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - struct stat s; - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_UX2_SIZE > USHRT_MAX || - z->cext + EB_C_UX2_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* stat() the file (or the symlink) to get the data; if we can't get */ - /* the data, there's no point in trying to fill out the fields. */ - if(LSSTAT( z->name, &s ) ) { - return ZE_OPEN; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_UX2_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_UX2_SIZE ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UX2_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_UX2_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'U'; - *l_ef++ = 'x'; - *l_ef++ = (char)(EB_UX2_MINLEN); - *l_ef++ = (char)(EB_UX2_MINLEN >> 8); - *l_ef++ = (char)(s.st_uid); - *l_ef++ = (char)(s.st_uid >> 8); - *l_ef++ = (char)(s.st_gid); - *l_ef++ = (char)(s.st_gid >> 8); - - z->ext += EB_L_UX2_SIZE; - - /* Now add the central version of the field. */ - *c_ef++ = 'U'; - *c_ef++ = 'x'; - *c_ef++ = 0; - *c_ef++ = 0; - - z->cext += EB_C_UX2_SIZE; - - return ZE_OK; -} - -/* ---------------------------------------------------------------------- */ -/* Add a 'Be' extra field to the zlist data pointed to by z. */ - -#define EB_L_BE_SIZE (EB_HEADSIZE + EB_L_BE_LEN) /* + attr size */ -#define EB_C_BE_SIZE (EB_HEADSIZE + EB_C_BE_LEN) - -/* maximum memcompress overhead is the sum of the compression header length */ -/* (6 = ush compression type, ulg CRC) and the worstcase deflate overhead */ -/* when uncompressible data are kept in 2 "stored" blocks (5 per block = */ -/* byte blocktype + 2 * ush blocklength) */ -#define MEMCOMPRESS_OVERHEAD (EB_MEMCMPR_HSIZ + EB_DEFLAT_EXTRA) - -local int add_Be_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - char *attrbuff = NULL; - off_t attrsize = 0; - char *compbuff = NULL; - ush compsize = 0; - uch flags = 0; - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_BE_SIZE > USHRT_MAX || - z->cext + EB_C_BE_SIZE > USHRT_MAX ) { - return ZE_MEM; - } - - /* Attempt to load up a buffer full of the file's attributes. */ - { - int retval; - - retval = get_attr_dir( z->name, &attrbuff, &attrsize ); - if( retval != EOK ) { - return ZE_OPEN; - } - if( attrsize == 0 ) { - return ZE_OK; - } - if( attrbuff == NULL ) { - return ZE_LOGIC; - } - - /* Check for way too much data. */ - if( attrsize > (off_t)ULONG_MAX ) { - zipwarn( "uncompressed attributes truncated", "" ); - attrsize = (off_t)(ULONG_MAX - MEMCOMPRESS_OVERHEAD); - } - } - - if( verbose ) { - printf( "\t[in=%lu]", (unsigned long)attrsize ); - } - - /* Try compressing the data */ - compbuff = (char *)malloc( (size_t)attrsize + MEMCOMPRESS_OVERHEAD ); - if( compbuff == NULL ) { - return ZE_MEM; - } - compsize = memcompress( compbuff, - (size_t)attrsize + MEMCOMPRESS_OVERHEAD, - attrbuff, - (size_t)attrsize ); - if( verbose ) { - printf( " [out=%u]", compsize ); - } - - /* Attempt to optimise very small attributes. */ - if( compsize > attrsize ) { - free( compbuff ); - compsize = (ush)attrsize; - compbuff = attrbuff; - - flags = EB_BE_FL_NATURAL; - } - - /* Check to see if we really have enough room in the EF for the data. */ - if( ( z->ext + compsize + EB_L_BE_LEN ) > USHRT_MAX ) { - compsize = USHRT_MAX - EB_L_BE_LEN - z->ext; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_BE_SIZE + compsize ); - } else { - l_ef = (char *)malloc( EB_L_BE_SIZE + compsize ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_BE_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_BE_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'B'; - *l_ef++ = 'e'; - *l_ef++ = (char)(compsize + EB_L_BE_LEN); - *l_ef++ = (char)((compsize + EB_L_BE_LEN) >> 8); - *l_ef++ = (char)((unsigned long)attrsize); - *l_ef++ = (char)((unsigned long)attrsize >> 8); - *l_ef++ = (char)((unsigned long)attrsize >> 16); - *l_ef++ = (char)((unsigned long)attrsize >> 24); - *l_ef++ = flags; - memcpy( l_ef, compbuff, (size_t)compsize ); - - z->ext += EB_L_BE_SIZE + compsize; - - /* And the central version. */ - *c_ef++ = 'B'; - *c_ef++ = 'e'; - *c_ef++ = (char)(EB_C_BE_LEN); - *c_ef++ = (char)(EB_C_BE_LEN >> 8); - *c_ef++ = (char)compsize; - *c_ef++ = (char)(compsize >> 8); - *c_ef++ = (char)(compsize >> 16); - *c_ef++ = (char)(compsize >> 24); - *c_ef++ = flags; - - z->cext += EB_C_BE_SIZE; - - return ZE_OK; -} - -/* Extra field info: - - 'UT' - UNIX time extra field - - 'Ux' - UNIX uid/gid extra field - - 'Be' - BeOS file attributes extra field - - This is done the same way ../unix/unix.c stores the 'UT'/'Ux' fields - (full data in local header, only modification time in central header), - with the 'Be' field added to the end and the size of the 'Be' field - in the central header. - - See the end of beos/osdep.h for a simple explanation of the 'Be' EF - layout. - */ -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* store full data in local header but just modification time stamp info - in central header */ -{ - int retval; - - /* Tell picky compilers to shut up about unused variables. */ - z_utim = z_utim; - - /* Check to make sure z is valid. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - /* This function is much simpler now that I've moved the extra fields */ - /* out... it simplified the 'Be' code, too. */ - retval = add_UT_ef( z ); - if( retval != ZE_OK ) { - return retval; - } - - retval = add_Ux_ef( z ); - if( retval != ZE_OK ) { - return retval; - } - - retval = add_Be_ef( z ); - if( retval != ZE_OK ) { - return retval; - } - - return ZE_OK; -} - -/* ---------------------------------------------------------------------- */ -/* Set a file's MIME type. */ -void setfiletype( const char *file, const char *type ) -{ - int fd; - attr_info fa; - ssize_t wrote_bytes; - - fd = open( file, O_RDWR ); - if( fd < 0 ) { - zipwarn( "can't open zipfile to write file type", "" ); - return; - } - - fa.type = B_MIME_STRING_TYPE; - fa.size = (off_t)(strlen( type ) + 1); - - wrote_bytes = fs_write_attr( fd, BE_FILE_TYPE_NAME, fa.type, 0, - type, fa.size ); - if( wrote_bytes != (ssize_t)fa.size ) { - zipwarn( "couldn't write complete file type", "" ); - } - - close( fd ); -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). - */ -{ -# ifdef NO_RMDIR - /* code from Greg Roelofs, who horked it from Mark Edwards (unzip) */ - int r, len; - char *s; /* malloc'd string for system command */ - - len = strlen(d); - if ((s = malloc(len + 34)) == NULL) - return 127; - - sprintf(s, "IFS=\" \t\n\" /bin/rmdir %s 2>/dev/null", d); - r = system(s); - free(s); - return r; -# else /* !NO_RMDIR */ - return rmdir(d); -# endif /* ?NO_RMDIR */ -} - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; - - printf(CompiledWith, - -#ifdef __MWERKS__ - "Metrowerks CodeWarrior", "", -#else -# ifdef __GNUC__ - "gcc ", __VERSION__, -# endif -#endif - - "BeOS", - -#ifdef __POWERPC__ - " (PowerPC)", -#else -# ifdef __INTEL__ - " (x86)", -# else - " (UNKNOWN!)", -# endif -#endif - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/beos/osdep.h b/third_party/infozip/zip/beos/osdep.h deleted file mode 100644 index 01979030a..000000000 --- a/third_party/infozip/zip/beos/osdep.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include -#include -#include - -#include /* for B_NO_ERROR */ - -#define USE_EF_UT_TIME /* Enable use of "UT" extra field time info */ - -#define EB_L_BE_LEN 5 /* min size is an unsigned long and flag */ -#define EB_C_BE_LEN 5 /* Length of data in local EF and flag. */ - -#define EB_BE_FL_NATURAL 0x01 /* data is 'natural' (not compressed) */ -#define EB_BE_FL_BADBITS 0xfe /* bits currently undefined */ - -#ifndef ZP_NEED_MEMCOMPR -# define ZP_NEED_MEMCOMPR -#endif - -/* Set a file's MIME type. */ -#define BE_FILE_TYPE_NAME "BEOS:TYPE" -void setfiletype( const char *file, const char *type ); - -/* -DR9 'Be' extra-field layout: - -'Be' - signature -ef_size - size of data in this EF (little-endian unsigned short) -full_size - uncompressed data size (little-endian unsigned long) -flag - flags (byte) - flags & EB_BE_FL_NATURAL = the data is not compressed - flags & EB_BE_FL_BADBITS = the data is corrupted or we - can't handle it properly -data - compressed or uncompressed file attribute data - -If flag & EB_BE_FL_NATURAL, the data is not compressed; this optimisation is -necessary to prevent wasted space for files with small attributes (which -appears to be quite common on the Advanced Access DR9 release). In this -case, there should be ( ef_size - EB_L_BE_LEN ) bytes of data, and full_size -should equal ( ef_size - EB_L_BE_LEN ). - -If the data is compressed, there will be ( ef_size - EB_L_BE_LEN ) bytes of -compressed data, and full_size bytes of uncompressed data. - -If a file has absolutely no attributes, there will not be a 'Be' extra field. - -The uncompressed data is arranged like this: - -attr_name\0 - C string -struct attr_info (big-endian) -attr_data (length in attr_info.size) -*/ diff --git a/third_party/infozip/zip/beos/zipup.h b/third_party/infozip/zip/beos/zipup.h deleted file mode 100644 index 40c79eb4c..000000000 --- a/third_party/infozip/zip/beos/zipup.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef O_RDONLY -# include -#endif -#define fhow O_RDONLY -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/bzip2/install.txt b/third_party/infozip/zip/bzip2/install.txt deleted file mode 100644 index 87d45adaf..000000000 --- a/third_party/infozip/zip/bzip2/install.txt +++ /dev/null @@ -1,258 +0,0 @@ -HOW TO ADD BZIP2 SUPPORT TO ZIP - -This document describes how to add bzip2 support to Zip. - -Compiling or linking in the bzip2 library adds an additional bzip2 -compression method to Zip. This new method can be selected instead -of the Zip traditional compression method deflation to compress files -and often gives a better compression ratio (perhaps at the cost of -greater CPU time). The compression method is specified using the -"-Z method" command-line option, where "method" may be either "deflate" -(the default), or "bzip2" (if Zip is built with bzip2 support). Zip -has been tested with bzip2 library 1.0.5 and earlier. - -Notes - -Compression method bzip2 requires a modern unzip. Before using bzip2 -compression in Zip, verify that a modern UnZip program with bzip2 support -will be used to read the resulting zip archive so that entries compressed -with bzip2 (compression method 12) can be read. Older unzips probably -won't recognize the compression method and will skip those entries. - -The Zip source kit does not include the bzip2 library or source files, but -these can be found at "http://www.bzip.org/" for example. See below for -how to add bzip2 to Zip for various operating systems. - -Zip using bzip2 compression is not compatible with the bzip2 application, -but instead provides an additional way to compress files before adding -them to a Zip archive. It does not replace the bzip2 program itself, -which creates bzip2 archives in a different format that are not -compatible with zip or unzip. - -The bzip2 code and algorithms are provided under the bzip2 license -(provided in the bzip2 source kit) and what is not covered by that license -is covered under the Info-ZIP license. Info-ZIP will look at issues -involving the use of bzip2 compression in Zip, but any questions about -the bzip2 code and algorithms or bzip2 licensing, for example, should be -directed to the bzip2 maintainer. - - -Installation - -To build Zip with bzip2 support, Zip generally needs one bzip2 header -file, "bzlib.h", and the object library, typically "libbz2.a", except -in cases where the source files are compiled in directly. If you -are either compiling the bzip2 library or compiling in the bzip2 -source files, we recommend defining the C macro BZ_NO_STDIO, which -excludes a lot of standalone error code (not used when bzip2 is -used as a library and makes the library smaller) and provides hooks -that Zip can use to provide better error handling. However, a -standard bzip2 object library will work, though any errors that bzip2 -generates may be more cryptic. - -Building the bzip2 library from the bzip2 source files (recommended): - - Download the latest bzip2 package (from "http://www.bzip.org/", for - example). - - Unpack the bzip2 source kit (bzip2-1.0.5.tar.gz was current as of - this writing, but the latest should work). - - Read the README file in the bzip2 source kit. - - Compile the bzip2 library for your OS, preferably defining - BZ_NO_STDIO. Note: On UNIX systems, this may be done automatically - when building Zip, as explained below. - - -Installation on UNIX (see below for installation on other systems): - - Note: Zip on UNIX uses the "bzlib.h" include file and the compiled - "libbz2.a" library to static link to bzip2. Currently we do not - support using the shared library (patches welcome). - - The easiest approach may be to drop the two above files in the - bzip2 directory of the Zip source tree and build Zip using the - "generic" target, that is, using a command like - make -f unix/Makefile generic - If all goes well, make should confirm that it found the files and - will be compiling in bzip2 by setting the BZIP2_SUPPORT flag and - then including the libraries while compiling and linking Zip. - - To use bzlib.h and libbz2.a from somewhere else on your system, - define the "make" macro IZ_BZIP2 to point to that directory. For - example: - make -f unix/Makefile generic IZ_BZIP2=/mybz2 - where /mybz2 might be "/usr/local/src/bzip2/bzip2-1.0.5" on some - systems. Only a compiled bzip2 library can be pointed to using - IZ_BZIP2 and Zip will not compile bzip2 source in other than the - bzip2 directory. - - If IZ_BZIP2 is not defined, Zip will look for the bzip2 files in - the "bzip2" directory in the Zip source directory. The bzip2 - directory is empty in the Zip source distribution (except for - this install.txt file) and is provided as a place to put the - bzip2 files. To use this directory, either drop bzlib.h and - libbz2.a in it to use the compiled library as noted above or drop - the contents of the bzip2 source kit in this directory so that - bzlib.h is directly in the bzip2 directory and Zip will try to - compile it if no compiled library is already there. - - - Unpacking bzip2 so Zip compiles it: - - To make this work, the bzip2 source kit must be unpacked directly - into the Zip "bzip2" directory. For example: - - # Unpack the Zip source kit. - gzip -cd zip30.tar-gz | tar xfo - - # Move down to the Zip kit's "bzip2" directory, ... - cd zip30/bzip2 - # ... and unpack the bzip2 source kit there. - gzip -cd ../../bzip2-1.0.5.tar.gz | tar xfo - - # Move the bzip2 source files up to the Zip kit's bzip2 directory. - cd bzip2-1.0.5 - mv * .. - # Return to the Zip source kit directory, ready to build. - cd ../.. - # Build Zip. - make -f unix/Makefile generic - - - Using a system bzip2 library: - - If IZ_BZIP2 is not defined and both a compiled library and the bzip2 - source files are missing from the Zip bzip2 directory, Zip will test - to see if bzip2 is globally defined on the system in the default - include and library paths and, if found, link in the system bzip2 - library. This is automatic. - - - Preventing inclusion of bzip2: - - To build Zip with _no_ bzip2 support on a system where the automatic - bzip2 detection scheme will find bzip2, you can specify a bad - IZ_BZIP2 directory. For example: - - make -f unix/Makefile generic IZ_BZIP2=no_such_directory - - You can also define NO_BZIP2_SUPPORT to exclude bzip2. - - - Verifying bzip2 support in Zip: - - When the Zip build is complete, verify that bzip2 support has been - enabled by checking the feature list: - - ./zip -v - - If all went well, bzip2 (and its library version) should be listed. - - -Installation on other systems - - MSDOS: - - Thanks to Robert Riebisch, the DJGPP 2.x Zip port now supports bzip2. - To include bzip2, first install bzip2. The new msdos/makebz2.dj2 - makefile then looks in the standard bzip2 installation directories - for the needed files. As he says: - It doesn't try to be clever about finding libbz2.a. It just - expects bzip2 stuff installed to the default include and library - folders, e.g., "C:\DJGPP\include" and "C:\DJGPP\lib" on DOS. - - Given a standard DJGPP 2.x installation, this should create a - version of Zip 3.0 with bzip2 support. - - The bzip2 library for DJGPP can be found on any DJGPP mirror in - "current/v2apps" (or "beta/v2apps/" for the latest beta). This - library has been ported to MSDOS/DJGPP by Juan Manuel Guerrero. - - - WIN32 (Windows NT/2K/XP/2K3/... and Windows 95/98/ME): - - For Windows there seems to be two approaches, either use bzip2 - as a dynamic link library or compile the bzip2 source in directly. - I have not gotten the static library libbz2.lib to work, but that - may be me. - - Using bzip2 as a dynamic link library: - - Building bzip2: - - If you have the needed bzlib.h, libbz2.lib, and libbz2.dll files - you can skip building bzip2. If not, open the libbz2.dsp project - and build libbz2.dll - - This creates - debug/libbz2.lib - and - libbz2.dll - - - Building Zip: - - Copy libbz2.lib to the bzip2 directory in the Zip source tree. This - is needed to compile Zip with bzip2 support. Also copy the matching - bzlib.h from the bzip2 source to the same directory. - - Add libbz2.lib to the link list for whatever you are building. Also - define the compiler define BZIP2_SUPPORT. - - Build Zip. - - - Using Zip with bzip2 as dll: - - Put libbz2.dll in your command path. This is needed to run Zip with - bzip2 support. - - Verify that bzip2 is enabled with the command - - zip -v - - You should see bzip2 listed. - - Compiling in bzip2 from the bzip2 source: - - This approach compiles in the bzip2 code directly. No external - library is needed. - - Get a copy of the bzip2 source and copy the contents to the bzip2 - directory in the Zip source tree so that bzlib.h is directly in - the bzip2 directory. - - Use the vc6bz2 project to build Zip. This project knows of the - added bzip2 files. - - Verify that bzip2 is enabled with the command - - zip -v - - - Windows DLL (WIN32): - - Nothing yet. - - - Mac OS X: - - Follow the standard UNIX build procedure. Mac OS X includes bzip2 - and the UNIX builders should find the bzip2 files in the standard - places. Note that the version of bzip2 on your OS may not be - current and you can instead specify a different library or compile - your own bzip2 library as noted in the Unix procedures above. - - - OS/2: - - Nothing yet. - - - VMS (OpenVMS): - - See [.vms]install_vms.txt for how to enable bzip2 support on VMS. - - -Last updated 26 March 2007, 15 July 2007, 9 April 2008, 27 June 2008 -S. Schweda, E. Gordon diff --git a/third_party/infozip/zip/cmsmvs/README.CMS b/third_party/infozip/zip/cmsmvs/README.CMS deleted file mode 100644 index a4425daa0..000000000 --- a/third_party/infozip/zip/cmsmvs/README.CMS +++ /dev/null @@ -1,434 +0,0 @@ -Using ZIP and UNZIP on VM/CMS -============================= - - -Installing executables ----------------------- - -The following CMS MODULEs are available: - ZIP - ZIPNOTE - ZIPCLOAK - ZIPSPLIT - UNZIP - -In addition to these, each MODULE file also has an EXEC with the same -name. These EXECs are front-ends to the MODULES that will attempt to -set up the required runtime libraries before running the MODULE. -All the EXECs are identical. Only their names are different. -They are stored as plain text files. - -The CMS MODULE files have been packed using the COPYFILE command to -allow their file format to be properly restored, since variable length -binary files will not currently unzip properly (see below for details). -The MODULEs are shipped with a filetype or extension of CMO (for CMS -MODULE). Their names may vary on the distribution disk to indicate -their level, etc. - -To restore them to executable MODULEs on CMS, do the following: - 1. Upload them to CMS with a Fixed record length with LRECL 1024. - Example, from a DOS or OS/2 window, type this: - SEND unzip.cmo A:unzip module a (RECFM F LRECL 1024 - - Example, using FTP from CMS, type this: - BINARY FIXED 1024 - GET unzip.cmo unzip.module.a - - Note: Replace "unzip.cmo" with the actual name. - - 2. Use COPYFILE to unpack the file. - Example, in CMS type this: - COPYFILE UNZIP MODULE A (UNPACK REPLACE OLDDATE - - 3. Repeat steps 1-2 for each of the programs. - - 4. Build the ZIPINFO module by typing this: - COPYFILE UNZIP MODULE A ZIPINFO MODULE A (OLDDATE - - 5. Upload the EXECs to CMS as text files (with ASCII-to-EBCDIC - translation). - Example, from a DOS or OS/2 window, type this: - SEND unzip.exc A:unzip exec a (CRLF - - Example, using FTP from CMS, type this: - GET unzip.exc unzip.exec.a - - 6. Repeat steps 4 for each of the EXECs. - - -Preparing the environment -------------------------- - -The executables provided were compiled with IBM C 3.1.0 and -require the the Language Environment (LE) runtime libraries. - -To provide access to the runtime libraries: - 1. Link to the disk containing the Language Environment files, - if necessary. - - 2. Use the command "GLOBAL LOADLIB SCEERUN" - - These commands can be placed in your PROFILE EXEC. - - Note: EXECs have been provided called ZIP, UNZIP, etc. that - issue the GLOBAL LOADLIB statement. This was done to alleviate - frustration of users that don't have the GLOBAL LOADLIB statement - in their PROFILE EXEC. These EXECs may require changing for - your system. - - Unfortunately, there is no way, using IBM C, to produce a MODULE - that doesn't require a runtime library. - - -Testing -------- - -To test the MODULEs, just type ZIP or UNZIP. They should -show help information on using the commands. - -If you see something like this: - DMSLIO201W The following names are undefined: - CEEEV003 - DMSABE155T User abend 4093 called from 00DCD298 reason code 000003EB - -Then you don't have access to the proper runtime libraries, as -described above. - -Here is additional information on the ZIP and UNZIP programs that -may assist support personnel: - - Compiled with IBM C V3R1M0 on VM/ESA 2.2.0 with - CMS level 13 Service Level 702. - - - Require the SCEERUN LOADLIB runtime library. This is - part of the Language Environment (LE). - - - Linked with options RMODE ANY AMODE ANY RLDSAVE. - -If you continue to have trouble, report the problem to Zip-Bugs -(see the bottom of this document). - - - -Compiling the source on VM/CMS ------------------------------- - -The source has been successfully compiled previously using -C/370 2.1 and 2.2. The source has been recently compiled using -IBM C 3.1.0 on VM/ESA 2.2.0 with CMS level 13. I don't have -access to an MVS system so the code hasn't been tested there -in a while. - - 1. Unzip the source files required for CMS. The root-level files - inside the ZIP file and the files in the CMSMVS subdirectory are - needed. Example (use both commands): - unzip -aj zip23.zip -x */* -dc - unzip -aj zip23.zip cmsmvs/* -dc - - This example unzips the files to the C-disk, while translating - character data and ignoring paths. - - If you don't already have a working UNZIP MODULE on CMS you will - have to unzip the files on another system and transport them - to CMS. All the required files are plain text so they can - be transferred with ASCII-to-EBCDIC translations. - - 2. Repeat step 1 with the zip file containing the UNZIP code. - Unzip the files to a different disk than the disk used for the ZIP - code. - - 3. To compile the ZIP code, run the supplied CCZIP EXEC. - To compile the UNZIP code, run the supplied CCUNZIP EXEC. - -NOTE: -Some of the ZIP and UNZIP source files have the same name. It is -recommended that you keep the source from each on separate disks and -move the disk you are building from ahead of the other in the search -order. - -For example, you may have a 192 disk with the ZIP source code and -a 193 disk with the UNZIP source code. To compile ZIP, access -the 192 disk as B, then run CCZIP. This will create the following -modules: ZIP, ZIPNOTE, ZIPSPLIT, ZIPCLOAK. - -To compile UNZIP, access 193 as B, then run CCUNZIP. This will create -the following modules: UNZIP, ZIPINFO (a copy of UNZIP). - - -========================================================================= - - -Using ZIP/UNZIP ---------------- - -Documentation for the commands is in MANUAL NONAME (for ZIP) and in -UNZIP DOC UNZIP. INFOZIP DOC describes the use of the -Z option of -UNZIP. - -The rest of this section explains special notes concerning the VM/CMS -version of ZIP and UNZIP. - - -Filenames and directories -------------------------- - - 1. Specifying filenames - - a. When specifying CMS files, use filename.filetype.filemode format - (separate the three parts of the name with a period and use no - spaces). Example: profile.exec.a - - Unfortunately, this prevents you from using ZIP from - FILELIST. To unzip a zip file, however, you can type something - like this next to it in FILELIST: - unzip /n -d c - - This will unzip the contents of the current file to a C-disk. - - b. It is possible to use DD names with ZIP and UNZIP on CMS, though - it can be cumbersome. Example: - filedef out disk myzip zip a - zip dd:out file1.txt file2.txt - - While you can also use a DD name for the input files, ZIP - currently does not correctly resolve the filename and will - store something like "dd:in" inside the ZIP file. A file stored - in this manor cannot easily be unzipped, as "dd:in" is an invalid - filename. - - c. In places where a directory name would be used on a PC, such as - for the ZIP -b (work path) option or the UNZIP -d (destination - path) options, use a filemode letter for CMS. For example, - to unzip files onto a C-disk, you might type something like this: - unzip myzip.zip -d c - - Currently, ZIP uses the A-disk for work files. When zipping - large files, you may want to specify a larger disk for work files. - This example will use a C-disk for work files. - zip -b C myzip.zip.c test.dat.a - - - 2. Filename conversions - - a. Filemode letters are never stored into the zip file or take from - a zip file. Only the filename and filetype are used. - ZIP removes the filemode when storing the filename into the - zip file. UNZIP assumes "A" for the filemode unless the -d - option is used. - - b. When unzipping, any path names are removed from the fileid - and the last two period-separated words are used as the - filename and filetype. These are truncated to a maximum of - eight characters, if necessary. If the filetype (extension) - is missing, then UNZIP uses "NONAME" for the filetype. - Any '(' or ')' characters are removed from the fileid. - - c. All files are created in upper-case. Files in mixed-case - cannot currently be stored into a ZIP file. - - d. Shared File System (SFS) directories are not supported. - Files are always accessed by fn.ft.fm. To use an SFS disk, - Assign it a filemode, then it can be used. - - - 3. Wildcards in file names - - a. Wildcards are not supported in the zip filename. The full - filename of the zip file must be given (but the .zip is not - necessary). So, you can't do this: - unzip -t *.zip - - b. Wildcards CAN be used with UNZIP to select (or exclude) files - inside a zip file. Examples: - unzip myzip *.c - Unzip all .c files. - unzip myzip *.c -x z*.c - Unzip all .c files but those - starting with Z. - - c. Wildcards cannot currently be used to select files with ZIP. - So, you can't do this: - zip -a myzip *.exec - - I expect to fix this for CMS in the future. - - - 4. File timestamps - - a. The dates and times of files being zipped or unzipped are not - currently read or set. When a file is zipped, the timestamp - inside the zip file will always be the current system date and - time. Likewise, when unzipping, the date and time of files - being unzipped will always be the current system date/time. - - b. Existing files are assumed to be newer than files inside a zip - file when using the -f freshen option of UNZIP. This will prevent - overwriting files that may be newer than the files inside the - zip file, but also effectively prevents the -f option from working. - - - 5. ASCII, EBCDIC, and binary data - - Background - ---------- - Most systems create data files as just a stream of bytes. Record - breaks happen when certain characters (new line and/or carriage - return characters) are encountered in the data. How to interpret - the data in a file is up to the user. The system must be told - to either notice new line characters in the data or to assume - that the data in the file is binary data and should be read or - written as-is. - - CMS and MVS are record-based systems. All files are composed - of data records. These can be stored in fixed-length files or - in variable length files. With fixed-length files, each record - is the same length. The record breaks are implied by the - LRECL (logical record length) attribute associated with the file. - With variable-length files, each record contains the length of - that record. The separation of records are not part of the - data, but part of the file structure. - - This means you can store any type of data in either type of file - structure without having to worry about the data being interpreted - as a record break. Fixed-length files may have padding at the - end of the file to make up a full record. Variable-length files - have no padding, but require extra record length data be stored - with the file data. - - Storing fixed-length files into a zip file is simple, because all - the data can just be dumped into the zip file and the record - format (RECFM) and logical record length (LRECL) can be stored - in the extra data area of the zip file so they can be restored - when UNZIP is used. - - Storing variable-length data is harder. There is no place to put - the record length data needed for each record of the file. This - data could be written to the zip file as the first two bytes of - each record and interpreted that way by UNZIP. That would make - the data unusable on systems other than CMS and MVS, though. - - Currently, there isn't a solution to this problem. Each record is - written to the zip file and the record length information is - discarded. Binary data stored in variable-length files can't be put - into a zip file then later unzipped back into the proper records. - This is fine for binary data that will be read as a stream of bytes - but not OK where the records matter, such as with CMS MODULEs. - - If the data is text (character data), there is a solution. - This data can be converted into ASCII when it's stored into - a zip file. The end of each record is now marked in the file - by new line characters. Another advantage of this method is - that the data is now accessible to non-EBCDIC systems. When - the data is unzipped on CMS or MVS, it is converted back into - EBCDIC and the records are recreated into a variable-length file. - - - So, here's what we have... - - a. To store readable text data into a zip file that can be used - on other platforms, use the -a option with ZIP to convert the - data to ASCII. These files will unzip into variable-length - files on CMS and should not contain binary data or corruption - may occur. - - b. Files that were zipped on an ASCII-based system will be - automatically translated to EBCDIC when unzipped. To prevent - this (to unzip binary data on CMS that was sent from an - ASCII-based system), use the -B option with UNZIP to force Binary - mode. To zip binary files on CMS, use the -B option with ZIP to - force Binary mode. This will prevent any data conversions from - taking place. - - c. When using the ZIP program without specifying the "-a" or "-B" - option, ZIP defaults to "native" (EBCDIC) mode and tries to - preserve the file information (RECFM, LRECL, and BLKSIZE). So - when you unzip a file zipped with ZIP under CMS or MVS, UNZIP - restores the file info. The output will be fixed-length if the - original was fixed and variable-length if the original was - variable. - - If UNZIP gives a "write error (disk full?)" message, you may be - trying to unzip a binary file that was zipped as a text file - (without using the -B option) - - - Summary - ------- - Here's how to ZIP the different types of files. - - RECFM F text - Use the -a option with ZIP to convert to ASCII for use with other - platforms or no options for use on EBCDIC systems only. - - RECFM V text - Use the -a option with ZIP to convert to ASCII for use with other - platforms or no options for use on EBCDIC systems only. - - - RECFM F binary - Use the -B option with ZIP (upper-case "B"). - - RECFM V binary - Use the -B option with ZIP. Can be zipped OK but the record - structure is destroyed when unzipped. This is OK for data files - read as binary streams but not OK for files such as CMS MODULEs. - - - 6. Character Sets - - If you are used to running UNZIP on systems like UNIX, DOS, OS/2 or - Windows, you will may have some problems with differences in the - character set. - - There are a number of different EBCDIC code pages, like there are a - number of different ASCII code pages. For example, there is a US - EBCDIC, a German EBCDIC, and a Swedish EBCDIC. As long as you are - working with other people who use the same EBCDIC code page, you - will have no trouble. If you work with people who use ASCII, or who - use a different EBCDIC code page, you may need to do some - translation. - - UNZIP translates ASCII text files to and from Open Systems EBCDIC - (IBM-1047), which may not be the EBCDIC that you are using. For - example, US EBCDIC (IBM-037) uses different character codes for - square brackets. In such cases, you can use the ICONV utility - (supplied with IBM C) to translate between your EBCDIC character set - and IBM-1047. - - If your installation does not use IBM-1047 EBCDIC, messages from - UNZIP may look a little odd. For example, in a US EBCDIC - installation, an opening square bracket will become an i-acute and a - closing square bracket will become a u-grave. - - The supplied ZIP and UNZIP EXECs attempt to correct this by setting - CMS INPUT and OUTPUT translations to adjust the display of left and - right brackets. You may need to change this if brackets don't - display correctly on your system. - - - 7. You can unzip using VM/CMS PIPELINES so unzip can be used as - a pipeline filter. Example: - 'PIPE COMMAND UNZIP -p test.zip george.test | Count Lines | Cons' - - - - -Please report all bugs and problems to: - Zip-Bugs@lists.wku.edu - - ------------------------------------------------------------------------ -Original CMS/MVS port by George Petrov. -e-mail: c888090@nlevdpsb.snads.philips.nl -tel: +31-40-781155 - -Philips C&P -Eindhoven -The Netherlands - ------------------------------------------------------------------------ -Additional fixes and README re-write (4/98) by Greg Hartwig. -e-mail: ghartwig@ix.netcom.com - ghartwig@vnet.ibm.com - ------------------------------------------------------------------------ -Additional notes from Ian E. Gorman. -e-mail: ian@iosphere.net - diff --git a/third_party/infozip/zip/cmsmvs/README.MVS b/third_party/infozip/zip/cmsmvs/README.MVS deleted file mode 100644 index 4d451db29..000000000 --- a/third_party/infozip/zip/cmsmvs/README.MVS +++ /dev/null @@ -1,92 +0,0 @@ -Thank you for trying this first port of ZIP for VM/CMS and MVS! - - - Using under MVS: - --------------------------- - -1. To use the Info-ZIP's ZIP under MVS you need: - - - C/370 ver 2.1 compiler or another compatible compiler supporting - long names for function/variable names. - -2. To compile the program under MVS do : - - - unzip all the files from zip22.zip file. They are stored as - ASCII format so you have to unzip them first on PC or other - system that already have UNZIP, and then upload them to the - mainframe with ASCII to EBCDIC conversion. - - - Copy all the .C files in the PDS called youruserid.ZIP.C - - - Copy all the .H files in the PDS called youruserid.ZIP.H - - - adjust the job ZIPMVSC.JOB to work on your size. Change my - userid - C888090 to yours - - - execute the job ZIPMVSC to compile and link all the sources. - - - maybe you have to preallocate PDS datasets named: - youruserid.ZIP.OBJ and youruserid.ZIP.LOAD - - - execute ZIPVMC to compile and link all the sources. - - - if everything is ok you will get an ZIP MODULE - - - the warnings about the duplicated ASCII and EBCDIC symbols - are OK :-) - -3. Using ZIP - - - Just read MANUAL - - - A few exceptions concerning MVS - - 3.1. if you want to make a portable zip file that is to be unzipped - on ASCII based systems use the -a option - - 3.2. If you want to zip the input files as binary ebcdic files - use the -B (capital letter) option - - 3.3. The date/end the time of the input files is set in the zip's - dir to the current system date/time - - 3.4. Without specifying the "-a" or "-B" option, the ZIP program - defaults to "native" (EBCDIC) mode and tries to preserve the - file information (LRECL,BLKSIZE..) - So when you UNZIP a file zipped with ZIP under VM/MVS it - restores the file info. - - There currently some problems with file with RECFM=V* - I don't save the length of each record yet :-) - - 3.5. No wildcards are supported as input file names: - - So you CAN'T use things like: zip myzip *.c - - 3.6. You can use DD names for zipfilename for example: - - under tso/rexx: - - "alloc fi(input) da('myzip.zip')" - "zip dd:input file1.txt file2.txt ..." - - under Batch: - - //MYZIP JOB (account) - //STEP1 EXEC PGM=ZIP,PARM='dd:input file1.txt file2.txt' - //STEPLIB DD DSN=userid.UNZIP.LOAD,DISP=SHR - //INPUT DD DSN=userid.MYZIP.ZIP,DISP=NEW, - // SPACE=(15000,(15000,10000),RLSE), - // DCB=(LRECL=80,RECFM=F) - //SYSPRINT DD SYSOUT=* - - -Please report all bugs and problems to : - zip-bugs@lists.wku.edu - -That's all for now. - -Have fun! - - -George Petrov diff --git a/third_party/infozip/zip/cmsmvs/README.MVS.LE b/third_party/infozip/zip/cmsmvs/README.MVS.LE deleted file mode 100644 index f7dcb8ac7..000000000 --- a/third_party/infozip/zip/cmsmvs/README.MVS.LE +++ /dev/null @@ -1,286 +0,0 @@ -Notes on Zip under MVS Language Environment (LE). - -First see README.MVS. This note describes just one beta test on OS/390 -V2R5 using IBM's C compiler (5647A01), V2R4. The major difference is -the use of LE on the beta site, together with some MVS native mode -fixes. Changes have not been tested on CMS. - -Some of the notes are to clarify things that were not clear from the -MANUAL or README.MVS. - -1. By default, IBM C generates the same csect name for each input - source. The prelink stage does not rename them and the linkage - editor throws away all but the first occurrence of each duplicate. - Oops, my code just disappeared :(. - - To get around this "feature", compile with the CSECT option to - force sensible names on the code and data sections of each csect. - The name of the static data csect defaults to the source name in - lower case, the code csect defaults to the source name in upper - case. These csect names still have to be unique, they cannot be - the same as function names. Of course, several csects have a - function which is the same name as the source in lower case, not - exactly an unusual occurrence. Therefore to make the csect name - unique, some of the sources have - - #ifdef MVS - # pragma csect(STATIC,xxxx_s) - #endif - - Where xxxx is an abbreviation of the source name. There has to be - a better way! - -2. The prelink step always gets cond code 4. It complains about - unresolved references, ignore it unless the linker also complains. - Prelink also complains about duplicate @@PPA2 sections and so does - the linker, but it seems to do no harm. Compile and link steps - should get 0, just prelink gets 4. See JCL at the bottom. - -3. Under MVS native mode (not Open Edition), tmpnam() returns a quoted - name of 5 qualifiers. The first is a HLQ chosen according to the - MVS LE algorithm (see below), the other qualifiers are time stamps. - If running on MVS and tmpnam() returns a quoted name with at leat - one '.', it is only safe to let the user change the high level - qualifier. Therefore -b insists on a single qualifier without '.' - in the MVS native environment. - -4. In Open Edition (OE) mode, the manual says that tmpnam() returns a - fully qualified name in directory TMPDIR or /tmp if TMPDIR is not - set. There is no point in zip trying to override that name so -b - is ignored in MVS OE mode (untested). The user should specify - environment variable TMPDIR instead. - -5. The MVS LE algorithm for choosing the high level qualifier for - native filenames is interesting, as in "May you live in interesting - times". The HLQ varies according to the environment the program is - running in, sometimes it is userid, sometimes it is TSO prefix. - See OS/390 C/C++ Programming Guide, Using a Data Set Name, - somewhere around section 2.9. - - If in doubt, use fully qualified and quoted names. Instead of - archive.zip, use 'prefix.archive.zip'. For input files, instead of - filename, use 'prefix.filename'. For PARM= in JCL, double up the - quotes. You even have to quote filenames in stdin. - -6. If your PARM includes any '/', make sure the PARM starts with '/'. - LE assumes anything before the first '/' is LE run time parameters. - It does no harm to always code a leading '/' for LE parms. - -7. JCL limits a PARM= to 100 characters total with approx. 65 on a - single line. Alas the syntax for continuing PARM= always embeds an - extra ',' somewhere in the parameters that the program finally - gets. No workaround, limit your PARM to a single line. With the - extra quotes around filenames, that does not leave much room. In - most cases, you will have to use '-@' to read the list of filenames - from SYSIN (stdin), it will not fit on a single PARM line. - -8. Filenames can be dataset names or you can refer to a ddname with - 'DD:name', case insensitive for external files, case sensitive for - OE files. You can even specify 'dd:name(mem)'. No wildcards, to - zip a complete pds you have to specify each member individually. - Directory recursion in OE does not appear to work at the moment. - -9. Zip attempts to map MVS filenames to Unix style names. It did not - work correctly for quoted names, fixed. Although you can pick up - an external (non-OE) file with a name using any case, be aware that - the mapping to a Unix style name faithfully follows the case you - supply. - -10. The archive file was being created with recfm=V and lrecl=32760. - 32760 is not valid for recfm=V under MVS, I originally changed it - to lrecl=32756. Then zip broke trying to fseek() over a record - boundary, I do not know whether this was a zip or LE bug. Trial - and error showed that recfm=U with byteseek seems to work on MVS. - No BDW or RDW, just a byte stream. The blocksize is always 6144. - - NOTE: This is an incompatible change from the previous beta, - archive files used to be recfm=V. That should not matter - because we just transfer the data, ignoring BDW and RDW - anyway. - -11. Zip used to complain about preallocated but empty archives, wrong - length records, no signature etc. The usual IBM/360 problem of no - end of file marker in a new, unopened dataset. Fixed, see routine - readzipfile in zipfile.c for the gory details. PARM= works fine. - -12. Several source files have records that are more than 80 bytes long. - It works if you transfer to mainframe datasets with a larger lrecl, - I used recfm=fb,lrecl=120 for the .C and .H files. To compile with - anything longer than 72 bytes, you need MVS C options NOMARGINS and - NOSEQUENCE (NOMAR,NOSEQ). - -13. cmsmvs was still using zname instead of name for open. Fixed. - -14. zip has to jump through a lot of hoops to see if an existing - zipfile actually contains data. A side effect of this is that - creating a zipfile with the RLSE parameter is a waste of time. - -Keith Owens . Not a maintainer, just a beta tester. -Mon Sep 14 19:31:30 EST 1998 - - -Sample JCL to compile Zip under MVS LE. You might need a large region, -I used REGION=128M on the job card. Also watch the output lines, -75,000 with OPT(2), 100,000+ with OPT(2) replaced with DEF(DEBUG). You -need to allocate prefix.ZIP.C.OBJ (recfm=FB, lrecl=80) and -prefix.ZIP.LOAD (recfm=U, blksize is site defined). - -//CBC JCLLIB ORDER=CBC.SCBCPRC -//ZIP EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(ZIP)', -// OUTFILE='prefix.ZIP.C.OBJ(ZIP),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//CRYPT EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(CRYPT)', -// OUTFILE='prefix.ZIP.C.OBJ(CRYPT),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//TTYIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(TTYIO)', -// OUTFILE='prefix.ZIP.C.OBJ(TTYIO),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//TREES EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(TREES)', -// OUTFILE='prefix.ZIP.C.OBJ(TREES),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//DEFLATE EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(DEFLATE)', -// OUTFILE='prefix.ZIP.C.OBJ(DEFLATE),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//FILEIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(FILEIO)', -// OUTFILE='prefix.ZIP.C.OBJ(FILEIO),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//GLOBALS EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(GLOBALS)', -// OUTFILE='prefix.ZIP.C.OBJ(GLOBALS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//UTIL EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(UTIL)', -// OUTFILE='prefix.ZIP.C.OBJ(UTIL),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//CRC32 EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(CRC32)', -// OUTFILE='prefix.ZIP.C.OBJ(CRC32),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//CRCTAB EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(CRCTAB)', -// OUTFILE='prefix.ZIP.C.OBJ(CRCTAB),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//ZIPFILE EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(ZIPFILE)', -// OUTFILE='prefix.ZIP.C.OBJ(ZIPFILE),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//ZIPUP EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(ZIPUP)', -// OUTFILE='prefix.ZIP.C.OBJ(ZIPUP),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//CMSMVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(CMSMVS)', -// OUTFILE='prefix.ZIP.C.OBJ(CMSMVS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//MVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M', -// INFILE='prefix.ZIP.C(MVS)', -// OUTFILE='prefix.ZIP.C.OBJ(MVS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE', -// CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT' -//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR -//PLINK EXEC PROC=EDCPL, -// OUTFILE='prefix.ZIP.LOAD(ZIP),DISP=SHR', -// PREGSIZ=6M, -// PPARM='NONCAL,MAP,MEMORY', -// LPARM='LIST,MAP,XREF' -//PLKED.SYSIN DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIP) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRYPT) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(TREES) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(DEFLATE) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(FILEIO) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(GLOBALS) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(UTIL) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRC32) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRCTAB) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPFILE) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPUP) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(MVS) -// DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CMSMVS) -//LKED.SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED -//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(2,2)) -// - -Sample JCL to zip the mainframe .C and .H files as ASCII (-a). Delete -any existing archive first, point the temporary file at a particular -prefix (-b), use 'prefix.ARCHIVE.ZIP' for the archive file, read the -list of files to zip from stdin (SYSIN). - -//DELETE EXEC PGM=IDCAMS -//SYSPRINT DD SYSOUT=* -//SYSIN DD * - DELETE prefix.ARCHIVE.ZIP - SET MAXCC = 0 -//ZIP EXEC PGM=ZIP, -// PARM='/-a -v -b temppref ''prefix.ARCHIVE.ZIP'' -@' -//STEPLIB DD DSN=prefix.ZIP.LOAD,DISP=SHR -//SYSPRINT DD SYSOUT=* -//SYSOUT DD SYSOUT=* -//CEEDUMP DD SYSOUT=* -//ZIPC DD DISP=SHR,DSN=prefix.ZIP.C -//ZIPH DD DISP=SHR,DSN=prefix.ZIP.H -//SYSIN DD * -dd:zipc(api) -dd:zipc(cms) -dd:zipc(cmsmvs) -dd:zipc(crctab) -dd:zipc(crc32) -dd:zipc(crypt) -dd:zipc(deflate) -dd:zipc(fileio) -dd:zipc(globals) -dd:zipc(mktime) -dd:zipc(mvs) -dd:zipc(trees) -dd:zipc(ttyio) -dd:zipc(util) -dd:zipc(zip) -dd:zipc(zipcloak) -dd:zipc(zipfile) -dd:zipc(zipnote) -dd:zipc(zipsplit) -dd:zipc(zipup) -dd:ziph(api) -dd:ziph(cmsmvs) -dd:ziph(crypt) -dd:ziph(cstat) -dd:ziph(ebcdic) -dd:ziph(mvs) -dd:ziph(revision) -dd:ziph(stat) -dd:ziph(tailor) -dd:ziph(ttyio) -dd:ziph(zip) -dd:ziph(ziperr) -dd:ziph(zipup) diff --git a/third_party/infozip/zip/cmsmvs/cczip.exec b/third_party/infozip/zip/cmsmvs/cczip.exec deleted file mode 100644 index 86edb590c..000000000 --- a/third_party/infozip/zip/cmsmvs/cczip.exec +++ /dev/null @@ -1,123 +0,0 @@ -/* CCZIP EXEC Compile zip for VM/CMS */ -/* Author: George Petrov, 11 Apr 1995 (VMCOMPIL EXEC) */ -/* Modified for IBM C V3R1 by Ian E. Gorman, 2 Nov 1998 - Facilities for compiling and testing were provided by - OmniMark Technologies Corporation, Ottawa, Canada -*/ -Address Command -Signal On Error - -/* Allow longnames, compile re-entrant code. - globals.c and cmsmvs.c require EXTENDED features */ -CCopts = 'LONGNAME RENT LANGLVL(EXTENDED) NOEXECOPS' - -/* ZIP options -- VM_CMS, REENTRANT */ -CCopts = CCopts 'DEFINE(VM_CMS,REENTRANT)' - -/* Link the load module to run in more or less than 16MB memory */ -LINKopts = 'AMODE ANY RMODE ANY RLDSAVE' - -/* resources needed to build */ -'GLOBAL TXTLIB SCEELKED CMSLIB' -'GLOBAL LOADLIB SCEERUN' - -/* produce the TEXT (object) files */ -linklist='' -modname='ZIP' -Say 'Building' modname 'MODULE...' -Call Compile 'ZIP' -Call Compile 'CRC32' -Call Compile 'CRYPT' -Call Compile 'DEFLATE' -Call Compile 'FILEIO' -Call Compile 'GLOBALS' -Call Compile 'TREES' -Call Compile 'TTYIO' -Call Compile 'UTIL' -Call Compile 'ZIPUP' -Call Compile 'ZIPFILE' -Call Compile 'CMSMVS' -Call Compile 'CMS' - -Say 'Linking...' -'EXEC CMOD' linklist '(MODNAME' modname LINKopts -Say modname 'built successfully.' - - -/*---------------------------------------------------------------------*/ -/* Build utility programs */ -/*---------------------------------------------------------------------*/ -CCopts = CCopts 'DEFINE(UTIL)' - - -linklist='' -modname='ZIPNOTE' -Say -Say 'Building' modname 'MODULE...' -Call Compile 'ZIPNOTE' -Call Compile 'ZIPFILE' -Call Compile 'FILEIO' -Call Compile 'UTIL' -Call Compile 'GLOBALS' -Call Compile 'CMSMVS' - -Say 'Linking...' -'EXEC CMOD' linklist '(MODNAME' modname LINKopts -Say modname 'built successfully.' - - -linklist='' -modname='ZIPSPLIT' -Say -Say 'Building' modname 'MODULE...' -Call Compile 'ZIPSPLIT' -Call Compile 'ZIPFILE' -Call Compile 'FILEIO' -Call Compile 'UTIL' -Call Compile 'GLOBALS' -Call Compile 'CMSMVS' - -Say 'Linking...' -'EXEC CMOD' linklist '(MODNAME' modname LINKopts -Say modname 'built successfully.' - - -linklist='' -modname='ZIPCLOAK' -Say -Say 'Building' modname 'MODULE...' -Call Compile 'ZIPCLOAK' -Call Compile 'ZIPFILE' -Call Compile 'FILEIO' -Call Compile 'UTIL' -Call Compile 'GLOBALS' -Call Compile 'CRC32' -Call Compile 'CRYPT' -Call Compile 'TTYIO' -Call Compile 'CMSMVS' - -Say 'Linking...' -'EXEC CMOD' linklist '(MODNAME' modname LINKopts -Say modname 'built successfully.' -Say 'Done.' - -Exit rc - - - -error: - Say 'Error' rc 'during compilation!' - Say 'Error in line' sigl':' - Say ' 'Sourceline(sigl) - Exit rc - - - -Compile: Procedure Expose CCopts LINKopts linklist - Parse arg filename filetype filemode . - If filetype='' Then filetype='C' - linklist = linklist filename - - Say 'Compiling' filename filetype filemode '...' - 'EXEC CC' filename filetype filemode '('CCopts - Return rc diff --git a/third_party/infozip/zip/cmsmvs/cms.c b/third_party/infozip/zip/cmsmvs/cms.c deleted file mode 100644 index e69f5cb97..000000000 --- a/third_party/infozip/zip/cmsmvs/cms.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* - * VM/CMS specific things. - */ - -#include "zip.h" - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - FILE *stream; - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else { - if ((stream = fopen(n, "r")) != (FILE *)NULL) - { - fclose(stream); - return newname(n, 0, caseflag); - } - else return ZE_MISS; - } - return ZE_OK; -} diff --git a/third_party/infozip/zip/cmsmvs/cmsmvs.c b/third_party/infozip/zip/cmsmvs/cmsmvs.c deleted file mode 100644 index 9c56de78c..000000000 --- a/third_party/infozip/zip/cmsmvs/cmsmvs.c +++ /dev/null @@ -1,442 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* - * routines common to VM/CMS and MVS - */ - -#include "zip.h" - -#include -#include -#include - -#ifndef MVS /* MVS has perfectly good definitions of the following */ -int stat(const char *path, struct stat *buf) -{ - if ((buf->fp = fopen(path, "r")) != NULL) { - fldata_t fdata; - if (fldata( buf->fp, buf->fname, &fdata ) == 0) { - buf->st_dev = fdata.__device; - buf->st_mode = *(short *)(&fdata); - } - strcpy( buf->fname, path ); - fclose(buf->fp); - } - return (buf->fp != NULL ? 0 : 1); -} -#endif /* MVS */ - - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#define PAD 0 -#define PATH_END '/' - -/* Library functions not in (most) header files */ - -#ifdef USE_ZIPMAIN -int main OF((void)); -#endif - -int utime OF((char *, ztimbuf *)); - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -#ifndef MVS /* MVS has perfectly good definitions of the following */ -int fstat(int fd, struct stat *buf) -{ - fldata_t fdata; - - if ((fd != -1) && (fldata( (FILE *)fd, buf->fname, &fdata ) == 0)) { - buf->st_dev = fdata.__device; - buf->st_mode = *(short *)(&fdata); - buf->fp = (FILE *)fd; - return 0; - } - return -1; -} -#endif /* MVS */ - - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - char mem[10] = ""; /* member name */ - char ext[10] = ""; /* extension name */ - - dosflag = dosify; /* default for non-DOS non-OS/2 */ - - /* Find starting point in name before doing malloc */ - for (t = x; *t == '/'; t++) - ; - - /* Make changes, if any, to the copied name (leave original intact) */ - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - -#ifdef MVS - /* strip quotes from name, non-OE format */ - if (*n == '\'' && (t = strrchr(n, '\'')) != n) { - if (!*(t+1)) { - /* yes, it is a quoted name */ - int l = strlen(n) - 2; - memmove(n, n+1, l); - *(n+l) = '\0'; - } - } - /* Change member names to fn.ext */ - if (t = strrchr(n, '(')) { - *t = '\0'; - strcpy(mem,t+1); /* Save member name */ - if (t = strchr(mem, ')')) *t = '\0'; /* Set end of mbr */ - /* Save extension */ - if (t = strrchr(n, '.')) t++; - else t = n; - strcpy(ext,t); - /* Build name as "member.ext" */ - strcpy(t,mem); - strcat(t,"."); - strcat(t,ext); - } - - /* Change all but the last '.' to '/' */ - if (t = strrchr(n, '.')) { - while (--t > n) - if (*t == '.') - *t = '/'; - } -#else - /* On CMS, remove the filemode (all past 2nd '.') */ - if (t = strchr(n, '.')) - if (t = strchr(t+1, '.')) - *t = '\0'; - t = n; -#endif - - strcpy(n, t); - - if (isdir == 42) return n; /* avoid warning on unused variable */ - - if (dosify) - msname(n); /* msname() needs string in native charset */ - - strtoasc(n, n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strtoebc(x, n); - return x; -} - - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - ztimbuf u; /* argument for utime() */ - - /* Convert DOS time to time_t format in u.actime and u.modtime */ - u.actime = u.modtime = dos2unixtime(d); - - utime(f, &u); -} - - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -{ - FILE *stream; - time_t ltime; - - if (strcmp(f, "-") != 0) { /* if not compressing stdin */ - Trace((mesg, "opening file '%s' with '%s'\n", f, FOPR)); - if ((stream = fopen(f, FOPR)) == (FILE *)NULL) { - return 0; - } else { - if (n != NULL) { - /* With byteseek, this will work */ - fseek(stream, 0L, SEEK_END); - *n = ftell(stream); - Trace((mesg, "file size = %lu\n", *((ulg *)n))); - } - fclose(stream); - } - } - else { - /* Reading from stdin */ - if (n != NULL) { - *n = -1L; - } - } - - /* Return current time for all the times -- for now */ - time(<ime); - if (t != NULL) - t->atime = t->mtime = t->ctime = ltime; - - /* Set attributes (always a file) */ - if (a != NULL) - *a = 0; - - return unix2dostime(<ime); -} - - - -int set_extra_field(z, z_utim) -struct zlist far *z; -iztimes *z_utim; -/* create extra field and change z->att if desired */ -{ - fldata_t fdata; - FILE *stream; - char *eb_ptr; -#ifdef USE_EF_UT_TIME - extent ef_l_len = (EB_HEADSIZE+EB_UT_LEN(1)); -#else /* !USE_EF_UT_TIME */ - extent ef_l_len = 0; -#endif /* ?USE_EF_UT_TIME */ - int set_cmsmvs_eb = 0; - -/*translate_eol = 0;*/ - if (aflag == ASCII) { - z->att = ASCII; - } else { - if (bflag) - z->att = BINARY; - else - z->att = __EBCDIC; - ef_l_len += sizeof(fdata)+EB_HEADSIZE; - set_cmsmvs_eb = 1; - } - - if (ef_l_len > 0) { - z->extra = (char *)malloc(ef_l_len); - if (z->extra == NULL) { - printf("\nFLDATA : Unable to allocate memory !\n"); - return ZE_MEM; - } - z->cext = z->ext = ef_l_len; - eb_ptr = z->cextra = z->extra; - - if (set_cmsmvs_eb) { - if (bflag) -/*** stream = fopen(z->zname,"rb,type=record"); $RGH$ ***/ - stream = fopen(z->name,"rb"); - else - stream = fopen(z->name,"r"); - if (stream == NULL) { - printf("\nFLDATA : Could not open file : %s !\n",z->name); - printf("Error %d: '%s'\n", errno, strerror(errno)); - return ZE_NONE; - } - - fldata(stream,z->name,&fdata); - /*put the system ID */ -#ifdef VM_CMS - *(eb_ptr) = EF_VMCMS & 0xFF; - *(eb_ptr+1) = EF_VMCMS >> 8; -#else - *(eb_ptr) = EF_MVS & 0xFF; - *(eb_ptr+1) = EF_MVS >> 8; -#endif - *(eb_ptr+2) = sizeof(fdata) & 0xFF; - *(eb_ptr+3) = sizeof(fdata) >> 8; - - memcpy(eb_ptr+EB_HEADSIZE,&fdata,sizeof(fdata)); - fclose(stream); -#ifdef USE_EF_UT_TIME - eb_ptr += (sizeof(fdata)+EB_HEADSIZE); -#endif /* USE_EF_UT_TIME */ - } -#ifdef USE_EF_UT_TIME - eb_ptr[0] = 0x55; /* ascii[(unsigned)('U')] */ - eb_ptr[1] = 0x54; /* ascii[(unsigned)('T')] */ - eb_ptr[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - eb_ptr[3] = 0; - eb_ptr[4] = EB_UT_FL_MTIME; - eb_ptr[5] = (char)(z_utim->mtime); - eb_ptr[6] = (char)(z_utim->mtime >> 8); - eb_ptr[7] = (char)(z_utim->mtime >> 16); - eb_ptr[8] = (char)(z_utim->mtime >> 24); -#endif /* USE_EF_UT_TIME */ - } - - return ZE_OK; -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). - */ -{ - return 0; -} - -#ifdef USE_ZIPMAIN -/* This function is called as main() to parse arguments */ -/* into argc and argv. This is required for stand-alone */ -/* execution. This calls the "real" main() when done. */ - -int main(void) - { - int argc=0; - char *argv[50]; - - int iArgLen; - char argstr[256]; - char **pEPLIST, *pCmdStart, *pArgStart, *pArgEnd; - - /* Get address of extended parameter list from S/370 Register 0 */ - pEPLIST = (char **)__xregs(0); - - /* Null-terminate the argument string */ - pCmdStart = *(pEPLIST+0); - pArgStart = *(pEPLIST+1); - pArgEnd = *(pEPLIST+2); - iArgLen = pArgEnd - pCmdStart + 1; - - /* Make a copy of the command string */ - memcpy(argstr, pCmdStart, iArgLen); - argstr[iArgLen] = '\0'; /* Null-terminate */ - - /* Store first token (cmd) */ - argv[argc++] = strtok(argstr, " "); - - /* Store the rest (args) */ - while (argv[argc-1]) - argv[argc++] = strtok(NULL, " "); - argc--; /* Back off last NULL entry */ - - /* Call "real" main() function */ - return zipmain(argc, argv); - -} -#endif /* USE_ZIPMAIN */ - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - char liblvlmsg [50+1]; - char *compiler = "?"; - char *platform = "?"; - char complevel[64]; - - /* Map the runtime library level information */ - union { - unsigned int iVRM; - struct { - unsigned int pd:4; /* Product designation */ - unsigned int vv:4; /* Version */ - unsigned int rr:8; /* Release */ - unsigned int mm:16; /* Modification level */ - } xVRM; - } VRM; - - - /* Break down the runtime library level */ - VRM.iVRM = __librel(); - sprintf(liblvlmsg, "Using runtime library level %s V%dR%dM%d", - (VRM.xVRM.pd==1 ? "LE" : "CE"), - VRM.xVRM.vv, VRM.xVRM.rr, VRM.xVRM.mm); - /* Note: LE = Language Environment, CE = Common Env. (C/370). */ - /* This refers ONLY to the current runtimes, not the compiler. */ - - -#ifdef VM_CMS - platform = "VM/CMS"; - #ifdef __IBMC__ - compiler = "IBM C"; - #else - compiler = "C/370"; - #endif -#endif - -#ifdef MVS - platform = "MVS"; - #ifdef __IBMC__ - compiler = "IBM C/C++"; - #else - compiler = "C/370"; - #endif -#endif - -#ifdef __COMPILER_VER__ - VRM.iVRM = __COMPILER_VER__; - sprintf(complevel," V%dR%dM%d", - VRM.xVRM.vv, VRM.xVRM.rr, VRM.xVRM.mm); -#else -#ifdef __IBMC__ - sprintf(complevel," V%dR%d", __IBMC__ / 100, (__IBMC__ % 100)/10); -#else - complevel[0] = '\0'; -#endif -#endif - - - printf("Compiled with %s%s for %s%s%s.\n\n", - - /* Add compiler name and level */ - compiler, complevel, - - /* Add platform */ - platform, - - /* Add timestamp */ -#ifdef __DATE__ - " on " __DATE__ -#ifdef __TIME__ - " at " __TIME__ -#endif -#endif - ".\n", - liblvlmsg - ); -} /* end function version_local() */ diff --git a/third_party/infozip/zip/cmsmvs/cmsmvs.h b/third_party/infozip/zip/cmsmvs/cmsmvs.h deleted file mode 100644 index e2adb31c5..000000000 --- a/third_party/infozip/zip/cmsmvs/cmsmvs.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* Include file for VM/CMS and MVS */ - -/* This is normally named osdep.h on most systems. Since CMS */ -/* generally doesn't support directories, it's been given a unique */ -/* name to avoid confusion. */ - - -#ifndef __cmsmvs_h /* prevent multiple inclusions */ -#define __cmsmvs_h - -#ifdef MVS -# define _POSIX_SOURCE /* tell MVS we want full definitions */ -# include -#endif /* MVS */ - -#include /* the usual non-BSD time functions */ -/* cstat.h is not required for MVS and actually gets in the way. Is it - * needed for CMS? - */ -#ifdef MVS -# include -# include -#else /* !MVS */ -# include "cstat.h" -#endif - - -/* Newer compiler version defines something for us */ -#if defined(__VM__) && !defined(VM_CMS) -# define VM_CMS -#endif - -#define CMS_MVS -#define EBCDIC - -#ifndef MVS /* MVS has perfectly good definitions for the following */ -# define NO_UNISTD_H -# define NO_FCNTL_H -#endif /*MVS */ - -/* If we're generating a stand-alone CMS module, patch in */ -/* a new main() function before the real main() for arg parsing. */ -#ifdef CMS_STAND_ALONE -# define USE_ZIPMAIN -#endif - -#ifndef NULL -# define NULL 0 -#endif - -#define PASSWD_FROM_STDIN - /* Kludge until we know how to open a non-echo tty channel */ - -/* definition for ZIP */ -#define getch() getc(stdin) -#define MAXPATHLEN 128 -#define NO_RMDIR -#define NO_MKTEMP -#define USE_CASE_MAP -#define isatty(t) 1 - -#ifndef MVS /* MVS has perfectly good definitions for the following */ -# define fileno(x) (char *)(x) -# define fdopen fopen -# define unlink remove -# define link rename -# define utime(f,t) -#endif /*MVS */ -#ifdef ZCRYPT_INTERNAL -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */ -#endif - -#ifdef MVS -# if defined(__CRC32_C) -# pragma csect(STATIC,"crc32_s") -# elif defined(__DEFLATE_C) -# pragma csect(STATIC,"deflat_s") -# elif defined(__ZIPFILE_C) -# pragma csect(STATIC,"zipfil_s") -# elif defined(__ZIPUP_C) -# pragma csect(STATIC,"zipup_s") -# endif -#endif /* MVS */ - -/* end defines for ZIP */ - - - -#if 0 /*$RGH$*/ -/* RECFM=F, LRECL=1 works for sure */ -#define FOPR "rb,recfm=fb" -#define FOPM "r+" -#define FOPW "wb,recfm=fb,lrecl=1" -#define FOPWT "w" -#endif - -/* Try allowing ZIP files to be RECFM=V with "byteseek" for CMS, recfm=U for MVS */ -#define FOPR "rb,byteseek" -#define FOPM "r+,byteseek" -#ifdef MVS - #define FOPW "wb,recfm=u,byteseek" -#else /* !MVS */ - #define FOPW "wb,recfm=v,lrecl=32760,byteseek" -#endif /* MVS */ - -#if 0 -#define FOPW_TMP "w,byteseek" -#else -#define FOPW_TMP "w,type=memory(hiperspace)" -#endif - -#define CBSZ 0x40000 -#define ZBSZ 0x40000 - -#endif /* !__cmsmvs_h */ diff --git a/third_party/infozip/zip/cmsmvs/cstat.h b/third_party/infozip/zip/cmsmvs/cstat.h deleted file mode 100644 index f02a5c30d..000000000 --- a/third_party/infozip/zip/cmsmvs/cstat.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* cstat.h - - Definitions used for file status functions - -*/ - -#ifndef __STAT_H -#define __STAT_H - -#include - -#define S_IFMT 0xF000 /* file type mask */ -#define S_IFDIR 0x4000 /* directory */ -#define S_IFIFO 0x1000 /* FIFO special */ -#define S_IFCHR 0x2000 /* character special */ -#define S_IFBLK 0x3000 /* block special */ -#define S_IFREG 0x8000 /* or just 0x0000, regular */ -#define S_IREAD 0x0100 /* owner may read */ -#define S_IWRITE 0x0080 /* owner may write */ -#define S_IEXEC 0x0040 /* owner may execute */ - -struct stat -{ - short st_dev; /* Drive number of disk containing the */ - /* file or file handle if the file is */ - /* on device */ - short st_ino; /* Not meaningfull for VM/CMS */ - short st_mode; /* Bit mask giving information about */ - /* the file's mode */ - short st_nlink; /* Set to the integer constant 1 */ - int st_uid; /* Not meaningfull for VM/CMS */ - int st_gid; /* Not meaningfull for VM/CMS */ - short st_rdev; /* Same as st_dev */ - long st_size; /* Size of the file in bytes */ - long st_atime; /* Most recent access */ - long st_mtime; /* Same as st_atime */ - long st_ctime; /* Same as st_atime */ - FILE *fp; - char fname[FILENAME_MAX]; -}; - -int stat(const char *path, struct stat *sb); -int fstat(int fd, struct stat *sb); - -#endif /* __STAT_H */ diff --git a/third_party/infozip/zip/cmsmvs/mc.exec b/third_party/infozip/zip/cmsmvs/mc.exec deleted file mode 100644 index ca22a182a..000000000 --- a/third_party/infozip/zip/cmsmvs/mc.exec +++ /dev/null @@ -1,95 +0,0 @@ -/* MAKECPIP EXEC Make program to build a C/370 module */ -/* Author: George Petrov, 29 Sep 1994 */ - -arg fn . '(' cparms /* Filter name */ -'pipe (end ?) < 'fn' makefile', /* get all source files from */ - '| frlab GLOBALS:'||, - '| drop', - '| strip', - '| var globals' -cparms = cparms globals -say '' -say 'Compile options : 'cparms -say '' -if pos('REB',cparms) > 0 then do -parse var cparms cp1 'REB' . ' ' cp2 /* REBuild options specified ? */ -cparms = cp1||cp2 -pipe1=, -'pipe (end ?) < 'fn' makefile', /* get all source files from */ - '| nfind *'||, /* the makefile and compile */ - '| frlab TEXT:'||, /* only the those who are */ - '| r: tolab MODULE:'||, /* changed or never compiled */ - '| drop', - '| o: fanout', - '| chop before str /(/', - '| statew', - '| c: fanout', /* compiled */ - '| specs /Compiling / 1 w1-3 n / .../ n', - '| cons' -end -else do -pipe1=, -'pipe (end ?) < 'fn' makefile', /* get all source files from */ - '| nfind *'||, /* the makefile and compile */ - '| frlab TEXT:'||, /* only the those who are */ - '| r: tolab MODULE:'||, /* changed or never compiled */ - '| drop', - '| o: fanout', - '| specs w1 1 /C/ nw w3 nw write w1 1 /TEXT A/ nw', - '| chop before str /(/', - '| statew', - '| change (57 66) / /0/', - '| sort 1.8 d', /* sort the date and time */ - '| uniq 1-17 singles', /* if the first is a source */ - '| sort 1.8 d 64.2 d 57.2 d 60.2 d 66.8 d', /* sort the date */ - '| uniq 1-8 first', /* if the first is a source */ - '| locate 9.8 /C /', /* program then it has to be */ - '| c: fanout', /* compiled */ - '| specs /Compiling / 1 w1-3 n / .../ n', - '| cons' -end -pipe2= '?', - 'r:', - '| drop', - '| specs w1 1', /* save the module name in var */ - '| var module', - '?', - 'o:', - '| specs w1 1', - '| join * / /', - '| var texts', /* save all the text file names */ - '?', /* for later include */ - 'c:', - '| specs /CC / 1 w1-3 n /(NOTERM 'cparms'/ nw', /* compile! */ - '| err: cms | cons', - '?', - 'err:', - '| strip both', - '| nfind 0'||, - '| var err', - '| specs /----> Errors found! RC=/ 1 1-* n', - '| cons' -/* '| g: gate'*/ -pipe1 pipe2 -say '' -if symbol('err') = 'VAR' & err ^= 0 then do - say 'Errors found in source files - link aborted! RC = 'err - exit err -end -say 'Generating module 'module -'pipe cms cmod' fn texts' DMSCSL | > 'fn' LINK A' -'set cmstype ht' -'state 'fn' LINK A' -rcc = rc -'set cmstype rt' -if rcc = 0 then do - say '' - say 'ERRORS discovered during linking!' - say 'See: 'fn' LINK A for more info' -end -exit rc -error: -say 'Error in REXX detected!' -Say 'Syntax error on line' Sigl':' Sourceline(Sigl) -Say 'Error was:' Errortext(RC) -return rc diff --git a/third_party/infozip/zip/cmsmvs/mvs.c b/third_party/infozip/zip/cmsmvs/mvs.c deleted file mode 100644 index d7f743786..000000000 --- a/third_party/infozip/zip/cmsmvs/mvs.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* - * MVS specific things - */ -#include "zip.h" -#include "mvs.h" -#include - -static int gen_node( DIR *dirp, RECORD *recptr ) -{ - char *ptr, *name, ttr[TTRLEN]; - int skip, count = 2; - unsigned int info_byte, alias, ttrn; - struct dirent *new; - - ptr = recptr->rest; - while (count < recptr->count) { - if (!memcmp( ptr, endmark, NAMELEN )) - return 1; - name = ptr; /* member name */ - ptr += NAMELEN; - memcpy( ttr, ptr, TTRLEN ); /* ttr name */ - ptr += TTRLEN; - info_byte = (unsigned int) (*ptr); /* info byte */ - if ( !(info_byte & ALIAS_MASK) ) { /* no alias */ - new = malloc( sizeof(struct dirent) ); - if (dirp->D_list == NULL) - dirp->D_list = dirp->D_curpos = new; - else - dirp->D_curpos = (dirp->D_curpos->d_next = new); - new->d_next = NULL; - memcpy( new->d_name, name, NAMELEN ); - new->d_name[NAMELEN] = '\0'; - if ((name = strchr( new->d_name, ' ' )) != NULL) - *name = '\0'; /* skip trailing blanks */ - } - skip = (info_byte & SKIP_MASK) * 2 + 1; - ptr += skip; - count += (TTRLEN + NAMELEN + skip); - } - return 0; -} - -DIR *opendir(const char *dirname) -{ - int bytes, list_end = 0; - DIR *dirp; - FILE *fp; - RECORD rec; - - fp = fopen( dirname, "rb" ); - if (fp != NULL) { - dirp = malloc( sizeof(DIR) ); - if (dirp != NULL) { - dirp->D_list = dirp->D_curpos = NULL; - strcpy( dirp->D_path, dirname ); - do { - bytes = fread( &rec, 1, sizeof(rec), fp ); - if (bytes == sizeof(rec)) - list_end = gen_node( dirp, &rec ); - } while (!feof(fp) && !list_end); - fclose( fp ); - dirp->D_curpos = dirp->D_list; - return dirp; - } - fclose( fp ); - } - return NULL; -} - -struct dirent *readdir(DIR *dirp) -{ - struct dirent *cur; - - cur = dirp->D_curpos; - dirp->D_curpos = dirp->D_curpos->d_next; - return cur; -} - -void rewinddir(DIR *dirp) -{ - dirp->D_curpos = dirp->D_list; -} - -int closedir(DIR *dirp) -{ - struct dirent *node; - - while (dirp->D_list != NULL) { - node = dirp->D_list; - dirp->D_list = dirp->D_list->d_next; - free( node ); - } - free( dirp ); - return 0; -} - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - int exists; /* 1 if file exists */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (!(exists = (LSSTAT(n, &s) == 0))) - { -#ifdef MVS - /* special case for MVS. stat does not work on non-HFS files so if - * stat fails with ENOENT, try to open the file for reading anyway. - * If the user has no OMVS segment, stat gets an initialization error, - * even on external files. - */ - if (errno == ENOENT || errno == EMVSINITIAL) { - FILE *f = fopen(n, "r"); - if (f) { - /* stat got ENOENT but fopen worked, external file */ - fclose(f); - exists = 1; - memset(&s, '\0', sizeof(s)); /* stat data is unreliable for externals */ - s.st_mode = S_IFREG; /* fudge it */ - } - } -#endif /* MVS */ - } - if (! exists) { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - if (!S_ISDIR(s.st_mode)) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} diff --git a/third_party/infozip/zip/cmsmvs/mvs.h b/third_party/infozip/zip/cmsmvs/mvs.h deleted file mode 100644 index b2f9760ff..000000000 --- a/third_party/infozip/zip/cmsmvs/mvs.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* definitions */ - -#define NAMELEN 8 - -struct dirent { - struct dirent *d_next; - char d_name[NAMELEN+1]; -}; - -typedef struct _DIR { - struct dirent *D_list; - struct dirent *D_curpos; - char D_path[FILENAME_MAX]; -} DIR; - -DIR * opendir(const char *dirname); -struct dirent *readdir(DIR *dirp); -void rewinddir(DIR *dirp); -int closedir(DIR *dirp); -char * readd(DIR *dirp); - -#define ALIAS_MASK (unsigned int) 0x80 -#define SKIP_MASK (unsigned int) 0x1F -#define TTRLEN 3 -#define RECLEN 254 - -typedef _Packed struct { - unsigned short int count; - char rest[RECLEN]; -} RECORD; - -char *endmark = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"; diff --git a/third_party/infozip/zip/cmsmvs/mvs.mki b/third_party/infozip/zip/cmsmvs/mvs.mki deleted file mode 100644 index 316d06452..000000000 --- a/third_party/infozip/zip/cmsmvs/mvs.mki +++ /dev/null @@ -1,125 +0,0 @@ -# Makefile for the MVS (OS/390 Base) version of ZIP 2.3 -# Produced for C/C++ V3R2 in OS/390 1.2.0 by Ian E. Gorman, 2 Nov 1998 -# Facilities for compiling and testing were made available by -# OmniMark Technologies Corporation, Ottawa, Canada - -# NOTES -# -# The only tabs in this file are in the first character of each recipe -# line, where they are required by make. -# -# Run this makefile in OpenMVS (OS/390 POSIX) using source files in the -# HFS file system. You can write the load module to either HFS file -# system or to a PDS in the native MVS file system. The PDS must have -# sufficient free space to hold the load module. -# -# To compile to a member of a PDS: -# make -# or -# make zip.mvs -# -# To compile a test version into the HFS file system: -# make hfs - -# ZIP options -- MVS, REENTRANT -ZIPOPTS=-DMVS -DREENTRANT - -# directories - -# generic source code -SRC=.. -SRC_P=$(SRC)/ - -# source code for MVS -CMSMVS=../cmsmvs -CMSMVS_P=$(CMSMVS)/ - -# include files -INCLS=-I$(SRC) -I$(CMSMVS) - -# object files and load modules -BLD_P=../mvs/ - -# Other options - -# Suffixes (E and O must be different) -E= -O=.o - -# Need EXTENDED features for global.c and vmvms.c, so not using c89 -CC=cc -CFLAGS=-D_OPEN_SYS $(ZIPOPTS) $(INCLS) - -LD=cc -LDFLAGS= - -# Files - -# object (TEXT) files -OBJECTS= $(BLD_P)zip$(O) $(BLD_P)trees$(O) \ - $(BLD_P)crypt$(O) $(BLD_P)ttyio$(O) $(BLD_P)deflate$(O) \ - $(BLD_P)fileio$(O) $(BLD_P)globals$(O) $(BLD_P)util$(O) \ - $(BLD_P)crc32$(O) $(BLD_P)zipfile$(O) \ - $(BLD_P)zipup$(O) $(BLD_P)cmsmvs$(O) $(BLD_P)mvs$(O) - -# Header files -HFILES= $(SRC_P)api.h $(SRC_P)crc32.h $(SRC_P)crypt.h $(SRC_P)ebcdic.h \ - $(SRC_P)revision.h $(SRC_P)tailor.h $(SRC_P)ttyio.h \ - $(SRC_P)zip.h $(SRC_P)ziperr.h $(CMSMVS_P)cmsmvs.h \ - $(CMSMVS_P)cstat.h $(CMSMVS_P)mvs.h $(CMSMVS_P)zipup.h - -# Rules - -all: $(BLD_P)zip.mvs$(E) -hfs: $(BLD_P)zip$(E) - -# link - -$(BLD_P)zip.mvs$(E): $(OBJECTS) - $(LD) -o "//INFOZIP.LOAD(ZIP)" $(LDFLAGS) $^ - echo "tso call \"infozip(zip)\" \"'\"\"""$$""@""\"\"'\"" > $% - chmod a+x $% - -$(BLD_P)zip$(E): $(OBJECTS) - $(LD) -o $% $(LDFLAGS) $^ - -# compile - -$(BLD_P)trees$(O): $(SRC_P)trees.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)trees.c - -$(BLD_P)crypt$(O): $(SRC_P)crypt.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)crypt.c - -$(BLD_P)ttyio$(O): $(SRC_P)ttyio.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)ttyio.c - -$(BLD_P)deflate$(O): $(SRC_P)deflate.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)deflate.c - -$(BLD_P)fileio$(O): $(SRC_P)fileio.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)fileio.c - -$(BLD_P)globals$(O): $(SRC_P)globals.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)globals.c - -$(BLD_P)zip$(O): $(SRC_P)zip.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)zip.c - -$(BLD_P)util$(O): $(SRC_P)util.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)util.c - -$(BLD_P)crc32$(O): $(SRC_P)crc32.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)crc32.c - -$(BLD_P)zipfile$(O): $(SRC_P)zipfile.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)zipfile.c - -$(BLD_P)zipup$(O): $(SRC_P)zipup.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(SRC_P)zipup.c - -$(BLD_P)cmsmvs$(O): $(CMSMVS_P)cmsmvs.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(CMSMVS_P)cmsmvs.c - -$(BLD_P)mvs$(O): $(CMSMVS_P)mvs.c $(HFILES) - $(CC) -c -o $% $(CFLAGS) $(CMSMVS_P)mvs.c diff --git a/third_party/infozip/zip/cmsmvs/pipzip.rexx b/third_party/infozip/zip/cmsmvs/pipzip.rexx deleted file mode 100644 index 4249ded51..000000000 --- a/third_party/infozip/zip/cmsmvs/pipzip.rexx +++ /dev/null @@ -1,27 +0,0 @@ -/* PIPZIP REXX Rexx filter to use ZIP */ -/* Author : George Petrov, 8 May 1995 */ - -parse arg opts -'callpipe *:', - '| specs w1 1 /./ n w2 n', - '| join * / /', - '| specs /zip 'opts'/ 1 1-* nw', - '| cms', - '| *:' - -exit rc - - - - - - - - - - - - - - - diff --git a/third_party/infozip/zip/cmsmvs/zip.exec b/third_party/infozip/zip/cmsmvs/zip.exec deleted file mode 100644 index 0b9de97c5..000000000 --- a/third_party/infozip/zip/cmsmvs/zip.exec +++ /dev/null @@ -1,66 +0,0 @@ -/***********************************************************************/ -/* */ -/* Front-end EXEC to set up linkage to the C runtime libraries */ -/* before executing a MODULE generated from C code. */ -/* */ -/* Copy this file as an EXEC with a filename matching the C MODULE. */ -/* */ -/* Greg Hartwig (ghartwig@vnet.ibm.com) 7/31/97, 4/24/98. */ -/* */ -/***********************************************************************/ -Address Command -Parse Arg argstring -Parse Source . . myname . - -/* Set output and input character translation so brackets show up */ -'SET OUTPUT AD' 'BA'x -'SET OUTPUT BD' 'BB'x -'SET INPUT BA AD' -'SET INPUT BB BD' - -Call CLIB -If rc<>0 Then Do - Say 'The required C runtime libraries don''t appear to be available.' - Say myname 'can not run.' - Exit 12 -End - -/* Run the command */ -myname argstring -Exit rc - - - - -/* Contents of the CLIB EXEC, modified for RC checking. */ -/* Removed TXTLIB setting. Only LOADLIB needed for execution. */ -CLIB: -/***************************************************/ -/* SET UP LIBRARIES FOR LE for MVS & VM */ -/***************************************************/ -Address COMMAND - -loadlib ='EDCLINK' /* C/370 runtime */ -loadlib ='SCEERUN' /* LE runtime */ - - -theirs=queued() /* old stack contentsM068*/ - 'QUERY LOADLIB ( LIFO' /* old setting M068*/ - LoadlibList='' /* init list M068*/ -rc=0 - Do while queued()^=theirs /* all lines from cmdM068*/ - Parse upper pull 'LOADLIB' '=' Ltemp /* get one line M068*/ - LoadlibList= Ltemp Loadliblist /* was stacked LIFO M068*/ - End /*M068*/ - If loadlibList='NONE' , - Then Do - 'GLOBAL LOADLIB' Loadlib /* enforce what we need */ - End - Else Do - Do xx=1 to Words(loadlib) - If Find(loadliblist,word(loadlib,xx)) = 0 , - then loadliblist = loadliblist word(loadlib,xx) - End - 'GLOBAL LOADLIB' loadliblist /* enforce what we need */ - End -Return diff --git a/third_party/infozip/zip/cmsmvs/zip.makefile b/third_party/infozip/zip/cmsmvs/zip.makefile deleted file mode 100644 index 85bef22f7..000000000 --- a/third_party/infozip/zip/cmsmvs/zip.makefile +++ /dev/null @@ -1,21 +0,0 @@ -* This is a comment -* this makefile compiles filter ZIPME - -GLOBALS: - long def(VM_CMS) -TEXT: - trees c - crypt c - ttyio c - deflate c - fileio c - globals c - zip c - util c - crc32.c - zipfile c - zipup c - cmsmvs c - cms c -MODULE: - zip module diff --git a/third_party/infozip/zip/cmsmvs/zipcloak.exec b/third_party/infozip/zip/cmsmvs/zipcloak.exec deleted file mode 100644 index 0b9de97c5..000000000 --- a/third_party/infozip/zip/cmsmvs/zipcloak.exec +++ /dev/null @@ -1,66 +0,0 @@ -/***********************************************************************/ -/* */ -/* Front-end EXEC to set up linkage to the C runtime libraries */ -/* before executing a MODULE generated from C code. */ -/* */ -/* Copy this file as an EXEC with a filename matching the C MODULE. */ -/* */ -/* Greg Hartwig (ghartwig@vnet.ibm.com) 7/31/97, 4/24/98. */ -/* */ -/***********************************************************************/ -Address Command -Parse Arg argstring -Parse Source . . myname . - -/* Set output and input character translation so brackets show up */ -'SET OUTPUT AD' 'BA'x -'SET OUTPUT BD' 'BB'x -'SET INPUT BA AD' -'SET INPUT BB BD' - -Call CLIB -If rc<>0 Then Do - Say 'The required C runtime libraries don''t appear to be available.' - Say myname 'can not run.' - Exit 12 -End - -/* Run the command */ -myname argstring -Exit rc - - - - -/* Contents of the CLIB EXEC, modified for RC checking. */ -/* Removed TXTLIB setting. Only LOADLIB needed for execution. */ -CLIB: -/***************************************************/ -/* SET UP LIBRARIES FOR LE for MVS & VM */ -/***************************************************/ -Address COMMAND - -loadlib ='EDCLINK' /* C/370 runtime */ -loadlib ='SCEERUN' /* LE runtime */ - - -theirs=queued() /* old stack contentsM068*/ - 'QUERY LOADLIB ( LIFO' /* old setting M068*/ - LoadlibList='' /* init list M068*/ -rc=0 - Do while queued()^=theirs /* all lines from cmdM068*/ - Parse upper pull 'LOADLIB' '=' Ltemp /* get one line M068*/ - LoadlibList= Ltemp Loadliblist /* was stacked LIFO M068*/ - End /*M068*/ - If loadlibList='NONE' , - Then Do - 'GLOBAL LOADLIB' Loadlib /* enforce what we need */ - End - Else Do - Do xx=1 to Words(loadlib) - If Find(loadliblist,word(loadlib,xx)) = 0 , - then loadliblist = loadliblist word(loadlib,xx) - End - 'GLOBAL LOADLIB' loadliblist /* enforce what we need */ - End -Return diff --git a/third_party/infozip/zip/cmsmvs/zipmvsc.job b/third_party/infozip/zip/cmsmvs/zipmvsc.job deleted file mode 100644 index 3c786d731..000000000 --- a/third_party/infozip/zip/cmsmvs/zipmvsc.job +++ /dev/null @@ -1,89 +0,0 @@ -//CCZIP JOB (BI09255), -// MSGLEVEL=(1,1),MSGCLASS=C,CLASS=D,NOTIFY=C888090 -//PROCLIB JCLLIB ORDER=(SYS1.C370.PROCLIB.M24) -//ZIP EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(ZIP)', -// OUTFILE='C888090.ZIP.C.OBJ(ZIP),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//CRYPT EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(CRYPT)', -// OUTFILE='C888090.ZIP.C.OBJ(CRYPT),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//TTYIO EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(TTYIO)', -// OUTFILE='C888090.ZIP.C.OBJ(TTYIO),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//TREES EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(TREES)', -// OUTFILE='C888090.ZIP.C.OBJ(TREES),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//DEFLATE EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(DEFLATE)', -// OUTFILE='C888090.ZIP.C.OBJ(DEFLATE),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//FILEIO EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(FILEIO)', -// OUTFILE='C888090.ZIP.C.OBJ(FILEIO),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//GLOBALS EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(GLOBALS)', -// OUTFILE='C888090.ZIP.C.OBJ(GLOBALS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//UTIL EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(UTIL)', -// OUTFILE='C888090.ZIP.C.OBJ(UTIL),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//CRC32 EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(CRC32)', -// OUTFILE='C888090.ZIP.C.OBJ(CRC32),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//ZIPFILE EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(ZIPFILE)', -// OUTFILE='C888090.ZIP.C.OBJ(ZIPFILE),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//ZIPUP EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(ZIPUP)', -// OUTFILE='C888090.ZIP.C.OBJ(ZIPUP),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//CMSMVS EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(CMSMVS)', -// OUTFILE='C888090.ZIP.C.OBJ(CMSMVS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//MVS EXEC EDCC,COND=(12,LE),CREGSIZ='4M', -// INFILE='C888090.ZIP.C(MVS)', -// OUTFILE='C888090.ZIP.C.OBJ(MVS),DISP=SHR', -// CPARM='LONG,NOTERM,LIST,XREF,SOURCE,OPT(2),DEF(MVS)' -//COMPILE.USERLIB DD DSN=C888090.ZIP.H,DISP=SHR -//PLINK EXEC PROC=EDCPL,COND=(12,LE), -// OUTFILE='C888090.ZIP.LOAD(ZIP),DISP=SHR', -// PPARM='NONCAL,MAP', -// LPARM='LIST,MAP,XREF' -//SYSPRINT DD SYSOUT=* -//PLKED.SYSIN DD DSN=C888090.ZIP.C.OBJ(ZIP),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(BITS),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(CRYPT),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(TREES),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(DEFLATE),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(FILEIO),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(GLOBALS),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(UTIL),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(CRC32),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(ZIPFILE),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(ZIPUP),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(CMSMVS),DISP=SHR -// DD DSN=C888090.ZIP.C.OBJ(MVS),DISP=SHR -//PLKED.SYSLIB DD DSN=SYS1.C370.SEDCBASE,DISP=SHR -// DD DSN=SYS1.PL1.SIBMBASE,DISP=SHR -//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(2,2)),DISP=NEW diff --git a/third_party/infozip/zip/cmsmvs/zipname.conven b/third_party/infozip/zip/cmsmvs/zipname.conven deleted file mode 100644 index e17fe9c1e..000000000 --- a/third_party/infozip/zip/cmsmvs/zipname.conven +++ /dev/null @@ -1,200 +0,0 @@ - - Zip file/directories name convention under MVS - --------------------------------------------------- - Draft 1.1 - - -1. Translating native file names to Zip filenames. - -1.1 Zipping a PDS - -On MVS there are directories called PDS (Partition Data Set) which have -the following format : name1.name2.name3(mname) -for example: myuserid.unzip.c(unzip) - -So as you see the path delimiter is '.'. Each dir name can be max 8 -chars long beginning with a number. - -Between '(' and ')' there is the so called member name - it is also 8 -chars long. This is the actual file name. - - -1.1.1 Converting MVS PDS name to zip path/filename (status: not implemented) - -The PDS name is converted to zippath as follows: -in the zip : name1/name2/mname.name3 -becomes on MVS: name1.name2.name3(mname) - - -1.2 Unzipping as PDS (status: implemented) - -When you unzip the file name myuserid/unzip/unzip.c the same process -is done backwards, so you get : myuserid.unzip.c(unzip) - -Notice that the file extension is used as last dirname! - - -1.2 Unzipping to a different PDS (status: implemented) - -You can also use -d option while unzipping for example: -unzip mytest myuserid/unzip/unzip.c -dnewdest.test - -then the new name will become: -newdest.test.myuserid.unzip.c(unzip) - - Second example: - -unzip mytest myuserid/unzip/*.c -dnewdest.test - -then you get a PDS: -newdest.test.myuserid.unzip.c(...) - -with all *.c files in it. - - -1.3 Zipping a Sequential Dataset (status: not implemented) - - Sequential dataset is a dataset with NO members. -Such a dataset is translated from native MVS to zip format by replacing -the '.' (points) with '/' (backslash). - -Example: -on MVS: name1.name2.name3 -becomes in the zip : name1/name2/name3 - -NOTE : The new filename in the zip has NO extension this way it can be - recognised as a Sequential dataset and not a PDS. - But this also means that all files in the zip archive that have - no extension will be unzipped as Sequential datasets! - - -1.4 Using a DDNAMES for input. (status: not implemented) - -To use DDNAMES as input file names put a 'dd:' before the ddname: -example: zip myzip dd:name1 dd:name2 dd:sales - -In the Zip archive the ddnames are saved as name.DDNAME so if you try -the example above you will get in your zip file (when listing it) : - -..size .. date time .. crc .. NAME1.DDNAME -..size .. date time .. crc .. NAME2.DDNAME -..size .. date time .. crc .. SALES.DDNAME - - -1.4 Using a DDNAMES as zip name (status: implemented) - -It is allowed to use a DDNAME as zipfile, just put dd: before it -example: unzip dd:myzip *.c - this will unzip all .c files from ddname myzip - -example2: ZIP DD:MYZIP DD:MANE1 MYSOURCE.C MYDOC.TEXT(ZIPPING) - this will zip ddname name1 file mysource.c and PDS mydoc.text(zipping) - into as a zip file in the ddname myzip - - -2. Converting longer path names (unix like) (status: not implemented) - to native MVS names. - -When in the zip archive there are dirnames longer that 8 chars they are -chopped at the 8 position. For example - MyLongZippath/WithLongFileName.text -is translated to: - MYLONGZI.TEXT(WITHLONG) - -Notice that all chars are converted to uppercase. - - -2.1 Using special characters (status: implemented) - -Also all '_' (underscore), '+' (plus), '-' (minus), '(' and ')' -from the file name/path in the zip archive are skipped because they -are not valid in the MVS filenames. - - -2.2 Numeric file names (status: not implemented) - -On MVS no name can begin with a number, so when a dir/file name begins with -one, a leading letter 'N' is inserted. For example: - Contents.512 -becomes: - CONTENTS.N512 - - - - - Zip file/directories name convention under VM/CMS - --------------------------------------------------- - -1. Translating native file names to Zip filenames. - -On VM/CMS (not ESA ) there are NO directories so you got only disks -and files. - -The file names are delimited with spaces. But for use with unzip/zip -you have to use '.' points as delimiters. - -For example on your A disk you have file called PROFILE EXEC -if you want to zip it type : zip myzip profile.exec - -If the same file is on your F disk you have to type: -zip myzip profile.exec.f - -So as you can see the general format is fname.ftype.fmode - -In the zipfile the disk from which the file comes is not saved! -So only the fname.ftype is saved. - -If you unzip and you want to give a different destination disk just use -the -d option like: - - unzip mytest *.c -df - -This will unzip all *.c files to your F disk. - - -2. Converting longer path names (unix like) to native VM/CMS names. - -When in the zip archive there are dirnames longer that 8 chars they are -chopped at the 8 position. Also the path is removed. For example - Zippath/WithLongFileName.text -is translated to: - WITHLONG.TEXT - -Notice that all chars are converted to uppercase. - -Also all '+' (plus), '-' (minus), '(' and ')' -from the file name/path in the zip archive are skipped because they -are not valid in the VM/CMS filenames. - -If there is no extension for the file name in the zip archive, unzip -will add .NONAME for example: - mypath/dir1/testfile -becomes: - TESTFILE.NONAME - -3. Future? - -There is also discussion for a new option on ZIP that you can give -a virtual directory to be added before each file name that is zipped. - -For example you want to zip a few .c file and put them in the zip -structure under the directory 'mydir/test', but you can't create dirs on -VM/CMS so you have to the something like: - -ZIP myzip file1.c file2.c -dmydir/test - -and you get in the zip archive files: - - mydir/test/file1.c - mydir/test/file2.c - -------------------------------------------------------------------------- - - -NOTE: Not all of those functions are implemented in the first beta - release of VM/MVS UNZIP/ZIP. - -Every ideas/corrections/bugs will be appreciated. -Mail to maillist: Info-ZIP@LISTS.WKU.EDU - -George Petrov diff --git a/third_party/infozip/zip/cmsmvs/zipnote.exec b/third_party/infozip/zip/cmsmvs/zipnote.exec deleted file mode 100644 index 0b9de97c5..000000000 --- a/third_party/infozip/zip/cmsmvs/zipnote.exec +++ /dev/null @@ -1,66 +0,0 @@ -/***********************************************************************/ -/* */ -/* Front-end EXEC to set up linkage to the C runtime libraries */ -/* before executing a MODULE generated from C code. */ -/* */ -/* Copy this file as an EXEC with a filename matching the C MODULE. */ -/* */ -/* Greg Hartwig (ghartwig@vnet.ibm.com) 7/31/97, 4/24/98. */ -/* */ -/***********************************************************************/ -Address Command -Parse Arg argstring -Parse Source . . myname . - -/* Set output and input character translation so brackets show up */ -'SET OUTPUT AD' 'BA'x -'SET OUTPUT BD' 'BB'x -'SET INPUT BA AD' -'SET INPUT BB BD' - -Call CLIB -If rc<>0 Then Do - Say 'The required C runtime libraries don''t appear to be available.' - Say myname 'can not run.' - Exit 12 -End - -/* Run the command */ -myname argstring -Exit rc - - - - -/* Contents of the CLIB EXEC, modified for RC checking. */ -/* Removed TXTLIB setting. Only LOADLIB needed for execution. */ -CLIB: -/***************************************************/ -/* SET UP LIBRARIES FOR LE for MVS & VM */ -/***************************************************/ -Address COMMAND - -loadlib ='EDCLINK' /* C/370 runtime */ -loadlib ='SCEERUN' /* LE runtime */ - - -theirs=queued() /* old stack contentsM068*/ - 'QUERY LOADLIB ( LIFO' /* old setting M068*/ - LoadlibList='' /* init list M068*/ -rc=0 - Do while queued()^=theirs /* all lines from cmdM068*/ - Parse upper pull 'LOADLIB' '=' Ltemp /* get one line M068*/ - LoadlibList= Ltemp Loadliblist /* was stacked LIFO M068*/ - End /*M068*/ - If loadlibList='NONE' , - Then Do - 'GLOBAL LOADLIB' Loadlib /* enforce what we need */ - End - Else Do - Do xx=1 to Words(loadlib) - If Find(loadliblist,word(loadlib,xx)) = 0 , - then loadliblist = loadliblist word(loadlib,xx) - End - 'GLOBAL LOADLIB' loadliblist /* enforce what we need */ - End -Return diff --git a/third_party/infozip/zip/cmsmvs/zipsplit.exec b/third_party/infozip/zip/cmsmvs/zipsplit.exec deleted file mode 100644 index 0b9de97c5..000000000 --- a/third_party/infozip/zip/cmsmvs/zipsplit.exec +++ /dev/null @@ -1,66 +0,0 @@ -/***********************************************************************/ -/* */ -/* Front-end EXEC to set up linkage to the C runtime libraries */ -/* before executing a MODULE generated from C code. */ -/* */ -/* Copy this file as an EXEC with a filename matching the C MODULE. */ -/* */ -/* Greg Hartwig (ghartwig@vnet.ibm.com) 7/31/97, 4/24/98. */ -/* */ -/***********************************************************************/ -Address Command -Parse Arg argstring -Parse Source . . myname . - -/* Set output and input character translation so brackets show up */ -'SET OUTPUT AD' 'BA'x -'SET OUTPUT BD' 'BB'x -'SET INPUT BA AD' -'SET INPUT BB BD' - -Call CLIB -If rc<>0 Then Do - Say 'The required C runtime libraries don''t appear to be available.' - Say myname 'can not run.' - Exit 12 -End - -/* Run the command */ -myname argstring -Exit rc - - - - -/* Contents of the CLIB EXEC, modified for RC checking. */ -/* Removed TXTLIB setting. Only LOADLIB needed for execution. */ -CLIB: -/***************************************************/ -/* SET UP LIBRARIES FOR LE for MVS & VM */ -/***************************************************/ -Address COMMAND - -loadlib ='EDCLINK' /* C/370 runtime */ -loadlib ='SCEERUN' /* LE runtime */ - - -theirs=queued() /* old stack contentsM068*/ - 'QUERY LOADLIB ( LIFO' /* old setting M068*/ - LoadlibList='' /* init list M068*/ -rc=0 - Do while queued()^=theirs /* all lines from cmdM068*/ - Parse upper pull 'LOADLIB' '=' Ltemp /* get one line M068*/ - LoadlibList= Ltemp Loadliblist /* was stacked LIFO M068*/ - End /*M068*/ - If loadlibList='NONE' , - Then Do - 'GLOBAL LOADLIB' Loadlib /* enforce what we need */ - End - Else Do - Do xx=1 to Words(loadlib) - If Find(loadliblist,word(loadlib,xx)) = 0 , - then loadliblist = loadliblist word(loadlib,xx) - End - 'GLOBAL LOADLIB' loadliblist /* enforce what we need */ - End -Return diff --git a/third_party/infozip/zip/cmsmvs/zipup.h b/third_party/infozip/zip/cmsmvs/zipup.h deleted file mode 100644 index 0ea8962dd..000000000 --- a/third_party/infozip/zip/cmsmvs/zipup.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow "r,byteseek" -#define fhowb "rb,byteseek" - -#define fbad NULL -typedef FILE *ftype; -#define zopen(n,p) (ftype)fopen((n),(p)) -#define zread(f,b,n) fread((b),1,(n),(FILE*)(f)) -#define zclose(f) fclose((FILE*)(f)) -#define zerr(f) ferror((FILE*)(f)) -#define zstdin stdin diff --git a/third_party/infozip/zip/cmsmvs/zipvmc.exec b/third_party/infozip/zip/cmsmvs/zipvmc.exec deleted file mode 100644 index 3fdd800df..000000000 --- a/third_party/infozip/zip/cmsmvs/zipvmc.exec +++ /dev/null @@ -1,48 +0,0 @@ -/* VMCOMPIL EXEC Unzip compile for VM/CMS */ -/* Author : George Petrov, 11 Apr 1995 */ - -signal on error - -parms = '(long def(VM_CMS)' - -/* Add local parms */ -parms = parms 'TARGET(COMPAT) SOURCE' - - -say 'Compiling TREES C...' -'cc trees c 'parms -say 'Compiling CRYPT C...' -'cc crypt c 'parms -say 'Compiling TTYIO C...' -'cc ttyio c 'parms -say 'Compiling DEFLATE C...' -'cc deflate c 'parms -say 'Compiling FILEIO C...' -'cc fileio c 'parms -say 'Compiling GLOBALS C...' -'cc globals c 'parms -say 'Compiling ZIP C...' -'cc zip c 'parms -say 'Compiling UTIL C...' -'cc util c 'parms -say 'Compiling CRC32 C...' -'cc crc32 c 'parms -say 'Compiling ZIPFILE C...' -'cc zipfile c 'parms -say 'Compiling ZIPUP C...' -'cc zipup c 'parms -say 'Compiling CMSMVS C...' -'cc cmsmvs c 'parms -say 'Compiling CMS C...' -'cc cms c 'parms - -say 'Linking all files...' -'cmod zip zip trees crypt deflate fileio globals ttyio', - 'util crc32 zipfile zipup cmsmvs cms' -say 'All Done!' -say "To run enter : ZIP parms" -exit rc - -error: -say 'Error durring compilation!' -exit rc diff --git a/third_party/infozip/zip/crc32.c b/third_party/infozip/zip/crc32.c index 6b2403b08..ac1459f82 100644 --- a/third_party/infozip/zip/crc32.c +++ b/third_party/infozip/zip/crc32.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* Copyright (c) 1990-2008 Info-ZIP. All rights reserved. @@ -21,7 +22,7 @@ #define __CRC32_C /* identifies this source module */ -#include "zip.h" +#include "third_party/infozip/zip/zip.h" #if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) @@ -29,7 +30,7 @@ # define ZCONST const #endif -#include "crc32.h" +#include "third_party/infozip/zip/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 diff --git a/third_party/infozip/zip/crc32.h b/third_party/infozip/zip/crc32.h index 83af2404c..05e9de1be 100644 --- a/third_party/infozip/zip/crc32.h +++ b/third_party/infozip/zip/crc32.h @@ -1,3 +1,4 @@ +/* clang-format off */ /* Copyright (c) 1990-2008 Info-ZIP. All rights reserved. diff --git a/third_party/infozip/zip/crypt.c b/third_party/infozip/zip/crypt.c index cc974ecb4..f0eb037bd 100644 --- a/third_party/infozip/zip/crypt.c +++ b/third_party/infozip/zip/crypt.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* Copyright (c) 1990-2008 Info-ZIP. All rights reserved. @@ -30,9 +31,10 @@ */ #define ZCRYPT_INTERNAL -#include "zip.h" -#include "crypt.h" -#include "ttyio.h" +#include "third_party/infozip/zip/zip.h" +#include "third_party/infozip/zip/crypt.h" +#include "third_party/infozip/zip/ttyio.h" +#include "libc/rand/rand.h" #if CRYPT @@ -74,7 +76,7 @@ as a fallback to allow successful compilation in "beta state" environments. */ -# include /* time() function supplies first part of crypt seed */ +# include "libc/time/time.h" /* 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 */ @@ -106,7 +108,7 @@ # endif #endif -#include "crc32.h" +#include "third_party/infozip/zip/crc32.h" #ifdef IZ_CRC_BE_OPTIMIZ local z_uint4 near crycrctab[256]; diff --git a/third_party/infozip/zip/crypt.h b/third_party/infozip/zip/crypt.h index 61f3234c1..0d8c54abd 100644 --- a/third_party/infozip/zip/crypt.h +++ b/third_party/infozip/zip/crypt.h @@ -1,3 +1,4 @@ +/* clang-format off */ /* Copyright (c) 1990-2007 Info-ZIP. All rights reserved. @@ -140,7 +141,6 @@ void init_keys OF((__GPRO__ ZCONST char *passwd)); int zipbare OF((struct zlist far *, ZCONST char *)); # else unsigned zfwrite OF((zvoid *, extent, extent)); - extern char *key; # endif #endif /* ZIP */ diff --git a/third_party/infozip/zip/deflate.c b/third_party/infozip/zip/deflate.c index c830854f9..c6b4b83f6 100644 --- a/third_party/infozip/zip/deflate.c +++ b/third_party/infozip/zip/deflate.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* deflate.c - Zip 3 @@ -69,7 +70,7 @@ #define __DEFLATE_C -#include "zip.h" +#include "third_party/infozip/zip/zip.h" #ifndef USE_ZLIB diff --git a/third_party/infozip/zip/ebcdic.h b/third_party/infozip/zip/ebcdic.h index a52de1e62..044097965 100644 --- a/third_party/infozip/zip/ebcdic.h +++ b/third_party/infozip/zip/ebcdic.h @@ -1,3 +1,4 @@ +/* clang-format off */ /* ebcdic.h diff --git a/third_party/infozip/zip/file_id.diz b/third_party/infozip/zip/file_id.diz deleted file mode 100644 index 5e3f34edf..000000000 --- a/third_party/infozip/zip/file_id.diz +++ /dev/null @@ -1,15 +0,0 @@ -Info-ZIP's Zip 3.0: generic C sources. - Complete C source code for Info-ZIP's - PKZIP-compatible .zip archiver, for - all supported compilers and platforms - (Unix, OS/2, MS-DOS, NT, VMS, Amiga, - Atari, Mac, Acorn, VM/CMS, etc.), plus - lots of pretty decent documentation. - Includes Info-ZIP's ZCrypt 2.9 for - PKWARE-compatible standard encryption - and decryption support for Info-ZIP's - Zip 2.32, Zip 3.0, UnZip 5.52, - UnZip 6.0, and WiZ 5.02 (and later). -This is FREE (but copyrighted) software. -See LICENSE for details on distribution -and reuse. diff --git a/third_party/infozip/zip/fileio.c b/third_party/infozip/zip/fileio.c index 1847e62ee..6450d5477 100644 --- a/third_party/infozip/zip/fileio.c +++ b/third_party/infozip/zip/fileio.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* fileio.c - Zip 3 @@ -13,8 +14,8 @@ */ #define __FILEIO_C -#include "zip.h" -#include "crc32.h" +#include "third_party/infozip/zip/zip.h" +#include "third_party/infozip/zip/crc32.h" #ifdef MACOS # include "helpers.h" @@ -24,7 +25,12 @@ # include "vms/vms.h" #endif /* def VMS */ -#include +#include "libc/fmt/fmt.h" +#include "libc/alg/alg.h" +#include "libc/stdio/temp.h" +#include "libc/time/time.h" +#include "libc/time/struct/tm.h" +#include "libc/limits.h" #ifdef NO_MKTIME time_t mktime OF((struct tm *)); @@ -33,7 +39,7 @@ time_t mktime OF((struct tm *)); #ifdef OSF #define EXDEV 18 /* avoid a bug in the DEC OSF/1 header files. */ #else -#include +#include "libc/errno.h" #endif #ifdef NO_ERRNO @@ -43,7 +49,7 @@ extern int errno; /* ----------------------- For long option support ----------------------- */ -#include +#include "libc/str/str.h" #if defined(VMS) || defined(TOPS20) diff --git a/third_party/infozip/zip/globals.c b/third_party/infozip/zip/globals.c index e73392adc..5fb193a5c 100644 --- a/third_party/infozip/zip/globals.c +++ b/third_party/infozip/zip/globals.c @@ -1,3 +1,4 @@ +/* clang-format off */ /* globals.c - Zip 3 @@ -18,7 +19,7 @@ #define UTIL /* do not declare the read_buf variable */ #endif -#include "zip.h" +#include "third_party/infozip/zip/zip.h" /* Handy place to build error messages */ diff --git a/third_party/infozip/zip/human68k/Makefile b/third_party/infozip/zip/human68k/Makefile deleted file mode 100644 index be1a8b705..000000000 --- a/third_party/infozip/zip/human68k/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for human68k -# Written by NIIMI Satoshi -# -# 1999/09/23: Modified by Shimazaki Ryo. - -ifeq "$(TARGET)" "X68030" -COPT = -m68020-40 -AOPT = -m68020 -sCPU020 -LDFLAGS = -L/usr/local/lib/lib060 -endif - -VPATH = human68k - -CC = gcc2 -CFLAGS = $(COPT) -I. -Wall -O2 -fomit-frame-pointer -fstrength-reduce \ - -DASM_CRC -D__DOS_INLINE__ -#LDFLAGS = -Wl,-x -LIBS = -lhmem -lttyi -lsignal - -AS = g2as -ASFLAGS = $(AOPT) -1 -c4 -y -w2 - -# object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \ - crc32.o human68k.o crc_68.o -OBJI = deflate.o trees.o -OBJA = -OBJU = zipfile_.o fileio_.o util_.o globals.o human68k_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h human68k/osdep.h - -all: zips - -.SUFFIXES: _.o .o .c -.c_.o: - $(CC) $(CFLAGS) -DUTIL -c $< -o $@ -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -ZIPS = zip.x zipnote.x zipsplit.x zipcloak.x - -zips: $(ZIPS) - -zip.x: $(OBJZ) $(OBJI) $(OBJA) - $(CC) $(LDFLAGS) -o $@ $(OBJZ) $(OBJI) $(OBJA) $(LIBS) -zipnote.x: $(OBJN) - $(CC) $(LDFLAGS) -o $@ $(OBJN) $(LIBS) -zipcloak.x: $(OBJC) - $(CC) $(LDFLAGS) -o $@ $(OBJC) $(LIBS) -zipsplit.x: $(OBJS) - $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - - -human68k.o: human68k/human68k.c - $(CC) $(CFLAGS) -c -o $@ $< - -human68k_.o: human68k/human68k.c - $(CC) $(CFLAGS) -c -o $@ $< -DUTIL - -#match.o: human68k/match.s -# $(AS) $(ASFLAGS) -o $@ $< - -deflate.o: human68k/deflate.s - $(AS) $(ASFLAGS) -o $@ $< - -crc_68.o: human68k/crc_68.s - $(AS) $(ASFLAGS) -o $@ $< - - -clean: - rm -f *.o $(ZIPS) - -zip.bfd: $(ZIPS) - rm -f $@ - for file in $(ZIPS); do \ - bdif -A -R uploaded/$$file $$file $@; \ - done - -# rules for zip, zipnote, zipcloak, zipsplit. -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h -zipup.o: human68k/zipup.h - -# EOF diff --git a/third_party/infozip/zip/human68k/Makefile.gcc b/third_party/infozip/zip/human68k/Makefile.gcc deleted file mode 100644 index edf298932..000000000 --- a/third_party/infozip/zip/human68k/Makefile.gcc +++ /dev/null @@ -1,78 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for human68k -# Written by NIIMI Satoshi - -VPATH = human68k - -CC = gcc -AS = as - -# if you are using mc68030 (or higher) based X68000, -# uncomment following defines -#CC = gcc -DUNALIGNED_OK -#AS = as -s UNALIGNED_OK - -CFLAGS = -Wall -O -fomit-frame-pointer -fstrength-reduce -DASMV -LDFLAGS = -s -LIBS = -lsignal -lmb -ldos - -# object file lists -OBJZ = zip.o zipfile.o zipup.o fileio.o util.o crc32.o globals.o \ - crypt.o ttyio.o - -OBJI = deflate.o trees.o -OBJA = match.o human68k.o -OBJU = zipfile_.o fileio_.o util_.o globals.o human68_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h human68k/osdep.h - -all: zips - -.SUFFIXES: _.o .o .c -.c_.o: - $(CC) $(CFLAGS) -DUTIL -c $< -o $@ -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -ZIPS = zip.x zipnote.x zipsplit.x zipcloak.x - -zips: $(ZIPS) - -zip.x: $(OBJZ) $(OBJI) $(OBJA) - $(CC) -o zip.x $(LDFLAGS) $(OBJZ) $(OBJI) $(OBJA) $(LIBS) -zipnote.x: $(OBJN) - $(CC) -o zipnote.x $(LDFLAGS) $(OBJN) $(LIBS) -zipcloak.x: $(OBJC) - $(CC) -o zipcloak.x $(LDFLAGS) $(OBJC) $(LIBS) -zipsplit.x: $(OBJS) - $(CC) -o zipsplit.x $(LDFLAGS) $(OBJS) $(LIBS) - -match.o: human68k/match.s - $(AS) -o $@ $< - -human68_.o: human68k/human68k.c - $(CC) $(CFLAGS) -DUTIL -c -o $@ $< - -clean: - rm -f *.o $(ZIPS) - -zip.bfd: $(ZIPS) - rm -f $@ - for file in $(ZIPS); do \ - bdif -A -R uploaded/$$file $$file $@; \ - done - -# rules for zip, zipnote, zipcloak, zipsplit. -$(OBJZ): $(ZIP_H) -$(OBJI): $(ZIP_H) -$(OBJN): $(ZIP_H) -$(OBJS): $(ZIP_H) -$(OBJC): $(ZIP_H) -zip.o crc32.o crypt.o fileio.o zipfile.o zipup.o: crc32.h -zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h -zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h -zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h -zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h -zipup.o: human68k/zipup.h diff --git a/third_party/infozip/zip/human68k/crc_68.s b/third_party/infozip/zip/human68k/crc_68.s deleted file mode 100644 index 9ce78d8a6..000000000 --- a/third_party/infozip/zip/human68k/crc_68.s +++ /dev/null @@ -1,144 +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 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 -;=========================================================================== -; crc_68 created by Paul Kienitz, last modified 04 Jan 96. -; -; Return an updated 32 bit CRC value, given the old value and a block of data. -; The CRC table used to compute the value is gotten by calling get_crc_table(). -; This replaces the older updcrc() function used in Zip and fUnZip. The -; prototype of the function is: -; -; ulg crc32(ulg crcval, uch *text, extent textlen); -; -; On the Amiga, type extent is always unsigned long, not unsigned int, because -; int can be short or long at whim, but size_t is long. -; -; If using this source on a non-Amiga 680x0 system, note that we treat -; a0/a1/d0/d1 as scratch registers not preserved across function calls. -; We do not bother to support registerized arguments for crc32() -- the -; textlen parm is usually large enough so that savings outside the loop -; are pointless. -; -; Define NO_UNROLLED_LOOPS to use a simple short loop which might be more -; efficient on certain machines with dinky instruction caches ('020?), or for -; processing short strings. If loops are unrolled, the textlen parm must be -; less than 512K; if not unrolled, it must be less than 64K. -; -; 1999/09/23: for Human68k: Modified by Shimazaki Ryo. - - xdef _crc32 ; (ulg val, uch *buf, extent bufsize) - -DO_CRC0 MACRO - moveq #0,ltemp - move.b (textbuf)+,ltemp - eor.b crcval,ltemp - lsl.w #2,ltemp - move.l (crc_table,ltemp.w),ltemp - lsr.l #8,crcval - eor.l ltemp,crcval - ENDM - - -DO_CRC2 MACRO - move.b (textbuf)+,btemp - eor.b crcval,btemp - lsr.l #8,crcval - move.l (crc_table,btemp.w*4),ltemp - eor.l ltemp,crcval - ENDM - -crc_table reg a0 array of unsigned long -crcval reg d0 unsigned long initial value -textbuf reg a1 array of unsigned char -textbufsize reg d1 unsigned long (count of bytes in textbuf) -btemp reg d2 -ltemp reg d3 - - - xref _get_crc_table ; ulg *get_crc_table(void) - - - - quad -_crc32: - move.l 8(sp),d0 - bne.s valid -;;;;; moveq #0,d0 - rts -valid: movem.l btemp/ltemp,-(sp) - jsr _get_crc_table - movea.l d0,crc_table - move.l 12(sp),crcval - move.l 16(sp),textbuf - move.l 20(sp),textbufsize - not.l crcval - - ifdef NO_UNROLLED_LOOPS - - if CPU==68000 - bra.s decr -loop: DO_CRC0 -decr: dbra textbufsize,loop - bra.s done - - else -twenty: moveq #0,btemp - bra.s decr2 -loop2: DO_CRC2 -decr2: dbra textbufsize,loop2 - endif - - ELSE ; !NO_UNROLLED_LOOPS - - if CPU==68000 - moveq #7,btemp - and textbufsize,btemp - lsr.l #3,textbufsize - bra decr8 -loop8: DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 - DO_CRC0 -decr8: dbra textbufsize,loop8 - bra.s decr1 -loop1: DO_CRC0 -decr1: dbra btemp,loop1 - bra done - - else -twenty: moveq #0,btemp - move.l textbufsize,-(sp) - lsr.l #3,textbufsize - bra decr82 - quad -loop82: DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 - DO_CRC2 -decr82: dbra textbufsize,loop82 - moveq #7,textbufsize - and.l (sp)+,textbufsize - bra.s decr12 -loop12: DO_CRC2 -decr12: dbra textbufsize,loop12 - endif - - ENDC ; ?NO_UNROLLED_LOOPS - -done: movem.l (sp)+,btemp/ltemp - not.l crcval -;;;;; move.l crcval,d0 ; crcval already is d0 - rts diff --git a/third_party/infozip/zip/human68k/deflate.s b/third_party/infozip/zip/human68k/deflate.s deleted file mode 100644 index 246962c1e..000000000 --- a/third_party/infozip/zip/human68k/deflate.s +++ /dev/null @@ -1,1076 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -; -; See the accompanying file LICENSE, version 1999-Oct-05 or later -; (the contents of which are also included in zip.h) for terms of use. -; If, for some reason, both of these files are missing, the Info-ZIP license -; also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -;=========================================================================== -; This is a 680x0 assembly language translation of the Info-ZIP source file -; deflate.c, by Paul Kienitz. No rights reserved. The function longest_match -; is based in part on match.a by Carsten Steger, which in turn is partly based -; on match.s for 386 by Jean-loup Gailly and Kai Uwe Rommel. Mostly, however, -; this material is based on deflate.c, by Gailly, Rommel, and Igor Mandrichenko. -; This code is not commented very much; see deflate.c for comments that explain -; what the functions are doing. -; -; The symbols that can be used to select different versions are as follows: -; -; CPU020 if defined, use 68020 instructions always. -; -; CPUTEST if defined, check at runtime for CPU type. Another symbol -; specifying the platform-specific test must be used with this. -; If neither of these is defined, use 68000 instructions only. -; Runtime test is nonportable; it is different for each OS. -; -; AMIGA use Amiga-specific test for 68020, if CPUTEST defined. Also -; tells it that registers d0/a0/d1/a1 are not preserved by -; function calls. At present, if AMIGA is not defined, it -; causes functions to preserve all registers. ALL OF THIS CODE -; CURRENTLY ASSUMES THAT REGISTERS D2-D7/A2-A6 WILL BE PRESERVED -; BY ANY FUNCTIONS THAT IT CALLS. -; -; DYN_ALLOC should be defined here if it is defined for C source; tells us -; that big arrays are allocated instead of static. -; -; WSIZE must be defined as the same number used for WSIZE in the C -; source, and must be a power of two <= 32768. As elsewhere, -; the default value is 32768. -; -; INT16 define this if ints are 16 bits; otherwise 32 bit ints assumed. -; -; SMALL_MEM define this if it is defined in the C source; otherwise it uses -; the MEDIUM_MEM model. BIG_MEM and MMAP are *not* supported. -; The FULL_SEARCH option in deflate.c is also not supported. -; -; DEBUG activates some tracing output, as in the C source. -; -; QUADLONG this selects a different version of the innermost longest_match -; loop code for 68020 operations, comparing bytes four at a time -; instead of two at a time. It seems to be a tiny bit faster on -; average, but it's slower often enough that one can't generalize. -; -; This code currently assumes that function results are returned in D0 for -; all platforms. It assumes that args to functions are pushed onto the stack, -; last arg first. It also currently assumes that all C symbols have an -; underscore prepended when referenced from assembly. -; -; 1999/09/23: for Human68k: Modified by Shimazaki Ryo. - - IFNDEF CPU020 - IFNDEF CPUTEST -CPU000 equ 1 - ENDC - ENDC - -; Use these macros for accessing variables of type int: - IFDEF INT16 -MOVINT MACRO _1,_2 - move.w _1,_2 - ENDM -CLRINT MACRO _1 - clr.w _1 - ENDM -INTSIZE equ 2 - ELSE ; !INT16 -MOVINT MACRO _1,_2 - move.l _1,_2 - ENDM -CLRINT MACRO _1 - clr.l _1 - ENDM -INTSIZE equ 4 - ENDC - - IFDEF DYN_ALLOC -BASEPTR MACRO _1,_2 - move.l _1,_2 - ENDM - ELSE -BASEPTR MACRO _1,_2 - lea _1,_2 - ENDM - ENDC - -; constants we use, many of them adjustable: - -MAX_MATCH equ 258 -MIN_MATCH equ 3 -TOO_FAR equ 4096 - IFNDEF WSIZE -WSIZE equ 32768 - ENDC -WMASK equ WSIZE-1 -MAX_DIST equ WSIZE-MAX_MATCH-MIN_MATCH-1 -MIN_LOOKAHEAD equ MAX_MATCH+MIN_MATCH+1 -; IFD BIG_MEM ; NOT supported -- type Pos needs to be 32 bits -;HASH_BITS equ 15 -; ELSE - IFDEF SMALL_MEM -HASH_BITS equ 13 - ELSE -HASH_BITS equ 14 ; default -- MEDIUM_MEM - ENDC -; ENDC ; BIG_MEM -HASH_SIZE equ 1< - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b -1(Window,Strst.l),d0 - movem.l d2/a2,-(sp) - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally - addq #2*INTSIZE,sp - movem.l (sp)+,d2/a2 - tst.w d0 - beq.s skipliteral - FLUSH_B 0 - move.l Strst,_block_start -skipliteral: - addq.w #1,Strst - subq.w #1,Look - -refill: - cmp.w #MIN_LOOKAHEAD,Look - bhs look_loop - bsr fill_window - bra look_loop - -last_tally: - tst.w Avail - beq last_flush - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b -1(Window,Strst.l),d0 - movem.l d2/a2,-(sp) - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally - addq #2*INTSIZE,sp - movem.l (sp)+,d2/a2 -last_flush: - FLUSH_B 1 - bra deflate_exit - -; ================== This is another version used for low compression levels: - -deflate_fast: - moveq #0,MatchL - moveq #MIN_MATCH-1,PrevL -flook_loop: - tst.w Look - beq flast_flush - - IN_STR a0,d0 - tst.w Head - beq.s fno_new_match - move.w Strst,d0 - sub.w Head,d0 - cmp.w #MAX_DIST,d0 - bhi.s fno_new_match - move.w PrevL,prev_length ; longest_match reads these variables - MOVINT Strst,_strstart - MOVINT Head,d0 ; parm for longest_match - bsr longest_match ; sets match_start - cmp.w Look,d0 ; does length exceed valid data? - bls.s fstml - move.w Look,d0 -fstml: move.w d0,MatchL ; valid length of match - -fno_new_match: - cmp.w #MIN_MATCH,MatchL - blo fliteral - ; CHECK_MATCH Strst,match_start,MatchL - MOVINT Strst,_strstart ; ct_tally reads this variable - move.l MatchL,d0 - subq.w #MIN_MATCH,d0 - movem.l d2/a2,-(sp) - MOVINT d0,-(sp) - move.l Strst,d0 - sub.w (match_start,pc),d0 - MOVINT d0,-(sp) - jsr _ct_tally ; sets d0 true if we have to flush - addq #2*INTSIZE,sp - movem.l (sp)+,d2/a2 - sub.w MatchL,Look - cmp.w (max_lazy_match,pc),MatchL - bhi ftoolong - subq.w #2,MatchL -finsertmatch: - addq.w #1,Strst - IN_STR a0,d1 ; preserve d0 - dbra MatchL,finsertmatch - moveq #0,MatchL ; not needed? - addq.w #1,Strst - bra.s flushfill - -ftoolong: - add.w MatchL,Strst - moveq #0,MatchL - moveq #0,d1 ; preserve d0 - move.b (Window,Strst.l),d1 - move.w d1,ins_h -; My assembler objects to passing <1(Window,Strst.l)> directly to UP_HASH... - move.b 1(Window,Strst.l),Avail ; Avail is not used in deflate_fast - UP_HASH d1,Avail ; preserve d0 - IFNE MIN_MATCH-3 - FAIL needs to UP_HASH another MIN_MATCH-3 times, but with what arg? - ENDC - bra.s flushfill - -fliteral: - TRACE_C <(Window,Strst.l)> - MOVINT Strst,_strstart ; ct_tally reads this variable - moveq #0,d0 - move.b (Window,Strst.l),d0 - movem.l d2/a2,-(sp) - MOVINT d0,-(sp) - CLRINT -(sp) - jsr _ct_tally ; d0 set if we need to flush - addq #2*INTSIZE,sp - movem.l (sp)+,d2/a2 - addq.w #1,Strst - subq.w #1,Look - -flushfill: - tst.w d0 - beq.s frefill - FLUSH_B 0 - move.l Strst,_block_start -frefill: - cmp.w #MIN_LOOKAHEAD,Look - bhs flook_loop - bsr fill_window - bra flook_loop - -flast_flush: - FLUSH_B 1 ; sets our return value - -deflate_exit: - MOVINT Strst,_strstart ; save back cached values - move.w PrevL,prev_length - move.w Look,lookahead - movem.l (sp)+,DEFREGS - rts - - -; ========================================================================= -; void fill_window(void) calls the input function to refill the sliding -; window that we use to find substring matches in. - -More reg Head ; local variable in fill_window -WindTop reg Prev ; local variable used for sliding -SlidIx reg PrevL ; local variable used for sliding - -FWREGS reg d2-d5/a2-a6 ; does NOT include Look and Strst -; all registers available to be clobbered by the sliding operation: -; we exclude More, WindTop, SlidIx, Look, Strst, Window, a4 and a7. -SPAREGS reg d0-d3/a0-a1/a5-a6 -SPCOUNT equ 8 ; number of registers in SPAREGS - - -_fill_window: ; C-callable entry point - movem.l Look/Strst,-(sp) - IFDEF INT16 - moveq #0,Strst ; Strst must be valid as a long - ENDC - MOVINT (_strstart,pc),Strst - move.w (lookahead,pc),Look - BASEPTR _window,Window - bsr.s fill_window - MOVINT Strst,_strstart - move.w Look,lookahead - movem.l (sp)+,Look/Strst - rts - -; strstart, lookahead, and window must be cached in Strst, Look, and Window: -fill_window: ; asm-callable entry point - movem.l FWREGS,-(sp) - move.w (eofile,pc),d0 ; we put this up here for speed - bne fwdone - and.l #$FFFF,Look ; make sure Look is valid as long -fw_refill: - move.l (_window_size,pc),More ; <= 64K - sub.l Look,More - sub.l Strst,More ; Strst is already valid as long - cmp.w #EOF,More - bne.s notboundary - subq.w #1,More - bra checkend - -notboundary: - move.w (sliding,pc),d0 - beq checkend - cmp.w #WSIZE+MAX_DIST,Strst - blo checkend - IF (32768-WSIZE)>0 - lea WSIZE(Window),WindTop ; WindTop is aligned when Window is - ELSE - move.l Window,WindTop - add.l #WSIZE,WindTop - ENDC - move.l Window,d0 - and.w #3,d0 - beq.s isaligned - subq.w #1,d0 -align: move.b (WindTop)+,(Window)+ ; copy up to a longword boundary - dbra d0,align -isaligned: -; This is faster than a simple move.l (WindTop)+,(Window)+ / dbra loop: - move.w #(WSIZE-1)/(4*SPCOUNT),SlidIx -slide: movem.l (WindTop)+,SPAREGS ; copy, 32 bytes at a time! - movem.l SPAREGS,(Window) ; a slight overshoot doesn't matter. - lea 4*SPCOUNT(Window),Window ; can't use (aN)+ as movem.l dest - dbra SlidIx,slide - BASEPTR _window,Window ; restore cached value - sub.w #WSIZE,match_start - sub.w #WSIZE,Strst - sub.l #WSIZE,_block_start - add.w #WSIZE,More - BASEPTR _head,a0 - move.w #HASH_SIZE-1,d0 -fixhead: - move.w (a0),d1 - sub.w #WSIZE,d1 - bpl.s headok - moveq #0,d1 -headok: move.w d1,(a0)+ - dbra d0,fixhead - BASEPTR _prev,a0 - move.w #WSIZE-1,d0 -fixprev: - move.w (a0),d1 - sub.w #WSIZE,d1 - bpl.s prevok - moveq #0,d1 -prevok: move.w d1,(a0)+ - dbra d0,fixprev - TRACE_C #'.' - - move _verbose+INTSIZE-2,d0 - beq checkend - movem.l d2/a2,-(sp) - xref _print_period - jsr _print_period - movem.l (sp)+,d2/a2 - -checkend: ; assert eofile is false - movem.l d2/a2,-(sp) - MOVINT More,-(sp) ; assert More's upper word is zero - move.l Strst,d0 - add.w Look,d0 - add.l Window,d0 - move.l d0,-(sp) - move.l _read_buf,a0 - jsr (a0) ; refill the upper part of the window - addq #4+INTSIZE,sp - movem.l (sp)+,d2/a2 - tst.w d0 - beq.s iseof - cmp.w #EOF,d0 - beq.s iseof - add.w d0,Look - cmp.w #MIN_LOOKAHEAD,Look - blo fw_refill ; eofile is still false - - bra.s fwdone -iseof: move.w #1,eofile -fwdone: movem.l (sp)+,FWREGS - rts - - -; ========================================================================= -; void lm_free(void) frees dynamic arrays in the DYN_ALLOC version. - -;;; xdef _lm_free ; the entry point - -_lm_free: - IFDEF DYN_ALLOC - move.l _window,d0 - beq.s lf_no_window - movem.l d2/a2,-(sp) - move.l d0,-(sp) - jsr _free - addq #4,sp - movem.l (sp)+,d2/a2 - clr.l _window -lf_no_window: - move.l _prev,d0 - beq.s lf_no_prev - movem.l d2/a2,-(sp) - move.l d0,-(sp) - jsr _free - move.l _head,(sp) ; reuse the same stack arg slot - jsr _free - addq #4,sp - movem.l (sp)+,d2/a2 - clr.l _prev - clr.l _head -lf_no_prev: - ENDC - rts - -; ============================================================================ -; void lm_init(int pack_level, unsigned short *flags) allocates dynamic arrays -; if any, and initializes all variables so that deflate() is ready to go. - -;;; xdef _lm_init ; the entry point - -Level reg d2 -;Window reg a2 ; as in deflate() - -_lm_init: - MOVINT 4(sp),d0 - move.l 4+INTSIZE(sp),a0 - move.w d0,Level - cmp.w #1,Level - blt.s levelerr - bgt.s try9 - bset.b #B_FAST,1(a0) -try9: cmp.w #9,Level - bgt.s levelerr - blt.s levelok - bset.b #B_SLOW,1(a0) - bra.s levelok -levelerr: - pea (level_message,pc) - jsr _error ; never returns -levelok: - clr.w sliding - move.l (_window_size,pc),d0 - bne.s gotawindowsize - move.w #1,sliding - move.l #2*WSIZE,_window_size -gotawindowsize: - - BASEPTR _window,Window - IFDEF DYN_ALLOC - move.l Window,d0 ; fake tst.l - bne.s gotsomewind - CAL_SH WSIZE - move.l d0,Window - move.l d0,_window - bne.s gotsomewind - pea (window_message,pc) - bra error -gotsomewind: - tst.l _prev - bne.s gotsomehead - CAL_SH WSIZE - move.l d0,_prev - beq.s nohead - CAL_SH HASH_SIZE - move.l d0,_head - bne.s gotfreshhead ; newly calloc'd memory is zeroed -nohead: pea (hash_message,pc) -error: MOVINT #ZE_MEM,-(sp) - jsr _ziperr ; never returns -gotsomehead: - ENDC ; DYN_ALLOC - - move.w #(HASH_SIZE/2)-1,d0 ; two shortwords per loop - BASEPTR _head,a0 -wipeh: clr.l (a0)+ - dbra d0,wipeh -gotfreshhead: - move.l Level,d0 - IFEQ Sizeof_config-8 - asl.l #3,d0 - ELSE - mulu #Sizeof_config,d0 - ENDC - lea (config_table,pc),a0 - add.l d0,a0 - move.w Max_lazy(a0),max_lazy_match - move.w Good_length(a0),good_match - move.w Nice_length(a0),nice_match - move.w Max_chain(a0),max_chain_len - CLRINT _strstart - clr.l _block_start - bsr match_init - - clr.w eofile - movem.l d2/a2,-(sp) - MOVINT #WSIZE,-(sp) ; We read only 32K because lookahead is short - move.l Window,-(sp) ; even when int size is long, as if deflate.c - move.l _read_buf,a0 ; were compiled with MAXSEG_64K defined. - jsr (a0) - addq #4+INTSIZE,sp - movem.l (sp)+,d2/a2 - move.w d0,lookahead - beq.s noread - cmp.w #EOF,d0 - bne.s irefill -noread: move.w #1,eofile - clr.w lookahead - bra.s init_done - -irefill: - move.w (lookahead,pc),d0 - cmp.w #MIN_LOOKAHEAD,d0 - bhs.s hashify - bsr _fill_window ; use the C-callable version -hashify: - clr.w ins_h - moveq #MIN_MATCH-2,d0 -hash1: move.b (Window)+,d1 - UP_HASH Level,d1 - dbra d0,hash1 - -init_done: - rts - -; strings for error messages: - IFDEF DYN_ALLOC -hash_message dc.b 'hash table allocation',0 -window_message dc.b 'window allocation',0 - ENDC -level_message dc.b 'bad pack level',0 - - end diff --git a/third_party/infozip/zip/human68k/human68k.c b/third_party/infozip/zip/human68k/human68k.c deleted file mode 100644 index be47b57d6..000000000 --- a/third_party/infozip/zip/human68k/human68k.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include "zip.h" - -#include -#include -#include -#ifndef UTIL -#include -#endif - -#define MATCH shmatch - -#define PAD 0 - - -#ifndef UTIL - -/* Library functions not in (most) header files */ - -int utime OF((char *, ztimbuf *)); - -/* Local functions */ -local char *readd OF((DIR *)); - -local char *readd(DIR* d) -{ - struct dirent* e = readdir(d); - - return e == NULL ? NULL : e->d_name; -} - -int wild(char* w) -{ - struct _filbuf inf; - /* convert FNAMX to malloc - 11/08/04 EG */ - char *name; - char *p; - - if (strcmp(w, "-") == 0) /* if compressing stdin */ - return newname(w, 0, 0); - if ((name = malloc(strlen(w) + 1)) == NULL) { - ZIPERR(ZE_MEM, "wild"); - } - strcpy(name, w); - _toslash(name); - - if ((p = strrchr(name, '/')) == NULL && (p = strrchr(name, ':')) == NULL) - p = name; - else - p++; - if (_dos_lfiles (&inf, w, 0xff) < 0) { - free(name); - return ZE_MISS; - } - do { - int r; - - strcpy(p, inf.name); - r = procname(name, 0); - if (r != ZE_OK) { - free(name); - return r; - } - } while (_dos_nfiles(&inf) >= 0); - free(name); - - return ZE_OK; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s)) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - _toslash(n); - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - - /* Find starting point in name before doing malloc */ - t = (x[0] && x[1] == (char)':') ? x + 2 : x; - while (*t == (char)'/') - t++; - - /* Make changes, if any, to the copied name (leave original intact) */ - _toslash(t); - - if (!pathput) - t = last(t, '/'); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (dosify) - msname(n); - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosify; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - return strcpy(x, n); -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - ztimbuf u; /* argument for utime() */ - - /* Convert DOS time to time_t format in u */ - u.actime = u.modtime = dos2unixtime(d); - - /* Set updated and accessed times of f */ - utime(f, &u); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - isstdin = !strcmp(f, "-"); - - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (isstdin) { - if (fstat(fileno(stdin), &s) != 0) { - free(name); - error("fstat(stdin)"); - } - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - - if (a != NULL) { - int atr = _dos_chmod(name, -1); - - if (atr < 0) - atr = 0x20; - *a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)atr); - } - free(name); - if (n != NULL) - *n = S_ISVOL(s.st_mode) ? -2L : S_ISREG(s.st_mode) ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime(&s.st_mtime); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ -{ -#ifdef USE_EF_UT_TIME - if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(1))) == NULL) - return ZE_MEM; - - z->extra[0] = 'U'; - z->extra[1] = 'T'; - z->extra[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - z->extra[3] = 0; - z->extra[4] = EB_UT_FL_MTIME; - z->extra[5] = (char)(z_utim->mtime); - z->extra[6] = (char)(z_utim->mtime >> 8); - z->extra[7] = (char)(z_utim->mtime >> 16); - z->extra[8] = (char)(z_utim->mtime >> 24); - - z->cext = z->ext = (EB_HEADSIZE+EB_UT_LEN(1)); - z->cextra = z->extra; - - return ZE_OK; -#else /* !USE_EF_UT_TIME */ - return (int)(z-z); -#endif /* ?USE_EF_UT_TIME */ -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - For VMS, d must be in format [x.y]z.dir;1 (not [x.y.z]). - */ -{ - return rmdir(d); -} - -void print_period(void) -{ - fputc('.', stderr); -} - -#endif /* !UTIL */ - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; -#if 0 - char buf[40]; -#endif - - printf(CompiledWith, - -#ifdef __GNUC__ - "gcc ", __VERSION__, -#else -# if 0 - "cc ", (sprintf(buf, " version %d", _RELEASE), buf), -# else - "unknown compiler", "", -# endif -#endif - - "Human68k", -#ifdef __MC68020__ - " (X68030)", -#else - " (X680x0)", -#endif - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ diff --git a/third_party/infozip/zip/human68k/match.s b/third_party/infozip/zip/human68k/match.s deleted file mode 100644 index 4e6bc1ca6..000000000 --- a/third_party/infozip/zip/human68k/match.s +++ /dev/null @@ -1,163 +0,0 @@ -*=========================================================================== -* Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -* -* See the accompanying file LICENSE, version 1999-Oct-05 or later -* (the contents of which are also included in zip.h) for terms of use. -* If, for some reason, both of these files are missing, the Info-ZIP license -* also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*=========================================================================== -* -* match.s -- optional optimized asm version of longest match in deflate.c -* Written by Jean-loup Gailly -* -* Adapted for X68000 by NIIMI Satoshi -* Adapted for the Amiga by Carsten Steger -* using the code in match.S. -* The major change in this code consists of removing all unaligned -* word accesses, because they cause 68000-based machines to crash. -* For maximum speed, UNALIGNED_OK can be defined. -* The program will then only run on 68020-based machines, though. - - -Cur_Match reg d0 ; Must be in d0! -Best_Len reg d1 -Loop_Counter reg d2 -Scan_Start reg d3 -Scan_End reg d4 -Limit reg d5 -Chain_Length reg d6 -Scan_Test reg d7 -Scan reg a0 -Match reg a1 -Prev_Address reg a2 -Scan_Ini reg a3 -Match_Ini reg a4 - -MAX_MATCH equ 258 -MIN_MATCH equ 3 -WSIZE equ 32768 -MAX_DIST equ WSIZE-MAX_MATCH-MIN_MATCH-1 - - - .xref _max_chain_length - .xref _prev_length - .xref _prev - .xref _window - .xref _strstart - .xref _good_match - .xref _match_start - .xref _nice_match - - - .xdef _match_init - .xdef _longest_match - - .text - .even - - -_match_init: - rts - - -_longest_match: - move.l 4(sp),Cur_Match -.ifdef UNALIGNED_OK - movem.l d2-d6/a2-a4,-(sp) -.else - movem.l d2-d7/a2-a4,-(sp) -.endif - move.l _max_chain_length,Chain_Length - move.l _prev_length,Best_Len - lea _prev,Prev_Address - lea _window+MIN_MATCH,Match_Ini - move.l _strstart,Limit - move.l Match_Ini,Scan_Ini - add.l Limit,Scan_Ini - subi.w #MAX_DIST,Limit - bhi.b limit_ok - moveq #0,Limit -limit_ok: - cmp.l _good_match,Best_Len - bcs.b length_ok - lsr.l #2,Chain_Length -length_ok: - subq.l #1,Chain_Length - -.ifdef UNALIGNED_OK - move.w -MIN_MATCH(Scan_Ini),Scan_Start - move.w -MIN_MATCH-1(Scan_Ini,Best_Len.w),Scan_End -.else - move.b -MIN_MATCH(Scan_Ini),Scan_Start - lsl.w #8,Scan_Start - move.b -MIN_MATCH+1(Scan_Ini),Scan_Start - move.b -MIN_MATCH-1(Scan_Ini,Best_Len.w),Scan_End - lsl.w #8,Scan_End - move.b -MIN_MATCH(Scan_Ini,Best_Len.w),Scan_End -.endif - - bra.b do_scan - -long_loop: - -.ifdef UNALIGNED_OK - move.w -MIN_MATCH-1(Scan_Ini,Best_Len.w),Scan_End -.else - move.b -MIN_MATCH-1(Scan_Ini,Best_Len.w),Scan_End - lsl.w #8,Scan_End - move.b -MIN_MATCH(Scan_Ini,Best_Len.w),Scan_End -.endif - -short_loop: - lsl.w #1,Cur_Match - move.w 0(Prev_Address,Cur_Match.l),Cur_Match - cmp.w Limit,Cur_Match - dbls Chain_Length,do_scan - bra.b return - -do_scan: - move.l Match_Ini,Match - add.l Cur_Match,Match - -.ifdef UNALIGNED_OK - cmp.w -MIN_MATCH-1(Match,Best_Len.w),Scan_End - bne.b short_loop - cmp.w -MIN_MATCH(Match),Scan_Start - bne.b short_loop -.else - move.b -MIN_MATCH-1(Match,Best_Len.w),Scan_Test - lsl.w #8,Scan_Test - move.b -MIN_MATCH(Match,Best_Len.w),Scan_Test - cmp.w Scan_Test,Scan_End - bne.b short_loop - move.b -MIN_MATCH(Match),Scan_Test - lsl.w #8,Scan_Test - move.b -MIN_MATCH+1(Match),Scan_Test - cmp.w Scan_Test,Scan_Start - bne.b short_loop -.endif - - move.w #(MAX_MATCH-MIN_MATCH),Loop_Counter - move.l Scan_Ini,Scan -scan_loop: - cmpm.b (Match)+,(Scan)+ - dbne Loop_Counter,scan_loop - - sub.l Scan_Ini,Scan - addq.l #(MIN_MATCH-1),Scan - cmp.l Best_Len,Scan - bls.b short_loop - move.l Scan,Best_Len - move.l Cur_Match,_match_start - cmp.l _nice_match,Best_Len - bcs.b long_loop -return: - move.l Best_Len,d0 -.ifdef UNALIGNED_OK - movem.l (sp)+,d2-d6/a2-a4 -.else - movem.l (sp)+,d2-d7/a2-a4 -.endif - rts - - end diff --git a/third_party/infozip/zip/human68k/osdep.h b/third_party/infozip/zip/human68k/osdep.h deleted file mode 100644 index 088a9ac1c..000000000 --- a/third_party/infozip/zip/human68k/osdep.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#include -#include -#include - -#ifdef ZCRYPT_INTERNAL -# include /* getpid() declaration for srand seed */ -#endif - -#define USE_CASE_MAP - -#define ROUNDED_TIME(time) (((time) + 1) & (~1)) - -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#ifdef HAVE_MBCTYPE_H -# include -#else -# define ismbblead(c) (0x80 <= (c) && ((c) < 0xa0 || 0xe0 <= (c))) -#endif diff --git a/third_party/infozip/zip/human68k/zipup.h b/third_party/infozip/zip/human68k/zipup.h deleted file mode 100644 index 592cff89e..000000000 --- a/third_party/infozip/zip/human68k/zipup.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow (O_RDONLY|O_BINARY) -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/macos/Contents b/third_party/infozip/zip/macos/Contents deleted file mode 100644 index 3aec069cc..000000000 --- a/third_party/infozip/zip/macos/Contents +++ /dev/null @@ -1,63 +0,0 @@ -Contents of the "macos" sub-archive for Zip 2.3 and later: - - -MacOS: - - Contents this file - readme.1st Instruction to unpack mac specific files - README.TXT Dirk Haase's infos on updated MacIntosh ports of Zip/UnZip - HISTORY.TXT Dirk Haase's MacOS specific ChangeLog - - zipup.h MacOS - osdep.h MacOS specific configuration and declarations - - ZipLib.h used to build a static library, global to the project - ZipSx.h used to build a standalone App with MW Sioux, global - to the project - ZpPrj.hqx Metrowerks CodeWarrior pro3 project file (BinHex) - - - source/ subdirectory containing all sources: - a) Zip specific code - extrafld.c contains all code related to the mac extra field - extrafld.h - macglob.h - macopen.c replaces fopen() and open() - macopen.h - macos.c Macintosh-specific routines for use with Info-ZIP's Zip - MatWild.c Pattern matching function - recurse.c Functions to go through the directories - recurse.h - unixlike.c This file provides a unix like file-stat routine - unixlike.h - VolWarn.h contains the warning message, about volumes with the - same name - zip_rc.hqx resource file for Macintosh unzip (BinHex) - - - b) general utilities shared between Zip and UnZip - charmap.h character mapping tables ISO 8859-1 <--> MacRoman - helpers.c some helper functions - helpers.h - macstuff.c Mac filemanager routines copied from MoreFiles 1.4.8 - macstuff.h - mactime.c replacement for broken Metrowerks RTL time functions - pathname.c functions for handling MacOS HFS path- /filenames - pathname.h - -The new ZpPrj.hqx project file should be "un-BinHex'ed" into ZpPrj, -which builds the following targets: - - Zip Lib (68K) -> static library 68k - - Zip Lib (PPC) -> static library PPC - - Zip Sioux (68K) -> MW Sioux standalone App, good for debugging - - Zip Sioux (PPC) -> MW Sioux standalone App, good for debugging - - -The resource files and the compiler project files are in BinHex form because -they contain Macintosh resource forks. The resource info cannot be -maintained when handling (e.g. repacking) the master source collection on -non-Macintosh systems. The BinHex form is the traditional way for -transferring such files via non-Macintosh systems. -It's also the safest since it uses only printable characters. The ".hqx" -files must be converted with StuffitExpander or BinHex 4.0 (or equivalent) -on a Macintosh system before using them. diff --git a/third_party/infozip/zip/macos/HISTORY.TXT b/third_party/infozip/zip/macos/HISTORY.TXT deleted file mode 100644 index 3a14a020d..000000000 --- a/third_party/infozip/zip/macos/HISTORY.TXT +++ /dev/null @@ -1,600 +0,0 @@ -A free Macintosh Port of Info-ZIP's -Zip and UnZip -By Dirk Haase, d_haase@sitec.net -Home page: www.sitec.net/maczip -Mirror page: -www.haase-online.de/dirk/maczip -================================ - - - - - -Release MacZip ver1.07 beta 1 -22. Februray 2001 ------------------ - -1) CHG: {unzip} switch to latest final release - unzip 5.42 - -2) CHG: {zip} switch to latest beta release - zip 2.40a - - - - - -Release MacZip ver1.06 final -22. Februray 2001 ------------------ - -1) CHG: {unzip} switch to latest final release - unzip 5.42 - -2) CHG: switch to latest release of Apples - Universal Interfaces 3.3.2 - -3) CHG: switch to latest release of - Morefiles 1.5 - - - - -Release MacZip ver1.06 beta 2 -02. August 2000 ---------------- - -1) CHG: {unzip} switch to latest beta release - unzip 5.42d - - - - - -Release MacZip ver1.06 beta 1 -27. July 2000 -------------- - -1) CHG: {zip} switch to latest beta release - unzip 2.30 - -2) CHG: {unzip} switch to latest beta release - unzip 5.42c - - - - - -Release MacZip ver1.05 final -27. July 2000 -------------- - -1) CHG: {unzip} switch to latest final release - unzip 5.41 - -2) FIX: {unzip} Fixed "unique unzip folder" foldername handling - -3) FIX: {unzip} added prototype crc32() in macbin3.c - -4) CHG: {unzip/zip} added exported Codewarrior project-file in xml-format - -5) ADD: {unzip} added extra-field recognition for Mac SmartZip in - zipinfo.c and unzpriv.h. - - - - - -Release MacZip ver1.04 final -25. January 2000 ----------------- - - -Final release of MacZip. All parts now -in final release state !! - -1) Switch to MW Codewarrior pro 5.3 - -2) CHG: {zip} switch (back) to latest final release - unzip 2.30 - -3) CHG: {unzip} switch (back) to latest final release - unzip 5.40 - - - - -Release MacZip ver1.04 beta 3 -05. October 1999 ----------------- - -1) CHG: {zip} switch to latest source level - unzip 2.30o beta release - -2) CHG: {unzip} switch to latest source level - unzip 5.41c beta release - -3) ADD: {console} added menu to print the license - - - - -Release MacZip ver1.04 beta 2 -02. June 1999 --------------- - -1) FIX: {unzip} added one more criteria to make the recognition - of macbinary more save. - -2) FIX: {unzip} sometimes, archive entries without any extra field - caused problems; the default setting of the extra field - was not set back to 'unknown' properly. - -3) FIX: {zip} Archive filename with invalid characters like '/' gets - renamed. However, I do not check the complete path - needs - some more work here. - -4) FIX: {zip} Filename match was case sensitive. - -6) CHG: {zip} switch to latest source level - unzip 2.30m beta release - -7) CHG: {unzip} switch to latest source level - unzip 5.41b beta release - -8) FIX: {zip/unzip 68k only) I have found a wrong compiler setting - for the 68k version. Because of this wrong setting the 68k - version crashed. - - - - -Release MacZip ver1.04 beta 1 -30. March 1999 --------------- - -1) CHG: {unzip) switch to latest source level - unzip 5.41a beta release - -2) ADD: {all} Added message logging support for Syslogd - by Brian Bergstrand. Syslogd can be found at - http://www.classicalguitar.net/brian/apps/syslogd/ - This feature is 'under construction'. - -3) FIX: {all} many small fixes and code cleanups - - - - -Release MacZip ver1.03 -27. March 1999 --------------- - -1) CHG: {console} Like Stuffit Expander MacZip quits automatically when - used with drag'n drop or as Helper App (Web-Browser). - -2) CHG: {console} Since Macintosh users are used to be guided by their - software in order not to do something stupid, I added a check - to post an extra warning if the options -m and data fork only - are both checked. - This behavior can be disabled: See Applescript example and - "maczip.env". - -3) CHG: {zip} switch from immediate deletion to moving to the - trash. Immediate deletion is now an option in "maczip.env". - -4) CHG: {zip} enhanced progress display. - -5) CHG: {zip) switch to latest source level - zip 2.3l beta release - -6) CHG: {unzip} The zip archive contains file names greater than - 31 characters. When MacZip tries to unzip the file, the - FSpCreate command fails because the filename length is to - long. MacZip correct this problem by trying to truncate - the file names to the 31 character limit. - -7) FIX: {zip/console} A couple of minor fixes - -8) CHG: {zip} Switched file-globbing to the Info-ZIP version. - - - - -Release MacZip ver1.02 -14. February 1999 ------------------ - -1) CHG: {zip} Changed the rule of file inclusion if switch '-X' - is set. Following conditions are checked: - a) if length of resource-fork is equal zero *and* the - length of data-fork is equal zero include the file. - b) if length of resource-fork greater zero *and* the - length of data-fork is equal zero don't include the file. - c) if length of data-fork greater zero include the file. - -2) CHG: {Console} Some users are very confused by the buttons "START PATH" - and "ZIP ARCHIVE". Somehow, it wasn't clear what the intended - meaning was. I changed the buttons to more clear labels on - them like: "file or folder to compress" and "location of - compressed file" - -3) CHG: {Console} I changed the menu structure to be more intuitive. - -4) FIX: {Console} Found a nasty bug which sometimes caused crashes - when the Zip / Unzip Dialogbox was used. - -5) CHG: {Console} Handling of file dialog is now a bit more restricted: - e.g: it's not possible to select a file if you have to select - a folder. - - - - -Release MacZip ver1.01 -30. January 1999 ----------------------- - -1) CHG: {console} The use of the "Current App" mechanism was clumsy - and forces the user into the Zip or Unzip modes. This kind - of modality is not so good for the command line. It's now - neccessary to enter zip or unzip to choose the action. - -2) FIX: {console} When Applescript sends quit to MacZip the script - that is running shows a spinning cursor and MacZip - does not quit. - -3) FIX: {console} MacZip gots accidentally the wrong creator code - (from BBedit) - - - - -Final Release MacZip ver1.0 ---------------------------- - -Released 21. January 1999 - - - - -9. Beta release 06.December.1998 ---------------------------------- - -1) CHG: {console} The checkbox of Filedialog (for extract path and file path) - "Show all files" is now selected by default. - -2) CHG: {unzip/standalone} changed prototypes of mac[f]printf() to return - an int number (better ANSI conformance); - -3) FIX: {unzip} repaired "stdout/stderr" mode of macwrite(). So func - MacMessagePrnt() is now obsolete and removed. - -4) ADD: {zip/unzip} Compressed Mac3 extra-fields are now supported - (Thanks to Christian Spieler) - -5) ADD: {unzip} Extraction of ZipIt archive are now supported. This support - is not complete: Filenames are correct but folder names are only - restored with the public directory names. - -6) ADD: {zip/unzip} Improved documentation. - -7) FIX: {unzip} Function isZipfile() is completely rewritten. - -8) CHG: {zip/unzip) switch to latest source level - zip 2.3i beta and unzip 5.4 final release - -9) ADD: Applescript event "do_cmd". - -Unless there are big bugs found, this release will be the last -beta release. The final release will come out in January 1999. - - - - -8. Beta release 20.November.1998 ---------------------------------- - -1) CHG: {zip/unzip) switch to latest source level - zip 2.3h beta and unzip 5.4 final release - -2) ADD: {zip} Zip finds "namelocked" files also, if switch "-S" - is set. - -3) FIX: {unzip} Function isZipfile() fails if the zip archive - has a comment. - -4) CHG: {zip} added some small speed improvements to pattern matching and - isZipFile() function. - -5) FIX: {unzip} Display of comments is fixed. - UzpMessagePrnt() is replaced by MacMessagePrnt(). I do not care - about ansi-bombs. I'm not sure, so this fix may be changed later. - -6) RMV: {unzip} Buildin More capability is removed since it's already built - into the GUI-App. - - - -7. Beta release 09.November.1998 ---------------------------------- - -1) CHG: {all} switched to Metrowerks Codewarrior Pro 4 - -2) FIX: {unzip} Display of comments stored in the zip-file is - now fixed - -3) FIX: {zip} Fixed display of the zip help-screen. - -4) CHG: {zip/unzip} Changed special dir 'Re$0urce.Fk' to 'XtraStuf.mac' - (see entry at 13.June.1998 item 3). I found it more descriptive for - users outside the mac-community. - -5) CHG: {all} switched to MoreFiles 1.4.9. - -6) CHG: {console} changed behaivor of the file open dialog: The select - button is now always enabled. - -7) ADD: {all} Environment variables are now supported. - Basically, it is possible to add timezone (= TZ environment variable) - support here, but it's not yet implemented. - See "MacZip.Env" for further info. - -8) RMV: {console} Targets "zip only" and "unzip only" are removed. - - - -6. Beta release 09.September.1998 ---------------------------------- - - -1) CHG: {Zip/Unzip} Metrowerks Standardlibrary time funktions are - rather broken and incomplete so I was forced to rewrite the - funktions: mktime(), localtime(), gmtime() and time(). - -2) ADD: {Console} Added Pause Funktion for screen output. - The Pause-Function is selfadjusting: Count of lines is depending - on the window size. - -3) CHG: Extra-Field layout is changed: All datas are now in little-endian - format (see appnote) - -4) ADD: {Console} Added an option to test the archive automatically - after zipping. This option is only via Zip-Dialogbox available - because it needs the unzip-module also. - -5) CHG: {Zip} code is now up to date with the latest beta 2.3f. - -6) ADD: {Console} Added (drag'n) drop support. Drop on the MacZip icon. - The following situations are supported: - 1. drop of one or more zipfiles (action = unzip) - each archive will be extracted in a separate folder - 2. drop of a folder (action = zip -r ) - The complete folder (inclusive sub-folders) - will be zipped - Not (yet) supported is currently: dropping more than one file - to compress. Workaround: Put all your files in one folder and - drop that folder on MacZip. - MacZip recognize zip-archives automatically. - - -5. Beta release 21.Aug.1998 ----------------------------- - - -1) ADD: {Console} Userinterface has now a Statusbar to show the - Progress. - -2) ADD: {Console} It's now possible to stop the run of Zip/Unzip - with the well known shortcut [Command] + [.] - -3) CHG: {Console} Improved user-entry routine. - -4) ADD: {Zip/Unzip} Crypt-code added. It's now possible to - encrypt/decrypt archives. - -5) RMV: {Unzip} Removed the warning of PKZip/Mac archive. - Unzip gets confused with the extra field of PKZip/Mac. So I assume - the extra field isn't compatible with Info-ZIP's definition. - -6) CHG: switched to Metrowerks Codewarrior Pro 3 - this includes: - - new Universal Interfaces 3.1 Headers - - improved codegeneration - -7) CHG: {Zip} code is now up to date with the latest beta 2.3e. - -8) CHG: {Unzip} changed function names wprintf, wgets .. to macprintf, macgets .. - to avoid naming conflict standart library. - -9) ADD: {Zip/Unzip} FXinfo, Mac-Pathname, file-dates and Finder-Comments - are now stored in the extra-field. Extra-field layout is - changed accordingly. Unzip uses now the filename stored in the - extra-field when unzipping. - -10) CHG: {Unzip} code is now up to date with the latest beta 5.33g. - -11) CHG: {Unzip} code is (again) up to date with the latest beta 5.33h. - -12) ADD: {Unzip} following switches were added: - -J [MacOS only] ignore mac extra info. All macintosh - info are not restored. Datafork and resource-fork - are restored separatly. - - -i [MacOS only] ignore filenames stored in mac extra - field. Use the most compatible filename stored in - the public field. - - -E [MacOS only] show mac extra field during restoring - -13) ADD: {Zip/Unzip} Charset MacRoman to ISO8859 Latin and vice versa - -14) RMV: {Zip} -N option removed. This MacZip crashes using this option. - I will fix it later. - - -I think I'm very close for a final release of "MacZip 1.0" :-) - - - -4. Beta release 27.June.1998 ----------------------------- - -26.June.1998 ------------- - -1) FIX: {Zip} extra field size value was wrong. - - - -25.June.1998 ------------- - -1) CHG: {Zip} code is now up to date with the latest beta 2.3d. - So both modules, zip & unzip, uses now latest beta. - -2) ADD: {Zip} added a UT extra-field for better compatibility. - -3) CHG: {Unzip} changed the code to find the mac extra-field. - Unzip has to look for a mac extra-field because - mac-archives has now two extra-fields (UT + M3). - -4) CHG: {Unzip} changed the method to move extra-field data to - the internal extra-structure. - Old method was just BlockMove of the ef_structptr to ef_memptr. - This method was dangerous because not all members of the - structure seamless aligned. There are may be some fill - bytes in the structure depending on the compiler setting. - -5) ADD: {Unzip} added a warning if unzipping a ZipIt/PKZip archive. - ZipIt/PKZip archives are usually additionally coded somehow. - InfoZip's Unzip will *not* decode the files. So extracted - files are may be not decoded. (see also 6. and 7.) - -6) ADD: ZipIt (the Shareware Tool) has now a new extra-field signature: - 0x2705. Found in "ZipIt 1.3.8". I added a new macro: EF_ZIPIT2 - -7) ADD: Added PKWare's extra-field signature: 0xCF77. - Found in "PKZIP v2.03". I added a new macro: EF_PKMAC - -8) ADD: {console} It's now possible to save all screen outputs - to the disk. - -9) RMV: {console} this is the first beta without expire-date. - - -16.June.1998 ------------- - -1) FIX: {Unzip/console} Extract path now defaults to current-dir if - no path is given. - -2> CHG: {Unzip} creates now a extract-folder by default. This behavior - differs to the commandline tool of Unzip on other platforms. - However, for a mac-user is this behavior more convenient. - - -3. Beta release 15.June.1998 ----------------------------- - -15.June.1998 ------------- - -1) CHG: {unzip/zip} I changed the layout of the extra field - to support more data. - - -14.June.1998 ------------- - -1) FIX: {Unzip} adjusted time_t value with an correct offset value. - -2) FIX: {Unzip} removed all unused code based on unfinished ideas by - former porter(s). - -3) CHG: use of shared code izshr 032. - -13.June.1998 ------------- - -1) FIX: {Unzip} Filenames are only converted when needed. When zipping - with the switch 'datafork only' the filenames are shorted which - was wrong. - -2) CHG: {Unzip} code is now up to date with the latest beta 5.33f. - -3) CHG: {Zip} Changed the naming rule of filenames from old Johnny Lee's - to my implementation. Johnny Lee's idea is based on change of the - filenames which cases several problems when unziping on a non mac - plattform. My idea is to add a special directory: 'Re$0urce.Fk'. - For the future: Zip will create archives according the new nameing - rule. However unzip will be compatible with old nameing rule. - See also 4. - -4} ADD: {Unzip} Added a new nameing rule for resource forks filename. - Resource forks are now stored in a special directory: 'Re$0urce.Fk'. - This naming rule make it easier to for other platforms to use - mac zip-files. - - - -11.June.1998 ------------- -1) FIX: {Zip} Internal file attribute is set to BINARY by default - when zipping resource forks otherwise Unzip will create - sometimes wrong resource-forks. - -2) CHG: {Unzip} code is now up to date with the latest beta 5.33e. - - - - -2. Beta release 10.June.1998 --------------------------- - -1) FIX: {Unzip} Long pathname fix solved. Unzip is now able to extract - archives with path longer than 256 chars. - -2) CHG: {Unzip} removed all conversion from c-style string to - pascal-string (see fix 1) - -3) ADD: {Unzip} Finderinfo of folders are also restored. - -4) ADD: {Console} Added info about current path in the command-line box. - -5) FIX: {Console} Construction of the command-line of the unzip-dialog - box fixed. - - - -First beta release 06.June.1998 ------------------------------ - -no history. -Just to many code was neccessary to build the first mac-port. - - -Start of the port MacZip -February 1998 - - --------------------------------------------------------------------------------- -Legende: - -FIX: fixes a bug -CHG: inform about changed items. -ADD: added feature -RMV: removed Item - -{Unzip} -> only related to the Unzip-module -{Zip} -> only related to the Zip-module - These are just libraries and are linked into the console-app. - -{Console} -> only related to the Userinterface (not SIOUX) - MacOS has no tool like a command-line. So it's neccessary - to write wrapper around the command-line tools. - - - - -Dirk Haase diff --git a/third_party/infozip/zip/macos/README.TXT b/third_party/infozip/zip/macos/README.TXT deleted file mode 100644 index 839658db4..000000000 --- a/third_party/infozip/zip/macos/README.TXT +++ /dev/null @@ -1,569 +0,0 @@ -A free Macintosh Port of Info-ZIP's -Zip and UnZip -By Dirk Haase, d_haase@sitec.net -Home page: www.sitec.net/maczip -Mirror page: -www.haase-online.de/dirk/maczip -================================ - - - -Abstract: ---------- -MacZip is a cross-platform compatible tool that includes -both Zip (for compression) and UnZip (for extraction). - -Zip is a compression and file packaging utility for Unix, -VMS, MSDOS, OS/2, Windows 9x, Windows NT, Atari, Macintosh, -Amiga, Acorn RISC OS, and other systems. - -UnZip unpacks zip archives. The Zip and UnZip programs can -process archives produced by PKZIP, and PKZIP and PKUNZIP -can work with archives produced by zip. Zip version 2.2 is -compatible with PKZIP 2.04. - -If you are new to MacZip please read first the file -"ReadMe.1st". - - - -License: --------- - 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 - - - -Requirements ------------- -MacZip requires at least System 7 and a Macintosh with a -minimum of a Motorola 68020 or PowerPC 601 processor. Other -configurations may work but it is not tested at all. - -The application is distributed as a fat binary with both -regular 68K and native PowerPC versions included. - - - -Installation ------------- -Move the executable(s) somewhere--for example, drag it (or -them) to your Applications folder. For easy access, make an -alias in the Launcher Control Panel or directly on your -desktop. The GUI is very simple. It was not my intention to -make a full-blown GUI, however I think it is comfortable -enough to use it as regular tool. - -This port supports also Apple-event. So you can install it -in your WWW-Browser as a helper app. - -For more Info about the contents of this package, take a -look into the "macos/Contents" (or :macos:Contents) file. -Some notes on how to rebuild the Macintosh applications can -be found in INSTALL. - - - -Usage: ------- - -Basically there are four ways to start MacZip: - -a) Drag'n Drop -b) using the Dialog box (Menu: File -> Zip/Unzip): - -Please read the file "ReadMe.1st" -for the description of the items a and b. - -c) Using the Command line (Menu: File->Command Line): - The Zip & UnZip tools are command line tools. So the - behavior is exactly the same like the Zip & UnZip tools on - Unix or Windows/DOS. This means, if you want to zip some - files, you have to write a command line like this: "zip - [switches] path_to_zip_archive path_to_files_folders" - - - Go to "File", select "Command Line" and the - "MacZip Entry box" Dialog Box appears. - - An example: - - a: your zip may be created at - Macintosh HD:applications:archive.zip - - b: your files may be found at - Macintosh HD:somewhere:my_folder_to_archive:* - - Note: At the end of the path there must be a filename or - a wild card ! - (see Footnotes: 1 wild card, 2 Mac path names) - - So the command line should look like (one line!): - - zip "Macintosh HD:applications:archive.zip" "Macintosh HD:somewhere:my_folder_to_archive:*" - - - Click on "Enter" to start the task. - - Since you can not set a default folder you have to enter - always a full qualified path names. Full-qualified path - names are path names including the Volume name ! (see - Footnote: 2 Mac path names) - - - -d) Using Applescript: - -There is only one additional event defined: "do_cmd". You -can enter every valid command line. The first word must be -"zip" or "unzip" to select the action (compress or -extraction). - -See sample Applescript: - - tell application "MacZip (PPC)" - activate - with timeout of 90000 seconds - do_cmd "zip -rjjN Volume:archive \"My Volume:*\" " - end timeout - end tell - -This script opens MacZip, brings it to the foreground on the -Mac, starts the zip action with the command line: zip -rjjN -Volume:archive "My Volume:*" . - - -A short introduction is also available online: -http://www.sitec.net/maczip/How-To-Do/ - -It's possible to stop the run of Zip/Unzip with the well -known shortcut [Command] + [.]. - - ---------------------------------------------------------------------------- - -There are some Mac-specific switches available. -Zip Module: - -df [MacOS] Include only data-fork of files zipped into - the archive. Good for exporting files to foreign - operating-systems. Resource-forks will be ignored - at all. - - -jj [MacOS] record Fullpath (+ Volname). The complete - path including volume will be stored. By default - the relative path will be stored. - - -S [MSDOS, OS/2, WIN32 and ATARI] Include system and - hidden files. - [MacOS] Includes finder invisible files, which are - ignored otherwise. - -Unzip Module: - -E [MacOS only] display contents of MacOS extra field - during restore operation. - - -i [MacOS only] ignore filenames stored in MacOS extra - fields. Instead, the most compatible filename - stored in the generic part of the entry's header is - used. - - -J [MacOS only] ignore MacOS extra fields. All Macin- - tosh specific info is skipped. Data-fork and - resource-fork are restored as separate files. - - -Select [File]->[Get Help on Zip/Unzip] for a complete list -of switches. - - - -Limitations / Problems: ------------------------ - - - Aliases are not supported. I tried, but I got broken - aliases. This port will silently ignore all aliases. - It's on my to-do list for future releases. - - - Zip needs much memory to compress many files: You may need - to increase the 'Preferred Size' in 'Get Info'. Values of 12 - Megabytes or more are possible - - - Unzip needs about 500 Kbytes of memory to unzip no matter - how many files were compressed and expanded. - - - and finally one big macintosh-related problem: - This port has one weak point: It's based on path names. - As you may be already know: Path names are not unique on a Mac ! - The main reason is that an attempt to implement support exact - saving of the MacOS specific internal file structures would - require a throughout rewrite of major parts of shared code, - probably sacrifying compatibility with other systems. I have - no solution at the moment. The port will just warn you if you - try zip from / to a volume which has a duplicate name. - MacZip has problems to find the archive or the files. My - (Big) recommendation: Name all your volumes with a unique - name and MacZip will run without any problem. - - -Known Bugs: - - - crypted files in a zip archive are sometimes corrupt: - I get an error message: invalid compressed data to inflate. - Appearance of this error is purely be chance: I did a small - test: Unzipping an archive containing 3589 files 56 files - fails to unzip, so about 1.5%. Root cause is completely - unclear to me :( - -I strongly recommend to test your archive (e.g. unzip -t archive). - - - - - -Zip Programs / Macintosh Extra-Data: ------------------------------------------ -A brief overview: -Currently, as far as I know, there are 6 Zip programs -available for the Macintosh platform. These programs build -(of course) different variants of Zip files: - - - Info-ZIP's first Port of Zip. Ported by Johnny Lee - This port is rather outdated and no longer supported (since 1992). - 68K only. Only minimal Mac-info is stored - (Creator/Type, Finder attributes). Creator/Type: '????' / '????' - Until year 1998, only UnZip 5.32 survived. - - - ZipIt by Tom Brown. This is Shareware and still supported I think. - ZipIt has a nice GUI, but I found it can't handle large Zip files - quite well. ZipIt compresses Macintosh files using the Mac Binary - format. So, transferring files to other platforms is not so easy. - Only minimal Mac-info is stored (Creator/Type, Finder attributes). - Mac filenames are changed to a most compatible filename. - Creator/Type: 'ZIP ' / 'ZIP ' - - - PKZIP/mac v2.03/210d. This is Shareware. - This Zip implementation for the Mac can be found on ASI's web site - (http://www.asizip.com/products/products.htm). The name of this - program is misleading, it is NOT a product from PKWARE. ASI's last - release version is v2.03, and they also offer a newer beta version - PKZIP/mac 210d. But even the Beta version is rather outdated (1995). - Only minimal Mac-info is stored (Creator/Type, Finder attributes). - The Zipfile format looks like incompatible to other platforms. - (More details about the compatibility issue can be found in - proginfo/3rdparty.bug!). Type: 'PKz1' - Mac filenames are restored without any change. - - - Aladdin DropZip 1999, This is Shareware. Aladdin chose - the format of ZipIt. Therefore, it has the some drawbacks - like ZipIt. - Creator/Type: 'SITx' / 'ZIP ' - - - SmartZip 1.0 1999 - by Marco Bambini Vampire Software. - This is Shareware. SmartZip compresses Macintosh files using the - Mac Binary. Therefore, it has the same drawbacks like ZipIt. - Creator/Type: 'dZIP' / 'ZIP ' - -and finally: - - Info-ZIP's latest Port of Zip. MacZip 1.0. Ported by me :-) - It is supported (of course) and up to date. Full set of macintosh - info is stored: Creator/Type, Finder attributes, Finder comments, - MacOS 8.0 Folder settings, Icon/Folder Positions ... - Mac filenames are restored without any change. - Creator/Type: 'IZip' / 'ZIP ' - - -Compatibility of my port; Extraction: - - Archives from Info-ZIP's first port (by Johnny Lee) are - still compatible. - - Extraction of ZipIt archives is supported. This support - is not complete: Filenames are correct but Directory names - are sometimes mangled to a DOS compatible form. Segmented - archives are not supported. - - PKZiP/mac archive files are extracted without resource-forks - and without any Finder info. I have no information about - that zip format. - -Compatibility of my port; Compression: - - My port supports only the new Info-ZIP format (introduced - with this port). Therefore archives created by MacZip 1.0 - (March 1999) must be extracted with this version or later - releases of Info-ZIP's UnZip to restore the complete set of - Macintosh attributes. - -Note: This port is complete unrelated to the shareware ZipIt. -Even more, handling of special Macintosh attributes is -incompatible with ZipIt. This port (MacZip) may be used to -extract archives created by ZipIt, but make sure that you -get the result as you expected. - - - -Macintosh Files; File Forks: ----------------------------- - -All Macintosh files comprise two forks, known as the data -fork and the resource fork. Unlike the bytes stored in the -resource fork, the bytes in the data fork do not have to -exhibit any particular internal structure. The application -is responsible for interpreting the bytes in the data fork -in whatever manner is appropriate. The bytes in the resource -fork usually have a defined internal structure and contain -data object like menus, dialog boxes, icons and pictures. -Although all Macintosh files contain both a data fork and a -resource fork, one or both of these forks may be empty. - -MacZip stores data-forks and resource-forks separately. The -Zipfile format does not allow to store two archive entries -using exactly the same name. My solution is to modify the -Path name of the resource-fork. All resource-fork names are -prepended with a leading special directory named -"XtraStuf.mac". So, when extracting on a Mac, you should -never see this directory "XtraStuf.mac" on your *disk*. - -On all foreign systems that support directories in filenames -(e.g.: OS/2, Unix, DOS/Windows, VMS) you will get a -directory "XtraStuf.mac" when extracting MacZip archives. -You can delete the complete directory "XtraStuf.mac" since -Mac resources do not make much sense outside the MacOS -world. - - - -Text encoding; Charsets of the Filenames: ------------------------------------------ - -The following information is only important if you plan to -transfer archives across different platforms/language systems: - -A typical Zip archive does not support different charsets. -All filenames stored in the public area (= accessible by -foreign systems other than MacOS) must be coded in the -charset ISO-8859-1 (CP1252 in the Microsoft Windows world) -or CP850 (DOSLatin1). The latter should only be used by Zip -programs that mark the archive entries as "created under -DOS". Apart from Macs, the commonly used platforms either -support ISO-8859-1 directly, or are compatible with it. To -achieve maximum compatibility, MacZip convert filenames from -the Mac OS Roman character set to ISO-8859-1 and vice versa. -But not every char of the charset MacRoman has their -equivalent in ISO-8859-1. To make the mapping in most cases -possible, I chose most similar chars or at least the MIDDLE -DOT. - -Mac OS Roman character set is used for at least the -following Mac OS localizations: U.S., British, Canadian -French, French, Swiss French, German, Swiss German, Italian, -Swiss Italian, Dutch, Swedish, Norwegian, Danish, Finnish, -Spanish, Catalan, Portuguese, Brazilian, and the default -International system. - -In all Mac OS encodings, character codes 0x00-0x7F are -identical to ASCII, except that - - in Mac OS Japanese, yen sign replaces reverse solidus - - in Mac OS Arabic, Farsi, and Hebrew, some of the - punctuation in this range is treated as having strong - left-right directionality, although the corresponding - Unicode characters have neutral directionality -So, for best compatibility, confine filenames to the standard -7-bit ASCII character set. - -If you generate a filename list of your archive (unzip -l), -you will see the converted filenames. Your can also extract -the archive with the switch '-i' (= ignore mac filenames), -and test your result. - -This MacZip port uses its own filename stored in the -archive. At the moment, the filename will be not converted. -However, I'm planning to add support for Unicode. - -Currently, the following Mac OS encodings are NOT supported: -Japanese, ChineseTrad, Korean, Arabic, Hebrew, Greek, -Cyrillic, Devanagari, Gurmukhi, Gujarati, Oriya, Bengali, -Tamil, Telugu Kannada, Malayalam, Sinhalese, Burmese, Khmer, -Thai, Laotian, Georgian, Armenian, ChineseSimp, Tibetan, -Mongolian, Ethiopic, Vietnamese, ExtArabic and finally: -Symbol - this is the encoding for the font named "Symbol". -Dingbats - this is the encoding for the font named "Zapf Dingbats". -If you extract an archive coded with one of these -charsets you will probably get filenames with funny -characters. - -These problems apply only to filenames and NOT to the file -content. -of course: The content of the files will NEVER be converted !! - - - -File-/Creator Type: -------------- - -This port uses the creator type 'IZip' and it is registered -at Apple (since 08. March 1998). File types can not be -registered any more. This port uses 'ZIP ' for Zip archive -files. The creator 'IZip' type should be used for all future -versions of MacZip. - - - -Hints for proper restoration of file-time stamps: -------------------------------------------------- - -UnZip requires the host computer to have proper time zone -information in order to handle certain tasks correctly (see -unzip.txt). To set the time zone on the Macintosh, go to -the Map Control Panel and enter the correct number of hours -(and, in a few locales, minutes) offset from Universal -Time/Greenwich Mean Time. For example, the US Pacific time -zone is -8 hours from UTC/GMT during standard (winter) time -and -7 hours from UTC/GMT during Daylight Savings Time. The -US Eastern time zone is -5 hours during the winter and -4 -hours during the summer. - -Discussion of Daylight Savings Time ------------------------------------ -The setting in the Date & Time control panel for Daylight -Savings time is a universal setting. That is, it assumes -everybody in the world is observing Daylight Savings time -when its check box is selected. - -If other areas of the world are not observing Daylight -Savings time when the check box is selected in the Date & -Time control panel, then the Map control panel will be off -by an hour for all areas that are not recognizing Daylight -Savings time. - -Conversely, if you set the Map control panel to an area that -does not observe Daylight Savings time and deselect/uncheck -the check box for Daylight Savings time in the Date & Time -control panel, then time in all areas celebrating Daylight -Savings time will be off by an hour in the Map control -panel. - -Example: - In the case of Hawaiians, sometimes they are three hours - behind Pacific Standard Time (PST) and sometimes two hours - behind Pacific Daylight Time (PDT). The Map control panel - can only calculate differences between time zones relative - to Greenwich Mean Time (GMT). Hawaii will always show up as - three hours past the Pacific time zone and five hours past - the Central time zone. - - When Hawaiians are not observing Daylight Savings time, but - the rest of the country is, there is no combination of - settings in Map and Date & Time control panels which will - enable you to display Hawaiian local time correctly AND - concurrently display the correct time in other places that - do observe Daylight Savings time. - - The knowledge about which countries observe Daylight Savings - time and which do not is not built into the Map control - panel, so it does not allow for such a complex calculation. - - This same situation also occurs in other parts of the world - besides Hawaii. Phoenix, Arizona is an example of an area of - the U.S. which also does not observe Daylight Savings time. - -Conclusion: -MacZip only knows the GMT and DST offsets of the -current time, not for the time in question. - - -Projects & Packages: --------------------- - -A Note to version numbers: Version of MacZip is currently -1.06 and is based on the zip code version 2.3 and unzip code -version 5.42. See About Box for current version and compiler -build date. - -Because of the amount of sources I splitted this port into -several projects. See http://www.sitec.net/maczip for -updates. - -- core source parts: - unzxxx.zip - zipxxx.zip - These archives contains the main parts of the port. You can - build libraries and a standalone App with Metrowerks - standard console SIOUX. They contain only sources, no - executables. These archives are exact copies of the standard - Info-ZIP source distributions; they were only repackaged - under MacOS using MacZip, with one minor addition: For those - files that are stored in BinHex'ed format in the Info-ZIP - reference source archives, unpacked version that are ready - for use have been added. - -- additional source part: - MacZipxxx.zip: contains all the GUI stuff and the project - files to build the main-app. Only sources of the GUI, no - zip or unzip code. To build MacZip successfully you will - need to also download the zip and unzip packages. - -- executables: - MacZipxxxnc.hqx: contains only executables and 'README.TXT', - This version is without en-/decryption support ! - MacZipxxxc.hqx: contains only executables and 'README.TXT', - This version supports en-/decryption ! - -- encryption sources: - zcryptxx.zip: To build crypt versions of MacZip. - download from ftp://ftp.icce.rug.nl/infozip/ (and subdirectories) - -- documentation: - MacZipDocu.zip: contains some further docus about the algorithm, - limits, Info-ZIP's appnote and a How-to-do Webpage. - - -Credits: --------- - -Macstuff.c and recurse.c: All the functions are from More Files. -More Files fixes many of the broken or underfunctional parts of -the file system. Thanks to Jim Luther. (see morefiles.doc) - - - - ---------------------------------------------------------------------------- -Footnotes: - -1. wild card: - The '*' is a wild card and means 'all files' - Just in case you don't know wild cards: - '*' is a place holder for any character. - e.g.: - "this*" matches with "this_file" or "this_textfile" but it - doesn't match with "only_this_file" or "first_this_textfile" - "*this*" matches with "this_file" or "this_textfile" AND - matches with "only_this_file" or "first_this_textfile" - - -2. Mac pathnames: -The following characteristics of Macintosh pathnames should -be noted: - - A full pathname never begins with a colon, but must contain - at least one colon. - A partial pathname always begins with a colon separator except - in the case where the file partial pathname is a simple file or - directory name. - Single trailing separator colons in full or partial pathnames - are ignored except in the case of full pathnames to volumes. - In full pathnames to volumes, the trailing separator colon is - required. - Consecutive separator colons can be used to ascend a level - from a directory to its parent directory. Two consecutive - separator colons will ascend one level, three consecutive - separator colons will ascend two levels, and so on. Ascending - can only occur from a directory; not a file. - - - - - ---------------------------------------------------------------------------- - -Dirk Haase -========== diff --git a/third_party/infozip/zip/macos/ZipLib.h b/third_party/infozip/zip/macos/ZipLib.h deleted file mode 100644 index e3dacf311..000000000 --- a/third_party/infozip/zip/macos/ZipLib.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ZipLib.h - - This header-files is global to the project ZipLib. - - ---------------------------------------------------------------------------*/ - - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -#define MACOS -#define MACZIP - -#define OLDROUTINENAMES 0 /* use new function names only */ -#define OLDROUTINELOCATIONS 0 /* use new headerlocations only */ -#define SystemSevenOrLater 1 /* Runs only on System 7.0 or later */ - -/* These functions are defined as a macro instead of a function. -so we have to undefine them for replacing (see printf.c) */ -#undef getc -#undef getchar -#undef putchar -#undef putc - -#ifndef ZCONST -# define ZCONST const -#endif - -#define NAME_MAX 1024 - - -/*****************************************************************************/ -/* Includes standard headers */ -/*****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Many things are different for mac-users, so we need - special mac functions :-) */ -int Zmacstat (const char *path, struct stat *buf); -#define stat(path, bufPtr) Zmacstat(path, bufPtr) -#define lstat(path, bufPtr) Zmacstat(path, bufPtr) - -int fprintf(FILE *file, const char *format, ...); -int printf(const char *format, ...); -void perror(const char *parm1); - - - -/* -#define MAC_DEBUG 1 -#define DEBUG 1 - */ - - -#ifdef MAC_DEBUG -#define LOG_DEBUG 7 /* debug-level messages */ -int Print2Syslog(UInt8 priority, const char *format, ...); -#include - - -#define Notify(msg) \ - { \ - (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ - msg, __FILE__, __LINE__); \ - } - - - - -#define Assert_it(cond,msg,kind) \ - { \ - if (!(cond)) \ - { \ - (void)Print2Syslog(LOG_DEBUG,"%s failed: [%s] cond: [%s] (file: %s line: %d)", \ - kind, msg, #cond, __FILE__, __LINE__); \ - } \ - } - - - - - -#define AssertBool(b,msg) Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) - - - -#define AssertStr(s,msg) \ - { \ - int s_i = 0; \ - Assert_it ((s),(msg),("1. AssertStr ")); \ - while ((s)[s_i]) { \ - Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ - ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ - s_i++; \ - } \ - } - - - -#define AssertTime(t,msg) Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ - ((t).tm_min >= 0) && ((t).tm_min < 60) && \ - ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ - ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ - ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ - ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ - ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) - - - -#define AssertIntRange(myvalue,minimum,maximum, msg) Assert_it ( \ - ((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), msg,("AssertIntRange ")) - - - - -#define AssertStrNoOverlap(str1,str2,msg) \ - { \ - long s_i = 0; \ - AssertStr((str1),(msg)) \ - AssertStr((str2),(msg)) \ - if ((str1) < (str2)) \ - { \ - s_i = strlen((str2)); \ - Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ - } \ - else \ - { \ - s_i = strlen((str1)); \ - Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ - } \ - } \ - - - - -#else -#define Assert_it(cond,msg,kind) -#define AssertBool(b,msg) -#define AssertStr(s,msg) -#define AssertTime(t,msg) -#define AssertIntRange(myvalue,minimum,maximum,msg) -#define AssertStrNoOverlap(str1,str2,msg) -#endif - diff --git a/third_party/infozip/zip/macos/ZipSx.h b/third_party/infozip/zip/macos/ZipSx.h deleted file mode 100644 index d2b9ae87b..000000000 --- a/third_party/infozip/zip/macos/ZipSx.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - ZipSx.h - - This header-files is global to the project ZipSioux. - - ---------------------------------------------------------------------------*/ - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -#define MACOS -#define USE_SIOUX -#define MACZIP - -#define OLDROUTINENAMES 0 /* use new function names only */ -#define OLDROUTINELOCATIONS 0 /* use new headerlocations only */ -#define SystemSevenOrLater 1 /* Runs only on System 7.0 or later */ - -/* These functions are defined as a macro instead of a function. -so we have to undefine them for replacing (see printf.c) */ -#undef getc -#undef getchar -#undef putchar - -#ifndef ZCONST -# define ZCONST const -#endif - -#define NAME_MAX 1024 - - -/*****************************************************************************/ -/* Includes standard headers */ -/*****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Many things are different for mac-users, so we need - special mac functions :-) */ -int Zmacstat (const char *path, struct stat *buf); -#define stat(path, bufPtr) Zmacstat(path, bufPtr) -#define lstat(path, bufPtr) Zmacstat(path, bufPtr) - -int fprintf(FILE *file, const char *format, ...); -int printf(const char *format, ...); -void perror(const char *parm1); - - - -/* -#define MAC_DEBUG 1 - */ - - - - - - -#ifdef MAC_DEBUG -#define LOG_DEBUG 7 /* debug-level messages */ -int Print2Syslog(UInt8 priority, const char *format, ...); -#include - - -#define Notify(msg) \ - { \ - (void)Print2Syslog(LOG_DEBUG, "%s (file: %s line: %d)", \ - msg, __FILE__, __LINE__); \ - } - - - - -#define Assert_it(cond,msg,kind) \ - { \ - if (!(cond)) \ - { \ - (void)Print2Syslog(LOG_DEBUG,"%s failed: [%s] cond: [%s] (file: %s line: %d)", \ - kind, msg, #cond, __FILE__, __LINE__); \ - } \ - } - - - - -#define AssertBool(b,msg) Assert_it (((b) == TRUE) || ((b) == FALSE),(msg),("AssertBool ")) - - - -#define AssertStr(s,msg) \ - { \ - int s_i = 0; \ - Assert_it ((s),(msg),("1. AssertStr ")); \ - while ((s)[s_i]) { \ - Assert_it ((!iscntrl((s)[s_i]) || ((s)[s_i] == 0x0A) || \ - ((s)[s_i] == 0x0D)),(s),("2. AssertStr ")); \ - s_i++; \ - } \ - } - - - -#define AssertTime(t,msg) Assert_it (((t).tm_sec >= 0) && ((t).tm_sec < 62) && \ - ((t).tm_min >= 0) && ((t).tm_min < 60) && \ - ((t).tm_hour >= 0) && ((t).tm_hour < 24) && \ - ((t).tm_mday >= 1) && ((t).tm_mday < 32) && \ - ((t).tm_mon >= 0) && ((t).tm_mon < 12) && \ - ((t).tm_wday >= 0) && ((t).tm_wday < 7) && \ - ((t).tm_yday >= 0) && ((t).tm_yday < 366),(msg),("AssertStr ")) - - - -#define AssertIntRange(myvalue,minimum,maximum, msg) Assert_it ( \ - ((myvalue) >= (minimum)) && ((myvalue) <= (maximum)), msg,("AssertIntRange ")) - - - - -#define AssertStrNoOverlap(str1,str2,msg) \ - { \ - long s_i = 0; \ - AssertStr((str1),(msg)) \ - AssertStr((str2),(msg)) \ - if ((str1) < (str2)) \ - { \ - s_i = strlen((str2)); \ - Assert_it ( (((str1) + s_i) < (str2)),(msg),("AssertStrNoOverlap ")); \ - } \ - else \ - { \ - s_i = strlen((str1)); \ - Assert_it ( (((str2) + s_i) < (str1)),(msg),("AssertStrNoOverlap ")); \ - } \ - } \ - - - - -#else -#define Assert_it(cond,msg,kind) -#define AssertBool(b,msg) -#define AssertStr(s,msg) -#define AssertTime(t,msg) -#define AssertIntRange(myvalue,minimum,maximum,msg) -#define AssertStrNoOverlap(str1,str2,msg) -#endif - diff --git a/third_party/infozip/zip/macos/ZpPrj.hqx b/third_party/infozip/zip/macos/ZpPrj.hqx deleted file mode 100644 index 5bb3da0fe..000000000 --- a/third_party/infozip/zip/macos/ZpPrj.hqx +++ /dev/null @@ -1,455 +0,0 @@ -(This file must be converted with BinHex 4.0) -:#9T`8(*U,R0TG!"6594%8dP8)3#3"&66!*!%Ip96593K!!%!!&66FNaKG3)!N!3 -@!*!$$39DF&"bDJ#3!aEf1!,VX93!6&MU!*!$J!#3"!,cIF3NA3#3'[q3"%e08(* -$9dP&!3b[H&ZZXklEb3#3"3,E[3#3"P40!!$hQ!#3"L8D"RMDS*NlIS6ISVG-[(8 -R+hBY21RaEd$i`XJbN!"bQK8YHRN,mmTE("$HbP6f+lXeRq'lH*3I@AbbH%Ef3E+ -Yif3KHp54hE%@hq8Fj,%GAml1RLpN-E,i(GQARdH@0q0,K(GffT%p5)X[RVFF@D4 -BKrHBaXd@6VD,AXpZB5d!C#'6K@abQi`@mJ[Cj$MPC!8iDT2X[EaXE0rjRCHM[$` -Ej#4Rp[RPjG6VcFj"ITHAR9DQepPe(-SAiAji1arZ(-5ApPP[lbMciLAdmP)if0m -4Z#m[-q'q["cNPGI1p`,!!JLip@eQPi2X'farqH4p"**I)T!!,ckH3A`!+i#AjfI -6V9BMbl,P@GDh0P[fhKZcCArkf5`lka2F0rFYkb28qpDfD[R@DP(8@d9PSQMYcUH -l#l&K+CqqV@b6b'8EXQaE[)pm16Za$2kVE&Ajrhr50p-icq)mQh-k-9rKr#ThirR -rPjaIiecK!m`jJh-@jcQFFcJAF-lMl1)dliLFcVQ"F`IR*Xk0R"GcEZCFalQ0mbl -1fcR[i$c+q@,1jh$HcAQBm`MR4C`2FElF9MERGNj6amLPR&XjIj*c$@F2jmXiAm$ -j*XlAFlk"mi@FrjhcMcNrbIN*cSpcISVc6cMr,HHpR$r0q3#eRXTrcYrLI$mR'2- -,R+rKI"hRIH3Bb9R2#IC-iM3GT%lK(-,CcQPUVdlJ(-lCbMQ1Xi(6p)BkME10Xj% -c+PDCdr561TN6d2S-jjpa'Lb,I*!!mcpbrKVR@cNIiIaPcSFjIjhc9cKrNI2GR'r -Mr#$RKcMIc[R[1Aq9mbfFlq6m*Fi,1*Ga,Z@mKI0IFGl*#5!Dh)bmK[09R,GaAX, -j"jarb2RI1(q(FaIR4cJrb[Nqc[Gb(Z#mQA-Ijhl1Jp4a$2rr-qGri@idr`pa2Tr -c#j`c1@GcRXXjPh-Kjha1dcX4X#IbK!KDTSmLi&#%2SXmRI-QcLq9Z!9QHAK&RJp -`lZ(FbhNGjrfFi0ZA1@rJr$6RRh*qP[1jR(r"H68Rb4GarLERAh1H6mK%r[mHjqp -bAXYTHM*b(ZI2F2iXj`61[`QF)`)'4&l"HCccMCcrM[2R16r(qAR1Rq!dI4jj2HF -pR$r&qmEbrbAmTmDmG5@R`BL)@2XZiLEchf"#j+Fj$@j%`)h)-cJ0YN6%B*!!fZ" -0"!b*Q-YJ5Z6l13f@4"l,H6RRrq,m"ZHMR,r0#FVclQpbISXh8X0[Fcl'q6MRDNj -kp$ZFEqEm1FlAFVk)df"Bj'l1*Cc,1EXjRmhj4Fi(1@rN[*lcMcMr0HFV1DrKT2p -IcEQEmcpaIScc2h$Zj2`0c[G`AX&j+HFl*#EQK*KF5AfSiiFjrbYhe2BUcZFYQ8# -8`"SqHK"mJ1I3kr3C28Brd%[d&(J&2Y#Ep#9p$1pa'!D(S)I"!2UBIUI2k&ekQ$k -NTkNhA)PD1m`$$m!AqJL1"DHLhq&FB#FB#Zm#3m%Rq0Hr%%46EGlDqbRHVF#K%H! -jCH(Hi#JG!5E6*4lH8SZ90Sij`3pl6lJjll@6MSXbZAq0&J$qBllBSmf01Ffr4[l -C`lkV[XcL4ASG'Uq6pdGP+lLTLlHfZ[CGhY-)T@1p"c3qUpkHR1ZA["4,,hRFkea -YBX@*hcX-dG"#+9Im%9i"mj8`IdC`pR"ZifcRl1$Xj"c&1CTc$1GBcR'FNcQl1'G -`VZ*FcEQ@Fb2R*XiYR$GclZHmKI0@cJ1F"cN2F4lQ[)hc+1IYR(G`2Src(Xjl19r -!q41F@f-(QGk,(-FjM(-iCbXRM$VH@aj#JTLJCcJ!8S+3!+!HU!JLJMDJ)qJ*@MT -N"$e"8C!!&83&)8&+Kk"K"%KC3E!i)0$PJemF2ha%-$h8ZV&k4A@S8HedmNlrlUV -k4r+lI'5L-VEe@@SUj"`H)5q"0Af[ML&D&MAMJ*Q(BUqXb8H5K0BVJkB$kF&FTK+ -E1,G`MZBF`cQ@Fa,R+-j1cKXiEq5mQA-NjdE1rCbhF0l+HC!!Xiec'fF2Cc[R#-j -9R$GacZ$FblQDFbhR2Xl*R)FjEq-mbRNAjpfFcq0m2ZFpR&XjQcLE1BG`YR!1j4` -QQE%pEq+fM@mD("[Z(pkQ6*ArB1m@(2NMrbrTZlE[a'9UA)NZ-1G*h2#q2MlNie# -FlAKr`'(q0ph`MVp(96SX3dYqJ(B)h'F3ShNX,hEQPI(CraA+,q4E26%a@U*4G2h -S*GZQpp4VDZqA6Ni-IBGlai[LEVbSIX8L6)&*mGBRF[Cp'P`'R8-#ZKG'%!T3Na# -3!-m)-8N-L68ZIi`Zd6(CV9@'cMfh-Y4UGPU0[2,dLj`Tq,X[KR+QI5p6KIl4ahY -LPcQ1D'%LG1"lQRGkkX`5C4jc2[L!DZG,#8B,5U,`Fq[1G#3r8(Mci'9Ud,jSF#T -ciQZmAjrirRI0jCeZYIacC+Q'iD#62CM9E%`2YX+JZLEVVGQjbYU*LD&c+[cadf` -LhS-SY$AS24*%1!"B$AaU%FbHEZBiI&Le*&2dm*m[h!(MBQeX&DQ`Q-m4dY!$bD8 -kHP%6%rda"hqX)Y,(1*GLV%NarU3BRe1-mLR'G"6MGiV4*m@3!)"LY%a"B48MHSS -40SAJU"bI-b0DLV%IaELIFKb+X6Xc5U8Bhe115CP42-9iN@)m66&kT4ME8S`!+ND -`&'1!bP%MmhBlHQAHENIq6!ilBQEHEJF8c*[YH+'TL4e&-HqfSf(QcBaJ-HTRalI --QaR0XZ0rjXefp0#0fM&5apJFihD-d6&kamJGih@-",S41aQYXQ09M1SaQXGB%f0 -hCUc,MZFamX5i(102M-iaYZG'X%`IfUkLVScJ-8E&'"jMCi`p-N,'Q#)M9BcX-BV -'Q"BMLBaU-CE)q"NMMibJ-IE)5"TMN!#-G$%qb@JJif#-"c++a@JM)f+-p6(ZaTJ -KSh#-26)#akJG)cf-J$+'b"JAii#-CXPS(b0DGM63M36#+mfiD'a8e)cUfE&(4Kd -CKh5MMSa1-LV*b#0MNk!-Sj!!M&'kN8P'*"Q9G118M&bD)4$'`aJTC265MR%bcZP -'1aP9C066MABbqXIS'D10M!$+f+!Gph0MPS`&-QVTa[BB(@4-N4%h4J8CE@2Ncih -9-3l(i)SE-Q%iaBfmqX-Q$+-`f-)J#i-SE[L%N8I'C"PjC'5@m8FcHQK(%4PcC%5 -6F6X'BaM6C151N8h'laK*C-54N6Y'(XfiR"fhBr5488I'm4LVBlb4F8Q898Bc'FY -Nh*049XBecBLQ(FQ%Kc2UL6M+q#hFJh%l0j,,+#lMSCR"(KP@53lhm0'6rT!!Ma[ -UBD#(34i'HKMHBCL(34i'HK"a'44#hN"HmSGk'1Y&cf"FQ2N+aL@4LKMrCE5BN@, -'N4QbB-5Bd@)h&X`i-#2'M!XMmM*kc2JK)kb-*6,HbYJK+J9ML)`I-YTS4LJ91+[ -!9`@q+["9JFF+r&AJV!*R&6LV`'N&,L[`9S(h#Xa9B+i#Fa@iVm"G"8G3F!F&eLZ -iJS*$+,L&JPXSZ)@#@bK`AX%V&,a#`5Z8I)+4BS-IGPcBi!!MbBb1-Tl+q'Cb60[ -d$q2CGJcCi*%Ge6-iT-!K"3iTm%H"2`Vm8H#2!Rm8q+2!(`Aq+2$(MLFcrQS`5)& -"#Ja5i)S#Ea4iSm!E4@mSX%%jSQQ`4i%j#Xa4p)d#Fa5BSm!I"HiSF%H"1`VF8H# -1!RF8Z+-F$6DiSm!G"HiSF%H"1mUH-pLM`"d&lLK`4p'AM"`UqPf"!`SX925k!JF -9Q+$!"!8Q+,"5JBm+E&$JJJ)A&,LJ`!-&(LM`3)%(#Ma3i)%#$a4iS-!$"4iSm%# -"X3T-8'##!K-8H+$J&!T1SH!5#LkKY"8`A%2"+44F3X%I&0a!`8%82%,")a3m3X% -M&$a#`5-82%,")a3m3X'R&(a+`DH8)r@')bNiNS+[+(Q5i5E+N@E$663pT1NK63p -THNM6EjVHd[55TTFd[D6T58hrDAT+de1DRY,dP+DR0$fPk5G02fRk5G02'KcAm'% -06dC@e["L63pVkUDTQkCZQVTTq,1'2f[iS)C$DlLcKQYV1,D'3fXiY)C$DlLfT[i -D,00`F!fHDALeKMYUZ,@'-fViYBCIDrLeKPpVq,@'[fTiVBD6DMLPKXYUH+@'9fT -iTBE[DRL`"PmeZ+[Kq"UFe'#N"L-eA&1$NaUFe25LTKFe[DMT3Dd8ErTF`fXe[Dl -TG3d@D$"!dr1DRYId[!BM0&a4Jp%DM0$JY!B(0"aCJ`-DRUc"!Jd@D,"!Jh%Dr02 -JP!EV0"LSiG%D204`D3f(eR"S$3CUF&1$QaVFe'#3!!Er0IL[`Am09pC`!#d(-"U -!JQmVH,L#0bXd!S8fS1$IL[STDU%F#6HDJD)HL[FUhUTiUq+YL[j8p*ULca4pT1J -K43mTHNJjGXriY(Q[3RG3p)b#RbZiX,,Z"XXdZ+2",JfQDEL!KJYSY!X0(p"`!3e -Id2!%$5I3F!)0*p$`#-dl0*a&`b-dr%H$[aVqSm&RMHDK`9)0(QY`@S2A'Pc@B,N -'bc9BVZ&''McAe&C6Fdep0(LZ`A-0RQX`A-060(a,`m-d2%a66`dAdh!a$5jVF&Q -$baTFe[")$Br8p)Q'#fPiNSCVDMLQKYGSZ*''-fNiU+Eq'JkRiD!D(UIK8jUHdh! -R66pU1*H'FfNiPiCcDAL@KQGTH*D'@fRk9F1[0$fVk9P0VfUiPSCVDEL@KQYT1+k -'(fTiSBB6D[T3``Ze[*!!mAZM%5Pd(iAZSp!8&0U43[qaNaMS)%CV8'J-QJ!0RpE -`E!hre["[$Ir@m'm0lpE`EJh[e["Y$Gr@m'd0hpEU*ZJ8B3GIH-fNB'1B3JRj'%8 -aRe@'`bJ'fdl93qCGKdIr(k0G&iF0[#%M-bGm-JqU9h[+JqSeiaYjr%&'P,'fP!I -eE&M+JlTf@5p2X8P-&!VFXe-H9,V,8aj8[#Y6(T5qUe)He-#V8ai8`fY5(P6&De- -H9-IV8Ki8h4Y6(Y6JQe)HP12l8Kl8cGHP2#LMVdTj8&6IP2+JVViQj8&jI8A+Jc, -l`T3(pIDG[6c*-6!Ipe"iVdM[339qIXU$8[lbP!FerD'8"mApH-U$+[r6+3r+rBG -5(Y6p$kBm6!$X6AQB%VJKj@'5i2U8KdQ$25N28`L[6hQB9(K$bX-Nd'G5(UDD4U8 -m6$f05hQBL*U8mM#jp2k8KmNUjfrAPiGTUkRIb12M+00CAFIbK"Kqp3Y@*5%[Rr2 -%D'*LHfYpqd1Q'%8rU[TPTCU9!ZrB&'H)J%d0cjQiHAcFqDRB&leNmjEJSQ'UecM -CQLfQFbPHr@*FabPMeHRc*Y[jG(e(hFQek)D4d@'j&[q0Q2c#a@3MMkmhTaZc05I -D'Q*m6rbr,IjI&Iq[MIpAarm[@Ra(jh'GXKM83X+ha2rhaIpharmEirp0LqRE9p+ -+ebL#f'+Ck)liId6m2b2qEer-fV*LI2YZEIKFj6VMre(arqMiIdcm2cEq(lIiL+% -q!PP&aq$*mArABT+aChCf9BZm9TR'hl5,@R8pUE+P'BEVKm9m,ieYpS,irfL-Zcr -H(iVr$mIr0mIrpmErqq2r@q,r@q2r!r(r`F9kk-F-ETSFU3"H4kT&[B5!ZXA`qZA -"AU-ZTQk0riI(rif,Z4U@"am$Q`X(*[RI&2rEmX+B%cR9+L!QqAUp'"dpr(VhhhD -Tq6pX-9IMiGF2MIq(a2mYLlQ'R,!jAd!C&4qcGAjq[ZpAGXmfpecHfH(mT08%'lH -MKZq)!"i#`hK'VKNDAcqmTV*QrH$8)(phM!a0+BL'U(aQTLGV3*0flr!0CV`6RKD -ki0la6eC+49ZBd)TjNY!!CKar%am6&-kZK6RZZZ9Mch%qRrR`k,*p'r84B-kl2PX -jV[V,2,2PlqCM2YNce[6Q[CXDkY+HUZXC0R[cfUi,m$j`mpI-q60rcBFRJ*P)DG) -I!4m#TNliQ1e[rGV0jF`imqpYfhGlCEd)4Q3ri%JrmrTf@S3lTLJk-KL00dmF1D0 -9*Q3fedk!N!#$'@ZQ2,KM*Ye-FYKm+19MXTHeR"p'(4lE,LHDm)H`8aIFiA(!c$G -hq"G-D&3P8ma'-`1q`RPL2"-Q26Bl9DN)$i2*`IQ,qGY)KBHD'M&V5kpCc`J6BQI -[D82QckGP0kiQMPR!b1Vjq6ZG'fAqRKPqFY"rdaR5CDD1qINC38KKKYEdE11ERB2 -%0i,CIZBBm@%i9e6dCP-Mj`C2'qC1lD`rZI%LB1DI1fScKrFaPiL2`0b!&(91$-d -,MKpeeSZDF-Im2pi!h$(PJ%F!GbJRH!9`"kpF&0K"R6i@LhAm-(Gi3P`3H%5G1,0 -Nf6lEUNlI"r`%$"1Ydb-"A`(Lm(GBPYei0VQLBYCbqX2d@p4T('EVJ5`m$&C52p0 -,8AR"KF("*5T@@A`dG`K@6+"`"c)bZmmGRKV#DU*k5c$,cahH$!+j8AZ#(J35`8& -QqlPMAKm"KMY`%NQ%1l`pQ2AR$Qm-XHfUelH$k4(Z!$*kKcZm+*J#!@EaD3#[Z+- -(K-Nhk!H#4`"hH(2`GZl`bU$1h1&p)GTAJpL$K`"hH%hJ*F!GrK(i#A$(Zr%9i)i -DibrJi"f0L$X`(FcKMNNZm*-lqJm["ZlJ%(JkF!F'iIR!(4J"4q#1hXBEJM[k$Bm -)lZJ0F)-lkQM"hYcaCN3,lSM"1i)lH!EH%G`a@5&#C+2H+Ki6L4b[M`VBcKfq+8b -kF)GR#Ah+(6iN6+a`KhF+lq)1la3Q6lM$"d@mS"VY-cJ#GhL,#-YXe,X$0BFlq)V --4$EU6m+%#(IiH9!Vl["6`EF#kX58UUHr4%k3!*2K"m-GrK,iaA#(PiF`Z5Ca6Ub -QQm4FDXiGrK[icA!(IZ%l`adi!VrLMMk(Lh&(2m&aZ+2ZBTMEC)h!,ZjiJaK`0ZN -PJcm0Gr3(rF8GILc`$ZlS$haVZ-0r"EcL$Jm8m*ml2%c`Xq%1(aCmEEM$Xi3q09q -c&"C-jJjZK*m-Gr!aZ"Khm#+i*(IiPH!h`aeiL4m0Gr3"IMAFd3IieR!(VZ&I`af -B!LC`4fq$eGc49rMCF%HYi92Fm@CmEEMM2A!ClZ$1q0a`"jE!EER$CiGBlP"&)$V -F`A("(ql`Im%2KcY`'PmFl["h`4q(1caKm-RK$Zj)2jT[L2L"p`phm'&i!AId"pi -rh)'le)3lZ!FFK$Y`'3mKlX![[)5iSmrKM0c4*h!dlRJRhN,Fi4-%$R"(Vq-*`Kf -H0IJ,FBFR$I8hAiXF!VmKlZKMq$jhm!EmKlL$@q*$a"eiKKm4Gr!LhXXGh!1Zc4f -B$Mjc"fk#4Gb"4hJ(F3F@L"V9BKhKGp`4!aIQ$Tk(pa"hq1R!hlQMcq#NjKZUPJ' -qFBH4-jj%h+%hi%h%(AS*(NAF`62TFHlJBrJ6F3F[`UH)1hS1[b,Z`'@i'hIJ(6h -&(4J%eq!1,)!cFNFIiQ[%(If![a&h["1I)ql`(!*EZ--R#El2(9J,0c6I-2%$rX) -G@![[jJj0"GcQMKVMBF3G(MqmLc[k%NmMlUJVRNEF`CI!-HlJ'23AGr3L(NIFJBP -J"AGJ%lb*1rS5[b2ZU#1q4pca(VJ$GhJNiB0N[Z&b"IJXGfJpk"MFJArJ*hG`82U -D1cJr[)`lH$9p`4dm&Tf"1cJKh)3lF!@[+1lJ-r"PlZ!9V(R!(CK16EJ$Bm"UlX! -JH"phB!Gib"hp$0IQM[i4,i6KeS,Hj!kY#mmZml@+2AKhFBH'KBFAGiM4j1'1'X- -VZB-$@IFdFiIIM(F9q6jpC15bPAVMFfA[m,U4dHe@*rGNR,99rb"C0k"9Mb$4reV -eqa$pVe92$h&DD0@$4[5r9[eM42r$q"SI,AZ(4jESIfek"(Q,A841eGG(p,mfrA' -B,1F1hae`L6[mHG!IZ'1b8I5r0MhAi-lFi@&KhQM[m$J5rDp0,a,4rpVd(8'li!j -[($(TEG-M"pcM$KmFdIrDp-!3r@m%pEAV+A#(Ra%H80cK833[i!lr(bDaZF26KfP -Vl[!KNY8K4ZJj*2VI#,hMd(bi`fF1[XmG[NkLrih3I`N[,qlS[j!!P8'%N!#!ch5 -Zld9UKQh3UIlaLhZ90LfCB+HE04Mpm4GQjPMU'f(#A*C+bmcjdR*"KRLhZmQ08,H -[Ch*Nq,54CMF[QRQh-McAEV5+r0pRT[Ur6AP)1bHILaTp'0X(QAcISH&iEi$ZScF -mlc8)0G[Md%K)frGH9Emd,R`-A'LIRcm3"c&#fVlId9NjM3XIZD(i+B6ERML)&Y, -frD(ZffPFq+-ELX(2N!0r1!irK,&p''UB[j[90TPU,PNEQM`-RQb*HFS@L#B23bP -EBakcfP!j$`-V25N2`bcE8Ki'AEDRqM$XXMrQDAM31X[NB4$QPT5()CPE8ak'CJk -Q2!c8(%Tj',BjR2)`L(0EbX13!-k4P)F"RU-T$m-kGkBm$2,FPI)`N!"cImT$ql2 -pLMH9AXQ$UAKGbS24H%[+Jq&i8mU$+IQ3!*3(dr,QP!GMmk'p2%@V4*1(3IJ$k6d --(Gk6mQ!!-5cP`FKKH-U$FAaVbS-C4&[+J`(pL*3(NrVfP)GKpcX5rM!dqjb8Kb( -jBbN2`q1hTc`-'ADN1Q+k2c,P`C5r)H9KkBXa+3p,B)a2H9JJBh,+``$j"hTmVj` -(+mI1p"i'(UI&2%1qPBGP0kBFHdq)i4H'X#E+2fr"9&SEjIYlr)6!I@'"`h2@5$@ -XVIAp,b53!%`d$*`dZh&N+M[`fHJ8C,BRr2`AhD$'h(AM3,CdGYQ"6pqFII`(Vqi -krM+"V@0DaSBhE8%[[(kU@ZLPGYrNe1BRF[r3a)4HL*&hEklAp)TkY*Th4C82%iq -2bFIE4DjReZFf0+VQrIV8Q(iBNDpGN4FG&*8KkiZ@8Zr8dQe2[QLp((qaRR$4hHA -)KqGhG@rTUfMpEp565cp'kX-@1$-VjIicGLXF['%mMl&l5cA9mjfk9hqpPZKCC6h -[6NY#rZjHS44HRrA9rYB4iH`*Vmmc#!5CUV+8f6pZ!a"Ep$)@PCJ$HhV$[hmbHml -YhaU[c1RhKTR3a&4,B%(QHX@DbarGGB)p"0dhPY!2ZK)B9TMe*`h@Y!r&JV*KSYl -8KKClZmEU4%[l9@chQXC'P!fX09ac&`0kX5`E-TBhAD%+Qpb@,UELh[T9N91i-[9 -NrEE)UPBRjrfXU49j6,h4m!j,aYE*A5hAVX)HX1fCGCF[X$E+)mCD9h$('N4Qci% -EZZ4MIDE)k9bCfV#H915-Ur)K9j!!`TkdXe'h0U`&&APXc)GYiZMZd"6eBmfSb&R -GaQ9BeGCTIcHfhKbL0R9DXBdEkMDB$+l6&RKmBcCRkVK1'@4#im4*hP5RGHE%UEa -M2Q`m*kd[P%RUY*HF2&98XEQYdj+aka3#c4f@J&K#QqQZU"1i8jZeR0k+ZQVCY,V -2L+a3fMKVfEihB+-B&H[%%XlD&SXPA&3l5,'%LfSTLBdhGr3L0QG'ZUNAJE"bT)A -j2f[C[YFbE9b[*H,Xl,JDr91[*DKB3YFl`5Dlb0CVIcShi%'ppTlc!Kl8Db-j2q" -"[6,1JS!($8lK,Jaid1$+D1F(2'M3i@&4`)-'LlXii%'$0V!A"$aSd,Cd5F#$"Ud -eP`BmD,![Z`-H0'T&Z#cJ3D1iY6cJ3D0fDLX#(M4U&ESbp,He"Vi`i%'MY9`9m+" -4kd`QE8hr0@TaZ5EQ`iCaEF#$*LHCe`8mD0,fqU+!"dhfjIU!"deDafi)H0#N4Hh -'J!G0pZ@QJ!G0@S0Z$RM3T(hPPS!(eZjfDm#$CLd"QB3e&U$0@U!bl@TUhDbe-KD -fc&GKb`XZQhkfYV2)C)DR0@Z&#KBE'd9V)iZ9XTN5EpBpJ9SCI"NLaQ!*E55i)GU -YBJR08$a[`a,D@"X1dIlbXN[c+qR4)IDPXB51JK0$l-[,4fEDp-d3mIk+LDd9F(b -)eTeAATTG62eDV199MEBeE,'@9iHG&PVN%pFd@&r6h#%[AVZK-X)l@qJl,+(T[aD -YG+m2q0HLGHDHJ(mYpZAH)&1fL$&Q1I)ZV(f(1K&qif6H*FP3qr+Q#TIQMYlBPdp -@i5e$R8k&NaJq0&3,BV'%(UT0VPK#$p8'9LbKKfSh+TE3`m5BJjplRQX3$"0E$l( -&P*%kKr(f52YMChH`A"dQ0lTYjlS+9Uc@k[3)2U1Q"iD*-8GG0X,FB@plM0+Ep`l -6J[9fHX[JeM"Y3ZmBBE-#dl,djA2fV"X%$iEEPhIZkSK,`m@#Zpbl`0a4ZqHLjCL -q(QjIhKhH0e`Hmlc`2QXYq[afZdlGKfY9HSpl'aMUK&[!mBYRkp5j94jhEdCbF`F -ZL#9dUpa#,+&Ea6#aK'l9fPFXS9[P,Q)*MF@RXi4Zdkj6,+(EY(mA5qJf-88XSGZ -dXaC,k$CYPX85ZNhF%N[S0RYG,+(Ej%CL#6e#e`'aK"iK0a*,k"&LQ9K#Mp"'@bb -K4fMT,*E3f'8k5qJ4@YH+*I3)E96&LDKG'9SXSG[P%')*hDiYV&K#YfZl,CE3l9S -pLb9dZdD3!')*hDjPVPK#Yf[I+TE3(ES)L#9dKha,,+%lP0A%%VV$(K0,k!kYPX8 -5ZN1X&8[S$Zeca4,DZTb+*I4)TAQaK"iTpaG,k*(DUSXPp%Ml@5bK4jTA,+&(DQ8 -XPY!Mj59L#GdTrSQmhLPI&%[S6ZhZa4+k8qiVPY#GpVPB3RIk0V'%lY4#@5bK1m9 -AXB3H*4m95qK4FNkaK"iPISXPp#KYf-85HT6p,*E3Shbc@%+2dNjC,+&(DI-VPY# -MGI!35qM4fUD,*I4ShbIQRD2&2,'%(QhrLbAdD0mTPY#Ma3baK"kYhDjB3Sq4GiS -Pp"MjM9K#Me%E%8[S-H+J@%+2XFI%%RU-m@)*28D1,TE3Bm9TXB3H+fm@5qLa1UQ -**I4BF8J'2FD+&f)*2GEDL5Ad@2QI@%*E&eZaK"iR*a0,k((b','%(LG(%N[SFH+ -b@%+2Xmr&%RUFla&,k((D'SXPp(MjX9K#MpFH@LbKamZra4*k[2aE,+((LhGL#6h -HAK*,k2(q&d[S#GUML#Ad",&(,+%Rb&2&%RU#j&!XS5H)k@)*28&F%%[S#GC),+% -Rb"h&%RULqS4B3Nq8CiXPp%6aALbK*fUR,jE3%m9VXB5H+,k)*I4%DbD@d1`$l5b -K*pPRBJNp5@`35qK*BS0B3Nq51iNPp#5aALbK*iNMBJNpb6U+*I4NY65aK*kXTL1 -Z5*2&Bl'%RU`++jE3Nm9lXB5H,'F35qM*B*Q6r#E6Efk5QT@pR59dPfXDLN90&qp -cFQfA&XaL#GhP'K0L#GhP@SJbG0)&6MK,k#jUjbbKTp"ccK*kLZX-LLAd&0Fb&%[ -S+DlP+CE38l3r&N[S+DkI*jE38qKcC`NpPEc1%RUUkb++*I48ebB85qLTV[JTPY" -6A@94,+'RZK+M@%*2"3HG*I48HXpC3Npcl85aK*lQqSCL#6h0e42&%RSDIHBXSDI -4Cmi5HTUVm)NPp$4`bPP#RdAr1%[SXeb285bKch)94,'%2N[A$l'%2X[e3m85qLc -AmK2plbcAk"2plba`c9P#RdeIX9kM[@1e4V%j2PXR&Y(rcYCp"%l%(DZ-bNSBCp[ -(S[qGE8q)rRFf1-9DMRc6U6[V1GSlqPK@`TMZ@SUb%XCd9f58P6#QZjUNV)3ahA8 -"iHrFXDSL()FlJf@Xp-Jh`jj$cq'1pl'q!(IJK+b%-81A#h#E1pDDK(G`a`U#XK, -'$([1p#cI6(#+G4hY(6dR+f(-G$e(@3PMTUY!bNSB-qdj@3PMTUY4bNSB-eeM8&E -#Q+R&ZDb%F3kiaPU2pSkHNj8`cY%P4eE#1-F9)f8PM(0F+e9@`MM(05YP*BacA)G -39X)iajk6P6$1"DIX#L2FQEUc(U5p`ajG9X)iejk6P6$1eETG9X)i9aYd@3RMA&H -%P*8`cVARC#@-@IDdV)3abji6*ljC[Np@`TLP8iQXK$(,062&hA1@Db$+5KLcA#p -59X+BEFr*5KLcj41b%XCXHdj@`TLYKLmVBFc@qPa@`TKYcmP+',1eETH9-'DlSU5 --)ThR#UDb%XCji"TVAGSlHNkQ8Fl6CPe@`MM2e9e&rcY21h[4rmjc*8A4rmjcc8R -4rqEBFl)5aKa`LV8`lCfT1qYKfMZXff8PM$RfR-bLc(&e@&N*BiiV@-UXaKbjKDb -%-GHHNj8`jYV6XK,'A(Y19X+BkrYN*BbjmL&C#@1Z+cR+*-GFEHYP*BajFJYC#@1 -H25FVBFac$3"C#@1H25%VBFbcjd6rQqIkRk,rcG2@Ar5rHDk"+IVII,Q&k(rcAGP -6p,rjFJ[4rqE,%8ArQbq1L[ihhe9#4IqE,dF8r@qqp[ULrbe`E9E4raCSSbrkh`* -l6[5r"Fk!L2kh3'iKqYm#ZBASI`YF@92d[`@ZXbMkhd*A%aApEk%p*rVI3YmRqYp -#ZBASI`YGT96d[iAbCY(r&XSY42mlhp9K4Imlhp9'4Imlhji3rHpmHdld[r1T1bZ -DfMZ`Ar5rmee,325rmm8jdIm@ZA+Xk(q,A*&8p,p&VJSUqYmLZB[SIi[NjD,r,A+ -PAG(r&SRpS[mY%SG%re[XbUDLrbffjd6r@qbk!U,r,CC$LrkhQ(jJ(94laqU@S[m -YGK94dIm@ZckNk(mAf(1LrehJqd6rZd!q*rVI"ESELIjh!E9QV8alaaUCS[pGi&U -MS[pGJ)E#fTPm5q`2dIq@Z&+#k(p,A,Y8p,mPpU,SId[N(+,r,E'ZS[mYN4q)rVG -%6LRkha*V,2VI%VQ)k(p,A,Y8p,mPVN8UqKqqkkbrDHrS,G(rPMV',2VI8PFm&Ie -[UBjKS[mY&AY%re[U@JZLrbf9pi[qYe6X&re[+6'Xd@R[i!'Lrbfe[dArklBr42r -VGL9AdIqkl3r4rlVP6+,rGDYYL2lA,GD+rYGYIiMqeff2L[lAEAq)rYGY286rklB -HS[peLm'Lrbf6YiRqYmaq&Ie[QEa6p,pPVViUqYmb9h`9r@qCXf1Lrbd64dAr@bB -I&Ie[QCJRqYmbqEVSIm[%E0(rPVRDTZKrbq9jS[mYPdH+rVIFZ624rjDVEBMqYe` -R10(rPX[242pElMV)S[mYYcp%re[ZZJkLrbfh2d6r@klf*[VIFVQqk(mVe"*%reX -K4a6pEi9VdBVqYm+C*G(r9UKeLIkh`M@'42pEBHq+rVI#PCC&re[KfUVH9H3RAIY -8p,m9VKNUJ5[!-PElY(F'#eMadpkCrQ(96hYRDX(+Rh`VAI06p,q9VLJUqYp+-)p -931dGUkD+rVI5Y94&re[TUV#LrkedY9I4reDkJU[SIbYGV96d[j@ZmbVkhdVA(4A -pEb@pa9UPpXld-'Z1mPe),9LRe0ka)URSIaHkiURSIaGD$p(r,U4[@028hY%VS[p -Gk)U[S[pGk1UaS[pG#+k`[LRI+RU'P8hYRAN$Dj[D1eC@&Ie[P5ZrL[khbRP$dIp -@ZFUXk(qVA-e8p,p9VJSVqYmUed)5r@m9[Fh+ThbVID[SIkYGJeAd[p@Z&#[khfT -`La93l4hVd)VqYpS99NAr@qekV+,rVAD09Y(r9S0pV02+YiEqC1e@HfIHCYG8iSl -e@%Ar@q1DXD,rVA%0@p(reYK2S[qYF9eDdIr@Z&kYk(pVa"M4rpD!@DcYbVH@hQ0 -e9hYRmV,#UlfMaU,rVAApA0(reVVUVHKrDm8jdIr@LQfLrkeeV9c4rpEk9Y(reY' -hV2aUlqJRdIr@ZEUYk(rVA)&Ap,peiTESIq[%+Y(reVNqV1KrkebY9[5rGI!+9Vl -PBpNeeX+eG`B,@!rAhTQkXb+Z[@20@p(r,K)[4Iqlb09h4Iqlb(9K4Iqlb&9M4Iq -lb,9e4Iqlb29j4IpE$qkc2Ukp-aM('VRfc[3`kq6D1r0qeXUeGkce+rVIHYIV&Ie -[[D[$L[khAJiKqYpkelF9r@mpI)QeFrNfZ#kXk(mE`%h@d,9hF!A4rcEiEY(r0[K -ZdImfZ0U[k(mEd%&B1GMHXHDXk(mEA,p@p,m0m#T@&1EEk,UeS[pY"0GB9GMHQ9j -PC@&lCpl'kX,fMTi@r@qMDrk+rVI4eAj&rpYSEiRqYa(1b@V$I*[N!D,rEE+R4Ir -E"0D`mV#p-rh!kX2f$S`8r@q6EaApEj0i,2VI*[Q0k(qEa#h4rcD*@k,rE4BM4Ir -EE$q*rVFCM'"0BAYRHS"eL1dGka+,rVGCr"$pEl1i*IVICYI$&Ie[XlJPqYm@9li -9r@q,DqU+rVI&GAY&rpX#"YQCDqlJ(k,rED%@V&jXleM49r5r,Dj2,2VI&YFd&[e -[Laa,p,qYiSISIeYGK9Id[kfZmb[kheE`MV@0lChT6eBfYRIJPZKr@ehE9r5rVDi -9,2VI9VQ)k(pEIEISIcfq@r5r(R&,p,mHF9Vd[alV,ITI$lh01X$fcY51YAlY(9a -%p,mHZBMSIcfZ#LckA`pmRY9mqEDj2V$SIpYmUqKrfjaY&re[QaJTqYmfDbckhcE -HcfV(pSkH&[e[QcdYqYmf0![@2HEElYUqS[pY&lG%rp[ZQX5LrffhaU,rE3FI@AR -ChS%PS[pYTaDX[fc[i1LLrfehY@24rlDl3V$SIc[N(k,rlA!eBp(rGXJM4IrE)@D -)rVH$AQ+GBR[(UX1Lrqe`c@E4rbjf2@(4rbjf4@,4rbjfY@E4rbjfK@R4rbkfEd6 -rZjMqBG9QH`IA&rh[B[Q6k(mlAA9Bp,qGVPJXqYp1hbIkhdljK1Kr1m&69SqfGh! -QdIpfbZp&rpYTr86rfb@(%2e[PkXHLrkh5b0ddIpff4qLrqebr@R4rhEj2Y(rGP% -[9Q+fGq#Ck(qla@r4rhEE(k,rlCDML2khfrH*rVGEc8$d[peb"G(rGSXVS[rYMUX -[fc[d#G(r,T&2LrjhLAaDp,p,A&GDp,p,A2YDp,p,`&r@TEChk#kLree#h9N&fpl -"+8ArHjDV*B[qpbaAB4Ep,r6Q-`KQ0P,F2ZP@IfB[aB0l[QX3&!Eka6G#-KJB+AG -F$&YT!11#*+*UL0YR"d$-'%Km(8V-im,H--&Bk"cVYYF0$1c'Dfe1ClEC2pfD'@J -AVGVXG,FcX,ZfCq##rJX'DUhTcN#eABqc)5%MAh&&Mj!!PXqbJ[!DZfUfq3L&@E- -K$'(eJhT(&G1pPQimQGZcBF`b-KX)MM1rb0`LmiV-+9TI3R-bMmM-),1)c!XbHmJ -X)[1#GJPkFc*hb'`JXi,-!M)rb"bJc2q&+Rb0#j`NJcFRh62rH@q'TpdjRmU6UQS -)h"F@D&CX#&efAfA2Ir,[2RqIjE#%$3rr$f1UIBdPaIZAa9rX2S2K$NX0"N5h8Y" --T-NGqZ,XE0FFGa$B-p[SeYF0cADkVCQ+hU1(LKVZSVN8UkGCLreSCD,DeAdd&im -(+rkMaR,ejZE1"e+XVhYeR3kNa34iN!$ZKH%G+kS2a"Zm0K&lmd[bjS2KkqSGVEm -2E'p!%AYcb$"EEc5+NR'4,E6*h-!H$V5TC1%"ASC,UdAc`4U[h6!QlFK(EYTF'@p -hkc2eUrlME4LE)jmG"J*+iGALfIKRMAdpe*[cmr5j(G9Qh[KkNKh9cR5eFD6kNU+ -[r!`69PZBm-%@6X`MpNE['0l`8'LP38cikXl-0aYJChl9NHTILVXeaDeNZ21LThq -lq)4A#NZdUjlmlbS4GDY@b-Q%aZkh(p**8!&dSQY`6S)UQ"0HJA+Lbd$ZJLXBi$) -%MH*L#deZQk)+i2(i)RlCq$ai%eH"EU,,`"d,,KHX!0S%$N!f+@U!R8K3+AFCV&e -`IjZ@J0V&CQ%k&PKUK`T%%ed"D+,li*Ri-MLli&)TI@"1"TYUpF-`#5S`6(30KNP -3K@(#+c"-G"Q'AA#P[ef'S#PFE+8TUM!FMbrLNSh2`c"a&4JQZJc$XH"b`3S`61! -!$*1L"X1*"*9bPf(B"IHhD3Q'A@`@KQ1"TADS`$$4&4JQZJq'L5r$X!XZPE)-`qX -(Til#-!NU-%ad$BC*8)9K`LX`6(3CKPe`TEpGKU!TA'bP+DS`()m[iT+0cm-`F48 -B*VS-`l(JFX%+-%cJ!!b6SJE$L359FTGKf!AhYfN*KPeX&SCMJD9fU-!`d48B*VS -2KSN[`l!,,T8b"m1RC+P"BHU80(9#R"U8T`B%UY-59Ep)05"6R45U6NT9&E&U8+l -kVVKd5Pik*6!05%bR4DCqQDNU0!e)6B0Ldk$FG%Vk'44r6XNr*`5J33PS3!3k,32 -e#d%$8Y"*-HLN(&34K!BPSHm+1+FNR&-LcS#-FeV)kCGbUQ,1J*`c+1J-5MURj*9 -"JH@8a(*#C"Q8@3D%PY055lrB-L#hR"4F6NSZ&G&P8(EjVNKb5LBj*C3-5#@RaC* -qZD3UQ!a)*S1LbD"XNT`B,8NBk54jZ%YR+!*H1NN!HHN8HG",CmM"AMj"[Krc@C) -GQBp209kQF3,i+q4)BdXQK`q"kGJm#+BcP'!`RDB)K-8NrHA+J@%q`FRfb`*L2Mi -1L8&`AfrQB6'GS4mB+i*(1NNr-&C%Mh55!@$X&6l5'@V!@"8rmPP+R9N83$+0-`# --C4%NNk-A'(Z&N!"dKP2!@"&$LNRkbe8$aUSNNXr5ehjPB#`+)lN%9@$X&8I5d*N -EH3J5e2!j0IU3!!iZL2RT($P"2jqJMerNK2ed(p5Uh$YM&@3)UPbH(%VRU&@j-%' -8MkqU"lND$ik[9!GB6JjN$)aNp!pP$)aP*!TINI$55IV*@dA'5bFC)'qp8Pik3if -m9H@mI*B5)"3P[8cM$*!!Yl+XPmR45pjkTEedKP2NV5,[&C2dPkY'hUSLAcj,ArZ -9b9Y4kXXPU*+hV0bApiI*iQ+3!#-*Ld'#$#S'19+J''4)BQ)K`FfG9M0@Zr$%@h1 -XE-[K2U+@iT-GA8SL$9d+GbeED,F8QPC5a0#TN!$#`p)J0!QP33+IiTAMqdVS5&i -3Qi2T)%X'TDXjDQhJBh3TrN4$*a#k&!j!Pf1VRC+%jb$"#A41XqBJK8qE5r(9q[V -%14-IL*j"MKSr##62)%Fr2mJ+RS8%9AjJReMK"aQjY"4IJj1d@&S+Vl9E2cr)+k@ -&&%9qN!$95B-%II`JUh+9%q6j39'$$E)-mS0!J5hNU2+$J[jD5P*Yk")rb)L[[I% -9IT!!P9k$"!2m)#-CPZ+VpHhM"i'Z&Z5SmB0!93Ybp21$V+C@5&$P"rD*&Ak3!&( -N5[%e1%RVFDA`@V[emi1m'&G)8H3(@5NZ50$($l)DF6P"RKm8CEiJbb!r#%5q3Si -U2bK)I+8NeBBZmB1-[YFEAq%(*p5p[1SHT1MM"fRG[46ZDJKiTA0Nq8'3!#2*$i) -%'Ai3j%MaJb"$NKm%#Ab!,m8RmD#842UP&&lVPa6!9e,%N!#YN!$#!rJJ0!R`33) -Ii-[aI59d!"r%jJ!qb*)"q'U1@K[i!&q+2p(3#B![K32`jGKUTb3"2NL3!!6i)%% -Di)-82X#AiU[e6IVbQAS1!Rb3!#-*m%'#$-!(19)!(f4)!Rb3!-!(q&*m%Jp+5D4 -I5Z'eINN"I#9&$0N++6b!$d+6!"mNm!'q(0pA3JI`3@`1i)-X'B#[jULeJ3r`TIJ -6$Cd!q&)i!&q1VAC+%Z#$"%Q!$a+N!6j)i30m+EjDhd%'ElYpDl@jFlDk-rmQ(X3 -bP0k`VMAp-+Vi1GK1*CK!F(&*8Z'#-N6#aDA)JiY+%JBAj*-%2bD*)hkJp*BINUe -K#[46B6'%Li9ji1kZNi$ZJP)pPi`5D%r'C!T5DVBFI,[)$'5Ril*&p+(CMbQd83+ -#r4"J0hQIVPB5APe3%P*G8"T'ACJ2RAj-ZKBq4")6f'5iZ#`X"@BB,Li(5eR,#aH -8JD@#XB8IQ+KKaViL9X-F,190+Q*KF9M+@P'iS"`XC3E%Nc'CJJ5`9$5eF*%",!A -@&E'i0#`9$#Vm`(3EqE#8FCj)a+4J+HX[iB,bX*3CC[GMdV9)`e)!59Ni#U!S"d0 -C#-V!6`&kdV#6JC`mh15K*J%c@BM*`8X'@V+`%N"+%8i#+!PJ*!-K"IK)3iF2'aR -)b-*&$LTL5aS9@%Fm1XXpiU%"!iP(jhK)2$E,4Z+K'8k5LXa#DLSm!@DT3"p1%jA -2FC9-F",X%m&ahK)2bV+AH'L1`k4M%d`Q(9NXAF"UiY&&EK12$aK10VUhp"QfNiU -X0QLDqD3#(Ip*4a@UQq9#mG"HQ#Z4khKd,mb9L(BmZJ4c"G)G$bh#A*Q!Tm+cA45 -3!2&%j8X`ed[-%m%CQ#Z3!24iD!RQ!X+HMLb@VJ*c&3SIMkr!A)R1*k),-&HQpUR -`3S2QB#iJqmR)!1B+a(pVIIY$A-l&CL(1"3B!jf*cm1BLXq$Q!M23jXGPqmB26R5 -0(qCh4kc118K,K5Dl1KBDKc-ANJ8c&jL$XQ4N!XL5F8'a!K"cX88)Fp%"J+9M#iA -1J*FI9fl"0($jB3kfNM(jDQBKb`9Q!@[Gk'KP,C(R2!"CmHJXD-9$!pL+4qH!+ak -EKDjiD!Dm8T(ChNQ&*lSR&HMh5U,b14$,"#Hl1a%F"l*i8"E+iU%j-%[(*Z!X(9N -XA3"TmHJLU-AM!eM,4[H@2J0YUFKUJkEK,4AS!#iG9DKZ&Z6LS39H9K)IA'b"Pj@ -%"aGEj'8&dF%&"VbX,$Mi`@P5%)J0X6SAH9Q[d"!,6I'bJXMJ!SZm,"!BNR&"X8U -mV#)YZ1J5,b[*#V(B2#mV5`TqF,i&-l`X%"-5F6PH9K!5iKV$ZRcll-kGH9%*-*5 -1AMmemB!bNCmqL!GRCK"5N4I06HHd["RG+V`X2Db3!!SX#S@9%K)GP,"hVLFHA#b -KLkb@-$m'P!S-q(433"HE+Tq,bKI2K@C+jmF9#ZFRb!X$3G&+`"'M,GQLpB+'#`f -+9J--2d%H0BYJi5M0KNCV1pKGNcG0Q3j8Qc8I9j!!1$hQd+X@!p!$Mb5&HF1qmmD -rT6p+JV,1+2%&h"XSG%c+kLed,,jFD+F3$6bb9ZKdJ[,F3+l3[R4BU%"5VmX@14Q -G,l%[JG@Hee[HI(L[k&BXE3fUNT5h80SqQ2*CC1ejeG*@!#SIA@#@)23!FT46q05 -N9X'"4bCTc-lC*KNb%&J)cr+f62$!``LI[k"ZP%M%JV,VZQLl'iUUr#FG[r$"QBE -c+i1e@Yf-8RG$RG*PlAmp'ITH6hcKp35@AqqkT[4f&epmZBY1[pZ&e9lGefmZ[[, -UI+qjX-+V`lbqh'j4N3heSU-fHp0-hZaQkm+DBE6rTTPfUqL@Ll,e6'bpjhT0YG& -Si4Df-@qdXl'YPD#)fN5ASQ"BfC!!@b2+49$fr05C$BV-CYAQ,CHfLNDYIjTellC -@K[TPKHZVDjpD[rbLfMRpP-,'#FN``9k)8CR0reLZZIIN-Z8)AJ&6R01)1AD0M'r -CCKBEQeNT*l,Z[SK-Aj!!*&ClZC6DFqXTPC&Y3q-E&KV!aXAl`5D9D[(!@29LYhE -c[4ZVdrPLaIeQm,0kpA34UI+C4V2PbfcX%PRA@m`aPG%%jc)@RZ&D)p13!,'fNiF -PZciINNP$Gq4$-QQSBMl%KjA$"j1QA-d,9ZIj92&#T)0bUH,&5!GYU-lN*IXb3AI -N"9eYeLE(81p)cZUNM%dF+V*S`HH(G(ppEEdJ*TZ)!J8af858*iM*@jAi26lc`[V -pH*X+5SANE8dLk`Jm8LhUH@GG4$6hhh2-cF&q)U-Rr-5FG5f`'a[$JfAD&,Th(iD -$iL0FE40AA@[(k0TE+j[bDZ%i8+lmX4GRHb!H@BT,i(iL@5`N8b9dX%20GBG)35Q -*)`[9$V06HcNZN@kKFM91p-ck`bf6CJ@C[LQ&ji2&HL5blZ#&Q$ji!F$KFq[YrU* -66*FAqrah3e&`FDaDCa9)Fh'S8mYMT1'GjYq0+2EHcHe'F(ecLi[EZr8'IfmU0ED -Mh1`TVQahqAqXHf@CB%marC3,`rpMeHeFl-eh0+TG(h1Xb(06APr[qVGlS5VfCPr -jekY,pd*KZJp@aZE`8NPYZ,,&k9kS6RFX6hH[2Yd(#p4pX%)Q`LX4&ek0ZRY&kMj -BTHjBTKZVHmSiqHmpfUZ([6K3RHjdChIX)0CFlDfA98X%FHG&QBY$jFYL&h%3-E- -,92&)8)RPdS(0NIb+HJHTLCFPlVc+QKKhBGj&!ab0&A"h8S"i+@bP[2ViY6*iF+M -9f0kD+pXJGV82@H1'SUaAr-VGQ2caUpZEpEP'2E4,iLjfCC)PlZblVbX,',mbL'A -+[@Hfk*5[L&qj'pX#lST'1TbcFkrA8pk9Zr(H*9IQ"Nb3!##j1Pc8Qpfb4q-hZeU -c"@`cNGS2L6@0LdQ8aBAijABaLAC*[-C9a)A%X-i&a-!Q8j98S@*3NkP+)X6[c8a -9dQ8R`'*c)NlZ$AqjP$&%2f-m*,8MYL8ImHZNBZd(`dr@6lB[hh'`X0!F`kRNJGh -ha1i*4(N1"Eqq,&Xk9bEq-(6V)&U$Akp%61`Ud@'*Q)6Fl"A-A@l)ZaYDphC"2)3 -E#)VI2BQBj'#TpkciYHQbJke!3e*A4pZ0ZL3QF4@V51)PANI0T+95!6C$3XG1*,H -j2'S%lh)APY6k!1%&q"#BM["ca&Sj'4$,kEGP1Q*IPM[KZQF([54hA#9kbBp2"AQ -*BPG"q,kib(YLr$@lfAYfr3YrMMFcZjZDedh1k'EQj6+@X9NhdB5cTKYP5mrGTQG -YCEif2RbAmR2-'#HQ"eLcIS+q-@$@#6(K#ZJF$K-1II%Te$flUX9-p4"T@8Z)DC& -i5*iLq5hU3V,FbQpc&j*P*$Rb%qIEQHFR8k6BQ'-mlMV,i(,X+8r&mTc4alTXL%P -mY&Fc3G&dK%NV%I&H-h#qDblm0kK1#KI"K4GLmL0XT9iN%BA*Xm+mQ%'b'jTA,$i -L&R"J@X3i8K*kpm"ib!'(*2CFAK-824DH[!qQGA)61SQTR0#a5Cc3KUq*A@,VbSf -RSb`-fl*dh*Ehhq'c#q5#"k&[J*!!`)1'J!IGpDXkZiUJ+R4RJHQ'XH'"q9[(AXZ -+QF&M4H[jHE'R`d#A'FbrVR!fRm'1ZdTpfNb`l3Nbfej'4+qVjF85BfL4i!Ierid -(4X)00k-,#6aJ(ra6H""f4Ki6H+!#(RJ1,EHhRAS2Ba1A%RMJk3FKE!K3a!0lUE- -60l@`GHVlkXE'*ST(ASfk[AYife4rifLHR#e$kV[hi$[Z1[U1[*P$pKfH"D3hCeE -i4Je16)`q8[PV19HhfrpCpbIHXAEmQMh(mKJI&!TEbl'fdAPiH1Rd1cE[,REdFcj -6elEbV@[A,`h3(cXR0`mY$I!1Lc$AlcU+-,i,6qpRhh(6p*&hj,e*NPm-1IGeCai -"%IZ1r8HlqR6IK``JqB([`8Hm(J-F"6HNlliM&)"CA$ib86RfeX%qSqr0,1Ak4pl -"YlFe2IY)Mi',eMdM&1!GI(1Q'`aVrV#ZpKhlUppMThEZLRHB!G`IpePff$[cG5d -p`5KlaNB[2TBRl8C@V2b1dBH4kV[[#!eJJYX[h[KI#*bb95Ym1dCEfjF'U%G)"6- -G`2+NY9cY(E21A5VJ(Id&qIYhe)$mIlpMN!!422'1'qD1&Z68&cDJ*2b`le&X3JB -8J)(Z5,ND9[[M-#iB)3([f(1N3`El)elA2EZqMBarril$4pMlB&eMl`J28%L1jMZ -A#-#c8!#P*Aa#f6LkUr%`AdalFKBq()A#!Gl"0iFQHDDZ1`kqidG0B[@'q$i%a54 -$PTj35%*101A`!!BA+U'pKLXJqHN[krH8q5BYqD%*QY,f9[jT6E$bMR#6kC!!Tc5 -iFRGm6i-lmBiR0EJ6lhK5Jc[jMLFdZ-&hK&*SF29lEpR2"&iNHrc@ekeF1hBUpar -)([r'IGRM2RA0SET1ZR9p0VlbcK9hR2abiq[hhPCEU%F)J`CADE5R0EM"GcbT`I8 -qi`FDh)Ph2+A"&4m54U$"pHF3rr16l`J&B0bBV!r@,'[%R[p#2l5m-U"p6mZV-TQ -`!#f[jb%T3VlfSG%YNipd%%`RI'+k+$aJ+LMXC(VQeU--cKKh-VNApr*-I6'Q%ci -aK@-mYhq-DGilISM!XHQCJ5QF[kY(q-hdc,'P!(`kc@)j#bqX,+k#NrP'ISF4Q)I -81[ST4R$L(8mbJK2[H",*6llM#53II%Gi!*+(,mc6pGBec''HVY*S6c1#`AFmb3K -kRr%$4R$L(8pTHF@(a0ia)$1CGpL0P%lJd*(m5*raL"Xk8C6SHdFSJ*E(&b)`,mC -+'08[SGK8%Gqmip$fhGpqarEYZapqKdc[XkCANF)0r4p[&I1+5Sjrm&DT[H2dY-U -J@Ka#-+hb)`q5'00j`S1NeKrK!@Vk2hKeP1[a2Dq1@Pe2UpHRqjl[5Bq0@MhX1jl -`aULp3hCeUJc#G5cj-3IR&6LSr02UGH8Gi44cF%pTAP5eGl,K(c@[%qpi8[-kmBi -R0Dq6lhK#maTm4hM!r0T6@P9[2@)-lLP0TrFG2p"d"YpaNJP@J&@qN!!+Pk4`!#d -QYAA!d%H")&X(0#DRj0$6,l@HR,H1BmM+&`ShJf5r-lL,$65L0chhr0,pHY+CFbZ -ZZI[*h+r+6RrarZa(VQXFUZ[%keGRQfjrdiTRAhfAmG'EUTpCU-FCIm8''Xr80Fc -"YIS-h@8$M4#iVfGbC2LdN5BDpX'm@aQHDcGDaAGpIcI"38KVZ%MSLPeUD-cA-($ -5l-D4UHc!THH(!'-frrR*Di1rG$IFDHRXXJ22I%Efm4qmZ[0f3LEdEFa1(K[HY!@ -RSHZRUS@Z-IG06Qeq)[F268b8cPV[f&b[UISm@XflSXU(L8H2qhLl++Fm2VHK86A -[ekH3!&(-rmHCa$LDpI@GY,jS`BM9MkjBj+(4HVD+[pH8GrZc-rRlKM,`hZb(q2H -0XQDcpF&@*j9hFl+ePDc[CmUlml+RmHr&-4p@qQq2GjZcl14ha#IZjY6Bjr,C!*! -!0A`-k,lrlHYffqX'"P5ejh4QQrhXiM'A)BZpXp2GcX$ZfTk"#rS[')$*(afSYZX -$5j)dJ%CS-+"SIk%[hmJe3q2VKpG8eU`IR"VNlik4SDNe5kXd3#-l*hKI$![-mN- -)KrZP60k1-d@B-(P'm2H@P+HG[lHQ2#2jHc$PkH6[SC4R&(m2Tca`cpY5RM(m2C, -bM1A[dC4R%Rr[6(NQmrHZP!ISZMrPJ5rAaccQUTaR0F&e+Fp'JTY5RNebq90jc)b -`1M(PkH([JC4R'hr[5AQB+AX6JS'(Kj8mGa2HN!$HFar"Be1HPa!m-Z9jJ1#1P1H -Pr,dqeI&"`M[6Hhk+i#NTcrd%Mcq@j``)i8[YF0EbD"*NKl2UAJ'KTamlR1'D9E2 -,$MIj3Z0QN!$1j#jf1(ZQVQ%11bHFD96XF&DrpjEpj4k9NlHqEZADX91jrd$fq$I -ZbalhU@X1eAA5VHZcmC9hVVMMj*FEAlrhYYT#2Fk-AhBiLpiA&3kd#FXePhHkeBI -dZ*!!K)qp3N*N2SYTCb!)fmVpMiq'!,D9q`UEbrREbRhQCVH91qBfF'(UfmU&ebJ --pGRb93GYp@FLe*jcIiS,iaI#8"Zeq1T`Z@hckS'!8"JT[2NHk$E6p(RS([c#"k! -pqCC,qUlY1h%C5mkj,k5JCbZ2!L8F8X6%N!"5eH`3'cQLkdF[f6DpTekE+&UlYdi -bZK*G%U"`q[jKM[pAm1+kK6fFQcLhFDlLA-fjNA-,jpfFScR(F)lPR-3jQA-8CbG -R1fFEj`M1NC`c1'rK[)rc*C`2F,k8md&i01XDARCX,6b6Kh80RjhbG2$hmT5(G3f -[6(PBer#UP!IalHU8Kh80VdPj@0I`fT4R((q[5hPBer$'P!FamUD8"ijiAmV$91c -V8KkceQ(NG5N2`emReL%dHFckKj%hT$aQrF2)De)Hl%9HQ2+`rZ%9+3rV(cirjB( -aI#EPH5(KSe1H&r(h$5Q2@4-aFPh+BpBV2,R@SFPMeMp8I5N2DbGf(FYcjSh`SA2 -!$H&pjQcRl1$Xj"c&1CTcM*`I2JpAKiI$XH(2F'0i,j`@[JSAK4I#qH"cF$9iQ19 -BU686KckD"&NcXES19HMTjiEU&erdX,0`@-NA#MH$C,m`932+-&V$Y-B!KXm`2XY -d3L(S6ZScQaX0f65qDA"XZ(pifcG`hNlH@[CVrXMrV*d4,hRb`C%$R(rqD1jLEG2 -S6Fmp[p3"*jdjYq+DZjr-rDVXp"I[chlNZXDKZNkmIR@fkIBhVAMfeAFC(lfTqTQ -&HTca9kaYqNaG`aa@[6XMGeREp!`%BCR0,5b`bFFbQlZZ[AHCcBh2F*R0SfmR*,a -NQFd`Qp8G)kG2GQYZmm,-c0&@)lp[QM@ffCieRq+NdbllNb83DK0HYlTM+!`'K-4 -mBET,iRA'T461l"1B8qN,SpMX08aJ1BNcq35qH(+YNc2["8BCEX)+``MH-j(c#h& -$V5r'kGqrF#mpmhdTX[-[Pa[c4V)[aXlkDScrbh#[IMM'I5h'ICeYfIRqUTaBMQ4 -ha[ar(E[UEf+qEf52+IrrEAcR0m0rY6UqkqciIhVm2b2Qr9CmclGMh-3BpeKmrq1 -aMYm*HEb1#G9P8Q&RAi`(0@qmZ$AEV'%T9NaNA38`46*XLSdP[c1rG@66qZCXB`N -!"l,3d!r"+DA6%f#$E(4LU6FAP2P#!0Ce-kqUVrDhC[r[%H"mcf$T31-@KJSGk*2 -HZc1lK1q-*81&5Ba0Kq'S-'Gf#9p)mIa,b)ZbmVekrYqlm,E[c(3"!cc"4B`(*55 -FaVR90SPDJ3fI$!,92Y4HqDVf`#@a+a`#&d*PqMl4UfG5%MJCl`SDZCd6Kfq'mh( -%EZ$%+4ZAl$'FZ(@c-eJ(j`M1PSJ&Z(HhFJlPC0q`8C`iGSrN(-[Cb6PZ+BIb[Qf -1lESL-jhZi9hIM[eUPUdf,MdK1KERmk('(6cF*M2j-j1iQqm0Dq"p)q2lkQlV"AD -r`VE`hZI(+4E5Uir[mq0QdLI0qfHkjHD1#D4U)&rN,Z,BBM)4erK-rR60G$Z(mc@ -k$CV8bArIX"qMc@I2Y$Z(ihEF4)[[RHRZ2&bR4VCDLjc+ZkPhiRe0lqI2Vmed'ke -liaEZ*IqULG&10e[q"AGIQacL1Rq$2h2+AGEU2[3HlXi,F3HI$p4X#R([(65(&cI -bAm8J,qjAAX$Gh""hP(k0V!jahcR("T2hI8aFmZ)qi@k$bf+q4rRc8"NAIHSRZ9X -Hqjlpe6D(I!ql41D+%0IbjX9q5K#ECc1('1[,4&bcZ9eI*Z)Dpbhf65+ZjAf,IC1 -)fr2V[IlirFZiNeeqphbdeam(a9AC$(1IQ#Vpm4XIjUiRa"e`efhTM`FrapeP-Hj -RH[eal58@91*H[G!IGDqmNl[,Ber5Rejr4+IXb5Y#A)Fpj08TqT+riNj`m"G@,p3 -THVUB)CZUYPqd8+IS#phD8RC,I35mP$T&Alk&ZcXLlKVmN!!k45rl-qi-2YKm2pI -Vil2&0[+$kp4'k[4+0d58h9mll$q[6[T*Rq)12+&pIRDK6VV2A[pfL"[bSB8kkCF -kFrTBL*Yaad+Gp-@rc0hMXBrT6kp1H[LVh*PGk[L@[R1K6ZV2k5d(MGeLQeFRYCq -P&Kh$(Q+0Qd,rIH9hL9XCFAU5A-UVklV2%bFlZcA*2b6IPrqCZ+YM(*[SHIRUAJY -h8qAZGbD1hHfmI0'9p*EbAB5mTjI[VKF6*cMG4"p,(far#RdJHq"&6KBc[,KYY3Z -)Hh1Xhk[i-cA8pHh'I65q!kiRrG&XAF&R)2'qKIl3,`*Ve0q%Z+%Z-1ReKci$6U6 -q0[)!qY*lRck0RPIr&2[l&EhhcB5R+V',IUAZdRm["`m82@*j#FZmbIZ@`@r99b* -1rc*raT9aNAH!P9VqDm,(mGDfDd2FErdLFI"Gmld+rY%3qLEb02L`PYqDI,2Jah0 -[$A&AITBiq+lj4T!!3adIiUk&HfKj-Hrq2B[VaGh`am5"lF4pDU'ZN5IF5KbFQcJ -ifA$MMXrrfpR%JIrJUhQ61LlNqp3r%LFFZdQHXc,%(3*lY([rm3lUEYpKS28"iLC -%r[3R[%0f$A`aNp[DA4piKmNK1"(jrp4'4r`B$BG6TiDii@ka*rJa",i5Z6$%IC' -HeR'Rf(fmThiLe1qVD!Mk#5(ZY@q&,lD(I!rF6Gc8%0FU"lSqa+hm#q+Q44b#-bd -*F4I6NeUmSNlS&F0Lhm`Qc[5)M3-RT-q@fdr6Babm6ITXrkZ*NfA[4UTcr(D)H`p -[dq+YqFj'$e"RKEK4p,D@Hj)2h(mia!eP0d)0[lCi4RpErR&mrN[`84ehqecm,Zk -NRbDq4#iZIB-Z)6Md+*a@"hkXR[A&(Jlp+9a,"hkXpVb`Kd26fDT9"hkXpY+[$SI -Qd%-kEUJi(plTF1J&Vb,1B,AY*lLAp-HGRb"Z3Dc(bhVpd3'2e%q*G@9h4-'26R" -D2cA%E8,RF$Kd%Ea(Xd1LlH0hpA$SCA"F(IF5(UDZ*1qiiUA%A4$L0X06(3jp4*b -!2e)RH+h8qe*Lp)q(Z0Ir83q(ERdpFD)(Y)Q$JN-cl$p2$e$Ai4cLiC!!@9'$r[$ -d!(8pQaFk(2ShD"XkkJ&M`"k(3epq*A(#cpVNiB*$M@#"M[bXaIF,$Mh(ZSTr3E[ -i+(dfrAELi)1d'$a-qZc2i-BkEPSl(ClUF1Kcm%XGYdImHIL3!-1KYlfE10Q%GXQ -024cDLGDLikSI(El(im'4#ATBK`eXe9XqeX1Kc3HiJpp42rLcdcqmc6PX[VGm'Fc -m303riR'40kZ2I6VU(iQi$KeDR2i4Mp1VA(GiAp3r%[R'LSq#IbhL)VU@HIH[`9m -GrVd@(Up(3Yb(U+Z(ImIRri%lc@k5a2hqTKlqADA@*6V+'cl6`lpAQdpdP!jjTr6 -P#ML%MMV+-(QGlF[MmhI"QcA[XR@LVi5(I84H*AZd[J9mF[MhN!$i,FXr,j!![`V -qAB9fSXXG+mdlf#YIm1qem'1p1G6[@q#T`lqAL+qbIhi,f1EKhr(j[r`)FHKA*Y9 -MD+`1rqTrMMM`h(a,h5&6m'mY'S'@6jP8Mm2I(!rl@lL3!0iDqV*1(9,`le+iVik -kdI9I1SKraqFr)$m6h@L2pE,iGhcqGM"H4peS*(c&iGp9k-3kkNB,ZA0pGJ303$m -RpJ&i)(hfQ(Km9BKlUhJLq(H*20[61I4ap+Z(ImIRhb0HHMU(2PiG3["[S4a,&SF -p+Mm8([B&qEfhEV-q!9cfm1rir#I4)(6Fd,VeAaEa,llITPi&$fLk,H*I)Zj4GCc -24[b,ad9'hD$@i9mLhbKU%m1r4,iMERlTi9rG(iKcKYq4Ec3mAr![qMbd62fL%$I -M,3[mVqjkZ)F15f[VTi'TJRpe0mK6Aa$LKS"hJRr4Xq`ESrPBR(MP3Pp'XlmMcQ# -[VCr*iI6#0m+9pG8acR!D`DhSFm3RlXhI&R"+m#pk$KLKeAQS+hUKKhr4&k$&k*G -&r%"AN!"hX$QT$MU62NqYb-1rZLqK9HMr&h%DMG29qeH*)cqdefJcJRr4R`!l0$c -8pMhij1&Ip!`d"5fI0Arh`Q@&rp@pPEN'$DFMEYk[,H"Ih4[T-Id,i4e[**r`[qK -b0!r0HrRHl2XprKGYJR&DcC0hdbFHrNA24[[3kUl`*(L&p0RH$a,h81`$F%[dc[2 -3ZE@m$lS06RMi&jeKGe-0CbGZ2ca@q&rGAm1400S&FEI)%ccmLfk&BfYe$qU%rLf -kmLr"bEAp6MkMK`VrUrX!ZE9e-(m2fK1HAKKj#4LQj4hQlf&Q1qSLRhL1ld!,jAe -SXCiq&aN&Fl9kX[NHNFm,hSpr'h(SYm6"ai6RAI%QiPi6hMId$rRRkAD4[@J6@Th -Ir$hI2[0dZmLBZSlT8q+1bVfN6S[S#DhHDrlH$MpdGET'r[(kq!jd5DR6@,LG9Qq -(ek+h5CfDj8RHRUakcXehT%j[KPYVDQAMk$HTdb'iR9C$0Rr[kZQ,NBYqM`"2(p9 -AbKfP6K2JkYSj#22hERLfUe1RrIe`L,Z(A[(UC2LCd@)d1'rj4a`r)Um'1c5kQFh -h"ldkGGe-!2Q*-jcHeHQ2k@hY,!Ed!Aj[kh4mrJjjfb-alS1p1Vd0E8@(29reci0 -9VNl23S28kY[d2Ea3k[40Z,j@4b81RLae@Lm2"XISEhLMe1R6B)%11mAUUpACT8k -[&+F0YK2h)R&@qZNAdBVdlm3q0K`dFXS-HjV(Z40apkR(I@QQHYr'fir)JcfFDhi -E'V5'Aj!!lhki8AfSGr-Pe%kMT4$h-R6+ZX!2QRm*,926bm3pf01IQYk2VUc9YBL -MRlak0rmQ'V4fYS8iH-A9)@kRZLNk$h(`L6H'Z!I%!h!2qN#pjAh[rJ)"4YHbF3C -2ACeZG6NKG"jJhf#'e+RTYp'U0"SbFDp5(jGk2b`rH(q-3kH81Xf#NqL`DDaq[EU -fe1P+HPZr0mBaKq(9UHNVmM0i",#2VLh[Hm"h'pb`F8E2P6SeI36Xdmie!0HQ,ed -rrD5D%r-[`#pp)rAq1*U)GTk)12LN9kHQVm)9p3GL($c%Ue26qq3I[a[MQ,f3!$T -p5pd4[3iHKQiZGCU#4U$9Bi(hH$mel9HI0[K'h-1pIQVq@IX!hBCh`0qN6Tm8bm& -Em!bq,rh8U2i02`9qk6qTdjqM9@Zd'Z,HUZiMIIm+Z)K@*`GqdF'ppcAHBTfBU5% -1r9IH[3*ZS1NG'iIZ+A'2q1k24(k*VL&a9cPRi-eKk0qbYlbjMBEIK`2V-)HKhiP -1*('0Tk(Yk6#(SGmPGjGmAd-ld'%13pmJYjDicm*&0&SaFEr1ZpAji4hhUQ-C$B' -iGpJhZd2F,(NB1J"aCMBLmUS3plKkkLG#h$["!q(aM4H+LfBHMEKh`IrGqckYR[( -*%2GZF9EHph*a&ai(c$+(+1qE3UpUjKTXR1'"lRdcl32$PBKl,rc%[HpCkVl-#J' -rr*IhVD8(p+G$h2[8YH9pCm%4p5dacZ#1Hpm'iicH50a[dJrZIBqTVe0ri*Fj5RR -I+p&H0E-*0Jlp5plh#E"!bq1)-h0)lRd2b*rXM0lr"`#3!edP!!!: diff --git a/third_party/infozip/zip/macos/osdep.h b/third_party/infozip/zip/macos/osdep.h deleted file mode 100644 index 5a69033ce..000000000 --- a/third_party/infozip/zip/macos/osdep.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright (c) 1990-2007 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-4 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 -*/ -#ifndef __MACOS_OSDEP_H -#define __MACOS_OSDEP_H 1 - -#ifndef MACOS -# define MACOS -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "unixlike.h" -#include "macglob.h" - -#define NO_MKTEMP 1 -#define PASSWD_FROM_STDIN 1 -#define NO_SYMLINKS 1 - -#define USE_ZIPMAIN 1 - -#define USE_CASE_MAP 1 /* case_map is used to ignore case in comparisons */ - - - - -/* -#define DEBUG_TIME - */ - -#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -#endif - -#undef IZ_CHECK_TZ - -#ifndef ZP_NEED_MEMCOMPR -# define ZP_NEED_MEMCOMPR -#endif - - -#define EXDEV 18 - -#define PATHCUT ':' - - -/* file operations use "b" for binary */ -#define FOPR "rb" -#define FOPM "r+b" -#define FOPW "wb" - -/* -#define DEBUG -*/ - -/* These functions are defined as a macro instead of a function. -so we have to undefine them for replacing (see printf.c) */ -#undef getc -#undef getchar -#undef putchar - - - -void setfiletype(char *file, unsigned long Creator, unsigned long Type); - -char *GetZipVersionsInfo(void); -char *GetZipVersionLocal(void); -char *GetZipCopyright(void); - -void InitAllVars(void); - -void PrintFileInfo(void); - - - -int fprintf(FILE *file, const char *format, ...); -int printf(const char *format, ...); -void perror(const char *parm1); -int macgetch(void); - - -int MacOpen(const char *path,int oflag,...); -FILE *MacFopen(const char *path,const char *mode); -#define fopen(path, mode) MacFopen(path, mode) -#define open(path, oflag) MacOpen(path, oflag) - - -char *GetComment(char *filename); -int readlink(char *path, char *buf, int size); - -void PrintStatProgress(char *msg); -void InformProgress(const long progressMax, const long progressSoFar ); -void ShowCounter(Boolean reset); -void leftStatusString(char *status); - - - - -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#endif /* __MACOS_OSDEP_H */ diff --git a/third_party/infozip/zip/macos/readme.1st b/third_party/infozip/zip/macos/readme.1st deleted file mode 100644 index 618275685..000000000 --- a/third_party/infozip/zip/macos/readme.1st +++ /dev/null @@ -1,16 +0,0 @@ -This port is for Mac versions before Mac OS X. As Mac OS X is build on Unix, -use the Unix port for Mac OS X. - 7 June 2008 - - -Before you start: - -Extract "*.hqx" and "source:*.hqx" first and read the Readme.txt. - -The resource file and the compiler project files are in BinHex form because -they contain Macintosh resource forks and as such can not be simply -stored a normal file on a non-Macintosh system. BinHex form is the -traditional way for transferring such files via non-Macintosh systems. -It's also the safest since it uses only printable characters. The ".hqx" -files must be converted with StuffitExpander or BinHex 4.0 (or equivalent) -on a Macintosh system before using them. - diff --git a/third_party/infozip/zip/macos/source/VolWarn.h b/third_party/infozip/zip/macos/source/VolWarn.h deleted file mode 100644 index 2d921ebbb..000000000 --- a/third_party/infozip/zip/macos/source/VolWarn.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* - -This is an Important note about pathnames - -*/ - -static char DuplicVolumeNote[] = { - "\rIMPORTANT NOTE:" \ - "\r" \ - "\r This port has one weak point: It is based on pathnames !! " \ - "\r Because it's a port !! Unlike MacOS: As far as I know all other "\ - "\r Operatingsystems (eg.: Unix, DOS, OS/2, ...) are based on pathnames" \ - "\r " \ - /* a short quote from "Inside Macintintosh, Files"; slightly modified by me */ - "\r On a Mac: Files and directories located in the same directory " \ - "\r must all have unique names. However, there is no requirement " \ - "\r that volumes have unique names. It is perfectly acceptable for two mounted" \ - "\r volumes to have the same name. This is one reason why a application should " \ - "\r use volume reference numbers rather than volume names to specify volumes," \ - "\r but for this Zip-Port I can't use reference numbers. " \ - "\r " \ - /* end quote */ - "\r" \ - "\r From the developers point of view:"\ - "\r The use of pathnames, however, is highly discouraged. If the user changes"\ - "\r names or moves things around, they are worthless." \ - "\r Full pathnames are particularly unreliable as a means of identifying files," \ - "\r directories or volumes within your application," \ - "\r for two primary reasons:" \ - "\r" \ - "\r* The user can change the name of any element in the path at" \ - "\r virtually any time." \ - "\r* Volume names on the Macintosh are *not* unique. Multiple" \ - "\r mounted volumes can have the same name. For this reason, the use of" \ - "\r a full pathname to identify a specific volume may not produce the" \ - "\r results you expect. If more than one volume has the same name and" \ - "\r a full pathname is used, the File Manager currently uses the first" \ - "\r mounted volume it finds with a matching name in the volume queue." \ - "\r" \ - "\r" \ - "\r The main reason is that an attempt to implement support exact saving of" \ - "\r the MacOS specific internal file-structures would require a throughout" \ - "\r rewrite of major parts of shared code, probably sacrifying compatibility" \ - "\r with other systems." \ - "\r I have no solution at the moment. The port will just warn you if you try" \ - "\r zip from / to a volume which has a duplicate name." \ - "\r MacZip has problems to find the archives and files." \ - "\r" \ - "\r" \ - "\r ... and the moral of this story:" \ - "\r" \ - "\r Don't mount multiple volumes with the same " \ - "\r name while zip/unzip is running" \ - "\r and "\ - "\r My (Big) recommendation: Name all your volumes with a unique name "\ - "\r (e.g: add a space character to the name) and" \ - "\r MacZip will run without any problem." \ - "\r" \ - "\r" \ - "\r Dirk Haase" \ - }; diff --git a/third_party/infozip/zip/macos/source/charmap.h b/third_party/infozip/zip/macos/source/charmap.h deleted file mode 100644 index 5656b6368..000000000 --- a/third_party/infozip/zip/macos/source/charmap.h +++ /dev/null @@ -1,380 +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 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 -*/ -#ifndef __macos_charmap_h -#define __macos_charmap_h - -/* - -Conversion table from MacOS Roman to -"Western Europe & America" Windows codepage 1252 - - Notes on Mac OS Roman: - ---------------------- - - Mac OS Roman character set is used for at least the following Mac OS - localizations: U.S., British, Canadian French, French, Swiss - French, German, Swiss German, Italian, Swiss Italian, Dutch, - Swedish, Norwegian, Danish, Finnish, Spanish, Catalan, - Portuguese, Brazilian, and the default International system. - - Not every char of the charset MacRoman has their equivalent - in Windows CodePage1252. - To make the mapping in most cases possible, I choosed - most similar chars or at least the BULLET. Chars that - do not have a direct match are marked with '***' - - 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. - -In all Mac OS encodings, character codes 0x00-0x7F are identical to ASCII - -*/ - - - -ZCONST unsigned char MacRoman_to_WinCP1252[128] = { -/* Win CP1252 UniCode UniCode Names */ - 0xC4 , /* 0x00C4 #LATIN CAPITAL LETTER A WITH DIAERESIS */ - 0xC5 , /* 0x00C5 #LATIN CAPITAL LETTER A WITH RING ABOVE */ - 0xC7 , /* 0x00C7 #LATIN CAPITAL LETTER C WITH CEDILLA */ - 0xC9 , /* 0x00C9 #LATIN CAPITAL LETTER E WITH ACUTE */ - 0xD1 , /* 0x00D1 #LATIN CAPITAL LETTER N WITH TILDE */ - 0xD6 , /* 0x00D6 #LATIN CAPITAL LETTER O WITH DIAERESIS */ - 0xDC , /* 0x00DC #LATIN CAPITAL LETTER U WITH DIAERESIS */ - 0xE1 , /* 0x00E1 #LATIN SMALL LETTER A WITH ACUTE */ - 0xE0 , /* 0x00E0 #LATIN SMALL LETTER A WITH GRAVE */ - 0xE2 , /* 0x00E2 #LATIN SMALL LETTER A WITH CIRCUMFLEX */ - 0xE4 , /* 0x00E4 #LATIN SMALL LETTER A WITH DIAERESIS */ - 0xE3 , /* 0x00E3 #LATIN SMALL LETTER A WITH TILDE */ - 0xE5 , /* 0x00E5 #LATIN SMALL LETTER A WITH RING ABOVE */ - 0xE7 , /* 0x00E7 #LATIN SMALL LETTER C WITH CEDILLA */ - 0xE9 , /* 0x00E9 #LATIN SMALL LETTER E WITH ACUTE */ - 0xE8 , /* 0x00E8 #LATIN SMALL LETTER E WITH GRAVE */ - 0xEA , /* 0x00EA #LATIN SMALL LETTER E WITH CIRCUMFLEX */ - 0xEB , /* 0x00EB #LATIN SMALL LETTER E WITH DIAERESIS */ - 0xED , /* 0x00ED #LATIN SMALL LETTER I WITH ACUTE */ - 0xEC , /* 0x00EC #LATIN SMALL LETTER I WITH GRAVE */ - 0xEE , /* 0x00EE #LATIN SMALL LETTER I WITH CIRCUMFLEX */ - 0xEF , /* 0x00EF #LATIN SMALL LETTER I WITH DIAERESIS */ - 0xF1 , /* 0x00F1 #LATIN SMALL LETTER N WITH TILDE */ - 0xF3 , /* 0x00F3 #LATIN SMALL LETTER O WITH ACUTE */ - 0xF2 , /* 0x00F2 #LATIN SMALL LETTER O WITH GRAVE */ - 0xF4 , /* 0x00F4 #LATIN SMALL LETTER O WITH CIRCUMFLEX */ - 0xF6 , /* 0x00F6 #LATIN SMALL LETTER O WITH DIAERESIS */ - 0xF5 , /* 0x00F5 #LATIN SMALL LETTER O WITH TILDE */ - 0xFA , /* 0x00FA #LATIN SMALL LETTER U WITH ACUTE */ - 0xF9 , /* 0x00F9 #LATIN SMALL LETTER U WITH GRAVE */ - 0xFB , /* 0x00FB #LATIN SMALL LETTER U WITH CIRCUMFLEX */ - 0xFC , /* 0x00FC #LATIN SMALL LETTER U WITH DIAERESIS */ - 0x86 , /* 0x2020 #DAGGER */ - 0xB0 , /* 0x00B0 #DEGREE SIGN */ - 0xA2 , /* 0x00A2 #CENT SIGN */ - 0xA3 , /* 0x00A3 #POUND SIGN */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 #BULLET */ - 0xB6 , /* 0x00B6 #PILCROW SIGN */ - 0xDF , /* 0x00DF #LATIN SMALL LETTER SHARP S */ - 0xAE , /* 0x00AE #REGISTERED SIGN */ - 0xA9 , /* 0x00A9 #COPYRIGHT SIGN */ - 0x99 , /* 0x2122 #TRADE MARK SIGN */ - 0xB4 , /* 0x00B4 #ACUTE ACCENT */ - 0xA8 , /* 0x00A8 #DIAERESIS */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xC6 , /* 0x00C6 #LATIN CAPITAL LETTER AE */ - 0xD8 , /* 0x00D8 #LATIN CAPITAL LETTER O WITH STROKE */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xB1 , /* 0x00B1 #PLUS-MINUS SIGN */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x00A5 #YEN SIGN */ - 0xB5 , /* 0x00B5 #MICRO SIGN */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xAA , /* 0x00AA #FEMININE ORDINAL INDICATOR */ - 0xBA , /* 0x00BA #MASCULINE ORDINAL INDICATOR */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xE6 , /* 0x00E6 #LATIN SMALL LETTER AE */ - 0xF8 , /* 0x00F8 #LATIN SMALL LETTER O WITH STROKE */ - 0xBF , /* 0x00BF #INVERTED QUESTION MARK */ - 0xA1 , /* 0x00A1 #INVERTED EXCLAMATION MARK */ - 0xAC , /* 0x00AC #NOT SIGN */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x83 , /* 0x0192 #LATIN SMALL LETTER F WITH HOOK */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xAB , /* 0x00AB #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ - 0xBB , /* 0x00BB #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ - 0x85 , /* 0x2026 #HORIZONTAL ELLIPSIS */ - 0xA0 , /* 0x00A0 #NO-BREAK SPACE */ - 0xC0 , /* 0x00C0 #LATIN CAPITAL LETTER A WITH GRAVE */ - 0xC3 , /* 0x00C3 #LATIN CAPITAL LETTER A WITH TILDE */ - 0xD5 , /* 0x00D5 #LATIN CAPITAL LETTER O WITH TILDE */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x96 , /* 0x2013 #EN DASH */ - 0x97 , /* 0x2014 #EM DASH */ - 0x93 , /* 0x201C #LEFT DOUBLE QUOTATION MARK */ - 0x94 , /* 0x201D #RIGHT DOUBLE QUOTATION MARK */ - 0x91 , /* 0x2018 #LEFT SINGLE QUOTATION MARK */ - 0x92 , /* 0x2019 #RIGHT SINGLE QUOTATION MARK */ - 0xF7 , /* 0x00F7 #DIVISION SIGN */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xFF , /* 0x00FF #LATIN SMALL LETTER Y WITH DIAERESIS */ - 0x9F , /* 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xA4 , /* 0x00A4 #CURRENCY SIGN */ - 0x8B , /* 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ - 0x9B , /* 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x87 , /* 0x2021 #DOUBLE DAGGER */ - 0xB7 , /* 0x00B7 #MIDDLE DOT */ - 0x82 , /* 0x201A #SINGLE LOW-9 QUOTATION MARK */ - 0x84 , /* 0x201E #DOUBLE LOW-9 QUOTATION MARK */ - 0x89 , /* 0x2030 #PER MILLE SIGN */ - 0xC2 , /* 0x00C2 #LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ - 0xCA , /* 0x00CA #LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ - 0xC1 , /* 0x00C1 #LATIN CAPITAL LETTER A WITH ACUTE */ - 0xCB , /* 0x00CB #LATIN CAPITAL LETTER E WITH DIAERESIS */ - 0xC8 , /* 0x00C8 #LATIN CAPITAL LETTER E WITH GRAVE */ - 0xCD , /* 0x00CD #LATIN CAPITAL LETTER I WITH ACUTE */ - 0xCE , /* 0x00CE #LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ - 0xCF , /* 0x00CF #LATIN CAPITAL LETTER I WITH DIAERESIS */ - 0xCC , /* 0x00CC #LATIN CAPITAL LETTER I WITH GRAVE */ - 0xD3 , /* 0x00D3 #LATIN CAPITAL LETTER O WITH ACUTE */ - 0xD4 , /* 0x00D4 #LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xD2 , /* 0x00D2 #LATIN CAPITAL LETTER O WITH GRAVE */ - 0xDA , /* 0x00DA #LATIN CAPITAL LETTER U WITH ACUTE */ - 0xDB , /* 0x00DB #LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ - 0xD9 , /* 0x00D9 #LATIN CAPITAL LETTER U WITH GRAVE */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x88 , /* 0x02C6 #MODIFIER LETTER CIRCUMFLEX ACCENT */ - 0x98 , /* 0x02DC #SMALL TILDE */ - 0xAF , /* 0x00AF #MACRON */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0xB8 , /* 0x00B8 #CEDILLA */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 , /* 0x2022 # *** BULLET */ - 0x95 /* 0x2022 # *** BULLET */ - }; - - - -ZCONST unsigned char WinCP1252_to_MacRoman[128] = { -/* Mac Roman UniCode UniCode Names */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xE2 , /* 0x201A # SINGLE LOW-9 QUOTATION MARK */ - 0xC4 , /* 0x0192 # LATIN SMALL LETTER F WITH HOOK */ - 0xE3 , /* 0x201E # DOUBLE LOW-9 QUOTATION MARK */ - 0xC9 , /* 0x2026 # HORIZONTAL ELLIPSIS */ - 0xA0 , /* 0x2020 # DAGGER */ - 0xE0 , /* 0x2021 # DOUBLE DAGGER */ - 0xF6 , /* 0x02C6 # MODIFIER LETTER CIRCUMFLEX ACCENT */ - 0xE4 , /* 0x2030 # PER MILLE SIGN */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xDC , /* 0x2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xD4 , /* 0x2018 # LEFT SINGLE QUOTATION MARK */ - 0xD5 , /* 0x2019 # RIGHT SINGLE QUOTATION MARK */ - 0xD2 , /* 0x201C # LEFT DOUBLE QUOTATION MARK */ - 0xD3 , /* 0x201D # RIGHT DOUBLE QUOTATION MARK */ - 0xA5 , /* 0x2022 # BULLET */ - 0xD0 , /* 0x2013 # EN DASH */ - 0xD1 , /* 0x2014 # EM DASH */ - 0xF7 , /* 0x02DC # SMALL TILDE */ - 0xAA , /* 0x2122 # TRADE MARK SIGN */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xDD , /* 0x203A # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xD9 , /* 0x0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS */ - 0xCA , /* 0x00A0 # NO-BREAK SPACE */ - 0xC1 , /* 0x00A1 # INVERTED EXCLAMATION MARK */ - 0xA2 , /* 0x00A2 # CENT SIGN */ - 0xA3 , /* 0x00A3 # POUND SIGN */ - 0xDB , /* 0x00A4 # CURRENCY SIGN */ - 0xB4 , /* 0x00A5 # YEN SIGN */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xAC , /* 0x00A8 # DIAERESIS */ - 0xA9 , /* 0x00A9 # COPYRIGHT SIGN */ - 0xBB , /* 0x00AA # FEMININE ORDINAL INDICATOR */ - 0xC7 , /* 0x00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ - 0xC2 , /* 0x00AC # NOT SIGN */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA8 , /* 0x00AE # REGISTERED SIGN */ - 0xF8 , /* 0x00AF # MACRON */ - 0xA1 , /* 0x00B0 # DEGREE SIGN */ - 0xB1 , /* 0x00B1 # PLUS-MINUS SIGN */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xAB , /* 0x00B4 # ACUTE ACCENT */ - 0xB5 , /* 0x00B5 # MICRO SIGN */ - 0xA6 , /* 0x00B6 # PILCROW SIGN */ - 0xE1 , /* 0x00B7 # MIDDLE DOT */ - 0xFC , /* 0x00B8 # CEDILLA */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xBC , /* 0x00BA # MASCULINE ORDINAL INDICATOR */ - 0xC8 , /* 0x00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xC0 , /* 0x00BF # INVERTED QUESTION MARK */ - 0xCB , /* 0x00C0 # LATIN CAPITAL LETTER A WITH GRAVE */ - 0xE7 , /* 0x00C1 # LATIN CAPITAL LETTER A WITH ACUTE */ - 0xE5 , /* 0x00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ - 0xCC , /* 0x00C3 # LATIN CAPITAL LETTER A WITH TILDE */ - 0x80 , /* 0x00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS */ - 0x81 , /* 0x00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE */ - 0xAE , /* 0x00C6 # LATIN CAPITAL LETTER AE */ - 0x82 , /* 0x00C7 # LATIN CAPITAL LETTER C WITH CEDILLA */ - 0xE9 , /* 0x00C8 # LATIN CAPITAL LETTER E WITH GRAVE */ - 0x83 , /* 0x00C9 # LATIN CAPITAL LETTER E WITH ACUTE */ - 0xE6 , /* 0x00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ - 0xE8 , /* 0x00CB # LATIN CAPITAL LETTER E WITH DIAERESIS */ - 0xED , /* 0x00CC # LATIN CAPITAL LETTER I WITH GRAVE */ - 0xEA , /* 0x00CD # LATIN CAPITAL LETTER I WITH ACUTE */ - 0xEB , /* 0x00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ - 0xEC , /* 0x00CF # LATIN CAPITAL LETTER I WITH DIAERESIS */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0x84 , /* 0x00D1 # LATIN CAPITAL LETTER N WITH TILDE */ - 0xF1 , /* 0x00D2 # LATIN CAPITAL LETTER O WITH GRAVE */ - 0xEE , /* 0x00D3 # LATIN CAPITAL LETTER O WITH ACUTE */ - 0xEF , /* 0x00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ - 0xCD , /* 0x00D5 # LATIN CAPITAL LETTER O WITH TILDE */ - 0x85 , /* 0x00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xAF , /* 0x00D8 # LATIN CAPITAL LETTER O WITH STROKE */ - 0xF4 , /* 0x00D9 # LATIN CAPITAL LETTER U WITH GRAVE */ - 0xF2 , /* 0x00DA # LATIN CAPITAL LETTER U WITH ACUTE */ - 0xF3 , /* 0x00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ - 0x86 , /* 0x00DC # LATIN CAPITAL LETTER U WITH DIAERESIS */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA7 , /* 0x00DF # LATIN SMALL LETTER SHARP S */ - 0x88 , /* 0x00E0 # LATIN SMALL LETTER A WITH GRAVE */ - 0x87 , /* 0x00E1 # LATIN SMALL LETTER A WITH ACUTE */ - 0x89 , /* 0x00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX */ - 0x8B , /* 0x00E3 # LATIN SMALL LETTER A WITH TILDE */ - 0x8A , /* 0x00E4 # LATIN SMALL LETTER A WITH DIAERESIS */ - 0x8C , /* 0x00E5 # LATIN SMALL LETTER A WITH RING ABOVE */ - 0xBE , /* 0x00E6 # LATIN SMALL LETTER AE */ - 0x8D , /* 0x00E7 # LATIN SMALL LETTER C WITH CEDILLA */ - 0x8F , /* 0x00E8 # LATIN SMALL LETTER E WITH GRAVE */ - 0x8E , /* 0x00E9 # LATIN SMALL LETTER E WITH ACUTE */ - 0x90 , /* 0x00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX */ - 0x91 , /* 0x00EB # LATIN SMALL LETTER E WITH DIAERESIS */ - 0x93 , /* 0x00EC # LATIN SMALL LETTER I WITH GRAVE */ - 0x92 , /* 0x00ED # LATIN SMALL LETTER I WITH ACUTE */ - 0x94 , /* 0x00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX */ - 0x95 , /* 0x00EF # LATIN SMALL LETTER I WITH DIAERESIS */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0x96 , /* 0x00F1 # LATIN SMALL LETTER N WITH TILDE */ - 0x98 , /* 0x00F2 # LATIN SMALL LETTER O WITH GRAVE */ - 0x97 , /* 0x00F3 # LATIN SMALL LETTER O WITH ACUTE */ - 0x99 , /* 0x00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX */ - 0x9B , /* 0x00F5 # LATIN SMALL LETTER O WITH TILDE */ - 0x9A , /* 0x00F6 # LATIN SMALL LETTER O WITH DIAERESIS */ - 0xD6 , /* 0x00F7 # DIVISION SIGN */ - 0xBF , /* 0x00F8 # LATIN SMALL LETTER O WITH STROKE */ - 0x9D , /* 0x00F9 # LATIN SMALL LETTER U WITH GRAVE */ - 0x9C , /* 0x00FA # LATIN SMALL LETTER U WITH ACUTE */ - 0x9E , /* 0x00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX */ - 0x9F , /* 0x00FC # LATIN SMALL LETTER U WITH DIAERESIS */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xA5 , /* 0x2022 # *** BULLET */ - 0xD8 /* 0x00FF # LATIN SMALL LETTER Y WITH DIAERESIS */ - }; - - -/* - -The following characters has no equivalent -to each other: - -MacCodes -164 0xA4 0x00A7 # SECTION SIGN -253 0xFD 0x02DD # DOUBLE ACUTE ACCENT -189 0xBD 0x03A9 # GREEK CAPITAL LETTER OMEGA -185 0xB9 0x03C0 # GREEK SMALL LETTER PI -255 0xFF 0x02C7 # CARON -249 0xF9 0x02D8 # BREVE -250 0xFA 0x02D9 # DOT ABOVE -251 0xFB 0x02DA # RING ABOVE -254 0xFE 0x02DB # OGONEK -218 0xDA 0x2044 # FRACTION SLASH -182 0xB6 0x2202 # PARTIAL DIFFERENTIAL -198 0xC6 0x2206 # INCREMENT -184 0xB8 0x220F # N-ARY PRODUCT -183 0xB7 0x2211 # N-ARY SUMMATION -195 0xC3 0x221A # SQUARE ROOT -176 0xB0 0x221E # INFINITY -186 0xBA 0x222B # INTEGRAL -197 0xC5 0x2248 # ALMOST EQUAL TO -173 0xAD 0x2260 # NOT EQUAL TO -178 0xB2 0x2264 # LESS-THAN OR EQUAL TO -179 0xB3 0x2265 # GREATER-THAN OR EQUAL TO -215 0xD7 0x25CA # LOZENGE -240 0xF0 0xF8FF # Apple logo -222 0xDE 0xFB01 # LATIN SMALL LIGATURE FI -223 0xDF 0xFB02 # LATIN SMALL LIGATURE FL -245 0xF5 0x0131 # LATIN SMALL LETTER DOTLESS I -206 0xCE 0x0152 # LATIN CAPITAL LIGATURE OE -207 0xCF 0x0153 # LATIN SMALL LIGATURE OE - -WinCodes -129 0x81 #UNDEFINED -141 0x8D #UNDEFINED -143 0x8F #UNDEFINED -144 0x90 #UNDEFINED -157 0x9D #UNDEFINED -167 0xA7 0x00A7 #SECTION SIGN -173 0xAD 0x00AD #SOFT HYPHEN -178 0xB2 0x00B2 #SUPERSCRIPT TWO -179 0xB3 0x00B3 #SUPERSCRIPT THREE -185 0xB9 0x00B9 #SUPERSCRIPT ONE -188 0xBC 0x00BC #VULGAR FRACTION ONE QUARTER -189 0xBD 0x00BD #VULGAR FRACTION ONE HALF -190 0xBE 0x00BE #VULGAR FRACTION THREE QUARTERS -208 0xD0 0x00D0 #LATIN CAPITAL LETTER ETH -215 0xD7 0x00D7 #MULTIPLICATION SIGN -221 0xDD 0x00DD #LATIN CAPITAL LETTER Y WITH ACUTE -222 0xDE 0x00DE #LATIN CAPITAL LETTER THORN -240 0xF0 0x00F0 #LATIN SMALL LETTER ETH -253 0xFD 0x00FD #LATIN SMALL LETTER Y WITH ACUTE -254 0xFE 0x00FE #LATIN SMALL LETTER THORN -140 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE -156 0x9C 0x0153 #LATIN SMALL LIGATURE OE -138 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON -154 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON -142 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON -158 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON -128 0x80 0x20AC #EURO SIGN -166 0xA6 0x00A6 #BROKEN BAR - - -*/ - - - - -#endif /* !__macos_charmap_h */ diff --git a/third_party/infozip/zip/macos/source/extrafld.c b/third_party/infozip/zip/macos/source/extrafld.c deleted file mode 100644 index a2efcdb21..000000000 --- a/third_party/infozip/zip/macos/source/extrafld.c +++ /dev/null @@ -1,920 +0,0 @@ -/* - Copyright (c) 1990-2002 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 -*/ -/*--------------------------------------------------------------------------- - - extrafld.c - - contains functions to build extra-fields. - - ---------------------------------------------------------------------------*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include -#include "zip.h" -#include "unixlike.h" -#include "helpers.h" -#include "pathname.h" - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -/* ---------------------------------------------------------------------- */ -/* Add a 'MAC3' extra field to the zlist data pointed to by z. */ -/* This is the (new) Info-zip extra block for Macintosh */ -#define EB_MAC3_HLEN 14 /* fixed length part of MAC3's header */ -#define EB_L_MAC3_FINFO_LEN 52 /* fixed part of MAC3 compressible data */ - -#define EB_MAX_OF_VARDATA 1300 /* max possible datasize */ - -#define EB_L_MAC3_SIZE (EB_HEADSIZE + EB_MAC3_HLEN) -#define EB_C_MAC3_SIZE (EB_HEADSIZE + EB_MAC3_HLEN) - -/* maximum memcompress overhead is the sum of the compression header length */ -/* (6 = ush compression type, ulg CRC) and the worstcase deflate overhead */ -/* when uncompressible data are kept in 2 "stored" blocks (5 per block = */ -/* byte blocktype + 2 * ush blocklength) */ -#define MEMCOMPRESS_OVERHEAD (EB_MEMCMPR_HSIZ + EB_DEFLAT_EXTRA) - -#define EB_M3_FL_COMPRESS 0x00 -#define EB_M3_FL_DATFRK 0x01 /* data is data-fork */ -#define EB_M3_FL_NOCHANGE 0x02 /* filename will be not changed */ -#define EB_M3_FL_UNCMPR 0x04 /* data is 'natural' (not compressed) */ -#define EB_M3_FL_TIME64 0x08 /* time is coded in 64 bit */ -#define EB_M3_FL_NOUTC 0x10 /* only 'local' time-stamps are stored */ - - -#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(2)) -#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1)) - -/* disable compressing of extra field -#define MAC_EXTRAFLD_UNCMPR */ - -/* ---------------------------------------------------------------------- */ -/* Add a 'JLEE' extra field to the zlist data pointed to by z. */ -/* This is the (old) Info-zip resource-fork extra block for Macintosh -(last Revision 1996-09-22) Layout made by Johnny Lee, Code made by me :-) */ -#define EB_L_JLEE_LEN 40 /* fixed length of JLEE's header */ -#define EB_C_JLEE_LEN 40 /* fixed length of JLEE's header */ - -#define EB_L_JLEE_SIZE (EB_HEADSIZE + EB_L_JLEE_LEN) -#define EB_C_JLEE_SIZE (EB_HEADSIZE + EB_C_JLEE_LEN) - - - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - -extern MacZipGlobals MacZip; -extern unsigned long count_of_Zippedfiles; - - - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ - -static int add_UT_ef(struct zlist far *z, iztimes *z_utim); -static int add_JLEE_ef(struct zlist far *z); /* old mac extra field */ -static int add_MAC3_ef(struct zlist far *z); /* new mac extra field */ - -static void make_extrafield_JLEE(char *l_ef); -static unsigned make_extrafield_MAC3(char *ef); -static char *make_EF_Head_MAC3(char *ef, unsigned compsize, ulg attrsize, - unsigned flag); - -static void print_extra_info(void); -void UserStop(void); - - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - -/* -* Set the extra-field's for each compressed file -*/ -int set_extra_field(struct zlist far *z, iztimes *z_utim) - /* store full data in local header but just modification time stamp info - in central header */ -{ - int retval; - - Assert_it(z, "set_extra_field","") - Assert_it(z_utim, "set_extra_field","") - - z_utim = z_utim; - - /* Check to make sure z is valid. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - /* Resource forks are always binary */ - if (MacZip.CurrentFork == ResourceFork) z->att = BINARY; - - if (noisy) - { - count_of_Zippedfiles++; - InformProgress(MacZip.RawCountOfItems, count_of_Zippedfiles ); - } - - /* - PrintFileInfo(); - */ - switch (MacZip.MacZipMode) - { - case JohnnyLee_EF: - { - retval = add_JLEE_ef( z ); - if (retval != ZE_OK) return retval; - break; - } - case NewZipMode_EF: - { /* */ -#ifdef USE_EF_UT_TIME - retval = add_UT_ef(z, z_utim); - if (retval != ZE_OK) return retval; -#endif - - retval = add_MAC3_ef( z ); - if (retval != ZE_OK) return retval; - break; - } - default: - { - printerr("Unknown Extrafieldmode", -1, -1, __LINE__, __FILE__, ""); - return ZE_LOGIC; /* function should never reach this point */ - } - } - - /* MacStat information is now outdated and - must be refreshed for the next file */ - MacZip.isMacStatValid = false; - - return ZE_OK; -} - - - - -#ifdef USE_EF_UT_TIME -/* -* Build and add the Unix time extra-field. This extra field -* will be included be default. Johnny Lee's implementation does -* not use this kind of extra-field. -* All datas are in Intel (=little-endian) format - - Extra field info: - - 'UT' - UNIX time extra field - - This is done the same way ../unix/unix.c stores the 'UT'/'Ux' fields - (full data in local header, only modification time in central header), - with the 'M3' field added to the end and the size of the 'M3' field - in the central header. - */ - -static int add_UT_ef(struct zlist far *z, iztimes *z_utim) -{ - char *l_ef = NULL; - char *c_ef = NULL; - - Assert_it(z, "add_UT_ef","") - -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) - return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - /* We can't work if there's no entry to work on. */ - if( z == NULL ) { - return ZE_LOGIC; - } - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + EB_L_UT_SIZE > EF_SIZE_MAX || - z->cext + EB_C_UT_SIZE > EF_SIZE_MAX ) { - return ZE_MEM; - } - - /* Allocate memory for the local and central extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_UT_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_UT_SIZE ); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_UT_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_UT_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /* Now add the local version of the field. */ - *l_ef++ = 'U'; - *l_ef++ = 'T'; - *l_ef++ = (char)(EB_UT_LEN(2)); /* length of data in local EF */ - *l_ef++ = (char)0; - *l_ef++ = (char)(EB_UT_FL_MTIME | EB_UT_FL_CTIME); - *l_ef++ = (char)(z_utim->mtime); - *l_ef++ = (char)(z_utim->mtime >> 8); - *l_ef++ = (char)(z_utim->mtime >> 16); - *l_ef++ = (char)(z_utim->mtime >> 24); - *l_ef++ = (char)(z_utim->ctime); - *l_ef++ = (char)(z_utim->ctime >> 8); - *l_ef++ = (char)(z_utim->ctime >> 16); - *l_ef++ = (char)(z_utim->ctime >> 24); - - z->ext += EB_L_UT_SIZE; - - /* Now add the central version. */ - memcpy(c_ef, l_ef-EB_L_UT_SIZE, EB_C_UT_SIZE); - c_ef[EB_LEN] = (char)(EB_UT_LEN(1)); /* length of data in central EF */ - - z->cext += EB_C_UT_SIZE; - - return ZE_OK; -} -#endif /* USE_EF_UT_TIME */ - - -/* -* Build and add the old 'Johnny Lee' Mac extra field -* All native datas are in Motorola (=big-endian) format -*/ - -static int add_JLEE_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - - Assert_it(z, "add_JLEE_ef","") - - /* Check to make sure we've got enough room in the extra fields. */ - if ( z->ext + EB_L_JLEE_SIZE > EF_SIZE_MAX || - z->cext + EB_C_JLEE_SIZE > EF_SIZE_MAX ) { - return ZE_MEM; - } - - - /* Allocate memory for the local extra fields. */ - if ( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + EB_L_JLEE_SIZE ); - } else { - l_ef = (char *)malloc( EB_L_JLEE_SIZE ); - z->ext = 0; - } - if ( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - /* Allocate memory for the central extra fields. */ - if ( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_JLEE_SIZE ); - } else { - c_ef = (char *)malloc( EB_C_JLEE_SIZE ); - z->cext = 0; - } - if ( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - - if ( verbose ) { - print_extra_info(); - } - - - /** - ** - ** Now add the local version of the field. - **/ - make_extrafield_JLEE(l_ef); - z->ext += EB_L_JLEE_SIZE; - - - /** - ** - ** Now add the central version of the field. - ** It's identical to the local header. I wonder why ?? - * the first two fields are in Intel little-endian format */ - make_extrafield_JLEE(c_ef); - z->cext += EB_C_JLEE_SIZE; - - return ZE_OK; -} - - - -/* -* This is an implementation of Johnny Lee's extra field. -* I never saw Johnny Lee's code. My code is based on the extra-field -* definition mac (see latest appnote 1997-03-11) -* and on some experiments with Johnny Lee's Zip-app version 1.0, 1992 -* -* Unfortunately I cannot agree with his extra-field layout. -* - it wasted space -* - and holds not all mac-specific information -* -* I coded this extra-field only for testing purposes. -* I don't want support this extra-field. Please use my implementation. -* -* This is old implementation of Johnny Lee's extra field. -* All native datas are in Motorola (=big-endian) format -*/ - -static void make_extrafield_JLEE(char *ef) -{ - - Assert_it(ef, "make_extrafield_JLEE","") - - if (MacZip.isMacStatValid == false) - { - fprintf(stderr,"Internal Logic Error: [%d/%s] MacStat is out of sync !", - __LINE__,__FILE__); - exit(-1); - } - - - /* the first two fields are in Intel little-endian format */ - *ef++ = 0xC8; /* tag for this extra block */ - *ef++ = 0x07; - - *ef++ = (char)(EB_L_JLEE_LEN); /* total data size this block */ - *ef++ = (char)((EB_L_JLEE_LEN) >> 8); - - /* the following fields are in motorola big-endian format */ - *ef++ = 'J'; /* extra field signature: 4 Bytes */ - *ef++ = 'L'; /* the old style extra field */ - *ef++ = 'E'; - *ef++ = 'E'; - - /* Start Macintosh Finder FInfo structure 16 Bytes overall */ - /* Type: 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); - - /* Creator: 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); - - /* file Finder Flags: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); - - /* Finders Icon position of a file*/ - /* V/Y-Position: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); - /* H/X-Position: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); - - /* fdFldr Folder containing file 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr); - /* End Macintosh Finder FInfo structure */ - - - /* Creation-time 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat); - - /* Modification-time 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat); - - /* info Bits 4 Bytes */ - *ef++ = 0x00; - *ef++ = 0x00; - *ef++ = 0x00; - if (MacZip.DataForkOnly) - { /* don't convert filename for unzipping */ - /* 0x01 = data-fork; 0x00 = resource-fork */ - *ef++ = (char) (MacZip.CurrentFork == DataFork) | 2; - } - else - { - *ef++ = (char) (MacZip.CurrentFork == DataFork); - } - - /* file's location folder ID 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlParID); - /* ============ */ - /* 40 Bytes */ -} - - - -/* -* Build and add the new mac extra field -* All native data are stored in Intel (=little-endian) format -*/ - -static int add_MAC3_ef( struct zlist far *z ) -{ - char *l_ef = NULL; - char *c_ef = NULL; - char *attrbuff = NULL; - off_t attrsize = (EB_L_MAC3_FINFO_LEN + EB_MAX_OF_VARDATA); - char *compbuff = NULL; - unsigned compsize = 0; - unsigned m3_compr; - Boolean compress_data = true; - - Assert_it(z, "add_MAC3_ef","") - - UserStop(); /* do event handling and let the user stop */ - - if( verbose ) { - print_extra_info(); - } - - /* allocate temporary buffer to collect the Mac extra field info */ - attrbuff = (char *)malloc( (size_t)attrsize ); - if( attrbuff == NULL ) { - return ZE_MEM; - } - - /* fill the attribute buffer, to get its (uncompressed) size */ - attrsize = make_extrafield_MAC3(attrbuff); - - if (compress_data && - ((compbuff = (char *)malloc((size_t)attrsize + MEMCOMPRESS_OVERHEAD)) - != NULL)) - { - /* Try compressing the data */ - compsize = memcompress( compbuff, - (size_t)attrsize + MEMCOMPRESS_OVERHEAD, - attrbuff, - (size_t)attrsize ); -#ifdef MAC_EXTRAFLD_UNCMPR - compsize = attrsize; -#endif - } - else - { - compsize = attrsize; - } - - if ((compsize) < attrsize) { - /* compression gained some space ... */ - free(attrbuff); /* no longer needed ... */ - m3_compr = EB_M3_FL_COMPRESS; - } else { - /* compression does not help, store data in uncompressed mode */ - if (compbuff != NULL) free(compbuff); - compbuff = attrbuff; - compsize = attrsize; - m3_compr = EB_M3_FL_UNCMPR; - } - - /* Check to make sure we've got enough room in the extra fields. */ - if( z->ext + (EB_L_MAC3_SIZE + compsize) > EF_SIZE_MAX || - z->cext + EB_C_MAC3_SIZE > EF_SIZE_MAX ) { - if (compbuff != NULL) free(compbuff); - return ZE_MEM; - } - - /* Allocate memory for the local extra fields. */ - if( z->extra && z->ext != 0 ) { - l_ef = (char *)realloc( z->extra, z->ext + - EB_L_MAC3_SIZE + compsize); - } else { - l_ef = (char *)malloc( EB_L_MAC3_SIZE + compsize); - z->ext = 0; - } - if( l_ef == NULL ) { - return ZE_MEM; - } - z->extra = l_ef; - l_ef += z->ext; - - /* Allocate memory for the central extra fields. */ - if( z->cextra && z->cext != 0 ) { - c_ef = (char *)realloc( z->cextra, z->cext + EB_C_MAC3_SIZE); - } else { - c_ef = (char *)malloc( EB_C_MAC3_SIZE ); - z->cext = 0; - } - if( c_ef == NULL ) { - return ZE_MEM; - } - z->cextra = c_ef; - c_ef += z->cext; - - /** - ** Now add the local version of the field. - **/ - l_ef = make_EF_Head_MAC3(l_ef, compsize, (ulg)attrsize, m3_compr); - memcpy(l_ef, compbuff, (size_t)compsize); - l_ef += compsize; - z->ext += EB_L_MAC3_SIZE + compsize; - free(compbuff); - /* And the central version. */ - c_ef = make_EF_Head_MAC3(c_ef, 0, (ulg)attrsize, m3_compr); - z->cext += EB_C_MAC3_SIZE; - - return ZE_OK; -} - - - - -/* -* Build the new mac local extra field header. -* It's identical with the central extra field. -* All native data are in Intel (=little-endian) format -*/ -static char *make_EF_Head_MAC3(char *ef, unsigned compsize, ulg attrsize, - unsigned flag) -{ - unsigned info_flag = flag; - - Assert_it(ef, "make_EF_Head_MAC3","") - - /* the first four fields are in Intel little-endian format */ - *ef++ = 'M'; /* tag for this extra block 2 Bytes */ - *ef++ = '3'; - - /* total data size this block 2 Bytes */ - *ef++ = (char) (EB_MAC3_HLEN + compsize); - *ef++ = (char)((EB_MAC3_HLEN + compsize) >> 8); - - *ef++ = (char)(attrsize); - *ef++ = (char)(attrsize >> 8); - *ef++ = (char)(attrsize >> 16); - *ef++ = (char)(attrsize >> 24); - - /* info Bits (flags) 2 Bytes */ - - if (MacZip.DataForkOnly) info_flag |= (EB_M3_FL_DATFRK | - EB_M3_FL_NOCHANGE); - if (MacZip.CurrentFork == DataFork) info_flag |= EB_M3_FL_DATFRK; - if (!MacZip.HaveGMToffset) info_flag |= EB_M3_FL_NOUTC; - - *ef++ = (char)info_flag; - *ef++ = (char)0x00; /* reserved at the moment */ - - /* Note: Apple defined File-Type/-Creator as OSType ( =unsigned long, - see Universal Headers 3.1). However, File-Type/-Creator are a - unique four-character sequence. Therefore the byteorder of the - File-Type/-Creator are NOT changed. The native format is used. */ - - /* Type: 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); - - /* Creator: 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); - - return ef; -} - - - - - -/* -* Build the new mac local extra field header. -* All native data are in Intel (=little-endian) format -*/ -unsigned make_extrafield_MAC3(char *ef) -{ - char *ef_m3_begin = ef; - char *temp_Pathname; - char tmp_buffer[NAME_MAX]; - unsigned char comment[257]; - unsigned short FLength = 0; - unsigned short CLength = 0; - short tempFork; - OSErr err; - - Assert_it(ef, "make_extrafield_MAC3","") - - if (MacZip.isMacStatValid == false) - { - fprintf(stderr, - "Internal Logic Error: [%d/%s] MacStat is out of sync !", - __LINE__, __FILE__); - exit(-1); - } - - /* Start Macintosh Finder FInfo structure except Type/Creator - (see make_EF_Head_MAC3()) 8 Bytes overall */ - - /* file Finder Flags: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags >> 8); - - /* Finders Icon position of a file*/ - /* V/Y-Position: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v >> 8); - - /* H/X-Position: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h >> 8); - - /* fdFldr Folder containing file 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFldr >> 8); - - /* End Macintosh Finder FInfo structure */ - - /* 8 Bytes so far ... */ - - /* Start Macintosh Finder FXInfo structure 16 Bytes overall */ - /* Icon ID: 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdIconID); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdIconID >> 8); - - /* unused: 6 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[0]); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[0] >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[1]); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[1] >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[2]); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdUnused[2] >> 8); - /* Script flag: 1 Byte */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdScript); - /* More flag bits: 1 Byte */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdXFlags); - /* Comment ID 2 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdComment); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdComment >> 8); - - /* Home Dir ID: 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlXFndrInfo.fdPutAway >> 24); - /* End Macintosh Finder FXInfo structure */ - - /* 24 Bytes so far ... */ - - /* file version number 1 Byte */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFVersNum); - - /* directory access rights 1 Byte */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioACUser); - - /* Creation-time 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlCrDat >> 24); - /* Modification-time 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlMdDat >> 24); - /* Backup-time 4 Bytes */ - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 8); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 16); - *ef++ = (char)(MacZip.fpb.hFileInfo.ioFlBkDat >> 24); - - /* 38 Bytes so far ... */ -#ifdef USE_EF_UT_TIME - if (MacZip.HaveGMToffset) { - /* GMT-Offset times 12 Bytes */ - *ef++ = (char)(MacZip.Cr_UTCoffs); - *ef++ = (char)(MacZip.Cr_UTCoffs >> 8); - *ef++ = (char)(MacZip.Cr_UTCoffs >> 16); - *ef++ = (char)(MacZip.Cr_UTCoffs >> 24); - *ef++ = (char)(MacZip.Md_UTCoffs); - *ef++ = (char)(MacZip.Md_UTCoffs >> 8); - *ef++ = (char)(MacZip.Md_UTCoffs >> 16); - *ef++ = (char)(MacZip.Md_UTCoffs >> 24); - *ef++ = (char)(MacZip.Bk_UTCoffs); - *ef++ = (char)(MacZip.Bk_UTCoffs >> 8); - *ef++ = (char)(MacZip.Bk_UTCoffs >> 16); - *ef++ = (char)(MacZip.Bk_UTCoffs >> 24); - } - /* 50 Bytes so far ... */ -#endif - - /* Text Encoding Base (charset) 2 Bytes */ - *ef++ = (char)(MacZip.CurrTextEncodingBase); - *ef++ = (char)(MacZip.CurrTextEncodingBase >> 8); - /* 52 Bytes so far ... */ - - /* MacZip.CurrentFork will be changed, so we have to save it */ - tempFork = MacZip.CurrentFork; - if (!MacZip.StoreFullPath) { - temp_Pathname = StripPartialDir(tmp_buffer, MacZip.SearchDir, - MacZip.FullPath); - } else { - temp_Pathname = MacZip.FullPath; - } - MacZip.CurrentFork = tempFork; - - FLength = strlen(temp_Pathname) + 1; - memcpy( ef, temp_Pathname, (size_t)FLength ); - ef += FLength; /* make room for the string - variable length */ - - err = FSpLocationFromFullPath(strlen(MacZip.FullPath), MacZip.FullPath, - &MacZip.fileSpec); - printerr("FSpLocationFromFullPath:", err, err, - __LINE__, __FILE__, tmp_buffer); - - err = FSpDTGetComment(&MacZip.fileSpec, comment); - printerr("FSpDTGetComment:", (err != -5012) && (err != 0), err, - __LINE__, __FILE__, ""); - PToCCpy(comment,tmp_buffer); - - CLength = strlen(tmp_buffer) + 1; - memcpy( ef, tmp_buffer, (size_t)CLength ); - ef += CLength; /* make room for the string - variable length */ - - if (verbose) printf("\n comment: [%s]", tmp_buffer); - - return (unsigned)(ef - ef_m3_begin); -} - - - - - - -/* -* Print all native data of the new mac local extra field. -* It's for debugging purposes and disabled by default. -*/ - -static void PrintFileInfo(void) -{ -DateTimeRec MacTime; - -printf("\n\n---------------------------------------------"\ - "----------------------------------"); -printf("\n FullPath Name = [%s]", MacZip.FullPath); -printf("\n File Attributes = %s 0x%x %d", - sBit2Str(MacZip.fpb.hFileInfo.ioFlAttrib), - MacZip.fpb.hFileInfo.ioFlAttrib, - MacZip.fpb.hFileInfo.ioFlAttrib); -printf("\n Enclosing Folder ID# = 0x%x %d", - MacZip.fpb.hFileInfo.ioFlParID, - MacZip.fpb.hFileInfo.ioFlParID); - -if (!MacZip.isDirectory) -{ -printf("\n File Type = [%c%c%c%c] 0x%lx", - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType); - -printf("\n File Creator = [%c%c%c%c] 0x%lx", - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); - -printf("\n Data Fork :" ); -printf("\n Actual (Logical) Length = %d 0x%x ", - MacZip.fpb.hFileInfo.ioFlLgLen, - MacZip.fpb.hFileInfo.ioFlLgLen); -printf("\n Allocated (Physical) Length = %d 0x%x", - MacZip.fpb.hFileInfo.ioFlPyLen, - MacZip.fpb.hFileInfo.ioFlPyLen); -printf("\n Resource Fork :" ); -printf("\n Actual (Logical) Length = %d 0x%x", - MacZip.fpb.hFileInfo.ioFlRLgLen, - MacZip.fpb.hFileInfo.ioFlRLgLen ); -printf("\n Allocated (Physical) Length = %d 0x%x", - MacZip.fpb.hFileInfo.ioFlRPyLen, - MacZip.fpb.hFileInfo.ioFlRPyLen ); -} - -printf("\n Dates : "); - -SecondsToDate (MacZip.CreatDate, &MacTime); -printf("\n Created = %4d/%2d/%2d %2d:%2d:%2d ", - MacTime.year, - MacTime.month, - MacTime.day, - MacTime.hour, - MacTime.minute, - MacTime.second); - -SecondsToDate (MacZip.BackDate, &MacTime); -printf("\n Backup = %4d/%2d/%2d %2d:%2d:%2d ", - MacTime.year, - MacTime.month, - MacTime.day, - MacTime.hour, - MacTime.minute, - MacTime.second); - -SecondsToDate (MacZip.ModDate, &MacTime); -printf("\n Modified = %4d/%2d/%2d %2d:%2d:%2d ", - MacTime.year, - MacTime.month, - MacTime.day, - MacTime.hour, - MacTime.minute, - MacTime.second); - -if (!MacZip.isDirectory) -{ -printf("\n Finder Flags : %s 0x%x %d", - sBit2Str(MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags), - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags); -printf("\n Finder Icon Position = X: %d 0x%x ", - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.h); -printf("\n Y: %d 0x%x ", - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdLocation.v); -} -else -{ -printf("\n Finder Flags : %s 0x%x %d", - sBit2Str(MacZip.fpb.dirInfo.ioDrUsrWds.frFlags), - MacZip.fpb.dirInfo.ioDrUsrWds.frFlags, - MacZip.fpb.dirInfo.ioDrUsrWds.frFlags); -printf("\n Finder Icon Position = X: %d 0x%x ", - MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.h, - MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.h); -printf("\n Y: %d 0x%x ", - MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.v, - MacZip.fpb.dirInfo.ioDrUsrWds.frLocation.v); -} - -printf("\n----------------------------------------------------"\ - "---------------------------\n"); -} - - - -/* -* If the switch '-v' is used, print some more info. -*/ - -static void print_extra_info(void) -{ -char Fork[20]; - -if (MacZip.CurrentFork == DataFork) sstrcpy(Fork,""); -else sstrcpy(Fork,""); - -printf("\n%16s [%c%c%c%c] [%c%c%c%c]",Fork, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 24, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 16, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType >> 8, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType, - - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 24, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 16, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator >> 8, - MacZip.fpb.hFileInfo.ioFlFndrInfo.fdCreator); -} diff --git a/third_party/infozip/zip/macos/source/getenv.c b/third_party/infozip/zip/macos/source/getenv.c deleted file mode 100644 index 3b2232790..000000000 --- a/third_party/infozip/zip/macos/source/getenv.c +++ /dev/null @@ -1,398 +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 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 -*/ -/* - -This file implements the getenv() function. - -# Background: -# Under Unix: Each Process (= running Program) has a set of -# associated variables. The variables are called enviroment -# variables and, together, constitute the process environment. -# These variables include the search path, the terminal type, -# and the user's login name. - -# Unfortunatelly the MacOS has no equivalent. So we need -# a file to define the environment variables. -# Name of this file is "MacZip.Env". It can be placed -# in the current folder of MacZip or in the -# preference folder of the system disk. -# If MacZip founds the "MacZip.Env" file in the current -# the folder of MacZip the "MacZip.Env" file in the -# preference folder will be ignored. - -# An environment variable has a name and a value: -# Name=Value -# Note: Spaces are significant: -# ZIPOPT=-r and -# ZIPOPT = -r are different !!! - - - */ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "pathname.h" -#include "helpers.h" - -/*****************************************************************************/ -/* Module level Vars */ -/*****************************************************************************/ - -static char ListAllKeyValues = 0; -static unsigned LineNumber = 0; -static char CompletePath[NAME_MAX]; -Boolean IgnoreEnvironment = false; /* used by dialog.c and initfunc.c - of the Mainapp */ - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -typedef struct _EnviromentPair { - char *key; - char *value; -} EnviromentPair; - - -#define MAX_COMMAND 1024 - - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ - - -int get_char(FILE *file); -void unget_char(int ch,FILE *file); -int get_string(char *string,int size, FILE *file, char *terms); -void skip_comments(FILE *file); -char *load_entry(FILE *file); -char *getenv(const char *name); -EnviromentPair *ParseLine(char *line); -OSErr FSpFindFolder_Name(short vRefNum, OSType folderType, - Boolean createFolder,FSSpec *spec, unsigned char *name); -FILE * FSp_fopen(ConstFSSpecPtr spec, const char * open_mode); -void ShowAllKeyValues(void); -void Set_LineNum(unsigned ln); - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - -/* get_string(str, max, file, termstr) : like fgets() but - * (1) has terminator string which should include \n - * (2) will always leave room for the null - * (3) uses get_char() so LineNumber will be accurate - * (4) returns EOF or terminating character, whichever - */ -int get_string(char *string, int size, FILE *file, char *terms) -{ - int ch; - - while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) { - if (size > 1) { - *string++ = (char) ch; - size--; - } - } - - if (size > 0) - { - *string = '\0'; - } - - return ch; -} - - - - -void Set_LineNum(unsigned ln) -{ - LineNumber = ln; -} - - - -/* get_char(file) : like getc() but increment LineNumber on newlines - */ -int get_char(FILE *file) -{ - int ch; - - ch = getc(file); - if (ch == '\n') - { - Set_LineNum(LineNumber + 1); - } - - return ch; -} - - - - -/* skip_comments(file) : read past comment (if any) - */ -void skip_comments(FILE *file) -{ - int ch; - - while (EOF != (ch = get_char(file))) - { - /* ch is now the first character of a line. - */ - - while (ch == ' ' || ch == '\t') - { - ch = get_char(file); - } - - if (ch == EOF) - { - break; - } - - /* ch is now the first non-blank character of a line. - */ - - if (ch != '\n' && ch != '#') - { - break; - } - - /* ch must be a newline or comment as first non-blank - * character on a line. - */ - - while (ch != '\n' && ch != EOF) - { - ch = get_char(file); - } - - /* ch is now the newline of a line which we're going to - * ignore. - */ - } - - if (ch != EOF) - { - unget_char(ch, file); - } -} - - - - -/* unget_char(ch, file) : like ungetc but do LineNumber processing - */ -void unget_char(int ch, FILE *file) -{ - ungetc(ch, file); - if (ch == '\n') - { - Set_LineNum(LineNumber - 1); - } -} - - -/* this function reads one file entry -- the next -- from a file. -* it skips any leading blank lines, ignores comments, and returns -* NULL if for any reason the entry can't be read and parsed. -*/ - -char *load_entry(FILE *file) -{ - int ch; - static char cmd[MAX_COMMAND]; - - skip_comments(file); - - ch = get_string(cmd, MAX_COMMAND, file, "\n"); - - if (ch == EOF) - { - return NULL; - } - - return cmd; -} - - - - - -EnviromentPair *ParseLine(char *line) -{ -char *tmpPtr; -static EnviromentPair *Env; -unsigned short length = strlen(line); - -Env->key = ""; -Env->value = ""; - -for (tmpPtr = line; *tmpPtr; tmpPtr++) - { - if (*tmpPtr == '=') - { - *tmpPtr = 0; - Env->key = line; - if (strlen(Env->key) < length) - { - Env->value = ++tmpPtr; - } - return Env; - } - } -return Env; -} - - - - - -char *getenv(const char *name) -{ -FILE *fp; -char *LineStr = NULL; -EnviromentPair *Env1; -FSSpec spec; -OSErr err; - -if (IgnoreEnvironment) - return NULL; /* user wants to ignore the environment vars */ - -if (name == NULL) - return NULL; - -GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); - -/* try open the file in the current folder */ -fp = FSp_fopen(&spec,"r"); -if (fp == NULL) - { /* Okey, lets try open the file in the preference folder */ - FSpFindFolder_Name( - kOnSystemDisk, - kPreferencesFolderType, - kDontCreateFolder, - &spec, - "\pMacZip.Env"); - fp = FSp_fopen(&spec,"r"); - if (fp == NULL) - { - return NULL; /* there is no enviroment-file */ - } - } - -LineStr = load_entry(fp); -while (LineStr != NULL) - { /* parse the file line by line */ - Env1 = ParseLine(LineStr); - if (strlen(Env1->value) > 0) - { /* we found a key/value pair */ - if (ListAllKeyValues) - printf("\n Line:%3d [%s] = [%s]",LineNumber,Env1->key,Env1->value); - if (stricmp(name,Env1->key) == 0) - { /* we found the value of a given key */ - return Env1->value; - } - } - LineStr = load_entry(fp); /* read next line */ - } -fclose(fp); - -return NULL; -} - - - - - -OSErr FSpFindFolder_Name( - short vRefNum, /* Volume reference number. */ - OSType folderType, /* Folder type taken by FindFolder. */ - Boolean createFolder, /* Should we create it if non-existant. */ - FSSpec *spec, /* Pointer to resulting directory. */ - unsigned char *name) /* Name of the file in the folder */ -{ - short foundVRefNum; - long foundDirID; - OSErr err; - - err = FindFolder(vRefNum, folderType, createFolder, - &foundVRefNum, &foundDirID); - if (err != noErr) - { - return err; - } - - err = FSMakeFSSpec(foundVRefNum, foundDirID, name, spec); - return err; -} - - - - -void ShowAllKeyValues(void) -{ -OSErr err; -FSSpec spec; -Boolean tmpIgnoreEnvironment = IgnoreEnvironment; - -ListAllKeyValues = 1; -IgnoreEnvironment = false; - -GetCompletePath(CompletePath,"MacZip.Env",&spec,&err); -if (err != 0) - { /* Okey, lets try open the file in the preference folder */ - FSpFindFolder_Name( - kOnSystemDisk, - kPreferencesFolderType, - kDontCreateFolder, - &spec, - "\pMacZip.Env"); - GetFullPathFromSpec(CompletePath,&spec, &err); - if (err != 0) - { - return; /* there is no enviroment-file */ - } - } - -printf("\nLocation of the current \"MacZip.Env\" file:\n [%s]",CompletePath); - -printf("\n\nList of all environment variables\n"); -getenv(" "); -printf("\n\nEnd\n\n"); - -/* restore used variables */ -ListAllKeyValues = 0; -LineNumber = 0; -IgnoreEnvironment = tmpIgnoreEnvironment; -} - - - - - - - - - - diff --git a/third_party/infozip/zip/macos/source/helpers.c b/third_party/infozip/zip/macos/source/helpers.c deleted file mode 100644 index 36b5befbb..000000000 --- a/third_party/infozip/zip/macos/source/helpers.c +++ /dev/null @@ -1,479 +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 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 -*/ -/*--------------------------------------------------------------------------- - - helpers.c - - Some useful functions Used by unzip and zip. - - ---------------------------------------------------------------------------*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include "zip.h" -#include -#include -#include - -#include "macstuff.h" -#include "helpers.h" -#include "pathname.h" - - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - - -extern int noisy; -extern char MacPathEnd; -extern char *zipfile; /* filename of the Zipfile */ -extern char *tempzip; /* Temporary zip file name */ -extern ZCONST unsigned char MacRoman_to_WinCP1252[128]; - - -static char argStr[1024]; -static char *argv[MAX_ARGS + 1]; - - - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - -/* -** Copy a C string to a Pascal string -** -*/ - -unsigned char *CToPCpy(unsigned char *pstr, char *cstr) -{ - register char *dptr; - register unsigned len; - - len=0; - dptr=(char *)pstr+1; - while (len<255 && (*dptr++ = *cstr++)!='\0') ++len; - *pstr= (unsigned char)len; - return pstr; -} - - -/* -** Copy a Pascal string to a C string -** -*/ - -char *PToCCpy(unsigned char *pstr, char *cstr) -{ -strncpy(cstr, (char *) &pstr[1], *pstr); - cstr[pstr[0]] = '\0'; /* set endmarker for c-string */ -return cstr; -} - - -/* -** strcpy() and strcat() work-alikes which allow overlapping buffers. -*/ - -char *sstrcpy(char *to,const char *from) -{ - memmove(to, from, 1+strlen(from)); - return to; -} - -char *sstrcat(char *to,const char *from) -{ - sstrcpy(to + strlen(to), from); - return to; -} - - - -/* -** Alloc memory and init it -** -*/ - -char *StrCalloc(unsigned short size) -{ -char *strPtr = NULL; - -if ((strPtr = calloc(size, sizeof(char))) == NULL) - printerr("StrCalloc failed:", -1, size, __LINE__, __FILE__, ""); - -Assert_it(strPtr,"strPtr == NULL","") -return strPtr; -} - - - -/* -** Release only non NULL pointers -** -*/ - -char *StrFree(char *strPtr) -{ - -if (strPtr != NULL) - { - free(strPtr); - } - -return NULL; -} - - - - -/* -** Return a value in a binary string -** -*/ - -char *sBit2Str(unsigned short value) -{ - static char str[sizeof(value)*8]; - int biz = 16; - int strwid = 16; - int i, j; - char *tempPtr = str; - - j = strwid - (biz + (biz >> 2)- (biz % 4 ? 0 : 1)); - - for (i = 0; i < j; i++) { - *tempPtr++ = ' '; - } - while (--biz >= 0) - { - *tempPtr++ = ((value >> biz) & 1) + '0'; - if (!(biz % 4) && biz) { - *tempPtr++ = ' '; - } - } - *tempPtr = '\0'; - - return str; -} - - - - -/* -** Parse commandline style arguments -** -*/ - -int ParseArguments(char *s, char ***arg) -{ - int n = 1, Quote = 0; - char *p = s, *p1, c; - - argv[0] = GetAppName(); - - *arg = argv; - - p1 = (char *) argStr; - while ((c = *p++) != 0) { - if (c==' ') continue; - argv[n++] = p1; - if (n > MAX_ARGS) - return (n-1); - do { - if (c=='\\' && *p++) - c = *p++; - else - if ((c=='"') || (c == '\'')) { - if (!Quote) { - Quote = c; - continue; - } - if (c == Quote) { - Quote = 0; - continue; - } - } - *p1++ = c; - } while (*p && ((c = *p++) != ' ' || Quote)); - *p1++ = '\0'; - } - return n; -} - - - -/* -** Print commandline style arguments -** -*/ - -void PrintArguments(int argc, char **argv) -{ - -printf("\n Arguments:"); -printf("\n --------------------------"); - -while(--argc >= 0) - printf("\n argc: %d argv: [%s]", argc, &*argv[argc]); - -printf("\n --------------------------\n\n"); -return; -} - - - -/* -** return some error-msg on file-system -** -*/ - -int PrintUserHFSerr(int cond, int err, char *msg2) -{ -char *msg; - -if (cond != 0) - { - switch (err) - { - case -35: - msg = "No such Volume"; - break; - - case -56: - msg = "No such Drive"; - break; - - case -37: - msg = "Bad Volume Name"; - break; - - case -49: - msg = "File is already open for writing"; - break; - - case -43: - msg = "Directory/File not found"; - break; - - case -120: - msg = "Directory/File not found or incomplete pathname"; - break; - - default: return err; - } - fprintf(stderr, "\n\n Error: %s ->%s", msg, msg2); - exit(err); - } - -return 0; -} - - - -/* -** Check mounted volumes and return number of volumes -** with the same name. -*/ - -short CheckMountedVolumes(char *FullPath) -{ -FSSpec volumes[50]; /* 50 Volumes should be enough */ -char VolumeName[257], volume[257]; -short actVolCount, volIndex = 1, VolCount = 0; -OSErr err; -int i; - -GetVolumeFromPath(FullPath, VolumeName); - -err = OnLine(volumes, 50, &actVolCount, &volIndex); -printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); - -for (i=0; i < actVolCount; i++) - { - PToCCpy(volumes[i].name,volume); - if (stricmp(volume, VolumeName) == 0) VolCount++; - } -printerr("OnLine: ", (VolCount == 0), VolCount, __LINE__, __FILE__, FullPath); - -return VolCount; -} - - - - - - - - -/* -** compares strings, ignoring differences in case -** -*/ - -int stricmp(const char *p1, const char *p2) -{ -int diff; - -while (*p1 && *p2) - { - if (*p1 != *p2) - { - if (isalpha(*p1) && isalpha(*p2)) - { - diff = toupper(*p1) - toupper(*p2); - if (diff) return diff; - } - else break; - } - p1++; - p2++; - } -return *p1 - *p2; -} - - - -/* -** Convert the MacOS-Strings (Filenames/Findercomments) to a most compatible. -** These strings will be stored in the public area of the zip-archive. -** Every foreign platform (outside macos) will access these strings -** for extraction. -*/ - -void MakeCompatibleString(char *MacOS_Str, - const char SpcChar1, const char SpcChar2, - const char SpcChar3, const char SpcChar4, - short CurrTextEncodingBase) -{ - char *tmpPtr; - register uch curch; - - Assert_it(MacOS_Str,"MakeCompatibleString MacOS_Str == NULL","") - for (tmpPtr = MacOS_Str; (curch = *tmpPtr) != '\0'; tmpPtr++) - { - if (curch == SpcChar1) - *tmpPtr = SpcChar2; - else - if (curch == SpcChar3) - *tmpPtr = SpcChar4; - else /* default */ - /* now convert from MacRoman to ISO-8859-1 */ - /* but convert only if MacRoman is activ */ - if ((CurrTextEncodingBase == kTextEncodingMacRoman) && - (curch > 127)) - { - *tmpPtr = (char)MacRoman_to_WinCP1252[curch - 128]; - } - } /* end for */ -} - - - - -Boolean CheckForSwitch(char *Switch, int argc, char **argv) -{ - char *p; /* steps through option arguments */ - int i; /* arg counter, root directory flag */ - - for (i = 1; i < argc; i++) - { - if (argv[i][0] == '-') - { - if (argv[i][1]) - { - for (p = argv[i]+1; *p; p++) - { - if (*p == Switch[0]) - { - return true; - } - if ((Switch[1] != NULL) && - ((*p == Switch[0]) && (*p == Switch[1]))) - { - return true; - } - } - } - } - } - -return false; -} - - - - - - - -#if (defined(USE_SIOUX) || defined(MACUNZIP_STANDALONE)) - -/* -** checks the condition and returns an error-msg -** this function is for internal use only -*/ - -OSErr printerr(const char *msg, int cond, int err, int line, char *file, - const char *msg2) -{ - -if (cond != 0) - { - fprintf(stderr, "\nint err: %d: %s %d [%d/%s] {%s}\n", clock(), msg, err, - line, file, msg2); - } - -return cond; -} - - -/* -fake-functions: -Not Implemented for metrowerks SIOUX -*/ - -void leftStatusString(char *status) -{ -status = status; -} - - -void rightStatusString(char *status) -{ -status = status; -} - - - -void DoWarnUserDupVol( char *FullPath ) -{ - char VolName[257]; - GetVolumeFromPath(FullPath, VolName); - - printf("\n There are more than one volume that has the same name !!\n"); - - printf("\n Volume: %s\n",VolName); - - printf("\n This port has one weak point:"); - printf("\n It is based on pathnames. As you may be already know:"); - printf("\n Pathnames are not unique on a Mac !"); - printf("\n MacZip has problems to find the correct location of"); - printf("\n the archive or the files.\n"); - - printf("\n My (Big) recommendation: Name all your volumes with an"); - printf("\n unique name and MacZip will run without any problem."); -} - - - -#endif diff --git a/third_party/infozip/zip/macos/source/helpers.h b/third_party/infozip/zip/macos/source/helpers.h deleted file mode 100644 index a9df5d86d..000000000 --- a/third_party/infozip/zip/macos/source/helpers.h +++ /dev/null @@ -1,57 +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 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 -*/ -#ifndef HELPERS_H -#define HELPERS_H 1 - - /* Convert a C string to a Pascal string */ -unsigned char *CToPCpy(unsigned char *pstr, char *cstr); - - /* Convert a Pascal string to a C string */ -char *PToCCpy(unsigned char *pstr, char *cstr); - -char *sstrcpy(char *to,const char *from); -char *sstrcat(char *to,const char *from); - -char *StrCalloc(unsigned short size); -char *StrFree(char *strPtr); - -char *sBit2Str(unsigned short value); - -void print_extra_info(void); - -int ParseArguments(char *s, char ***arg); -void PrintArguments(int argc, char **argv); - -Boolean IsZipFile(char *name); -OSErr printerr(const char *msg, int cond, int err, int line, char *file, - const char *msg2); -int PrintUserHFSerr(int cond, int err, char *msg2); - -short CheckMountedVolumes(char *FullPath); -void DoWarnUserDupVol(char *path); - -void PrintFileInfo(void); - -int stricmp(const char *p1, const char *p2); -void leftStatusString(char *status); -void rightStatusString(char *status); - -Boolean isZipFile(FSSpec *fileToOpen); - -unsigned long MacFileDate_to_UTime(unsigned long mactime); -Boolean CheckForSwitch(char *Switch, int argc, char **argv); - -void MakeCompatibleString(char *MacOS_Str, - const char SpcChar1, const char SpcChar2, - const char SpcChar3, const char SpcChar4, - short CurrTextEncodingBase); - -#define MAX_ARGS 25 - -#endif /* HELPERS_H */ diff --git a/third_party/infozip/zip/macos/source/macglob.h b/third_party/infozip/zip/macos/source/macglob.h deleted file mode 100644 index 17415e1f2..000000000 --- a/third_party/infozip/zip/macos/source/macglob.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef _MACGLOBAL_ -#define _MACGLOBAL_ - -#include - -/* -all my Global vars are defined here. -*/ - -#define ResourceFork -1 -#define DataFork 1 -#define NoFork 0 - -/* -all my Global vars are defined here. -*/ -typedef struct { - short CurrentFork; - short MacZipMode; - - Boolean isMacStatValid; - Boolean HaveGMToffset; - - short CurrTextEncodingBase; - - /* info about the current file */ - Boolean isDirectory; - char FullPath[NAME_MAX]; - char FileName[NAME_MAX]; - FSSpec fileSpec; - - long dirID; - CInfoPBRec fpb; - - /* time infos about the current file */ - time_t CreatDate; - time_t ModDate; - time_t BackDate; - long Cr_UTCoffs; /* offset "local time - UTC" for CreatDate */ - long Md_UTCoffs; /* offset "local time - UTC" for ModDate */ - long Bk_UTCoffs; /* offset "local time - UTC" for BackDate */ - - /* some statistics over all*/ - unsigned long FoundFiles; - unsigned long FoundDirectories; - unsigned long RawCountOfItems; - unsigned long BytesOfData; - - unsigned long attrsize; - - /* some switches and user parameters */ - Boolean DataForkOnly; - Boolean StoreFullPath; - Boolean StoreFoldersAlso; /* internal switch is true if '-r' is set */ - unsigned short SearchLevels; - char Pattern[NAME_MAX]; - Boolean IncludeInvisible; - Boolean StatingProgress; - - char SearchDir[NAME_MAX]; - char CurrentPath[NAME_MAX]; - - /* current zip / tempzip file info */ - char ZipFullPath[NAME_MAX]; - - FSSpec ZipFileSpec; - unsigned long ZipFileType; - char TempZipFullPath[NAME_MAX]; - FSSpec TempZipFileSpec; - -} MacZipGlobals; - - - -void UserStop(void); - - -#endif diff --git a/third_party/infozip/zip/macos/source/macopen.c b/third_party/infozip/zip/macos/source/macopen.c deleted file mode 100644 index 9e1873032..000000000 --- a/third_party/infozip/zip/macos/source/macopen.c +++ /dev/null @@ -1,363 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/*** macopen.c; stuff only required for the Mac port ***/ - -#include "zip.h" - -#include -#include -#include -#include - -#include "helpers.h" -#include "pathname.h" -#include "macopen.h" -#include "macstuff.h" - -#ifdef MACZIP -#include "macglob.h" - -extern char *zipfile; /* filename of the Zipfile */ -extern char *tempzip; /* Temporary zip file name */ - -extern MacZipGlobals MacZip; - - -/* don't include "osdep.h" otherwise we will trap into endless loop */ -#undef open -#undef fopen - - - -FILE *MacFopen(const char *path, const char *mode) -{ -static char TruncPath[NAME_MAX]; -OSErr err = 0; - -AssertStr(path,path) - - /* open zipfile or tempzip */ -if (strcmp(zipfile,path) == 0) - { - GetCompletePath(MacZip.ZipFullPath,path,&MacZip.ZipFileSpec,&err); - err = PrintUserHFSerr((err != -43) && (err != 0), err, path); - printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path); - if (CheckMountedVolumes(MacZip.ZipFullPath) > 1) - DoWarnUserDupVol(MacZip.ZipFullPath); - - /* tempfile should appear in the same directory of the zipfile - -> save path of zipfile */ - TruncFilename(TruncPath, MacZip.ZipFullPath); - return fopen(MacZip.ZipFullPath, mode); - } - -if (strcmp(tempzip,path) == 0) - { /* add path of zipfile */ - sstrcat(TruncPath,tempzip); - GetCompletePath(MacZip.TempZipFullPath,TruncPath,&MacZip.TempZipFileSpec,&err); - err = PrintUserHFSerr((err != -43) && (err != 0), err, path); - printerr("GetCompletePath:",err,err,__LINE__,__FILE__,path); - - return fopen(MacZip.TempZipFullPath, mode); - } - -printerr("MacFopen:",err,err,__LINE__,__FILE__,path); -return NULL; -} - - - - -int MacOpen(const char *path,int oflag, ...) -{ -char RealFname[NAME_MAX]; - -AssertStr(path,path) - -RfDfFilen2Real(RealFname,path, MacZip.MacZipMode, MacZip.DataForkOnly, &MacZip.CurrentFork); -/* convert to real fname and init global var MacZip.CurrentFork !! */ - -switch (MacZip.CurrentFork) - { - case DataFork: - { - return my_open(RealFname, oflag); - break; - } - case ResourceFork: - { - return my_open( RealFname, oflag | O_RSRC); - break; - } - default: /* for now (Zip ver 2.3b) MacOpen should never reach this point */ - { /* however, this may change in the future ... */ - printerr("open: no resource / datafork ",-1,-1,__LINE__,__FILE__,path); - return -1; - } - } -} - - -#ifdef muell - /* file to delete */ -int destroy(char *path) -{ -static char lastpath[NAME_MAX]; -char currpath[NAME_MAX]; -static Boolean FirstCall = true; -long rc; - -AssertStr(path,path) - -RfDfFilen2Real(currpath, path, MacZip.MacZipMode, MacZip.DataForkOnly, &MacZip.CurrentFork); - -if (FirstCall == true) - { - FirstCall = false; - rc = remove(currpath); - } -else if (strcmp(currpath,lastpath) == 0) return 0; /* ignore, file is already deleted */ - else rc = remove(currpath); /* we are removeing all the files only by their - pathname this is dangerous on a mac but there is no other way without - a complete rewrite of the port */ - -strcpy(lastpath,currpath); - -return rc; -} -#endif - - - - -/* this function replaces the function "replace()" defined in fileio.c */ -int replace(char *new_f, char *temp_f) /* destination and source file names */ -{ -OSErr err = 0; -char newfname[NAME_MAX]; - -AssertStr(new_f,new_f) -AssertStr(temp_f,temp_f) - -UserStop(); - -GetFilename(newfname, new_f); - -/* check zipfile name and tempfile name */ -/* we are using this function only for replacing the tempfile with the zipfile */ -if ((strcmp(zipfile,new_f) == 0) || (strcmp(tempzip,temp_f) == 0)) - { - remove(MacZip.ZipFullPath); - - /* rename the temp file to the zip file */ - err = rename(MacZip.TempZipFullPath,MacZip.ZipFullPath); - printerr("rename:",err,err,__LINE__,__FILE__,MacZip.TempZipFullPath); -if (err != 0) return ZE_CREAT; - else return ZE_OK; - } -else return ZE_CREAT; -} - - - - /* file to delete */ - /* we are removeing all the files only by their - pathname this is dangerous on a mac but there is no - other way without a complete rewrite of the port */ - -int destroy(char *path) -{ -static char lastpath[NAME_MAX]; -static FSSpec trashfolder; -static Boolean FirstCall = true; -static char Num = 0; -static Boolean Immediate_File_Deletion = false; -char currpath[NAME_MAX], *envptr; -FSSpec fileToDelete; -OSErr err; - -/* init this function */ -if ((path == NULL) || - (strlen(path) == 0)) - { - FirstCall = true; - Num = 0; - return -1; - } - -UserStop(); - -RfDfFilen2Real(currpath, path, MacZip.MacZipMode, - MacZip.DataForkOnly, &MacZip.CurrentFork); -GetCompletePath(currpath,currpath,&fileToDelete, &err); - -if (FirstCall == true) - { - FirstCall = false; - sstrcpy(lastpath,currpath); - err = FSpFindFolder(fileToDelete.vRefNum, kTrashFolderType, - kDontCreateFolder,&trashfolder); - printerr("FSpFindFolder:",err,err,__LINE__,__FILE__,path); - - envptr = getenv("Immediate_File_Deletion"); - if (!(envptr == (char *)NULL || *envptr == '\0')) - { - if (stricmp(envptr,"yes") == 0) - Immediate_File_Deletion = true; - else - Immediate_File_Deletion = false; - } - - if (Immediate_File_Deletion) - { - err = FSpDelete(&fileToDelete); - return err; - } - - err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, - fileToDelete.name, trashfolder.parID, trashfolder.name); - return err; - } - -if (strcmp(currpath,lastpath) == 0) - { - return 0; /* ignore, file is already deleted */ - } -else - { - - if (Immediate_File_Deletion) - { - err = FSpDelete(&fileToDelete); - sstrcpy(lastpath,path); - return err; - } - - err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, - fileToDelete.name, trashfolder.parID, trashfolder.name); - - /* -48 = file is already existing so we have to rename it before - moving the file */ - if (err == -48) - { - Num++; - if (fileToDelete.name[0] >= 28) /* cut filename if to long */ - fileToDelete.name[0] = 28; - P2CStr(fileToDelete.name); - sprintf(currpath,"%s~%d",(char *)fileToDelete.name,Num); - C2PStr(currpath); - C2PStr((char *)fileToDelete.name); - err = HRename (fileToDelete.vRefNum, fileToDelete.parID, - fileToDelete.name, (unsigned char *) currpath); - err = CatMove (fileToDelete.vRefNum, fileToDelete.parID, - (unsigned char *) currpath, trashfolder.parID, - trashfolder.name); - } - } - -sstrcpy(lastpath,currpath); -return err; -} - - - -#endif /* #ifdef MACZIP */ - - - - -/* - * int open(const char *path, int oflag) - * - * Opens a file stream. - */ -int my_open(char *path, int oflag) -{ - FSSpec spec; - char permission; - HParamBlockRec hpb; - OSErr err, errno; - Boolean targetIsFolder, wasAliased; - - AssertStr(path,path) - - /* Setup permission */ - if ((oflag & 0x03) == O_RDWR) - permission = fsRdWrPerm; - else - permission = (oflag & O_RDONLY) ? fsRdPerm : 0 + (oflag & O_WRONLY) ? fsWrPerm : 0; - - FSpLocationFromFullPath(strlen(path),path, &spec); - if ((oflag & (O_ALIAS | O_NRESOLVE)) == 0) - ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased); - hpb.fileParam.ioNamePtr = spec.name; - hpb.fileParam.ioVRefNum = spec.vRefNum; - hpb.fileParam.ioDirID = spec.parID; - hpb.ioParam.ioPermssn = permission; - - if (oflag & O_RSRC) /* open the resource fork of the file */ - err = PBHOpenRFSync(&hpb); - else /* open the data fork of the file */ - err = PBHOpenDFSync(&hpb); - - if ((err == fnfErr) && (oflag & O_CREAT)) { - hpb.fileParam.ioFlVersNum = 0; - err = PBHCreateSync(&hpb); - if (err == noErr) { - /* Set the finder info */ - unsigned long secs; - unsigned long isbinary = oflag & O_BINARY; - - hpb.fileParam.ioFlFndrInfo.fdType = '\?\?\?\?'; - hpb.fileParam.ioFlFndrInfo.fdCreator = '\?\?\?\?'; - hpb.fileParam.ioFlFndrInfo.fdFlags = 0; - if (oflag & O_ALIAS) /* set the alias bit */ - hpb.fileParam.ioFlFndrInfo.fdFlags = kIsAlias; - else /* clear all flags */ - hpb.fileParam.ioFlFndrInfo.fdFlags = 0; - - GetDateTime(&secs); - hpb.fileParam.ioFlCrDat = hpb.fileParam.ioFlMdDat = secs; - PBHSetFInfoSync(&hpb); - } - - if (err && (err != dupFNErr)) { - errno = err; return -1; - } - - if (oflag & O_RSRC) /* open the resource fork of the file */ - err = PBHOpenRFSync(&hpb); - else /* open the data fork of the file */ - err = PBHOpenDFSync(&hpb); - } - - if (err && (err != dupFNErr) && (err != opWrErr)) { - errno = err; return -1; - } - - if (oflag & O_TRUNC) { - IOParam pb; - - pb.ioRefNum = hpb.ioParam.ioRefNum; - pb.ioMisc = 0L; - err = PBSetEOFSync((ParmBlkPtr)&pb); - if (err != noErr) { - errno = err; return -1; - } - } - - if (oflag & O_APPEND) lseek(hpb.ioParam.ioRefNum,0,SEEK_END); - - return (hpb.ioParam.ioRefNum); -} - - - - - diff --git a/third_party/infozip/zip/macos/source/macopen.h b/third_party/infozip/zip/macos/source/macopen.h deleted file mode 100644 index 152bceb2e..000000000 --- a/third_party/infozip/zip/macos/source/macopen.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef __MACOPEN_H__ -#define __MACOPEN_H__ - -#include -#include - - -FILE *MacFopen(const char *path, const char *mode); -int MacOpen(const char *path, int oflag, ...); - -int my_open(char *path, int oflag); - -#endif /* __MACOPEN_H__ */ diff --git a/third_party/infozip/zip/macos/source/macos.c b/third_party/infozip/zip/macos/source/macos.c deleted file mode 100644 index 935c9a15b..000000000 --- a/third_party/infozip/zip/macos/source/macos.c +++ /dev/null @@ -1,1079 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - macos.c - - Macintosh-specific routines for use with Info-ZIP's Zip 2.3 and later. - - ---------------------------------------------------------------------------*/ - - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include "zip.h" - -#include "revision.h" -#include "crypt.h" - -#include -#include -#include -#include - -#include - -#include -#include - -/* #include "charmap.h" */ -#include "helpers.h" -#include "macstuff.h" -#include "pathname.h" -#include "recurse.h" - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -#define PATH_END MacPathEnd - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - -int error_level; /* used only in ziperr() */ - - -/* Note: sizeof() returns the size of this allusion - 13 is current length of "XtraStuf.mac:" */ -extern const char ResourceMark[13]; /* var is initialized in file pathname.c */ - - -extern jmp_buf EnvForExit; -MacZipGlobals MacZip; - -unsigned long count_of_Zippedfiles = 0; - - -/*****************************************************************************/ -/* Module level Vars */ -/*****************************************************************************/ - -static const char MacPathEnd = ':'; /* the Macintosh dir separator */ - -/* Inform Progress vars */ -long estTicksToFinish; -long createTime; -long updateTicks; - -static char *Time_Est_strings[] = { - "Zipping Files; Items done:", - "More than 24 hours", - "More than %s hours", - "About %s hours, %s minutes", - "About an hour", - "Less than an hour", - "About %s minutes, %s seconds", - "About a minute", - "Less than a minute", - "About %s seconds", - "About a second", - "About 1 minute, %s seconds"}; - - - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ - -int DoCurrentDir(void); - -void DoAboutBox(void); -void DoQuit(void); -void DoEventLoop(void); - -void ZipInitAllVars(void); -void UserStop(void); -Boolean IsZipFile(char *name); - -static long EstimateCompletionTime(const long progressMax, - const long progressSoFar, unsigned char percent); -static void UpdateTimeToComplete(void); - - - - -#ifdef USE_SIOUX -#include -void DoWarnUserDupVol( char *FullPath ); - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - -/* -** Standalone Unzip with Metrowerks SIOUX starts here -** -*/ -int main(int argc, char **argv) -{ - int return_code; - - SIOUXSettings.asktosaveonclose = FALSE; - SIOUXSettings.showstatusline = TRUE; - - SIOUXSettings.columns = 100; - SIOUXSettings.rows = 40; - - /* 30 = MacZip Johnny Lee's; 40 = new (my) MacZip */ - MacZip.MacZipMode = NewZipMode_EF; - - argc = ccommand(&argv); - if (verbose) PrintArguments(argc, argv); - - ZipInitAllVars(); - - return_code = zipmain(argc, argv); - - if (verbose) printf("\n\n Finish"); - return return_code; -} - - - -/* -** SIOUX needs no extra event handling -** -*/ - -void UserStop(void) -{ -}; - - - - -/* -** Password enter function '*' printed for each char -** -*/ - -int macgetch(void) -{ - WindowPtr whichWindow; - EventRecord theEvent; - char c; /* one-byte buffer for read() to use */ - - do { - SystemTask(); - if (!GetNextEvent(everyEvent, &theEvent)) - theEvent.what = nullEvent; - else { - switch (theEvent.what) { - case keyDown: - c = theEvent.message & charCodeMask; - break; - case mouseDown: - if (FindWindow(theEvent.where, &whichWindow) == - inSysWindow) - SystemClick(&theEvent, whichWindow); - break; - case updateEvt: - break; - } - } - } while (theEvent.what != keyDown); - - printf("*"); - fflush(stdout); - - return (int)c; -} - -#endif - - - - -/******************************/ -/* Function version_local() */ -/******************************/ - -/* -** Print Compilers version and compile time/date -** -*/ - -void version_local() -{ -/* prints e.g: -Compiled with Metrowerks CodeWarrior version 2000 for PowerPC Processor - compile time: Feb 4 1998 17:49:49. -*/ - -static ZCONST char CompiledWith[] = - "\n\nCompiled with %s %x for %s \n %s %s %s.\n\n"; - - printf(CompiledWith, - - -#ifdef __MWERKS__ - " Metrowerks CodeWarrior version", __MWERKS__, -#endif - - -#ifdef __MC68K__ - " MC68K Processor", -#else - " PowerPC Processor", -#endif - -#ifdef __DATE__ - "compile time: ", __DATE__, __TIME__ -#else - "", "", "" -#endif - ); -} /* end function version_local() */ - - - - - -/* -** Deletes a dir if the switch '-m' is used -** -*/ - -int deletedir(char *path) -{ -static char Num = 0; -static FSSpec trashfolder; -static Boolean FirstCall = true; -static Boolean Immediate_File_Deletion = false; -OSErr err; -FSSpec dirToDelete; -char currpath[NAME_MAX], *envptr; -CInfoPBRec fpb; - -/* init this function */ -if ((path == NULL) || - (strlen(path) == 0)) - { - Num = 0; - FirstCall = true; - return -1; - } - -UserStop(); - -GetCompletePath(currpath,path,&dirToDelete, &err); - -if (FirstCall == true) - { - FirstCall = false; - envptr = getenv("Immediate_File_Deletion"); - if (!(envptr == (char *)NULL || *envptr == '\0')) - { - if (stricmp(envptr,"yes") == 0) - Immediate_File_Deletion = true; - else - Immediate_File_Deletion = false; - } - err = FSpFindFolder(dirToDelete.vRefNum, kTrashFolderType, - kDontCreateFolder,&trashfolder); - printerr("FSpFindFolder:",err,err,__LINE__,__FILE__,path); - } - - fpb.dirInfo.ioNamePtr = dirToDelete.name; - fpb.dirInfo.ioVRefNum = dirToDelete.vRefNum; - fpb.dirInfo.ioDrDirID = dirToDelete.parID; - fpb.dirInfo.ioFDirIndex = 0; - - err = PBGetCatInfoSync(&fpb); - printerr("PBGetCatInfo deletedir ", err, err, - __LINE__, __FILE__, ""); - -if (fpb.dirInfo.ioDrNmFls > 0) - { - return 0; /* do not move / delete folders which are not empty */ - } - -if (Immediate_File_Deletion) - { - err = FSpDelete(&dirToDelete); - return err; - } - -err = CatMove (dirToDelete.vRefNum, dirToDelete.parID, - dirToDelete.name, trashfolder.parID, trashfolder.name); - -/* -48 = file is already existing so we have to rename it before - moving the file */ -if (err == -48) - { - Num++; - if (dirToDelete.name[0] >= 28) /* cut foldername if to long */ - dirToDelete.name[0] = 28; - P2CStr(dirToDelete.name); - sprintf(currpath,"%s~%d",(char *)dirToDelete.name,Num); - C2PStr(currpath); - C2PStr((char *)dirToDelete.name); - err = HRename (dirToDelete.vRefNum, dirToDelete.parID, - dirToDelete.name, (unsigned char *) currpath); - - err = CatMove (dirToDelete.vRefNum, dirToDelete.parID, - (unsigned char *) currpath, trashfolder.parID, - trashfolder.name); - } - -return err; -} - - - - -/* -** Set the file-type so the archive will get the correct icon, type -** and creator code. -*/ - -void setfiletype(char *new_f, unsigned long Creator, unsigned long Type) -{ -OSErr err; - -if (strcmp(zipfile, new_f) == 0) - err = FSpChangeCreatorType(&MacZip.ZipFileSpec, Creator, Type); -printerr("FSpChangeCreatorType:", err, err, __LINE__, __FILE__, new_f); - -return; -} - - - - - -/* -** Convert the external (native) filename into Zip's internal Unix compatible -** name space. -*/ - -char *ex2in(char *externalFilen, int isdir, int *pdosflag) -/* char *externalFilen external file name */ -/* int isdir input: externalFilen is a directory */ -/* int *pdosflag output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *internalFilen; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - char *Pathname; - char buffer[NAME_MAX]; - int dosflag; - - AssertStr(externalFilen, externalFilen) - AssertBool(isdir,"") - - dosflag = dosify; /* default for non-DOS and non-OS/2 */ - - /* Find starting point in name before doing malloc */ - for (t = externalFilen; *t == PATH_END; t++) - ; - - if (!MacZip.StoreFullPath) - { - Pathname = StripPartialDir(buffer, MacZip.SearchDir,t); - } - else - { - Pathname = t; - } - - /* Make changes, if any, to the copied name (leave original intact) */ - if (!pathput) - { - t = last(Pathname, PATH_END); - } - else t = Pathname; - - /* Malloc space for internal name and copy it */ - if ((internalFilen = malloc(strlen(t) + 10 + strlen(ResourceMark) )) == NULL) - return NULL; - - sstrcpy(internalFilen, t); - - /* we have to eliminate illegal chars: - * The name space for Mac filenames and Zip filenames (unix style names) - * do both include all printable extended-ASCII characters. The only - * difference we have to take care of is the single special character - * used as path delimiter: - * ':' on MacOS and '/' on Unix and '\' on Dos. - * So, to convert between Mac filenames and Unix filenames without any - * loss of information, we simply interchange ':' and '/'. Additionally, - * we try to convert the coding of the extended-ASCII characters into - * InfoZip's standard ISO 8859-1 codepage table. - */ - MakeCompatibleString(internalFilen, ':', '/', '/', ':', - MacZip.CurrTextEncodingBase); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - - if (isdir) - { - return internalFilen; /* avoid warning on unused variable */ - } - - if (dosify) - { - msname(internalFilen); - printf("\n ex2in: %s",internalFilen); - } - - return internalFilen; -} - - - -/* -** Collect all filenames. Go through all directories -** -*/ - -int wild(char *Pathpat) - /* path/pattern to match */ -/* If not in exclude mode, expand the pattern based on the contents of the - file system. Return an error code in the ZE_ class. */ -{ -FSSpec Spec; -char fullpath[NAME_MAX]; -OSErr err; - -AssertStr(Pathpat, Pathpat); - -if (noisy) printf("%s \n\n",GetZipVersionsInfo()); - -if (extra_fields == 0) - { - MacZip.DataForkOnly = true; - } - -/* for switch '-R' -> '.' means current dir */ -if (strcmp(Pathpat,".") == 0) sstrcpy(Pathpat,"*"); - -sstrcpy(MacZip.Pattern,Pathpat); - -if (recurse) - { - MacZip.StoreFoldersAlso = true; - MacZip.SearchLevels = 0; /* if 0 we aren't checking levels */ - } -else - { - MacZip.StoreFoldersAlso = false; - MacZip.SearchLevels = 1; - } - -/* make complete path */ -GetCompletePath(fullpath, MacZip.Pattern, &Spec,&err); -err = PrintUserHFSerr((err != -43) && (err != 0), err, MacZip.Pattern); -printerr("GetCompletePath:", err, err, __LINE__, __FILE__, fullpath); - -/* extract the filepattern */ -GetFilename(MacZip.Pattern, fullpath); - -/* extract Path and get FSSpec of search-path */ -/* get FSSpec of search-path ; we need a dir to start - searching for filenames */ -TruncFilename(MacZip.SearchDir, fullpath); -GetCompletePath(MacZip.SearchDir, MacZip.SearchDir, &Spec,&err); - -if (noisy) { - if (MacZip.SearchLevels == 0) - { - printf("\nSearch Pattern: [%s] Levels: all", MacZip.Pattern); - } - else - { - printf("\nSearch Pattern: [%s] Levels: %d", MacZip.Pattern, - MacZip.SearchLevels); - } - printf("\nSearch Path: [%s]", MacZip.SearchDir); - printf("\nZip-File: [%s] \n",MacZip.ZipFullPath); - -} - -/* we are working only with pathnames; - * this can cause big problems on a mac ... - */ -if (CheckMountedVolumes(MacZip.SearchDir) > 1) - DoWarnUserDupVol(MacZip.SearchDir); - -/* start getting all filenames */ -err = FSpRecurseDirectory(&Spec, MacZip.SearchLevels); -printerr("FSpRecurseDirectory:", err, err, __LINE__, __FILE__, ""); - -return ZE_OK; -} - - - -/* -** Convert the internal filename into a external (native). -** The user will see this modified filename. -** For more performance: -** I do not completly switch back to the native macos filename. -** The user will still see directory separator '/' and the converted -** charset. -*/ - -char *in2ex(char *n) /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - AssertStr(n,n) - - if ((x = malloc(strlen(n) + 1)) == NULL) - return NULL; - - RfDfFilen2Real(x, n, MacZip.MacZipMode, MacZip.DataForkOnly, - &MacZip.CurrentFork); - - return x; -} - - - - -/* -** Process on filenames. This function will be called to collect -** the filenames. -*/ - -int procname(char *filename, /* name to process */ - int caseflag) /* true to force case-sensitive match - (always false on a Mac) */ -/* Process a name . Return - an error code in the ZE_ class. */ -{ - int rc; /* matched flag */ - -AssertBool(caseflag,"caseflag") -AssertStr(filename,filename) - - /* add or remove name of file */ -rc = newname(filename, MacZip.isDirectory, caseflag); - -return rc; -} - - - - -ulg filetime( -char *f, /* name of file to get info on */ -ulg *a, /* return value: file attributes */ -long *n, /* return value: file size */ -iztimes *t) /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - - AssertStr(f,f) - - if (strlen(f) == 0) return 0; - - if (SSTAT(f, &s) != 0) - /* Accept about any file kind including directories - * (stored with trailing : with -r option) - */ - return 0; - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - if (MacZip.isDirectory) { - *a |= MSDOS_DIR_ATTR; - } - } - if (n != NULL) - *n = (s.st_mode & UNX_IFMT) == UNX_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; /* on Mac, st_ctime contains creation time! */ - } - - return unix2dostime(&s.st_mtime); -} - - - -void stamp(char *f, ulg d) -/* char *f; name of file to change */ -/* ulg d; dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - time_t u[2]; /* argument for utime() */ - -f = f; - - /* Convert DOS time to time_t format in u */ - - u[0] = u[1] = dos2unixtime(d); -/* utime(f, u); */ -} - - - - -/* -** return only the longest part of the path: -** second parameter: Volume:test folder:second folder: -** third parameter: Volume:test folder:second folder:third folder:file -** result will be: third folder:file -** first parameter: contains string buffer that will be used to prepend -** the "resource mark" part in front of the result when -** a resource fork is processed in "M3" mode. -** -*/ - -char *StripPartialDir(char *CompletePath, - const char *PartialPath, const char *FullPath) -{ -const char *tmpPtr1 = PartialPath; -const char *tmpPtr2 = FullPath; -int result; - -Assert_it(CompletePath,"StripPartialDir","") -AssertStrNoOverlap(FullPath,PartialPath,PartialPath) - -if (MacZip.DataForkOnly) - { - tmpPtr2 += strlen(tmpPtr1); - return (char *)tmpPtr2; - } - -switch (MacZip.MacZipMode) - { - case JohnnyLee_EF: - { - tmpPtr2 += strlen(tmpPtr1); - return (char *)tmpPtr2; - break; - } - - case NewZipMode_EF: - { /* determine Fork type */ - result = strncmp(FullPath, ResourceMark, sizeof(ResourceMark)-2); - if (result != 0) - { /* data fork */ - MacZip.CurrentFork = DataFork; - tmpPtr2 += strlen(tmpPtr1); - return (char *)tmpPtr2; - } - else - { /* resource fork */ - MacZip.CurrentFork = ResourceFork; - sstrcpy(CompletePath, ResourceMark); - tmpPtr2 += strlen(tmpPtr1); - tmpPtr2 += sizeof(ResourceMark); - sstrcat(CompletePath, tmpPtr2); - return (char *)CompletePath; - } - break; - } - } - - return NULL; /* function should never reach this point */ -} - - - - -/* -** Init all global variables -** Must be called for each zip-run -*/ - -void ZipInitAllVars(void) -{ -getcwd(MacZip.CurrentPath, sizeof(MacZip.CurrentPath)); -/* MacZip.MacZipMode = JohnnyLee_EF; */ -MacZip.MacZipMode = NewZipMode_EF; - -MacZip.DataForkOnly = false; -MacZip.CurrentFork = NoFork; - -MacZip.StoreFoldersAlso = false; - -MacZip.FoundFiles = 0; -MacZip.FoundDirectories = 0; -MacZip.RawCountOfItems = 0; -MacZip.BytesOfData = 0; - -MacZip.StoreFullPath = false; -MacZip.StatingProgress = false; -MacZip.IncludeInvisible = false; - -MacZip.isMacStatValid = false; - -MacZip.CurrTextEncodingBase = FontScript(); - -MacZip.HaveGMToffset = false; - -createTime = TickCount(); -estTicksToFinish = -1; -updateTicks = 0; - -/* init some functions */ -IsZipFile(NULL); - -destroy(NULL); -deletedir(NULL); -ShowCounter(true); - -extra_fields = 1; -error_level = 0; -count_of_Zippedfiles = 0; -} - - - - -/* -** Get the findercomment and store it as file-comment in the Zip-file -** -*/ -char *GetComment(char *filename) -{ -OSErr err; -static char buffer[NAME_MAX]; -char buffer2[NAME_MAX]; -char *tmpPtr; - -if (filename == NULL) return NULL; - - /* now we can convert Unix-Path in HFS-Path */ -for (tmpPtr = filename; *tmpPtr; tmpPtr++) - if (*tmpPtr == '/') - *tmpPtr = ':'; - -if (MacZip.StoreFullPath) - { /* filename is already a fullpath */ - sstrcpy(buffer,filename); - } -else - { /* make a fullpath */ - sstrcpy(buffer,MacZip.SearchDir); - sstrcat(buffer,filename); - } - -/* make fullpath and get FSSpec */ -/* Unfortunately: I get only the converted filename here */ -/* so filenames with extended characters can not be found */ -GetCompletePath(buffer2,buffer, &MacZip.fileSpec, &err); -printerr("GetCompletePath:",(err != -43) && (err != -120) && (err != 0) , - err,__LINE__,__FILE__,buffer); - -err = FSpDTGetComment(&MacZip.fileSpec, (unsigned char *) buffer); -printerr("FSpDTGetComment:", (err != -5012) && (err != 0), err, - __LINE__, __FILE__, filename); -P2CStr((unsigned char *) buffer); -if (err == -5012) return NULL; /* no finder-comments found */ - -if (noisy) printf("\n%32s -> %s",filename, buffer); -/* -Beside the script change we need only to change 0x0d in 0x0a -so the last two arguments are not needed and does nothing. -*/ -MakeCompatibleString(buffer, 0x0d, 0x0a, ' ', ' ', - MacZip.CurrTextEncodingBase); - -return buffer; -} - - - - -/* -** Print a progress indicator for stating the files -** -*/ - -void PrintStatProgress(char *msg) -{ - -if (!noisy) return; /* do no output if noisy is false */ - -MacZip.StatingProgress = true; - -if (strcmp(msg,"done") == 0) - { - MacZip.StatingProgress = false; - printf("\n ... done \n\n"); - } -else printf("\n %s",msg); - -} - - - - -void InformProgress(const long progressMax, const long progressSoFar ) -{ -int curr_percent; -char no_time[5] = "..."; - -curr_percent = percent(progressMax, progressSoFar); - -if (curr_percent < 95) - { - estTicksToFinish = EstimateCompletionTime(progressMax, - progressSoFar, curr_percent); - } -else - { - rightStatusString(no_time); - leftStatusString(no_time); - } - -updateTicks = TickCount() + 60; -return; -} - - -void ShowCounter(Boolean reset) -{ -static char statusline[100]; -static unsigned long filecount = 0; - -if (reset) - { - filecount = 0; - return; - } - -if (noisy) - { - sprintf(statusline, "%6d", filecount++); - rightStatusString(statusline); - } -} - - -static long EstimateCompletionTime(const long progressMax, - const long progressSoFar, - unsigned char curr_percent) -{ - long max = progressMax, value = progressSoFar; - static char buf[100]; - unsigned long ticksTakenSoFar = TickCount() - createTime; - float currentRate = (float) ticksTakenSoFar / (float) value; - long newEst = (long)( currentRate * (float)( max - value )); - - sprintf(buf, "%d [%d%%]",progressSoFar, curr_percent); - rightStatusString(buf); - - estTicksToFinish = newEst; - - UpdateTimeToComplete(); - -return estTicksToFinish; -} - - - - - -static void UpdateTimeToComplete(void) -{ - short days, hours, minutes, seconds; - char estStr[255]; - Str15 xx, yy; - short idx = 0; - - if ( estTicksToFinish == -1 ) - return; - - days = estTicksToFinish / 5184000L; - hours = ( estTicksToFinish - ( days * 5184000L )) / 216000L; - minutes = ( estTicksToFinish - ( days * 5184000L ) - - ( hours * 216000L )) / 3600L; - seconds = ( estTicksToFinish - ( days * 5184000L ) - - ( hours * 216000L ) - ( minutes * 3600L )) / 60L; - - xx[0] = 0; - yy[0] = 0; - - if ( days ) - { - /* "more than 24 hours" */ - - idx = 1; - goto setEstTimeStr; - } - - if ( hours >= 8 ) - { - /* "more than x hours" */ - - NumToString( hours, xx ); - idx = 2; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 252000L ) /* > 1hr, 10 minutes */ - { - /* "about x hours, y minutes" */ - - NumToString( hours, xx ); - NumToString( minutes, yy ); - idx = 3; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 198000L ) /* > 55 minutes */ - { - /* "about an hour" */ - idx = 4; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 144000L ) /* > 40 minutes */ - { - /* "less than an hour" */ - - idx = 5; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 4200L ) /* > 1 minute, 10 sec */ - { - /* "about x minutes, y seconds */ - - NumToString( minutes, xx ); - NumToString( seconds, yy ); - - if ( minutes == 1 ) - idx = 11; - else - idx = 6; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 3000L ) /* > 50 seconds */ - { - /* "about a minute" */ - - idx = 7; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 1500L ) /* > 25 seconds */ - { - /* "less than a minute" */ - - idx = 8; - goto setEstTimeStr; - } - - if ( estTicksToFinish > 120L ) /* > 2 seconds */ - { - NumToString( seconds, xx ); - idx = 9; - goto setEstTimeStr; - } - - idx = 10; - - setEstTimeStr: - sprintf(estStr,Time_Est_strings[idx],P2CStr(xx),P2CStr(yy)); - leftStatusString((char *)estStr); -} - - - - - -/* -** Just return the zip version -** -*/ - -char *GetZipVersionsInfo(void) -{ -static char ZipVersion[100]; - -sprintf(ZipVersion, "Zip Module\n%d.%d%d%s of %s", Z_MAJORVER, Z_MINORVER, - Z_PATCHLEVEL, Z_BETALEVEL, REVDATE); - -return ZipVersion; -} - - - - -#ifndef USE_SIOUX - -/* -** Just return the copyright message -** -*/ - -char *GetZipCopyright(void) -{ -static char CopyR[300]; - -sstrcpy(CopyR, copyright[0]); -sstrcat(CopyR, copyright[1]); -sstrcat(CopyR, "\r\rPlease send bug reports to the authors at\r"\ - "Zip-Bugs@lists.wku.edu"); - -return CopyR; -} - - - - -/* -** Just return the compilers date/time -** -*/ - -char *GetZipVersionLocal(void) -{ -static char ZipVersionLocal[50]; - -sprintf(ZipVersionLocal, "[%s %s]", __DATE__, __TIME__); - -return ZipVersionLocal; -} - -#endif /* #ifndef USE_SIOUX */ - - - - diff --git a/third_party/infozip/zip/macos/source/macstuff.c b/third_party/infozip/zip/macos/source/macstuff.c deleted file mode 100644 index 03236073c..000000000 --- a/third_party/infozip/zip/macos/source/macstuff.c +++ /dev/null @@ -1,1724 +0,0 @@ -/* -These Functions were originally part of More Files version 1.4.8 - -More Files fixes many of the broken or underfunctional -parts of the file system. - -More Files - -A collection of File Manager and related routines - -by Jim Luther (Apple Macintosh Developer Technical Support Emeritus) -with significant code contributions by Nitin Ganatra -(Apple Macintosh Developer Technical Support Emeritus) -Copyright 1992-1998 Apple Computer, Inc. -Portions copyright 1995 Jim Luther -All rights reserved. - -The Package "More Files" is distributed under the following -license terms: - - "You may incorporate this sample code into your - applications without restriction, though the - sample code has been provided "AS IS" and the - responsibility for its operation is 100% yours. - However, what you are not permitted to do is to - redistribute the source as "DSC Sample Code" after - having made changes. If you're going to - redistribute the source, we require that you make - it clear in the source that the code was descended - from Apple Sample Code, but that you've made - changes." - - -The following changes are made by Info-ZIP: - -- The only changes are made by pasting the functions - (mostly found in MoreFilesExtras.c / MoreFiles.c) - directly into macstuff.c / macstuff.h and slightly - reformatting the text (replacement of TABs by spaces, - removal/replacement of non-ASCII characters). - The code itself is NOT changed. - -This file has been modified by Info-ZIP for use in MacZip. -This file is NOT part of the original package More Files. - -More Files can be found on the MetroWerks CD and Developer CD from -Apple. You can also download the latest version from: - - http://members.aol.com/JumpLong/#MoreFiles - -Jim Luther's Home-page: - http://members.aol.com/JumpLong/ - - -*/ - -#include - - -#include "macstuff.h" - - - -extern int errno; - -static OSErr GetCommentFromDesktopFile(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment); - -static OSErr GetCommentID(short vRefNum, - long dirID, - ConstStr255Param name, - short *commentID); - -static OSErr GetDesktopFileName(short vRefNum, - Str255 desktopName); - - -enum -{ - kBNDLResType = 'BNDL', - kFREFResType = 'FREF', - kIconFamResType = 'ICN#', - kFCMTResType = 'FCMT', - kAPPLResType = 'APPL' -}; - - -/*****************************************************************************/ - -/* -** File Manager FSp calls -*/ - -/*****************************************************************************/ - -pascal OSErr FSMakeFSSpecCompat(short vRefNum, - long dirID, - ConstStr255Param fileName, - FSSpec *spec) -{ - OSErr result; - -#if !__MACOSSEVENORLATER - if ( !FSHasFSSpecCalls() && !QTHasFSSpecCalls() ) - { - Boolean isDirectory; - - result = GetObjectLocation(vRefNum, dirID, fileName, - &(spec->vRefNum), &(spec->parID), spec->name, - &isDirectory); - } - else -#endif /* !__MACOSSEVENORLATER */ - { - /* Let the file system create the FSSpec if it can since it does the job */ - /* much more efficiently than I can. */ - result = FSMakeFSSpec(vRefNum, dirID, fileName, spec); - - /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */ - /* returned in the parID field when making an FSSpec to the volume's */ - /* root directory by passing a full pathname in MakeFSSpec's */ - /* fileName parameter. Fixed in Mac OS 8.1 */ - if ( (result == noErr) && (spec->parID == 0) ) - spec->parID = fsRtParID; - } - return ( result ); -} - - -/*****************************************************************************/ -/* FSHasFSSpecCalls returns true if the file system provides FSSpec calls. */ - -#if !__MACOSSEVENORLATER -static Boolean FSHasFSSpecCalls(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else - Boolean result = false; -#endif - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif - if ( Gestalt(gestaltFSAttr, &response) == noErr ) - { - result = ((response & (1L << gestaltHasFSSpecCalls)) != 0); - } -#if !GENERATENODATA - } -#endif - return ( result ); -} -#endif /* !__MACOSSEVENORLATER */ - - - -/*****************************************************************************/ -/* QTHasFSSpecCalls returns true if QuickTime provides FSSpec calls */ -/* except for FSpExchangeFiles. */ - -#if !__MACOSSEVENORLATER -static Boolean QTHasFSSpecCalls(void) -{ - long response; -#if !GENERATENODATA - static Boolean tested = false; - static Boolean result = false; -#else - Boolean result = false; -#endif - -#if !GENERATENODATA - if ( !tested ) - { - tested = true; -#endif - result = (Gestalt(gestaltQuickTimeVersion, &response) == noErr); -#if !GENERATENODATA - } -#endif - return ( result ); -} -#endif /* !__MACOSSEVENORLATER */ - - - - -/* - *---------------------------------------------------------------------- - * - * FSpGetDefaultDir -- - * - * This function gets the current default directory. - * - * Results: - * The provided FSSpec is changed to point to the "default" - * directory. The function returns what ever errors - * FSMakeFSSpecCompat may encounter. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int FSpGetDefaultDir(FSSpecPtr dirSpec) /* On return the default directory. */ -{ - OSErr err; - short vRefNum = 0; - long int dirID = 0; - - err = HGetVol(NULL, &vRefNum, &dirID); - - if (err == noErr) { - err = FSMakeFSSpecCompat(vRefNum, dirID, (ConstStr255Param) NULL, - dirSpec); - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * FSpSetDefaultDir -- - * - * This function sets the default directory to the directory - * pointed to by the provided FSSpec. - * - * Results: - * The function returns what ever errors HSetVol may encounter. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int FSpSetDefaultDir(FSSpecPtr dirSpec) /* The new default directory. */ -{ - OSErr err; - - /* - * The following special case is needed to work around a bug - * in the Macintosh OS. (Acutally PC Exchange.) - */ - - if (dirSpec->parID == fsRtParID) { - err = HSetVol(NULL, dirSpec->vRefNum, fsRtDirID); - } else { - err = HSetVol(dirSpec->name, dirSpec->vRefNum, dirSpec->parID); - } - - return err; -} - -/* - *---------------------------------------------------------------------- - * - * FSpFindFolder -- - * - * This function is a version of the FindFolder function that - * returns the result as a FSSpec rather than a vRefNum and dirID. - * - * Results: - * Results will be simaler to that of the FindFolder function. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -OSErr -FSpFindFolder( - short vRefNum, /* Volume reference number. */ - OSType folderType, /* Folder type taken by FindFolder. */ - Boolean createFolder, /* Should we create it if non-existant. */ - FSSpec *spec) /* Pointer to resulting directory. */ -{ - short foundVRefNum; - long foundDirID; - OSErr err; - - err = FindFolder(vRefNum, folderType, createFolder, - &foundVRefNum, &foundDirID); - if (err != noErr) { - return err; - } - - err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", spec); - return err; -} - - - -/* - *---------------------------------------------------------------------- - * - * FSpPathFromLocation -- - * - * This function obtains a full path name for a given macintosh - * FSSpec. Unlike the More Files function FSpGetFullPath, this - * function will return a C string in the Handle. It also will - * create paths for FSSpec that do not yet exist. - * - * Results: - * OSErr code. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -OSErr -FSpPathFromLocation( - FSSpec *spec, /* The location we want a path for. */ - int *length, /* Length of the resulting path. */ - Handle *fullPath) /* Handle to path. */ -{ - OSErr err; - FSSpec tempSpec; - CInfoPBRec pb; - - *fullPath = NULL; - - /* - * Make a copy of the input FSSpec that can be modified. - */ - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - - if (tempSpec.parID == fsRtParID) { - /* - * The object is a volume. Add a colon to make it a full - * pathname. Allocate a handle for it and we are done. - */ - tempSpec.name[0] += 2; - tempSpec.name[tempSpec.name[0] - 1] = ':'; - tempSpec.name[tempSpec.name[0]] = '\0'; - - err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - } else { - /* - * The object isn't a volume. Is the object a file or a directory? - */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrDirID = tempSpec.parID; - pb.dirInfo.ioFDirIndex = 0; - err = PBGetCatInfoSync(&pb); - - if ((err == noErr) || (err == fnfErr)) { - /* - * If the file doesn't currently exist we start over. If the - * directory exists everything will work just fine. Otherwise we - * will just fail later. If the object is a directory, append a - * colon so full pathname ends with colon. - */ - if (err == fnfErr) { - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - } else if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) { - tempSpec.name[0] += 1; - tempSpec.name[tempSpec.name[0]] = ':'; - } - - /* - * Create a new Handle for the object - make it a C string. - */ - tempSpec.name[0] += 1; - tempSpec.name[tempSpec.name[0]] = '\0'; - err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - if (err == noErr) { - /* - * Get the ancestor directory names - loop until we have an - * error or find the root directory. - */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrParID = tempSpec.parID; - do { - pb.dirInfo.ioFDirIndex = -1; - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - err = PBGetCatInfoSync(&pb); - if (err == noErr) { - /* - * Append colon to directory name and add - * directory name to beginning of fullPath. - */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], - tempSpec.name[0]); - err = MemError(); - } - } while ( (err == noErr) && - (pb.dirInfo.ioDrDirID != fsRtDirID) ); - } - } - } - - /* - * On error Dispose the handle, set it to NULL & return the err. - * Otherwise, set the length & return. - */ - if (err == noErr) { - *length = GetHandleSize(*fullPath) - 1; - } else { - if ( *fullPath != NULL ) { - DisposeHandle(*fullPath); - } - *fullPath = NULL; - *length = 0; - } - - return err; -} - - - -/*****************************************************************************/ - -pascal OSErr FSpGetDirectoryID(const FSSpec *spec, - long *theDirID, - Boolean *isDirectory) -{ - return ( GetDirectoryID(spec->vRefNum, spec->parID, spec->name, - theDirID, isDirectory) ); -} - - -/*****************************************************************************/ - -pascal OSErr GetDirectoryID(short vRefNum, - long dirID, - ConstStr255Param name, - long *theDirID, - Boolean *isDirectory) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - *isDirectory = (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0; - if ( *isDirectory ) - { - *theDirID = pb.dirInfo.ioDrDirID; - } - else - { - *theDirID = pb.hFileInfo.ioFlParID; - } - } - - return ( error ); -} - - -/*****************************************************************************/ - -pascal OSErr GetCatInfoNoName(short vRefNum, - long dirID, - ConstStr255Param name, - CInfoPBPtr pb) -{ - Str31 tempName; - OSErr error; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb->dirInfo.ioNamePtr = tempName; - pb->dirInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb->dirInfo.ioNamePtr = (StringPtr)name; - pb->dirInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb->dirInfo.ioVRefNum = vRefNum; - pb->dirInfo.ioDrDirID = dirID; - error = PBGetCatInfoSync(pb); - pb->dirInfo.ioNamePtr = NULL; - return ( error ); -} - - - -/*****************************************************************************/ - -pascal OSErr GetObjectLocation(short vRefNum, - long dirID, - ConstStr255Param pathname, - short *realVRefNum, - long *realParID, - Str255 realName, - Boolean *isDirectory) -{ - OSErr error; - CInfoPBRec pb; - Str255 tempPathname; - - /* clear results */ - *realVRefNum = 0; - *realParID = 0; - realName[0] = 0; - - /* - ** Get the real vRefNum - */ - error = DetermineVRefNum(pathname, vRefNum, realVRefNum); - if ( error == noErr ) - { - /* - ** Determine if the object already exists and if so, - ** get the real parent directory ID if it's a file - */ - - /* Protection against File Sharing problem */ - if ( (pathname == NULL) || (pathname[0] == 0) ) - { - tempPathname[0] = 0; - pb.hFileInfo.ioNamePtr = tempPathname; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)pathname; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - /* - ** The file system object is present and we have the file's - ** real parID - */ - - /* Is it a directory or a file? */ - *isDirectory = (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0; - if ( *isDirectory ) - { - /* - ** It's a directory, get its name and parent dirID, and then - ** we're done - */ - - pb.dirInfo.ioNamePtr = realName; - pb.dirInfo.ioVRefNum = *realVRefNum; - /* pb.dirInfo.ioDrDirID already contains the dirID of the - directory object */ - pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ - error = PBGetCatInfoSync(&pb); - - /* get the parent ID here, because the file system can return the */ - /* wrong parent ID from the last call. */ - *realParID = pb.dirInfo.ioDrParID; - } - else - { - /* - ** It's a file - use the parent directory ID from the last call - ** to GetCatInfoparse, get the file name, and then we're done - */ - *realParID = pb.hFileInfo.ioFlParID; - error = GetFilenameFromPathname(pathname, realName); - } - } - else if ( error == fnfErr ) - { - /* - ** The file system object is not present - see if its parent is present - */ - - /* - ** Parse to get the object name from end of pathname - */ - error = GetFilenameFromPathname(pathname, realName); - - /* if we can't get the object name from the end, we can't continue */ - if ( error == noErr ) - { - /* - ** What we want now is the pathname minus the object name - ** for example: - ** if pathname is 'vol:dir:file' tempPathname becomes 'vol:dir:' - ** if pathname is 'vol:dir:file:' tempPathname becomes 'vol:dir:' - ** if pathname is ':dir:file' tempPathname becomes ':dir:' - ** if pathname is ':dir:file:' tempPathname becomes ':dir:' - ** if pathname is ':file' tempPathname becomes ':' - ** if pathname is 'file or file:' tempPathname becomes '' - */ - - /* get a copy of the pathname */ - BlockMoveData(pathname, tempPathname, pathname[0] + 1); - - /* remove the object name */ - tempPathname[0] -= realName[0]; - /* and the trailing colon (if any) */ - if ( pathname[pathname[0]] == ':' ) - { - --tempPathname[0]; - } - - /* OK, now get the parent's directory ID */ - - /* Protection against File Sharing problem */ - pb.hFileInfo.ioNamePtr = (StringPtr)tempPathname; - if ( tempPathname[0] != 0 ) - { - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - else - { - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - *realParID = pb.dirInfo.ioDrDirID; - - *isDirectory = false; /* we don't know what the object is - really going to be */ - } - - if ( error != noErr ) - { - error = dirNFErr; /* couldn't find parent directory */ - } - else - { - error = fnfErr; /* we found the parent, but not the file */ - } - } - } - - return ( error ); -} - - - -/*****************************************************************************/ - -pascal OSErr DetermineVRefNum(ConstStr255Param pathname, - short vRefNum, - short *realVRefNum) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - *realVRefNum = pb.volumeParam.ioVRefNum; - } - return ( error ); -} - - -/*****************************************************************************/ - -pascal OSErr GetFilenameFromPathname(ConstStr255Param pathname, - Str255 filename) -{ - short index; - short nameEnd; - OSErr error; - - /* default to no filename */ - filename[0] = 0; - - /* check for no pathname */ - if ( pathname != NULL ) - { - /* get string length */ - index = pathname[0]; - - /* check for empty string */ - if ( index != 0 ) - { - /* skip over last trailing colon (if any) */ - if ( pathname[index] == ':' ) - { - --index; - } - - /* save the end of the string */ - nameEnd = index; - - /* if pathname ends with multiple colons, then this pathname refers */ - /* to a directory, not a file */ - if ( pathname[index] != ':' ) - { - /* parse backwards until we find a colon or hit the beginning - of the pathname */ - while ( (index != 0) && (pathname[index] != ':') ) - { - --index; - } - - /* if we parsed to the beginning of the pathname and the - pathname ended */ - /* with a colon, then pathname is a full pathname to a volume, - not a file */ - if ( (index != 0) || (pathname[pathname[0]] != ':') ) - { - /* get the filename and return noErr */ - filename[0] = (char)(nameEnd - index); - BlockMoveData(&pathname[index+1], &filename[1], nameEnd - index); - error = noErr; - } - else - { - /* pathname to a volume, not a file */ - error = notAFileErr; - } - } - else - { - /* directory, not a file */ - error = notAFileErr; - } - } - else - { - /* empty string isn't a file */ - error = notAFileErr; - } - } - else - { - /* NULL pathname isn't a file */ - error = notAFileErr; - } - - return ( error ); -} - - - -/*****************************************************************************/ - -/* -** GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync -** in cases where the returned volume name is not needed by the caller. -** The pathname and vRefNum parameters are not touched, and the pb -** parameter is initialized by PBHGetVInfoSync except that ioNamePtr in -** the parameter block is always returned as NULL (since it might point -** to the local tempPathname). -** -** I noticed using this code in several places, so here it is once. -** This reduces the code size of MoreFiles. -*/ -pascal OSErr GetVolumeInfoNoName(ConstStr255Param pathname, - short vRefNum, - HParmBlkPtr pb) -{ - Str255 tempPathname; - OSErr error; - - /* Make sure pb parameter is not NULL */ - if ( pb != NULL ) - { - pb->volumeParam.ioVRefNum = vRefNum; - if ( pathname == NULL ) - { - pb->volumeParam.ioNamePtr = NULL; - pb->volumeParam.ioVolIndex = 0; /* use ioVRefNum only */ - } - else - { /* make a copy of the string and */ - BlockMoveData(pathname, tempPathname, pathname[0] + 1); - /* use the copy so original isn't trashed */ - pb->volumeParam.ioNamePtr = (StringPtr)tempPathname; - /* use ioNamePtr/ioVRefNum combination */ - pb->volumeParam.ioVolIndex = -1; - } - error = PBHGetVInfoSync(pb); - pb->volumeParam.ioNamePtr = NULL; /* ioNamePtr may point to local - tempPathname, so don't return it */ - } - else - { - error = paramErr; - } - return ( error ); -} - - - - -/*****************************************************************************/ - -pascal OSErr FSpGetFullPath(const FSSpec *spec, - short *fullPathLength, - Handle *fullPath) -{ - OSErr result; - OSErr realResult; - FSSpec tempSpec; - CInfoPBRec pb; - - *fullPathLength = 0; - *fullPath = NULL; - - /* Default to noErr */ - realResult = noErr; - - /* Make a copy of the input FSSpec that can be modified */ - BlockMoveData(spec, &tempSpec, sizeof(FSSpec)); - - if ( tempSpec.parID == fsRtParID ) - { - /* The object is a volume */ - - /* Add a colon to make it a full pathname */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* We're done */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - } - else - { - /* The object isn't a volume */ - - /* Is the object a file or a directory? */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrDirID = tempSpec.parID; - pb.dirInfo.ioFDirIndex = 0; - result = PBGetCatInfoSync(&pb); - /* Allow file/directory name at end of path to not exist. */ - realResult = result; - if ( (result == noErr) || (result == fnfErr) ) - { - /* if the object is a directory, append a colon so full pathname - ends with colon */ - if ( (result == noErr) && (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) - { - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - } - - /* Put the object name in first */ - result = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]); - if ( result == noErr ) - { - /* Get the ancestor directory names */ - pb.dirInfo.ioNamePtr = tempSpec.name; - pb.dirInfo.ioVRefNum = tempSpec.vRefNum; - pb.dirInfo.ioDrParID = tempSpec.parID; - do /* loop until we have an error or find the root directory */ - { - pb.dirInfo.ioFDirIndex = -1; - pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID; - result = PBGetCatInfoSync(&pb); - if ( result == noErr ) - { - /* Append colon to directory name */ - ++tempSpec.name[0]; - tempSpec.name[tempSpec.name[0]] = ':'; - - /* Add directory name to beginning of fullPath */ - (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1], - tempSpec.name[0]); - result = MemError(); - } - } while ( (result == noErr) && (pb.dirInfo.ioDrDirID != fsRtDirID) ); - } - } - } - if ( result == noErr ) - { - /* Return the length */ - *fullPathLength = InlineGetHandleSize(*fullPath); - result = realResult; /* return realResult in case it was fnfErr */ - } - else - { - /* Dispose of the handle and return NULL and zero length */ - if ( *fullPath != NULL ) - { - DisposeHandle(*fullPath); - } - *fullPath = NULL; - *fullPathLength = 0; - } - - return ( result ); -} - - - -/*****************************************************************************/ - -pascal OSErr FSpLocationFromFullPath(short fullPathLength, - const void *fullPath, - FSSpec *spec) -{ - AliasHandle alias; - OSErr result; - Boolean wasChanged; - Str32 nullString; - - /* Create a minimal alias from the full pathname */ - nullString[0] = 0; /* null string to indicate no zone or server name */ - result = NewAliasMinimalFromFullPath(fullPathLength, fullPath, nullString, - nullString, &alias); - - if ( result == noErr ) - { - /* Let the Alias Manager resolve the alias. */ - result = ResolveAlias(NULL, alias, spec, &wasChanged); - - DisposeHandle((Handle)alias); /* Free up memory used */ - } - - return ( result ); -} - - - -/*****************************************************************************/ - -pascal OSErr GetFullPath(short vRefNum, - long dirID, - ConstStr255Param name, - short *fullPathLength, - Handle *fullPath) -{ - OSErr result; - FSSpec spec; - - *fullPathLength = 0; - *fullPath = NULL; - - result = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); - if ( (result == noErr) || (result == fnfErr) ) - { - result = FSpGetFullPath(&spec, fullPathLength, fullPath); - } - - return ( result ); -} - - - -/*****************************************************************************/ - -pascal OSErr ChangeCreatorType(short vRefNum, - long dirID, - ConstStr255Param name, - OSType creator, - OSType fileType) -{ - CInfoPBRec pb; - OSErr error; - short realVRefNum; - long parID; - - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) == 0 ) /* if file */ - { /* save parent dirID for BumpDate call */ - parID = pb.hFileInfo.ioFlParID; - - /* If creator not 0x00000000, change creator */ - if ( creator != (OSType)0x00000000 ) - { - pb.hFileInfo.ioFlFndrInfo.fdCreator = creator; - } - - /* If fileType not 0x00000000, change fileType */ - if ( fileType != (OSType)0x00000000 ) - { - pb.hFileInfo.ioFlFndrInfo.fdType = fileType; - } - - pb.hFileInfo.ioDirID = dirID; - error = PBSetCatInfoSync(&pb); /* now, save the new information - back to disk */ - - if ( (error == noErr) && (parID != fsRtParID) ) /* can't - bump fsRtParID */ - { - /* get the real vRefNum in case a full pathname was passed */ - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = BumpDate(realVRefNum, parID, NULL); - /* and bump the parent directory's mod date to wake - up the Finder */ - /* to the change we just made */ - } - } - } - else - { - /* it was a directory, not a file */ - error = notAFileErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpChangeCreatorType(const FSSpec *spec, - OSType creator, - OSType fileType) -{ - return ( ChangeCreatorType(spec->vRefNum, spec->parID, spec->name, - creator, fileType) ); -} - -/*****************************************************************************/ - -pascal OSErr BumpDate(short vRefNum, - long dirID, - ConstStr255Param name) -/* Given a file or directory, change its modification date to the - current date/time. */ -{ - CInfoPBRec pb; - Str31 tempName; - OSErr error; - unsigned long secs; - - /* Protection against File Sharing problem */ - if ( (name == NULL) || (name[0] == 0) ) - { - tempName[0] = 0; - pb.hFileInfo.ioNamePtr = tempName; - pb.hFileInfo.ioFDirIndex = -1; /* use ioDirID */ - } - else - { - pb.hFileInfo.ioNamePtr = (StringPtr)name; - pb.hFileInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */ - } - pb.hFileInfo.ioVRefNum = vRefNum; - pb.hFileInfo.ioDirID = dirID; - error = PBGetCatInfoSync(&pb); - if ( error == noErr ) - { - GetDateTime(&secs); - /* set mod date to current date, or one second into the future - if mod date = current date */ - pb.hFileInfo.ioFlMdDat = - (secs == pb.hFileInfo.ioFlMdDat) ? (++secs) : (secs); - if ( pb.dirInfo.ioNamePtr == tempName ) - { - pb.hFileInfo.ioDirID = pb.hFileInfo.ioFlParID; - } - else - { - pb.hFileInfo.ioDirID = dirID; - } - error = PBSetCatInfoSync(&pb); - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpBumpDate(const FSSpec *spec) -{ - return ( BumpDate(spec->vRefNum, spec->parID, spec->name) ); -} - - -/*****************************************************************************/ - -pascal OSErr OnLine(FSSpecPtr volumes, - short reqVolCount, - short *actVolCount, - short *volIndex) -{ - HParamBlockRec pb; - OSErr error = noErr; - FSSpec *endVolArray; - - if ( *volIndex > 0 ) - { - *actVolCount = 0; - for ( endVolArray = volumes + reqVolCount; - (volumes < endVolArray) && (error == noErr); ++volumes ) - { - pb.volumeParam.ioNamePtr = (StringPtr) & volumes->name; - pb.volumeParam.ioVolIndex = *volIndex; - error = PBHGetVInfoSync(&pb); - if ( error == noErr ) - { - volumes->parID = fsRtParID; /* the root directory's - parent is 1 */ - volumes->vRefNum = pb.volumeParam.ioVRefNum; - ++*volIndex; - ++*actVolCount; - } - } - } - else - { - error = paramErr; - } - - return ( error ); -} - - -/*****************************************************************************/ - -pascal OSErr DTGetComment(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment) -{ - DTPBRec pb; - OSErr error; - short dtRefNum; - Boolean newDTDatabase; - - if (comment != NULL) - { - comment[0] = 0; /* return nothing by default */ - - /* attempt to open the desktop database */ - error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - /* There was a desktop database and it's now open */ - - if ( !newDTDatabase ) - { - pb.ioDTRefNum = dtRefNum; - pb.ioNamePtr = (StringPtr)name; - pb.ioDirID = dirID; - pb.ioDTBuffer = (Ptr)&comment[1]; - /* - ** IMPORTANT NOTE #1: Inside Macintosh says that comments - ** are up to 200 characters. While that may be correct for - ** the HFS file system's Desktop Manager, other file - ** systems (such as Apple Photo Access) return up to - ** 255 characters. Make sure the comment buffer is a Str255 - ** or you'll regret it. - ** - ** IMPORTANT NOTE #2: Although Inside Macintosh doesn't - ** mention it, ioDTReqCount is a input field to - ** PBDTGetCommentSync. Some file systems (like HFS) ignore - ** ioDTReqCount and always return the full comment -- - ** others (like AppleShare) respect ioDTReqCount and only - ** return up to ioDTReqCount characters of the comment. - */ - pb.ioDTReqCount = sizeof(Str255) - 1; - error = PBDTGetCommentSync(&pb); - if (error == noErr) - { - comment[0] = (unsigned char)pb.ioDTActCount; - } - } - } - else - { - /* There is no desktop database - try the Desktop file */ - error = GetCommentFromDesktopFile(vRefNum, dirID, name, comment); - if ( error != noErr ) - { - error = afpItemNotFound; /* return an expected error */ - } - } - } - else - { - error = paramErr; - } - - return (error); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTGetComment(const FSSpec *spec, - Str255 comment) -{ - return (DTGetComment(spec->vRefNum, spec->parID, spec->name, comment)); -} - - -/*****************************************************************************/ - -pascal OSErr DTSetComment(short vRefNum, - long dirID, - ConstStr255Param name, - ConstStr255Param comment) -{ - DTPBRec pb; - OSErr error; - short dtRefNum; - Boolean newDTDatabase; - - error = DTOpen(name, vRefNum, &dtRefNum, &newDTDatabase); - if ( error == noErr ) - { - pb.ioDTRefNum = dtRefNum; - pb.ioNamePtr = (StringPtr)name; - pb.ioDirID = dirID; - pb.ioDTBuffer = (Ptr)&comment[1]; - /* Truncate the comment to 200 characters just in case */ - /* some file system doesn't range check */ - if ( comment[0] <= 200 ) - { - pb.ioDTReqCount = comment[0]; - } - else - { - pb.ioDTReqCount = 200; - } - error = PBDTSetCommentSync(&pb); - } - return (error); -} - -/*****************************************************************************/ - -pascal OSErr FSpDTSetComment(const FSSpec *spec, - ConstStr255Param comment) -{ - return (DTSetComment(spec->vRefNum, spec->parID, spec->name, comment)); -} - - -/*****************************************************************************/ - -pascal OSErr DTOpen(ConstStr255Param volName, - short vRefNum, - short *dtRefNum, - Boolean *newDTDatabase) -{ - OSErr error; - GetVolParmsInfoBuffer volParmsInfo; - long infoSize; - DTPBRec pb; - - /* Check for volume Desktop Manager support before calling */ - infoSize = sizeof(GetVolParmsInfoBuffer); - error = HGetVolParms(volName, vRefNum, &volParmsInfo, &infoSize); - if ( error == noErr ) - { - if ( hasDesktopMgr(volParmsInfo) ) - { - pb.ioNamePtr = (StringPtr)volName; - pb.ioVRefNum = vRefNum; - error = PBDTOpenInform(&pb); - /* PBDTOpenInform informs us if the desktop was just created */ - /* by leaving the low bit of ioTagInfo clear (0) */ - *newDTDatabase = ((pb.ioTagInfo & 1L) == 0); - if ( error == paramErr ) - { - error = PBDTGetPath(&pb); - /* PBDTGetPath doesn't tell us if the database is new */ - /* so assume it is not new */ - *newDTDatabase = false; - } - *dtRefNum = pb.ioDTRefNum; - } - else - { - error = paramErr; - } - } - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetCommentFromDesktopFile -** -** Get a file or directory's Finder comment field (if any) from the -** Desktop file's 'FCMT' resources. -*/ -static OSErr GetCommentFromDesktopFile(short vRefNum, - long dirID, - ConstStr255Param name, - Str255 comment) -{ - OSErr error; - short commentID; - short realVRefNum; - Str255 desktopName; - short savedResFile; - short dfRefNum; - StringHandle commentHandle; - - /* Get the comment ID number */ - error = GetCommentID(vRefNum, dirID, name, &commentID); - if ( error == noErr ) - { - if ( commentID != 0 ) /* commentID == 0 means there's no comment */ - { - error = DetermineVRefNum(name, vRefNum, &realVRefNum); - if ( error == noErr ) - { - error = GetDesktopFileName(realVRefNum, desktopName); - if ( error == noErr ) - { - savedResFile = CurResFile(); - /* - ** Open the 'Desktop' file in the root directory. (because - ** opening the resource file could preload unwanted resources, - ** bracket the call with SetResLoad(s)) - */ - SetResLoad(false); - dfRefNum = HOpenResFile(realVRefNum, fsRtDirID, desktopName, - fsRdPerm); - SetResLoad(true); - - if ( dfRefNum != -1) - { - /* Get the comment resource */ - commentHandle = (StringHandle)Get1Resource(kFCMTResType, - commentID); - if ( commentHandle != NULL ) - { - if ( InlineGetHandleSize((Handle)commentHandle) > 0 ) - { - BlockMoveData(*commentHandle, comment, - *commentHandle[0] + 1); - } - else - { /* no comment available */ - error = afpItemNotFound; - } - } - else - { /* no comment available */ - error = afpItemNotFound; - } - - /* restore the resource chain and close - the Desktop file */ - UseResFile(savedResFile); - CloseResFile(dfRefNum); - } - else - { - error = afpItemNotFound; - } - } - else - { - error = afpItemNotFound; - } - } - } - else - { - error = afpItemNotFound; /* no comment available */ - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr HGetVolParms(ConstStr255Param volName, - short vRefNum, - GetVolParmsInfoBuffer *volParmsInfo, - long *infoSize) -{ - HParamBlockRec pb; - OSErr error; - - pb.ioParam.ioNamePtr = (StringPtr)volName; - pb.ioParam.ioVRefNum = vRefNum; - pb.ioParam.ioBuffer = (Ptr)volParmsInfo; - pb.ioParam.ioReqCount = *infoSize; - error = PBHGetVolParmsSync(&pb); - if ( error == noErr ) - { - *infoSize = pb.ioParam.ioActCount; - } - return ( error ); -} - -/*****************************************************************************/ -/* -** GetCommentID -** -** Get the comment ID number for the Desktop file's 'FCMT' resource ID from -** the file or folders fdComment (frComment) field. -*/ -static OSErr GetCommentID(short vRefNum, - long dirID, - ConstStr255Param name, - short *commentID) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - *commentID = pb.hFileInfo.ioFlXFndrInfo.fdComment; - return ( error ); -} - -/*****************************************************************************/ - -/* -** GetDesktopFileName -** -** Get the name of the Desktop file. -*/ -static OSErr GetDesktopFileName(short vRefNum, - Str255 desktopName) -{ - OSErr error; - HParamBlockRec pb; - short index; - Boolean found; - - pb.fileParam.ioNamePtr = desktopName; - pb.fileParam.ioVRefNum = vRefNum; - pb.fileParam.ioFVersNum = 0; - index = 1; - found = false; - do - { - pb.fileParam.ioDirID = fsRtDirID; - pb.fileParam.ioFDirIndex = index; - error = PBHGetFInfoSync(&pb); - if ( error == noErr ) - { - if ( (pb.fileParam.ioFlFndrInfo.fdType == 'FNDR') && - (pb.fileParam.ioFlFndrInfo.fdCreator == 'ERIK') ) - { - found = true; - } - } - ++index; - } while ( (error == noErr) && !found ); - - return ( error ); -} - - -/*****************************************************************************/ - -pascal OSErr XGetVInfo(short volReference, - StringPtr volName, - short *vRefNum, - UnsignedWide *freeBytes, - UnsignedWide *totalBytes) -{ - OSErr result; - long response; - XVolumeParam pb; - - /* See if large volume support is available */ - if ( ( Gestalt(gestaltFSAttr, &response) == noErr ) && ((response & (1L << gestaltFSSupports2TBVols)) != 0) ) - { - /* Large volume support is available */ - pb.ioVRefNum = volReference; - pb.ioNamePtr = volName; - pb.ioXVersion = 0; /* this XVolumeParam version (0) */ - pb.ioVolIndex = 0; /* use ioVRefNum only, return volume name */ - result = PBXGetVolInfoSync(&pb); - if ( result == noErr ) - { - /* The volume name was returned in volName (if not NULL) and */ - /* we have the volume's vRefNum and allocation block size */ - *vRefNum = pb.ioVRefNum; - - /* return the freeBytes and totalBytes */ - *totalBytes = pb.ioVTotalBytes; - *freeBytes = pb.ioVFreeBytes; - } - } - else - { - /* No large volume support */ - - /* Use HGetVInfo to get the results */ - result = HGetVInfo(volReference, volName, vRefNum, &freeBytes->lo, &totalBytes->lo); - if ( result == noErr ) - { - /* zero the high longs of totalBytes and freeBytes */ - totalBytes->hi = 0; - freeBytes->hi = 0; - } - } - return ( result ); -} - - - -/*****************************************************************************/ - -pascal OSErr HGetVInfo(short volReference, - StringPtr volName, - short *vRefNum, - unsigned long *freeBytes, - unsigned long *totalBytes) -{ - HParamBlockRec pb; - unsigned long allocationBlockSize; - unsigned short numAllocationBlocks; - unsigned short numFreeBlocks; - VCB *theVCB; - Boolean vcbFound; - OSErr result; - - /* Use the File Manager to get the real vRefNum */ - pb.volumeParam.ioVRefNum = volReference; - pb.volumeParam.ioNamePtr = volName; - pb.volumeParam.ioVolIndex = 0; /* use ioVRefNum only, return volume name */ - result = PBHGetVInfoSync(&pb); - - if ( result == noErr ) - { - /* The volume name was returned in volName (if not NULL) and */ - /* we have the volume's vRefNum and allocation block size */ - *vRefNum = pb.volumeParam.ioVRefNum; - allocationBlockSize = (unsigned long)pb.volumeParam.ioVAlBlkSiz; - - /* System 7.5 (and beyond) pins the number of allocation blocks and */ - /* the number of free allocation blocks returned by PBHGetVInfo to */ - /* a value so that when multiplied by the allocation block size, */ - /* the volume will look like it has $7fffffff bytes or less. This */ - /* was done so older applications that use signed math or that use */ - /* the GetVInfo function (which uses signed math) will continue to work. */ - /* However, the unpinned numbers (which we want) are always available */ - /* in the volume's VCB so we'll get those values from the VCB if possible. */ - - /* Find the volume's VCB */ - vcbFound = false; - theVCB = (VCB *)(GetVCBQHdr()->qHead); - while ( (theVCB != NULL) && !vcbFound ) - { - /* Check VCB signature before using VCB. Don't have to check for */ - /* MFS (0xd2d7) because they can't get big enough to be pinned */ - if ( theVCB->vcbSigWord == 0x4244 ) - { - if ( theVCB->vcbVRefNum == *vRefNum ) - { - vcbFound = true; - } - } - - if ( !vcbFound ) - { - theVCB = (VCB *)(theVCB->qLink); - } - } - - if ( theVCB != NULL ) - { - /* Found a VCB we can use. Get the un-pinned number of allocation blocks */ - /* and the number of free blocks from the VCB. */ - numAllocationBlocks = (unsigned short)theVCB->vcbNmAlBlks; - numFreeBlocks = (unsigned short)theVCB->vcbFreeBks; - } - else - { - /* Didn't find a VCB we can use. Return the number of allocation blocks */ - /* and the number of free blocks returned by PBHGetVInfoSync. */ - numAllocationBlocks = (unsigned short)pb.volumeParam.ioVNmAlBlks; - numFreeBlocks = (unsigned short)pb.volumeParam.ioVFrBlk; - } - - /* Now, calculate freeBytes and totalBytes using unsigned values */ - *freeBytes = numFreeBlocks * allocationBlockSize; - *totalBytes = numAllocationBlocks * allocationBlockSize; - } - - return ( result ); -} - - -/* -** PBXGetVolInfoSync is the glue code needed to make PBXGetVolInfoSync -** File Manager requests from CFM-based programs. At some point, Apple -** will get around to adding this to the standard libraries you link with -** and you'll get a duplicate symbol link error. At that time, just delete -** this code (or comment it out). -** -** Non-CFM 68K programs don't needs this glue (and won't get it) because -** they instead use the inline assembly glue found in the Files.h interface -** file. -*/ - -#if __WANTPASCALELIMINATION -#undef pascal -#endif - -#if GENERATINGCFM -pascal OSErr PBXGetVolInfoSync(XVolumeParamPtr paramBlock) -{ - enum - { - kXGetVolInfoSelector = 0x0012, /* Selector for XGetVolInfo */ - - uppFSDispatchProcInfo = kRegisterBased - | REGISTER_RESULT_LOCATION(kRegisterD0) - | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) - | REGISTER_ROUTINE_PARAMETER(1, kRegisterD1, SIZE_CODE(sizeof(long))) /* trap word */ - | REGISTER_ROUTINE_PARAMETER(2, kRegisterD0, SIZE_CODE(sizeof(long))) /* selector */ - | REGISTER_ROUTINE_PARAMETER(3, kRegisterA0, SIZE_CODE(sizeof(XVolumeParamPtr))) - }; - - return ( CallOSTrapUniversalProc(NGetTrapAddress(_FSDispatch, OSTrap), - uppFSDispatchProcInfo, - _FSDispatch, - kXGetVolInfoSelector, - paramBlock) ); -} -#endif - -#if __WANTPASCALELIMINATION -#define pascal -#endif - -/*****************************************************************************/ - -pascal OSErr GetDirName(short vRefNum, - long dirID, - Str31 name) -{ - CInfoPBRec pb; - OSErr error; - - if ( name != NULL ) - { - pb.dirInfo.ioNamePtr = name; - pb.dirInfo.ioVRefNum = vRefNum; - pb.dirInfo.ioDrDirID = dirID; - pb.dirInfo.ioFDirIndex = -1; /* get information about ioDirID */ - error = PBGetCatInfoSync(&pb); - } - else - { - error = paramErr; - } - - return ( error ); -} - - -/*****************************************************************************/ - -pascal OSErr GetVolFileSystemID(ConstStr255Param pathname, - short vRefNum, - short *fileSystemID) -{ - HParamBlockRec pb; - OSErr error; - - error = GetVolumeInfoNoName(pathname,vRefNum, &pb); - if ( error == noErr ) - { - *fileSystemID = pb.volumeParam.ioVFSID; - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr GetDInfo(short vRefNum, - long dirID, - ConstStr255Param name, - DInfo *fndrInfo) -{ - CInfoPBRec pb; - OSErr error; - - error = GetCatInfoNoName(vRefNum, dirID, name, &pb); - if ( error == noErr ) - { - if ( (pb.dirInfo.ioFlAttrib & ioDirMask) != 0 ) - { - /* it's a directory, return the DInfo */ - *fndrInfo = pb.dirInfo.ioDrUsrWds; - } - else - { - /* oops, a file was passed */ - error = dirNFErr; - } - } - - return ( error ); -} - -/*****************************************************************************/ - -pascal OSErr FSpGetDInfo(const FSSpec *spec, - DInfo *fndrInfo) -{ - return ( GetDInfo(spec->vRefNum, spec->parID, spec->name, fndrInfo) ); -} - - diff --git a/third_party/infozip/zip/macos/source/macstuff.h b/third_party/infozip/zip/macos/source/macstuff.h deleted file mode 100644 index 9e92dcef1..000000000 --- a/third_party/infozip/zip/macos/source/macstuff.h +++ /dev/null @@ -1,18 +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 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 -*/ -#ifndef _MACSTUFF_H -#define _MACSTUFF_H 1 - -#include "MoreFilesExtras.h" -#include "MoreDesktopMgr.h" -#include "MoreFiles.h" -#include "FSpCompat.h" -#include "FullPath.h" - -#endif /* _MACSTUFF_H */ diff --git a/third_party/infozip/zip/macos/source/mactime.c b/third_party/infozip/zip/macos/source/mactime.c deleted file mode 100644 index af9ad5ed7..000000000 --- a/third_party/infozip/zip/macos/source/mactime.c +++ /dev/null @@ -1,451 +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 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 -*/ -/* ----------------------------------------------------------------------------- - -The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, -mktime and time do not work correctly. The supplied link library mactime.c -contains replacement functions for them. - - * Caveat: On a Mac, we only know the GMT and DST offsets for - * the current time, not for the time in question. - * Mac has no support for DST handling. - * DST changeover is all manually set by the user. - - -------------------------------------------------------------------------------*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "mactime.h" - - -/* -The MacOS function GetDateTime returns the -number of seconds elapsed since midnight, January 1, 1904. -*/ -const unsigned long MacOS_2_Unix = 2082844800L; - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - - -#ifndef TEST_TIME_LIB -#define my_gmtime gmtime -#define my_localtime localtime -#define my_mktime mktime -#define my_time time -#endif - - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ -/* internal prototypes */ -static void clear_tm(struct tm * tm); -static long GMTDelta(void); -static Boolean DaylightSaving(void); -static time_t GetTimeMac(void); -static time_t Mactime(time_t *timer); -static void normalize(int *i,int *j,int norm); -static struct tm *time2tm(const time_t *timer); -static time_t tm2time(struct tm *tp); - -/* Because serial port and SLIP conflict with ReadXPram calls, - we cache the call here so we don't hang on calling ReadLocation() */ -static void myReadLocation(MachineLocation * loc); - - -/* prototypes for STD lib replacement functions */ -struct tm *my_gmtime(const time_t *t); -struct tm *my_localtime(const time_t *t); -time_t my_mktime(struct tm *tp); -time_t my_time(time_t *t); - - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - /* - * Mac file times are based on 1904 Jan 1 00:00 local time, - * not 1970 Jan 1 00:00 UTC. - * So we have to convert the time stamps into UNIX UTC - * compatible values. - */ -time_t MacFtime2UnixFtime(unsigned long macftime) -{ - long UTCoffset; - - GetGMToffsetMac(macftime, &UTCoffset); - MACOS_TO_UNIX(macftime); - macftime -= UTCoffset; - - return macftime; -} - - - /* - * Mac file times are based on 1904 Jan 1 00:00 local time, - * not 1970 Jan 1 00:00 UTC. - * So we have to convert the time stamps into MacOS local - * compatible values. - */ -unsigned long UnixFtime2MacFtime(time_t unxftime) -{ - long UTCoffset; - unsigned long macftime = unxftime; - - UNIX_TO_MACOS(macftime); - GetGMToffsetMac(macftime, &UTCoffset); - macftime += UTCoffset; - - return macftime; -} - - - - - -/* -* This function convert a file-localtime to an another -* file-localtime. -*/ -time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs) -{ - time_t MacGMTTime; - long UTCoffset; - - /* convert macloctim into corresponding UTC value */ - MacGMTTime = macloctim - s_gmtoffs; - GetGMToffsetMac(macloctim, &UTCoffset); - - return (MacGMTTime + UTCoffset); -} /* AdjustForTZmove() */ - - - - -/* - * This function calculates the difference between the supplied Mac - * ftime value (local time) and the corresponding UTC time in seconds. - */ -Boolean GetGMToffsetMac(unsigned long mactime, long *UTCoffset) -{ - -mactime = mactime; -/* - * Caveat: On a Mac, we only know the GMT and DST offsets for - * the current time, not for the time in question. - * Mac has no support for DST handling. - * DST changeover is all manually set by the user. - - May be later I can include a support of GMT offset calculation for the - time in question here. -*/ - *UTCoffset = GMTDelta(); - - return true; -} - - - - - - - -/***************************************************************************** - * Standard Library Replacement Functions - * gmtime(), mktime(), localtime(), time() - * - * The unix epoch is used here. - * These functions gmtime(), mktime(), localtime() and time() - * expects and returns unix times. - * - * At midnight Jan. 1, 1970 GMT, the local time was - * midnight Jan. 1, 1970 + GMTDelta(). - * - * - *****************************************************************************/ - - -struct tm *my_gmtime(const time_t *timer) -{ - return time2tm(timer); -} - - - - -struct tm *my_localtime(const time_t *timer) -{ - time_t maclocal; - - maclocal = *timer; - maclocal += GMTDelta(); - - return time2tm(&maclocal); -} - - - - -time_t my_mktime(struct tm *tp) -{ - time_t maclocal; - - maclocal = tm2time(tp); - maclocal -= GMTDelta(); - - return maclocal; -} - - - - - - -time_t my_time(time_t *time) -{ -time_t tmp_time; - -GetDateTime(&tmp_time); - -MACOS_TO_UNIX(tmp_time); - -if (time) - { - *time = tmp_time; - } - -return tmp_time; -} - - - -/*****************************************************************************/ -/* static module level functions -/*****************************************************************************/ - - -/* - * The geographic location and time zone information of a Mac - * are stored in extended parameter RAM. The ReadLocation - * produdure uses the geographic location record, MachineLocation, - * to read the geographic location and time zone information in - * extended parameter RAM. - * - * Because serial port and SLIP conflict with ReadXPram calls, - * we cache the call here. - * - * Caveat: this caching will give the wrong result if a session - * extend across the DST changeover time, but - * this function resets itself every 2 hours. - */ -static void myReadLocation(MachineLocation * loc) -{ - static MachineLocation storedLoc; /* InsideMac, OSUtilities, page 4-20 */ - static time_t first_call = 0, last_call = 86400; - - if ((last_call - first_call) > 7200) - { - GetDateTime(&first_call); - ReadLocation(&storedLoc); - } - - GetDateTime(&last_call); - *loc = storedLoc; -} - - - - -static Boolean DaylightSaving(void) -{ - MachineLocation loc; - unsigned char dlsDelta; - - myReadLocation(&loc); - dlsDelta = loc.u.dlsDelta; - - return (dlsDelta != 0); -} - - - - -/* current local time = GMTDelta() + GMT - GMT = local time - GMTDelta() */ -static long GMTDelta(void) -{ - MachineLocation loc; - long gmtDelta; - - myReadLocation(&loc); - - /* - * On a Mac, the GMT value is in seconds east of GMT. For example, - * San Francisco is at -28,800 seconds (8 hours * 3600 seconds per hour) - * east of GMT. The gmtDelta field is a 3-byte value contained in a - * long word, so you must take care to get it properly. - */ - gmtDelta = loc.u.gmtDelta & 0x00FFFFFF; - if ((gmtDelta & 0x00800000) != 0) - { - gmtDelta |= 0xFF000000; - } - - return gmtDelta; -} - - - -/* This routine simulates stdclib time(), time in seconds since 1.1.1970 - The time is in GMT */ -static time_t GetTimeMac(void) -{ - unsigned long maclocal; - - - /* - * Get the current time expressed as the number of seconds - * elapsed since the Mac epoch, midnight, Jan. 1, 1904 (local time). - * On a Mac, current time accuracy is up to a second. - */ - - GetDateTime(&maclocal); /* Get Mac local time */ - maclocal -= GMTDelta(); /* Get Mac GMT */ - MACOS_TO_UNIX(maclocal); - - return maclocal; /* return unix GMT */ -} - - - - -/* - * clear_tm - sets a broken-down time to the equivalent of 1970/1/1 00:00:00 - */ - -static void clear_tm(struct tm * tm) -{ - tm->tm_sec = 0; - tm->tm_min = 0; - tm->tm_hour = 0; - tm->tm_mday = 1; - tm->tm_mon = 0; - tm->tm_year = 0; - tm->tm_wday = 1; - tm->tm_yday = 0; - tm->tm_isdst = -1; -} - - -static void normalize(int *i,int *j,int norm) -{ - while(*i < 0) - { - *i += norm; - (*j)--; - } - - while(*i >= norm) - { - *i -= norm; - (*j)++; - } -} - - - -/* Returns the GMT times */ -static time_t Mactime(time_t *timer) -{ - time_t t = GetTimeMac(); - - if (timer != NULL) - *timer = t; - - return t; -} - - - - -static struct tm *time2tm(const time_t *timer) -{ - DateTimeRec dtr; - MachineLocation loc; - time_t macLocal = *timer; - - static struct tm statictime; - static const short monthday[12] = - {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; - - UNIX_TO_MACOS(macLocal); - SecondsToDate(macLocal, &dtr); - - statictime.tm_sec = dtr.second; /* second, from 0 to 59 */ - statictime.tm_min = dtr.minute; /* minute, from 0 to 59 */ - statictime.tm_hour = dtr.hour; /* hour, from 0 to 23 */ - statictime.tm_mday = dtr.day; /* day of the month, from 1 to 31 */ - statictime.tm_mon = dtr.month - 1; /* month, 1= January and 12 = December */ - statictime.tm_year = dtr.year - 1900; /* year, ranging from 1904 to 2040 */ - statictime.tm_wday = dtr.dayOfWeek - 1; /* day of the week, 1 = Sun, 7 = Sat */ - - statictime.tm_yday = monthday[statictime.tm_mon] - + statictime.tm_mday - 1; - - if (2 < statictime.tm_mon && !(statictime.tm_year & 3)) - { - ++statictime.tm_yday; - } - - myReadLocation(&loc); - statictime.tm_isdst = DaylightSaving(); - - return(&statictime); -} - - - - - -static time_t tm2time(struct tm *tp) -{ -time_t intMacTime; -DateTimeRec dtr; - - normalize(&tp->tm_sec, &tp->tm_min, 60); - normalize(&tp->tm_min, &tp->tm_hour,60); - normalize(&tp->tm_hour,&tp->tm_mday,24); - normalize(&tp->tm_mon, &tp->tm_year,12); - - dtr.year = tp->tm_year + 1900; /* years since 1900 */ - dtr.month = tp->tm_mon + 1; /* month, 0 = January and 11 = December */ - dtr.day = tp->tm_mday; /* day of the month, from 1 to 31 */ - dtr.hour = tp->tm_hour; /* hour, from 0 to 23 */ - dtr.minute = tp->tm_min; /* minute, from 0 to 59 */ - dtr.second = tp->tm_sec; /* second, from 0 to 59 */ - - DateToSeconds(&dtr, &intMacTime); - - MACOS_TO_UNIX(intMacTime); - - return intMacTime; -} diff --git a/third_party/infozip/zip/macos/source/mactime.h b/third_party/infozip/zip/macos/source/mactime.h deleted file mode 100644 index cb76aa445..000000000 --- a/third_party/infozip/zip/macos/source/mactime.h +++ /dev/null @@ -1,61 +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 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 -*/ -#ifndef _MACTIME_H_ -#define _MACTIME_H_ -/* ----------------------------------------------------------------------------- - -The original functions (Metrowerks Codewarrior pro 3.0) gmtime, localtime, -mktime and time do not work correctly. The supplied link library mactime.c -contains replacement functions for them. - - * Caveat: On a Mac, we only know the GMT and DST offsets for - * the current time, not for the time in question. - * Mac has no support for DST handling. - * DST changeover is all manually set by the user. - - -------------------------------------------------------------------------------*/ - -#include -#include - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - - - /* - * ARGH. Mac times are based on 1904 Jan 1 00:00, not 1970 Jan 1 00:00. - * So we have to diddle time_t's appropriately: add or subtract 66 years' - * worth of seconds == number of days times 86400 == (66*365 regular days + - * 17 leap days ) * 86400 == (24090 + 17) * 86400 == 2082844800L seconds. - * We hope time_t is an unsigned long (ulg) on the Macintosh... - */ -/* -This Offset is only used by MacFileDate_to_UTime() -*/ - -#define MACOS_TO_UNIX(x) (x) -= (unsigned long)MacOS_2_Unix -#define UNIX_TO_MACOS(x) (x) += (unsigned long)MacOS_2_Unix - -/* -The MacOS function GetDateTime returns the -number of seconds elapsed since midnight, January 1, 1904. -*/ -extern const unsigned long MacOS_2_Unix; - - -/* prototypes for public utility functions */ -time_t MacFtime2UnixFtime(unsigned long macftime); -unsigned long UnixFtime2MacFtime(time_t unxftime); -time_t AdjustForTZmoveMac(unsigned long macloctim, long s_gmtoffs); -Boolean GetGMToffsetMac(unsigned long macftime, long *UTCoffset); - - -#endif diff --git a/third_party/infozip/zip/macos/source/pathname.c b/third_party/infozip/zip/macos/source/pathname.c deleted file mode 100644 index 6bf100337..000000000 --- a/third_party/infozip/zip/macos/source/pathname.c +++ /dev/null @@ -1,726 +0,0 @@ -/* - Copyright (c) 1990-2003 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 -*/ -/*--------------------------------------------------------------------------- - - pathname.c - - Function dealing with the pathname. Mostly C-string work. - - ---------------------------------------------------------------------------*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include -#include -#include -#include - -#include "pathname.h" -#include "helpers.h" -#include "macstuff.h" - - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - -const char ResourceMark[] = "XtraStuf.mac:"; /* see also macos.c */ - - -#include "zip.h" - - - - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - -/* - *---------------------------------------------------------------------- - * - * FSpFindFolder -- - * - * This function is a version of the FindFolder function that - * returns the result as a FSSpec rather than a vRefNum and dirID. - * - * Results: - * Results will be simaler to that of the FindFolder function. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -OSErr -FSpFindFolder( - short vRefNum, /* Volume reference number. */ - OSType folderType, /* Folder type taken by FindFolder. */ - Boolean createFolder, /* Should we create it if non-existant. */ - FSSpec *spec) /* Pointer to resulting directory. */ -{ - short foundVRefNum; - long foundDirID; - OSErr err; - - err = FindFolder(vRefNum, folderType, createFolder, - &foundVRefNum, &foundDirID); - if (err != noErr) { - return err; - } - - err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", spec); - return err; -} - - -/* -** return volumename from pathname -** -*/ - -unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName) -{ -const char *VolEnd, *tmpPtr1; -char *tmpPtr2 = VolumeName; - -AssertStr(FullPath,"GetVolumeFromPath") - -for (VolEnd = FullPath; *VolEnd != '\0' && *VolEnd != ':'; VolEnd++) - ; -if (*VolEnd == '\0') return 0; - -for (tmpPtr1 = FullPath; tmpPtr1 != VolEnd;) - { - *tmpPtr2++ = *tmpPtr1++; - } - -*tmpPtr2 = '\0'; - -return (unsigned short) strlen(VolumeName); -} - - - -/***********************************/ -/* Function FindNewExtractFolder() */ -/***********************************/ - -char *FindNewExtractFolder(char *ExtractPath, Boolean uniqueFolder) -{ -char buffer[NAME_MAX], *tmpPtr, *namePtr; -char *last_dotpos = ExtractPath; -short count = 0, folderCount = 0; -OSErr err; -FSSpec Spec; -long theDirID; -Boolean isDirectory; -unsigned short namelen, pathlen = strlen(ExtractPath); -unsigned long ext_length = 0; -unsigned long num_to_cut = 0; -long firstpart_length = pathlen; - -AssertStr(ExtractPath,"FindNewExtractFolder ExtractPath == NULL") - -for (tmpPtr = ExtractPath; *tmpPtr; tmpPtr++) - if (*tmpPtr == ':') - { - folderCount++; - namePtr = tmpPtr; - } - -if (folderCount > 1) { - namelen = strlen(namePtr); -} else { - namelen = strlen(ExtractPath); -} - -if (uniqueFolder) { - for (count = 0; count < 99; count++) - { - memset(buffer,0,sizeof(buffer)); - - if (namelen >= 28) - ExtractPath[pathlen-2] = 0x0; - else - ExtractPath[pathlen-1] = 0x0; - - sprintf(buffer,"%s%d",ExtractPath,count); - GetCompletePath(ExtractPath, buffer, &Spec,&err); - err = FSpGetDirectoryID(&Spec, &theDirID, &isDirectory); - if (err == -43) break; - } -} else { - /* Look for the last extension pos */ - for (tmpPtr = ExtractPath; *tmpPtr; tmpPtr++) - if (*tmpPtr == '.') last_dotpos = tmpPtr; - - ext_length = strlen(last_dotpos); - - if (ext_length < 6) { /* up to 5 chars are treated as a */ - /* normal extension like ".html" or ".class" */ - int nameLength = last_dotpos - ExtractPath; - if (nameLength > 1) { - ExtractPath[nameLength] = 0x0; - } else { - ExtractPath[pathlen-1] = 0x0; - } - } else { - ExtractPath[pathlen-1] = 0x0; - } - - GetCompletePath(ExtractPath, ExtractPath, &Spec,&err); -} - -/* Foldernames must always end with a colon */ -sstrcat(ExtractPath,":"); -return ExtractPath; -} - - - -/* -** creates an archive file name -** -*/ - -void createArchiveName(char *thePath) -{ -char *tmpPtr, *namePtr; -short folderCount = 0; -unsigned short namelen, pathlen = strlen(thePath); - -if (thePath[pathlen-1] == ':') thePath[pathlen-1] = 0x0; - -for (tmpPtr = thePath; *tmpPtr; tmpPtr++) - if (*tmpPtr == ':') - { - folderCount++; - namePtr = tmpPtr; - } - -namelen = strlen(namePtr); - - /* we have to eliminate illegal chars: - * The name space for Mac filenames and Zip filenames (unix style names) - * do both include all printable extended-ASCII characters. The only - * difference we have to take care of is the single special character - * used as path delimiter: - * ':' on MacOS and '/' on Unix and '\\' on Dos. - * So, to convert between Mac filenames and Unix filenames without any - * loss of information, we simply interchange ':' and '/'. Additionally, - * we try to convert the coding of the extended-ASCII characters into - * InfoZip's standard ISO 8859-1 codepage table. - */ - MakeCompatibleString(namePtr, '/', '_', '.', '-', -1); - - /* Avoid filenames like: "Archive..zip" */ -if (thePath[pathlen-1] == '.') - { - thePath[pathlen-1] = 0; - } - -if (folderCount >= 1) - { /* path contains at least one folder */ - - if (namelen >= 28) - { - pathlen = pathlen-4; - } - - thePath[pathlen] = '.'; - thePath[pathlen+1] = 'z'; - thePath[pathlen+2] = 'i'; - thePath[pathlen+3] = 'p'; - thePath[pathlen+4] = 0x0; - return; - } -else - { /* path contains no folder */ - FindDesktopFolder(thePath); - createArchiveName(thePath); - } -} - - - -/* -** finds the desktop-folder on a volume with -** largest amount of free-space. -*/ - -void FindDesktopFolder(char *Path) -{ -char buffer[255]; -FSSpec volumes[50]; /* 50 Volumes should be enough */ -short actVolCount, volIndex = 1, VolCount = 0; -OSErr err; -short i, foundVRefNum; -FSSpec spec; -UInt64 freeBytes; -UInt64 totalBytes; -UInt64 MaxFreeBytes; - -err = OnLine(volumes, 50, &actVolCount, &volIndex); -printerr("OnLine:", (err != -35) && (err != 0), err, __LINE__, __FILE__, ""); - -MaxFreeBytes = 0; - -for (i=0; i < actVolCount; i++) - { - XGetVInfo(volumes[i].vRefNum, - volumes[i].name, - &volumes[i].vRefNum, - &freeBytes, - &totalBytes); - - if (MaxFreeBytes < freeBytes) { - MaxFreeBytes = freeBytes; - foundVRefNum = volumes[i].vRefNum; - } - - if ((freeBytes == 0) && (MaxFreeBytes < freeBytes)) { - MaxFreeBytes = freeBytes; - foundVRefNum = volumes[i].vRefNum; - } - -} - - FSpFindFolder(foundVRefNum, kDesktopFolderType, - kDontCreateFolder,&spec); - - GetFullPathFromSpec(buffer, &spec , &err); - sstrcat(buffer,Path); - sstrcpy(Path,buffer); -} - - -/* -** return the path without the filename -** -*/ - -char *TruncFilename(char *DirPath, const char *FilePath) -{ -char *tmpPtr; -char *dirPtr = NULL; - -AssertStr(DirPath,"TruncFilename") -Assert_it(Spec,"TruncFilename","") - -sstrcpy(DirPath, FilePath); - -for (tmpPtr = DirPath; *tmpPtr; tmpPtr++) - if (*tmpPtr == ':') - dirPtr = tmpPtr; - -if (dirPtr) - *++dirPtr = '\0'; -else - printerr("TruncFilename: FilePath has no Folders", -1, - -1, __LINE__, __FILE__, FilePath); - -return DirPath; -} - - - -/* -** return only filename -** -*/ - -char *GetFilename(char *FileName, const char *FilePath) -{ -const char *tmpPtr; -const char *dirPtr = NULL; - -Assert_it(FileName,"GetFilename","") -Assert_it(FilePath,"GetFilename","") - -for (tmpPtr = FilePath; *tmpPtr; tmpPtr++) - { - if (*tmpPtr == ':') - { - dirPtr = tmpPtr; - } - } - -if (dirPtr) - { - ++dirPtr; /* jump over the ':' */ - } -else - { - return strcpy(FileName, FilePath); /* FilePath has no Folders */ - } - -return strcpy(FileName, dirPtr); -} - - - -/* -** return fullpathname from folder/dir-id -** -*/ - -char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, - ConstStr255Param name, OSErr *err) -{ -FSSpec spec; - - *err = FSMakeFSSpecCompat(vRefNum, dirID, name, &spec); - printerr("FSMakeFSSpecCompat:", (*err != -43) && (*err != 0), *err, - __LINE__, __FILE__, ""); - if ( (*err == noErr) || (*err == fnfErr) ) - { - return GetFullPathFromSpec(CompletePath, &spec, err); - } - -return NULL; -} - - - -/* -** convert real-filename to archive-filename -** -*/ - -char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, - short CurrentFork, short MacZipMode, Boolean DataForkOnly) -{ - -AssertStr(RealPath,"Real2RfDfFilen") -AssertStr(RfDfFilen,"Real2RfDfFilen") - -if (DataForkOnly) /* make no changes */ - { - return sstrcpy(RfDfFilen, RealPath); - } - -switch (MacZipMode) - { - case JohnnyLee_EF: - { - sstrcpy(RfDfFilen, RealPath); - if (CurrentFork == DataFork) /* data-fork */ - return sstrcat(RfDfFilen, "d"); - if (CurrentFork == ResourceFork) /* resource-fork */ - return sstrcat(RfDfFilen, "r"); - break; - } - - case NewZipMode_EF: - { - switch (CurrentFork) - { - case DataFork: - { - sstrcpy(RfDfFilen, RealPath); - return RfDfFilen; /* data-fork */ - break; - } - case ResourceFork: - { - sstrcpy(RfDfFilen, ResourceMark); - sstrcat(RfDfFilen, RealPath); /* resource-fork */ - return RfDfFilen; - break; - } - default: - { - printerr("Real2RfDfFilen:", -1, -1, - __LINE__, __FILE__, RealPath); - return NULL; /* function should never reach this point */ - } - } - break; - } - default: - { - printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); - return NULL; /* function should never reach this point */ - } - } - -printerr("Real2RfDfFilen:", -1, -1, __LINE__, __FILE__, RealPath); -return NULL; /* function should never come reach this point */ -} - - - -/* -** convert archive-filename into a real filename -** -*/ - -char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, - Boolean DataForkOnly, short *CurrentFork) -{ -short length; -int result; - -AssertStr(RfDfFilen,"RfDfFilen2Real") - -if (DataForkOnly || - (MacZipMode == UnKnown_EF) || - (MacZipMode < JohnnyLee_EF)) - { - *CurrentFork = DataFork; - return sstrcpy(RealFn,RfDfFilen); - } - -result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); -if (result == 0) - { - MacZipMode = NewZipMode_EF; - } - -switch (MacZipMode) - { - case JohnnyLee_EF: - { - sstrcpy(RealFn, RfDfFilen); - length = strlen(RealFn); /* determine Fork type */ - if (RealFn[length-1] == 'd') *CurrentFork = DataFork; - else *CurrentFork = ResourceFork; - RealFn[length-1] = '\0'; /* simply cut one char */ - return RealFn; - break; - } - - case NewZipMode_EF: - { /* determine Fork type */ - result = strncmp(RfDfFilen, ResourceMark, sizeof(ResourceMark)-2); - if (result != 0) - { - *CurrentFork = DataFork; - sstrcpy(RealFn, RfDfFilen); - return RealFn; /* data-fork */ - } - else - { - *CurrentFork = ResourceFork; - if (strlen(RfDfFilen) > (sizeof(ResourceMark) - 1)) - { - sstrcpy(RealFn, &RfDfFilen[sizeof(ResourceMark)-1]); - } - else RealFn[0] = '\0'; - return RealFn; /* resource-fork */ - } - break; - } - default: - { - *CurrentFork = NoFork; - printerr("RfDfFilen2Real():", -1, MacZipMode, - __LINE__, __FILE__, RfDfFilen); - return NULL; /* function should never reach this point */ - } - } - -printerr("RfDfFilen2Real():", -1, MacZipMode, __LINE__, __FILE__, RfDfFilen); -return NULL; /* function should never reach this point */ -} - - - -/* -** return the applications name (argv[0]) -** -*/ - -char *GetAppName(void) -{ -ProcessSerialNumber psn; -static Str255 AppName; -ProcessInfoRec pinfo; -OSErr err; - -GetCurrentProcess(&psn); -pinfo.processName = AppName; -pinfo.processInfoLength = sizeof(pinfo); -pinfo.processAppSpec = NULL; - -err = GetProcessInformation(&psn,&pinfo); -AppName[AppName[0]+1] = 0x00; - -return (char *)&AppName[1]; -} - - - -/* -** return fullpathname from FSSpec -** -*/ - -char *GetFullPathFromSpec(char *FullPath, FSSpec *Spec, OSErr *err) -{ -Handle hFullPath; -short len; - -Assert_it(Spec,"GetFullPathFromSpec","") - -*err = FSpGetFullPath(Spec, &len, &hFullPath); -printerr("FSpGetFullPath:", (*err != -43) && (*err != 0), *err, - __LINE__, __FILE__, ""); - -memmove(FullPath, (Handle) *hFullPath, len); -FullPath[len] = '\0'; /* make c-string */ - -DisposeHandle((Handle)hFullPath); /* we don't need it any more */ - -printerr("Warning path length exceeds limit: ", len >= NAME_MAX, len, - __LINE__, __FILE__, " chars "); - -return FullPath; -} - - - - -/* -* This function expands a given partial path to a complete path. -* Path expansions are relative to the running app. -* This function follows the notation: -* 1. relative path: -* a: ":subfolder:filename" -> ":current folder:subfolder:filename" -* b: "::folder2:filename" -> folder2 is beside the current -* folder on the same level -* c: "filename" -> in current folder -* -* An absolute path will be returned. - -The following characteristics of Macintosh pathnames should be noted: - - A full pathname never begins with a colon, but must contain at - least one colon. - A partial pathname always begins with a colon separator except in - the case where the file partial pathname is a simple file or - directory name. - Single trailing separator colons in full or partial pathnames are - ignored except in the case of full pathnames to volumes. - In full pathnames to volumes, the trailing separator colon is required. - Consecutive separator colons can be used to ascend a level from a - directory to its parent directory. Two consecutive separator colons - will ascend one level, three consecutive separator colons will ascend - two levels, and so on. Ascending can only occur from a directory; - not a file. -*/ - -char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, - OSErr *err) -{ -Boolean hasDirName = false; -char currentdir[NAME_MAX]; -char *tmpPtr; -unsigned short pathlen; - -AssertStr(name,"GetCompletePath") -Assert_it(Spec,"GetCompletePath","") -Assert_it((CompletePath != name),"GetCompletePath","") - -for (tmpPtr = name; *tmpPtr; tmpPtr++) - if (*tmpPtr == ':') hasDirName = true; - -if (name[0] != ':') /* case c: path including volume name or only filename */ - { - if (hasDirName) - { /* okey, starts with volume name, so it must be a complete path */ - sstrcpy(CompletePath, name); - } - else - { /* only filename: add cwd and return */ - getcwd(currentdir, NAME_MAX); - sstrcat(currentdir, name); - sstrcpy(CompletePath, currentdir); - } - } -else if (name[1] == ':') /* it's case b: "::folder2:filename" */ - { - printerr("GetCompletePath ", -1, *err, __LINE__, __FILE__, "not implemented"); - /* it's not yet implemented; do we really need this case ?*/ - return NULL; - } -else /* it's case a: ":subfolder:filename" */ - { - getcwd(CompletePath, NAME_MAX); /* we don't need a second colon */ - CompletePath[strlen(CompletePath)-1] = '\0'; - sstrcat(CompletePath, name); - } - -pathlen = strlen(CompletePath); -*err = FSpLocationFromFullPath(pathlen, CompletePath, Spec); - -return CompletePath; -} - - - -char *MakeFilenameShorter(const char *LongFilename) -{ -static char filename[35]; /* contents should be never longer than 32 chars */ -static unsigned char Num = 0; /* change the number for every call */ - /* this var will rollover without a problem */ -char tempLongFilename[1024], charnum[5]; -char *last_dotpos = tempLongFilename; -unsigned long full_length = strlen(LongFilename); -unsigned long ext_length = 0; -unsigned long num_to_cut = 0; -long firstpart_length; -char *tmpPtr; -short MaxLength = 31; - -if (full_length <= MaxLength) /* filename is not long */ - { - return strcpy(filename,LongFilename); - } - -Num++; -strcpy(tempLongFilename,LongFilename); - -/* Look for the last extension pos */ -for (tmpPtr = tempLongFilename; *tmpPtr; tmpPtr++) - if (*tmpPtr == '.') last_dotpos = tmpPtr; - -ext_length = strlen(last_dotpos); -firstpart_length = last_dotpos - tempLongFilename; - -if (ext_length > 6) /* up to 5 chars are treated as a */ - { /* normal extension like ".html" or ".class" */ - firstpart_length = 0; - } - -num_to_cut = full_length - MaxLength; - -/* number the files to make the names unique */ -sprintf(charnum,"~%x", Num); -num_to_cut += strlen(charnum); - -if (firstpart_length == 0) - { - firstpart_length = full_length; - tempLongFilename[firstpart_length - num_to_cut] = 0; - sprintf(filename,"%s%s", tempLongFilename, charnum); - } -else - { - tempLongFilename[firstpart_length - num_to_cut] = 0; - sprintf(filename,"%s%s%s", tempLongFilename, charnum, last_dotpos); - } - -return filename; -} diff --git a/third_party/infozip/zip/macos/source/pathname.h b/third_party/infozip/zip/macos/source/pathname.h deleted file mode 100644 index 1a39ed377..000000000 --- a/third_party/infozip/zip/macos/source/pathname.h +++ /dev/null @@ -1,64 +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 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 -*/ -#ifndef PATHNAME_H -#define PATHNAME_H 1 - - -char *StripPartialDir(char *CompletePath, - const char *PartialPath, const char *FullPath); - -char *Real2RfDfFilen(char *RfDfFilen, const char *RealPath, short CurrentFork, - short MacZipMode, Boolean DataForkOnly); -char *RfDfFilen2Real(char *RealFn, const char *RfDfFilen, short MacZipMode, - Boolean DataForkOnly, short *CurrentFork); - -unsigned short GetVolumeFromPath(const char *FullPath, char *VolumeName); -char *GetCompletePath(char *CompletePath, const char *name, FSSpec *Spec, - OSErr *err); -char *TruncFilename(char *DirPath, const char *FilePath); -char *GetFilename(char *CompletePath, const char *name); -char *GetFullPathFromSpec(char *CompletePath, FSSpec *Spec, OSErr *err); -char *GetFullPathFromID(char *CompletePath, short vRefNum, long dirID, - ConstStr255Param name, OSErr *err); - -char *GetAppName(void); -void createArchiveName(char *Path); -void FindDesktopFolder(char *Path); -char *FindNewExtractFolder(char *ExtractPath, Boolean uniqueFolder); -OSErr FSpFindFolder( - short vRefNum, /* Volume reference number. */ - OSType folderType, /* Folder type taken by FindFolder. */ - Boolean createFolder, /* Should we create it if non-existant. */ - FSSpec *spec); /* Pointer to resulting directory. */ - -char *MakeFilenameShorter(const char *LongFilename); - -/* -Rule: UnKnown_EF should always be zero. - JohnnyLee_EF, NewZipMode_EF should always greater than all - other definitions -*/ -#define UnKnown_EF 0 -#define TomBrownZipIt1_EF 10 -#define TomBrownZipIt2_EF 20 -#define JohnnyLee_EF 30 -#define NewZipMode_EF 40 - - - -#define ResourceFork -1 -#define DataFork 1 -#define NoFork 0 - - -#ifndef NAME_MAX -#define NAME_MAX 1024 -#endif - -#endif /* PATHNAME_H */ diff --git a/third_party/infozip/zip/macos/source/recurse.c b/third_party/infozip/zip/macos/source/recurse.c deleted file mode 100644 index e87db3cdc..000000000 --- a/third_party/infozip/zip/macos/source/recurse.c +++ /dev/null @@ -1,442 +0,0 @@ -/* -These functions are based on Jim Luther's IterateDirectory() found in MoreFiles -However, it's heavily modified by Dirk Haase -*/ - -/* -** IterateDirectory: File Manager directory iterator routines. -** -** by Jim Luther -** -** File: IterateDirectory.c -** -** Copyright (c) 1995-1998 Jim Luther and Apple Computer, Inc. -** All rights reserved. -** -** You may incorporate this sample code into your applications without -** restriction, though the sample code has been provided "AS IS" and the -** responsibility for its operation is 100% yours. -** -** IterateDirectory is designed to drop into the MoreFiles sample code -** library I wrote while in Apple Developer Technical Support -*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include -#include -#include -#include -#include - - -#include "zip.h" -#include "macstuff.h" -#include "helpers.h" -#include "recurse.h" -#include "macglob.h" -#include "pathname.h" - - - - -/*****************************************************************************/ -/* Macros, typedefs */ -/*****************************************************************************/ - -/* The RecurseGlobals structure is used to minimize the amount of -** stack space used when recursively calling RecurseDirectoryLevel -** and to hold global information that might be needed at any time. -*/ -struct RecurseGlobals -{ - short vRefNum; - CInfoPBRec cPB; /* the parameter block used for - PBGetCatInfo calls */ - unsigned char *itemName; /* the name of the current item */ - char *FullPath; - short FullPathLen; - OSErr result; /* temporary holder of results - - saves 2 bytes of stack each level */ - Boolean quitFlag; /* set to true if filter wants to - kill interation */ - unsigned short maxLevels; /* Maximum levels to - iterate through */ - unsigned short currentLevel; /* The current level - IterateLevel is on */ -}; - -typedef struct RecurseGlobals RecurseGlobals; -typedef RecurseGlobals *RecurseGlobalsPtr; - - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - -extern MacZipGlobals MacZip; -extern const char ResourceMark[13]; /* "XtraStuf.mac:" var is initialized in file pathname.c */ -extern int extra_fields; /* do not create extra fields if false */ - -static RecurseGlobals theGlobals; - -static unsigned long DirLevels = 0; -static char *buffer; -extern int verbose; /* 1=report oddities in zip file structure */ - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ - -int procname(char *filename, int caseflag); -int MatchWild( char *pPat, char *pStr, int case_sens); -Boolean IsZipFile(char *name); - -static void RecurseDirectoryLevel(long DirID, RecurseGlobals *Globals); -static Boolean isRegularItem( RecurseGlobals *Globals); -static void ProcessFiles(RecurseGlobals *Globals, - Boolean hasDataFork, Boolean hasResourceFork); -static void ProcessDirectory(RecurseGlobals *Globals, - Boolean IncludeItem, long DirID); -static void ProcessItem(RecurseGlobals *Globals, long DirID); - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - -static void RecurseDirectoryLevel(long DirID, RecurseGlobals *Globals) -{ -char buffer2[23]; - - /* if maxLevels is zero, we aren't checking levels */ - if ( (Globals->maxLevels == 0) || - /* if currentLevel < maxLevels, look at this level */ - (Globals->currentLevel < Globals->maxLevels) ) - { - short index = 1; - - ++Globals->currentLevel; /* go to next level */ - if (DirLevels < Globals->currentLevel) DirLevels = Globals->currentLevel; - sprintf(buffer2,"Globals->currentLevel: %d",Globals->currentLevel); - - do - { /* Isn't C great... What I'd give for a "WITH - theGlobals DO" about now... */ - - /* Get next source item at the current directory level */ - Globals->cPB.dirInfo.ioFDirIndex = index; - Globals->cPB.dirInfo.ioDrDirID = DirID; - Globals->result = PBGetCatInfoSync((CInfoPBPtr)&Globals->cPB); - - ShowCounter(false); - - if ( Globals->result == noErr ) - { - ProcessItem(Globals, DirID); - } /* if ( Globals->result == noErr ) */ - - ++index; /* prepare to get next item */ - /* time to fall back a level? */ - } while ( (Globals->result == noErr) && (!Globals->quitFlag) ); - - if ( (Globals->result == fnfErr) || /* fnfErr is OK - - it only means we hit - the end of this level */ - (Globals->result == afpAccessDenied) ) /* afpAccessDenied is OK, - too - it only means we cannot see inside a directory */ - { - Globals->result = noErr; - } - - --Globals->currentLevel; /* return to previous level as we leave */ - } -} - - - -/*****************************************************************************/ - -pascal OSErr RecurseDirectory(short vRefNum, - long thedirID, - ConstStr255Param name, - unsigned short maxLevels) -{ - OSErr result; - short theVRefNum; - Boolean isDirectory; - long DirID; - - /* Get the real directory ID and make sure it is a directory */ - result = GetDirectoryID(vRefNum, thedirID, name, &DirID, &isDirectory); - if ( result == noErr ) - { - if ( isDirectory == true ) - { - /* Get the real vRefNum */ - result = DetermineVRefNum(name, vRefNum, &theVRefNum); - if ( result == noErr ) - { - /* Set up the globals we need to access from - the recursive routine. */ - theGlobals.cPB.hFileInfo.ioNamePtr = theGlobals.itemName; - theGlobals.cPB.hFileInfo.ioVRefNum = theVRefNum; - theGlobals.itemName[0] = 0; - theGlobals.result = noErr; - theGlobals.quitFlag = false; - theGlobals.maxLevels = maxLevels; - theGlobals.currentLevel = 0; /* start at level 0 */ - - /* Here we go into recursion land... */ - RecurseDirectoryLevel(DirID, &theGlobals); - - result = theGlobals.result; /* set the result */ - } - } - else - { - result = dirNFErr; /* a file was passed instead - of a directory */ - } - } - - return ( result ); -} - - - -/*****************************************************************************/ - -pascal OSErr FSpRecurseDirectory(const FSSpec *spec, - unsigned short maxLevels) -{ - OSErr rc; - - theGlobals.vRefNum = spec->vRefNum; - - /* make room for pathnames */ - theGlobals.itemName = (unsigned char *) StrCalloc(NAME_MAX); - theGlobals.FullPath = StrCalloc(NAME_MAX); - buffer = StrCalloc(NAME_MAX); - - - if ((noisy) && (MacZip.DataForkOnly)) - printf("\n Warning: Datafork only \n"); - - /* reset the count to zero */ - ShowCounter(true); - - if (noisy) leftStatusString("Build File List; Items done:"); - if (noisy) printf("\n Collecting Filenames ..."); - rc = RecurseDirectory(spec->vRefNum, spec->parID, spec->name,maxLevels); - printerr("RecurseDirectory:",rc,rc,__LINE__,__FILE__,""); - - if (noisy) printf("\n... done \n\n %6d matched files found \n", - MacZip.FoundFiles); - if (noisy) printf(" %6d folders found in %d Levels \n", - MacZip.FoundDirectories,DirLevels); - - if (MacZip.BytesOfData > (1024*1024)) - if (noisy) printf(" %4.3f MBytes unzipped size\n\n", - (float) MacZip.BytesOfData/(1024*1024)); - else - if (noisy) printf(" %4.3f KBytes unzipped size\n\n", - (float) MacZip.BytesOfData/1024); - - /* free all memory of pathnames */ - theGlobals.itemName = (unsigned char *) StrFree((char *)theGlobals.itemName); - theGlobals.FullPath = StrFree(theGlobals.FullPath); - buffer = StrFree(buffer); - - return rc; -} - - - - -/* -* Return true if filename == zipfile -* After the first match no further check will be done ! -* -*/ -Boolean IsZipFile(char *filen) -{ -static firstMatch = false; - -if (filen == NULL) - firstMatch = false; - -if (!firstMatch) - { - if (stricmp(filen, MacZip.ZipFullPath) == 0) - { - firstMatch = true; - return true; - } - } - -return false; -} - - - -static Boolean isRegularItem( RecurseGlobals *Globals) -{ -Boolean isInvisible = false, - isAlias = false, - isSystem = false; - -isSystem = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & - (1 << 12)) == 0 ); -isInvisible = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & - (1 << 14)) == 0 ); -isAlias = !((Globals->cPB.hFileInfo.ioFlFndrInfo.fdFlags & - (1 << 15)) == 0); - -if (isAlias == true) - { - return false; - } - -if (MacZip.IncludeInvisible == true) - { - return true; - } - -if ((isSystem == true) || - (isInvisible == true)) - { - return false; - } - -return true; -} - - - - -static void ProcessFiles(RecurseGlobals *Globals, - Boolean hasDataFork, Boolean hasResourceFork) -{ - /* some file statistics */ -MacZip.FoundFiles++; - -if (hasDataFork == true) - { - MacZip.BytesOfData = - Globals->cPB.hFileInfo.ioFlLgLen + - MacZip.BytesOfData; - MacZip.CurrentFork = DataFork; - MacZip.RawCountOfItems++; - - if (MacZip.DataForkOnly == true) - { - procname(Globals->FullPath, false); - hasResourceFork = false; - } - else - { - procname(Real2RfDfFilen(buffer,Globals->FullPath, - DataFork, MacZip.MacZipMode, - MacZip.DataForkOnly), false); - } - } - -if (hasResourceFork == true) - { - MacZip.BytesOfData = - Globals->cPB.hFileInfo.ioFlRLgLen + - MacZip.BytesOfData; - MacZip.CurrentFork = ResourceFork; - MacZip.RawCountOfItems++; - - procname(Real2RfDfFilen(buffer, Globals->FullPath, - ResourceFork, MacZip.MacZipMode, - MacZip.DataForkOnly), false); - } -} - - - - -static void ProcessDirectory(RecurseGlobals *Globals, - Boolean IncludeItem, long DirID) -{ -OSErr rc; - -MacZip.isDirectory = true; - -GetFullPathFromID(Globals->FullPath,Globals->vRefNum, DirID, - Globals->itemName, &rc); - -MacZip.RawCountOfItems++; -MacZip.FoundDirectories++; - -if (MacZip.StoreFoldersAlso) - { - procname(Globals->FullPath, false); - } - - /* We have a directory */ - if ( !Globals->quitFlag && IncludeItem) - { - /* Dive again if the IterateFilterProc didn't say "quit" and dir is - not an alias */ - RecurseDirectoryLevel(Globals->cPB.dirInfo.ioDrDirID, - Globals); - } -} - - - -static void ProcessItem(RecurseGlobals *Globals, long DirID) -{ -OSErr rc; -Boolean IncludeItem = false, hasDataFork = false; -Boolean hasResourceFork = false; - -IncludeItem = isRegularItem(Globals); - -/* Is it a File? */ -if ( (Globals->cPB.hFileInfo.ioFlAttrib & ioDirMask) == 0 ) - { - PToCCpy(Globals->itemName,MacZip.FileName); - MacZip.isDirectory = false; - - hasDataFork = (Globals->cPB.hFileInfo.ioFlLgLen != 0); - hasResourceFork = (Globals->cPB.hFileInfo.ioFlRLgLen != 0); - - /* include also files with zero recource- and data-fork */ - if ((hasDataFork == 0) && (hasResourceFork == 0)) - hasDataFork = true; - - if ((hasDataFork == 0) && - (hasResourceFork != 0) && - (extra_fields == false)) - { - IncludeItem = false; - } - - GetFullPathFromID(Globals->FullPath,Globals->vRefNum, - DirID, Globals->itemName, &rc); - printerr("GetFullPathFromID:",rc,rc,__LINE__, - __FILE__,MacZip.FileName); - - if (IncludeItem && /* don't include the zipfile itself */ - (!IsZipFile(Globals->FullPath)) ) - { - if (MATCH(MacZip.Pattern, MacZip.FileName, false) == true) - { - ProcessFiles(Globals, hasDataFork, hasResourceFork); - } /* if (MatchWild( MacZip.FileName,MacZip.Pattern ) == - true) */ - } /* if (!IsZipFile(Globals->FullPath)) */ - } /* Is it a File? */ - -/* Is it a directory? */ -if ( (Globals->cPB.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) - { - ProcessDirectory(Globals,IncludeItem, DirID); - } /* Is it a directory? */ -} diff --git a/third_party/infozip/zip/macos/source/recurse.h b/third_party/infozip/zip/macos/source/recurse.h deleted file mode 100644 index cfbc4b053..000000000 --- a/third_party/infozip/zip/macos/source/recurse.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -** IterateDirectory: File Manager directory iterator routines. -** -** by Jim Luther -** -** File: IterateDirectory.h -** -** Copyright (c) 1995-1998 Jim Luther and Apple Computer, Inc. -** All rights reserved. -** -** You may incorporate this sample code into your applications without -** restriction, though the sample code has been provided "AS IS" and the -** responsibility for its operation is 100% yours. -** -** IterateDirectory is designed to drop into the MoreFiles sample code -** library I wrote while in Apple Developer Technical Support -*/ - -#ifndef __RECURSEDIRECTORY__ -#define __RECURSEDIRECTORY__ - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/*****************************************************************************/ - -pascal OSErr RecurseDirectory(short vRefNum, - long dirID, - ConstStr255Param name, - unsigned short maxLevels ); -/* Iterate (scan) through a directory's content. - The IterateDirectory function performs a recursive iteration (scan) of - the specified directory and calls your IterateFilterProc function once - for each file and directory found. - - The maxLevels parameter lets you control how deep the recursion goes. - If maxLevels is 1, IterateDirectory only scans the specified directory; - if maxLevels is 2, IterateDirectory scans the specified directory and - one subdirectory below the specified directory; etc. Set maxLevels to - zero to scan all levels. - - The yourDataPtr parameter can point to whatever data structure you might - want to access from within the IterateFilterProc. - - vRefNum input: Volume specification. - dirID input: Directory ID. - name input: Pointer to object name, or nil when dirID - specifies a directory that's the object. - maxLevels input: Maximum number of directory levels to scan or - zero to scan all directory levels. - iterateFilter input: A pointer to the routine you want called once - for each file and directory found by - IterateDirectory. - yourDataPtr input: A pointer to whatever data structure you might - want to access from within the IterateFilterProc. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume or iterateFilter was NULL - dirNFErr -120 Directory not found or incomplete pathname - or a file was passed instead of a directory - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: RecurseFilterProcPtr, FSpRecurseDirectory -*/ - -/*****************************************************************************/ - -pascal OSErr FSpRecurseDirectory(const FSSpec *spec, - unsigned short maxLevels); -/* Iterate (scan) through a directory's content. - The FSpIterateDirectory function performs a recursive iteration (scan) - of the specified directory and calls your IterateFilterProc function once - for each file and directory found. - - The maxLevels parameter lets you control how deep the recursion goes. - If maxLevels is 1, FSpIterateDirectory only scans the specified directory; - if maxLevels is 2, FSpIterateDirectory scans the specified directory and - one subdirectory below the specified directory; etc. Set maxLevels to - zero to scan all levels. - - The yourDataPtr parameter can point to whatever data structure you might - want to access from within the IterateFilterProc. - - spec input: An FSSpec record specifying the directory to scan. - maxLevels input: Maximum number of directory levels to scan or - zero to scan all directory levels. - iterateFilter input: A pointer to the routine you want called once - for each file and directory found by - FSpIterateDirectory. - yourDataPtr input: A pointer to whatever data structure you might - want to access from within the IterateFilterProc. - - Result Codes - noErr 0 No error - nsvErr -35 No such volume - ioErr -36 I/O error - bdNamErr -37 Bad filename - fnfErr -43 File not found - paramErr -50 No default volume or iterateFilter was NULL - dirNFErr -120 Directory not found or incomplete pathname - afpAccessDenied -5000 User does not have the correct access - afpObjectTypeErr -5025 Directory not found or incomplete pathname - - __________ - - See also: RecurseFilterProcPtr, RecurseDirectory -*/ - - - -/*****************************************************************************/ - - - -#endif /* __RECURSEDIRECTORY__ */ diff --git a/third_party/infozip/zip/macos/source/unixlike.c b/third_party/infozip/zip/macos/source/unixlike.c deleted file mode 100644 index 4eb55da3a..000000000 --- a/third_party/infozip/zip/macos/source/unixlike.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/*--------------------------------------------------------------------------- - - unixlike.c - - Macintosh-specific routines to emulate unixfunctions. - - ---------------------------------------------------------------------------*/ - -/*****************************************************************************/ -/* Includes */ -/*****************************************************************************/ - -#include "zip.h" - -#include -#include -#include - -#include "unixlike.h" -#include "helpers.h" -#include "pathname.h" -#include "macstuff.h" -#include "macglob.h" -#include "mactime.h" - -/*****************************************************************************/ -/* Global Vars */ -/*****************************************************************************/ - -extern MacZipGlobals MacZip; -extern int errno; - - -/*****************************************************************************/ -/* Prototypes */ -/*****************************************************************************/ - - -/*****************************************************************************/ -/* Functions */ -/*****************************************************************************/ - - - - -/* - *---------------------------------------------------------------------- - * - * MacStat -- - * - * This function replaces the library version of stat. The stat - * function provided by most Mac compiliers is rather broken and - * incomplete. - * - * Results: - * See stat documentation. - * - * Side effects: - * See stat documentation. - * - *---------------------------------------------------------------------- - */ - -int Zmacstat(const char *Fname, struct stat *buf) -{ - OSErr err, rc; - short fullPathLength; - Handle hFullPath; - char path[NAME_MAX], path2[NAME_MAX]; - HVolumeParam vpb; - static unsigned long count_of_files = 0; - - AssertStr(Fname,Fname) - Assert_it(buf,"","") - - UserStop(); - - memset(buf, 0, sizeof(buf)); /* zero out all fields */ - - RfDfFilen2Real(path2, Fname, MacZip.MacZipMode, MacZip.DataForkOnly, - &MacZip.CurrentFork); - GetCompletePath(path, path2, &MacZip.fileSpec, &err); - err = PrintUserHFSerr((err != -43) && (err != 0), err, path); - printerr("GetCompletePath:", err, err, __LINE__, __FILE__, path); - - if (err != noErr) { - errno = err; - return -1; - } - - /* Collect here some more information, it's not related to Macstat. - (note: filespec gets changed later in this function) */ - /* clear string-buffer */ - memset(MacZip.FullPath, 0x00, sizeof(MacZip.FullPath)); - rc = FSpGetFullPath(&MacZip.fileSpec, &fullPathLength, &hFullPath); - strncpy(MacZip.FullPath, *hFullPath, fullPathLength); - DisposeHandle(hFullPath); /* we don't need it any more */ - /* Collect some more information not related to Macstat */ - - - /* - * Fill the fpb & vpb struct up with info about file or directory. - */ - - FSpGetDirectoryID(&MacZip.fileSpec, &MacZip.dirID, &MacZip.isDirectory); - vpb.ioVRefNum = MacZip.fpb.hFileInfo.ioVRefNum = MacZip.fileSpec.vRefNum; - vpb.ioNamePtr = MacZip.fpb.hFileInfo.ioNamePtr = MacZip.fileSpec.name; - - if (MacZip.isDirectory) { - MacZip.fpb.hFileInfo.ioDirID = MacZip.fileSpec.parID; - /* - * Directories are executable by everyone. - */ - buf->st_mode |= UNX_IXUSR | UNX_IXGRP | UNX_IXOTH | UNX_IFDIR; - } else { - MacZip.fpb.hFileInfo.ioDirID = MacZip.dirID; - } - - MacZip.fpb.hFileInfo.ioFDirIndex = 0; - err = PBGetCatInfoSync((CInfoPBPtr)&MacZip.fpb); - - if (err == noErr) { - vpb.ioVolIndex = 0; - err = PBHGetVInfoSync((HParmBlkPtr)&vpb); - if (err == noErr && buf != NULL) { - /* - * Files are always readable by everyone. - */ - buf->st_mode |= UNX_IRUSR | UNX_IRGRP | UNX_IROTH; - - /* - * Use the Volume Info & File Info to fill out stat buf. - */ - if (MacZip.fpb.hFileInfo.ioFlAttrib & 0x10) { - buf->st_mode |= UNX_IFDIR; - buf->st_nlink = 2; - } else { - buf->st_nlink = 1; - if (MacZip.fpb.hFileInfo.ioFlFndrInfo.fdFlags & 0x8000) { - buf->st_mode |= UNX_IFLNK; - } else { - buf->st_mode |= UNX_IFREG; - } - } - - if (MacZip.fpb.hFileInfo.ioFlFndrInfo.fdType == 'APPL') { - /* - * Applications are executable by everyone. - */ - buf->st_mode |= UNX_IXUSR | UNX_IXGRP | UNX_IXOTH; - } - if ((MacZip.fpb.hFileInfo.ioFlAttrib & 0x01) == 0){ - /* - * If not locked, then everyone has write acces. - */ - buf->st_mode |= UNX_IWUSR | UNX_IWGRP | UNX_IWOTH; - } - - buf->st_ino = MacZip.fpb.hFileInfo.ioDirID; - buf->st_dev = MacZip.fpb.hFileInfo.ioVRefNum; - buf->st_uid = -1; - buf->st_gid = -1; - buf->st_rdev = 0; - - if (MacZip.CurrentFork == ResourceFork) - buf->st_size = MacZip.fpb.hFileInfo.ioFlRLgLen; - else - buf->st_size = MacZip.fpb.hFileInfo.ioFlLgLen; - - buf->st_blksize = vpb.ioVAlBlkSiz; - buf->st_blocks = (buf->st_size + buf->st_blksize - 1) - / buf->st_blksize; - - /* - * The times returned by the Mac file system are in the - * local time zone. We convert them to GMT so that the - * epoch starts from GMT. This is also consistent with - * what is returned from "clock seconds". - */ - if (!MacZip.isDirectory) { - MacZip.CreatDate = MacZip.fpb.hFileInfo.ioFlCrDat; - MacZip.ModDate = MacZip.fpb.hFileInfo.ioFlMdDat; - MacZip.BackDate = MacZip.fpb.hFileInfo.ioFlBkDat; - } else { - MacZip.CreatDate = MacZip.fpb.dirInfo.ioDrCrDat; - MacZip.ModDate = MacZip.fpb.dirInfo.ioDrMdDat; - MacZip.BackDate = MacZip.fpb.dirInfo.ioDrBkDat; - } - -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) - { - MacZip.HaveGMToffset = false; - MacZip.Md_UTCoffs = 0L; - MacZip.Cr_UTCoffs = 0L; - MacZip.Bk_UTCoffs = 0L; - } - else -#endif - { - /* Do not use GMT offsets when Md_UTCoffs calculation - * fails, since this time stamp is used for time - * comparisons in Zip and UnZip operations. - * We do not bother when GMT offset calculation fails for - * any other time stamp value. Instead we simply assume - * a default value of 0. - */ - MacZip.HaveGMToffset = - GetGMToffsetMac(MacZip.ModDate, &MacZip.Md_UTCoffs); - if (MacZip.HaveGMToffset) { - GetGMToffsetMac(MacZip.CreatDate, &MacZip.Cr_UTCoffs); - GetGMToffsetMac(MacZip.BackDate, &MacZip.Bk_UTCoffs); - } else { - MacZip.Cr_UTCoffs = 0L; - MacZip.Bk_UTCoffs = 0L; - } - } -#ifdef DEBUG_TIME - { - printf("\nZmacstat: MacZip.HaveGMToffset: %d", - MacZip.HaveGMToffset); - printf("\nZmacstat: Mac modif: %lu local -> UTOffset: %d", - MacZip.ModDate, MacZip.Md_UTCoffs); - printf("\nZmacstat: Mac creat: %lu local -> UTOffset: %d", - MacZip.CreatDate, MacZip.Cr_UTCoffs); - printf("\nZmacstat: Mac back: %lu local -> UTOffset: %d", - MacZip.BackDate, MacZip.Bk_UTCoffs); - } -#endif /* DEBUG_TIME */ - - - buf->st_mtime = MacFtime2UnixFtime(MacZip.ModDate); - buf->st_ctime = MacFtime2UnixFtime(MacZip.CreatDate); - buf->st_atime = buf->st_mtime; - -#ifdef DEBUG_TIME - { - printf("\nZmacstat: Unix modif: %lu UTC; Mac: %lu local", - buf->st_mtime, MacZip.ModDate); - printf("\nZmacstat: Unix creat: %lu UTC; Mac: %lu local\n", - buf->st_ctime, MacZip.CreatDate); - } -#endif /* DEBUG_TIME */ - - if (noisy) - { - if (MacZip.StatingProgress) - { - count_of_files++; - InformProgress(MacZip.RawCountOfItems, count_of_files ); - } - else - count_of_files = 0; - } - } - } - - if (err != noErr) { - errno = err; - } - - MacZip.isMacStatValid = true; - return (err == noErr ? 0 : -1); -} - - - - - -/* - *---------------------------------------------------------------------- - * - * chmod -- - * - * Results: - * See chmod documentation. - * - * Side effects: - * See chmod documentation. - * - *---------------------------------------------------------------------- - */ - -int chmod(char *path, int mode) -{ - HParamBlockRec hpb; - OSErr err; - - hpb.fileParam.ioNamePtr = C2PStr(path); - hpb.fileParam.ioVRefNum = 0; - hpb.fileParam.ioDirID = 0; - - if (mode & 0200) { - err = PBHRstFLockSync(&hpb); - } else { - err = PBHSetFLockSync(&hpb); - } - - if (err != noErr) { - errno = err; - return -1; - } - - return 0; -} diff --git a/third_party/infozip/zip/macos/source/unixlike.h b/third_party/infozip/zip/macos/source/unixlike.h deleted file mode 100644 index e61a35455..000000000 --- a/third_party/infozip/zip/macos/source/unixlike.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* - * Directory Operations for Mac based on BSD 4.3 - * By Jason Linhart, January 1997 - */ - -#ifndef _UNIXLIKE_H -#define _UNIXLIKE_H 1 - -#include - -#ifndef NAME_MAX -#define NAME_MAX 2048 -#endif - -#define UNX_IFMT 0170000 /* Unix file type mask */ -#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ -#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ -#define UNX_IFREG 0100000 /* Unix regular file */ -#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 */ - -/* historical file modes */ -#define S_IREAD 0x100 -#define S_IWRITE 0x80 -#define S_IEXEC 0x40 - - -#define isatty(arg) 1 - - -#define EINVAL 22 /* Invalid argument */ -#define ENAMETOOLONG 63 /* File name too long */ - - -struct dirent { - char d_name[NAME_MAX]; -}; - -/* - * The following definitions are usually found in fcntl.h. - * However, MetroWerks has screwed that file up a couple of times - * and all we need are the defines. - */ -#define O_APPEND 0x0100 /* open the file in append mode */ -#define O_CREAT 0x0200 /* create the file if it doesn't exist */ -#define O_EXCL 0x0400 /* if the file exists don't create it again */ -#define O_TRUNC 0x0800 /* truncate the file after opening it */ - - -int Zmacstat (const char *path, struct stat *buf); -int chmod(char *path, int mode); - - -#include "macstuff.h" - -#endif /* _UNIXLIKE_H */ diff --git a/third_party/infozip/zip/macos/source/zip_rc.hqx b/third_party/infozip/zip/macos/source/zip_rc.hqx deleted file mode 100644 index 99e0d250f..000000000 --- a/third_party/infozip/zip/macos/source/zip_rc.hqx +++ /dev/null @@ -1,43 +0,0 @@ -(This file must be converted with BinHex 4.0) -:#RTTF#jbBbjcDA3!8dP84&0*9#%!N!3([`#3"&(E8dP8)3!"!!!([h*-BA8#Q3# -3!aDCQ3d!"RTTF#jbB`!!&[Bi"2[rG!"-5QS!N!1!!*!%"32,j+m2!*!Drj!%8P0 -53e*6483"",#mXHDaqlGG!!!GmJ#3"JFj!*!%6Mi!N!MGc!`!P@6pq1R*k4&+Z,d -p"5$(b(-Upcc#j%EiHCfjPTq%8h+X8d)MR$`rF[b9Vh`pTLc2jqZ9r'RNq9VN1'& -'MMmj6Sk6#5HFc0J4lN8iHFU2--,*K%Z1NIR+#1XNR("#bE-)2I+FF$*G@H6BL+` -*!&6IV1ml1d+22#-$4UEm*#01"T`m*4`Ji(03ThM'$-EBilf-V8-e6Q8bXEVD@Xi -2bilcmGEY"lV6QGjZrK)I1CKZ$BfR4pSbLD'f`F'qVPKb+*(-*V2CPLfaGj1CE+a -Z+-$kpr4hpHrCf@d%f66E!A2P-rA6phmUj)QrdYP4r[6)H+cZF"hRV``NHSG5`b! -F6-0YBZ$!JH&%#frIb,2TmH4`LVGN4c1(%U1Q8#cf)P44dU"#-`D)I($H4I5qc[j -NJLI5)qpN5)Ic[S(-`-&1H(U2L*U'-H`1Y1p&qc#*YVk4(RNUbp(ae(#'R,B[d%B -(Nd40$id1C`FhmUlKNBmbkAf$Sra8qpDYcm0,H%GIhbiej(!EESbmC+a*'3dqdlC -j)%*H#+!,D!K4#J#3!$9H-J)mB*6L!50R"%"&hi6DD*61[-qq22%f1hkXPq@r)'` -(1hjQJ19cKP'bY0#60RQ3!&kd,r))mj-X,LBCCa&CeiX#f`ibZ$9##+[1HUJ34G5 -584+#&@p9i[UDj-&PD2rAi0qYdMpMQ""M8FLBT`#FUMje-i6rVXl2qI`jK@XY#eH -+%JH[5(`6,qEcH@K,(FfA4rZDNG,4mp60fALH@TT,SC!!5Sf0$HHP31&mP"AfKN) -K-!N[&XjM@##`1I,(a"V"#L%@#U9'*'lT-5CaU8GqpLTFkUP"%klmfMLJ1QpH5r2 -djNdfhIXJFIqqN!!&1QHe$jUlHF`jZ2I41X8k$@ZbKF1C2"Cq6YZaF(Z+5Yra&63 -"alCh62Vm6N(RqR90&)#m`cE3mILqV`@qBmcQkf0"9Ei%#**RRRpcS0DmV!N6DB- -&#R112Ym4-1d)GJ(R0,i,0!TEJ!%$#Mj$SFqp80)XU4&"+j!!DmFJk)S2*[(KNMR -mHApd)4Im@I2aqEBrpd,EVi3ehd@qETI[eprhmmlp0UGjqhe`q#[[Ljk#GDclAll -[P91j$d[[ir`4X1LcbmVcI$8cCd49rY*`E2l+F1l-Uk0CV,edY8%d('d@pD*qVRk -L@64FE9KlU9Q%E`3$i@+cD"BSp)'26f,8K%[iL[#3!$-h&aDPY5L2CJBBpF5Kh5k -+ASJVqckQ9kG`*C95rEka+29B5U+f"eYIqF&ZC()P-%GbHXQ44)a!l[Z9q3[c5Z! -aN!!pGHT"X#q,IJ$8lG#i224dkNXMhd,#3I"ap4JkEk@YlrKEp1r14erRqIYVJY@ -RbX4G0GVTc4A5A20`[E`GcX60GGI#0@$KHMqfFB9BIV4&%kr6+kH*J`(FR3lKcJj -pNqpN!JiZ-`'&1jQ!a*e-31RCQB$%R8c!dY1CJ19(C`+@AjGIa[qCCq8qH,K8FA% -LH$LpGbZiFpp0ehUR[lZTL-[HU3T8q*FVkd5&AaDBjrX##ha2S$UImK6,r-Z9MDM -#PaVqNfUH+VqmXplAGpG!G`k,I&I!i[ZC`J,Iba3@rEQC`J,Iba5@rFQGIhNq5h` -r-lM2ArAJIYjp(jEjYX!5he+i`cIhZRrjYq)%rjNh@"K4Ej!!V8&p!,8@0C*$l3L -bk#`f"%i9DMaRk,i*YC&aj0dFH6G(hXf4Gh2Nh4ajYp5aY(5[I@a#hBBDeh9E'*X -Kq3q,)QS*99$0SCj&R68Va[9Ie6lJ9444KDk%dDE9%CrPQhJ,hbD#)RJ8936RJK1 -bjb%HMTILXr&#r&Um++SIZ#*1fAP1hM-c'CG*VekG*BkGApkj'DZA13GkPA1JPcN -(iC4c%*m@1&[2l0@LLCK%pFUBG%kj4M@2,@pY&UjA+*Y2#Zil5%pF&GI[LBAVh-2 -$3I"aCG,5ekC[qL[MlZ1QRP32Ga5YQFY`Cf-[rZ!JX+GrCir-1R)J6J!jdY[ekRU -IXFT6',*jNmH[B69Hq&&6$N-NlS3K8Xm03mM2+VTKb253!iSqNDRHIKqNq$hqV6$ -%pVF8KPMc@68N$0Q#[KXH1UJL$1P'',*PpB``C"5M'eXG)JbTfDal(BB!AfdN$-' -cjq2P-%6bli8Kq,pej"NCErJr%NGk[[Pkpa44M+pBl4Mq$SC![ij'pZ[3j20d)N[ -i$qR%J5hSI`01r3hJcl+!m54`kMY9f'+N1PrYaRqe4SCq@E8Hr)$%dK,,5@`LdR2 -b$cBKPr+"5-q*AH`)BBm-4AUqlG-DHk"a9QQ`Yi"0+Beefb-pTlj6'Z(2`,ZS0"j -+!KY9'SpQ-0f,5U2Q'(Lr+Sd(h`3fV65DpX2VT0+)[!EHKdUMS4ABTdVMX4IJG8T -T'*pJ6K'P8IXk0+iTMFB8I'L[i9r!Qp6c`!dlH9,2idGJTp9PD'b(MjH9AZ0cQ02 -TqYdI$#8c2*2-$Kr+**,r!`#3!dm4!!!: diff --git a/third_party/infozip/zip/macos/zipup.h b/third_party/infozip/zip/macos/zipup.h deleted file mode 100644 index ce2af4ad1..000000000 --- a/third_party/infozip/zip/macos/zipup.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#ifndef O_RDONLY -# include -#endif - -#define fhow (O_RDONLY|O_BINARY) -#define fbad (-1) - -typedef int ftype; - - -#define zopen(n,p) MacOpen(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 - - diff --git a/third_party/infozip/zip/man/zip.1 b/third_party/infozip/zip/man/zip.1 deleted file mode 100644 index 0c2fce069..000000000 --- a/third_party/infozip/zip/man/zip.1 +++ /dev/null @@ -1,2840 +0,0 @@ -.\" ========================================================================= -.\" Copyright (c) 1990-2008 Info-ZIP. All rights reserved. -.\" -.\" See the accompanying file LICENSE, version 2007-Mar-4 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 -.\" ========================================================================== -.\" -.\" zip.1 by Mark Adler, Jean-loup Gailly and R. P. C. Rodgers -.\" updated by E. Gordon for Zip 3.0 (8 May 2005, 24 December 2006, -.\" 4 February 2007, 27 May 2007, 4 June 2007 by EG; 12 June 2007 by CS; -.\" 30 August 2007, 27 April 2008, 25 May 2008, 27 May 2008 by EG, -.\" 7 June 2008 by SMS and EG; 12 June 2008 by EG) -.\" -.TH ZIP 1L "16 June 2008 (v3.0)" Info-ZIP -.SH NAME -zip \- package and compress (archive) files -.SH SYNOPSIS -.B zip -.RB [\- aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$ ] -[\-\-longoption ...] -.RB [\- b " path]" -.RB [\- n " suffixes]" -.RB [\- t " date]" -.RB [\- tt " date]" -[\fIzipfile\fR [\fIfile\fR \.\|.\|.]] -[\fB-xi\fR list] -.PP -.B zipcloak -(see separate man page) -.PP -.B zipnote -(see separate man page) -.PP -.B zipsplit -(see separate man page) -.PP -Note: Command line processing in -.I zip -has been changed to support long options and handle all -options and arguments more consistently. Some old command -lines that depend on command line inconsistencies may no longer -work. -.SH DESCRIPTION -.I zip -is a compression and file packaging utility for Unix, VMS, MSDOS, -OS/2, Windows 9x/NT/XP, Minix, Atari, Macintosh, Amiga, and Acorn -RISC OS. It is analogous to a combination of the Unix commands -.IR tar (1) -and -.IR compress (1) -and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems). -.LP -A companion program -.RI ( unzip (1L)) -unpacks -.I zip -archives. -The -.I zip -and -.IR unzip (1L) -programs can work with archives produced by PKZIP (supporting -most PKZIP features up to PKZIP version 4.6), -and PKZIP and PKUNZIP can work with archives produced by -\fIzip\fP (with some exceptions, notably streamed archives, -but recent changes in the zip file standard may facilitate -better compatibility). -.I zip -version 3.0 is compatible with PKZIP 2.04 and also supports -the Zip64 extensions of PKZIP 4.5 which allow archives -as well as files to exceed the previous 2 GB limit (4 GB in -some cases). \fIzip\fP also now supports \fBbzip2\fP compression -if the \fBbzip2\fP library is included when \fIzip\fP is compiled. -Note that PKUNZIP 1.10 cannot extract files produced by -PKZIP 2.04 or -\fIzip\ 3.0\fP. You must use PKUNZIP 2.04g or -\fIunzip\ 5.0p1\fP (or later versions) to extract them. -.PP -See the \fBEXAMPLES\fP section at the bottom of this page -for examples of some typical uses of \fIzip\fP. -.PP -\fBLarge\ Archives\ and\ Zip64.\fP -.I zip -automatically uses the Zip64 extensions when files larger than 4 GB are -added to an archive, an archive containing Zip64 entries is updated -(if the resulting archive still needs Zip64), -the size of the archive will exceed 4 GB, or when the -number of entries in the archive will exceed about 64K. -Zip64 is also used for archives streamed from standard input as the size -of such archives are not known in advance, but the option \fB\-fz\-\fP can -be used to force \fIzip\fP to create PKZIP 2 compatible archives (as long -as Zip64 extensions are not needed). You must use a PKZIP 4.5 -compatible unzip, such as \fIunzip\ 6.0\fP or later, to extract files -using the Zip64 extensions. -.PP -In addition, streamed archives, entries encrypted with standard encryption, -or split archives created with the pause option may not be compatible with -PKZIP as data descriptors are used -and PKZIP at the time of this writing does not support data descriptors -(but recent changes in the PKWare published zip standard now include some -support for the data descriptor format \fIzip\fP uses). - -.PP -\fBMac OS X.\fP Though previous Mac versions had their own \fIzip\fP port, -\fIzip\fP supports Mac OS X as part of the Unix port and most Unix features -apply. References to "MacOS" below generally refer to MacOS versions older -than OS X. Support for some Mac OS features in the Unix Mac OS X port, such -as resource forks, is expected in the next \fIzip\fP release. - -.PP -For a brief help on \fIzip\fP and \fIunzip\fP, -run each without specifying any parameters on the command line. - -.SH "USE" -.PP -The program is useful for packaging a set of files for distribution; -for archiving files; -and for saving disk space by temporarily -compressing unused files or directories. -.LP -The -.I zip -program puts one or more compressed files into a single -.I zip -archive, -along with information about the files -(name, path, date, time of last modification, protection, -and check information to verify file integrity). -An entire directory structure can be packed into a -.I zip -archive with a single command. -Compression ratios of 2:1 to 3:1 are common for text files. -.I zip -has one compression method (deflation) and can also store files without -compression. (If \fBbzip2\fP support is added, \fIzip\fP can also -compress using \fBbzip2\fP compression, but such entries require a -reasonably modern unzip to decompress. When \fBbzip2\fP compression -is selected, it replaces deflation as the default method.) -.I zip -automatically chooses the better of the two (deflation or store or, if -\fBbzip2\fP is selected, \fBbzip2\fP or store) for each file to be -compressed. -.LP -\fBCommand\ format.\fP The basic command format is -.IP -\fBzip\fR options archive inpath inpath ... -.LP -where \fBarchive\fR is a new or existing \fIzip\fR archive -and \fBinpath\fR is a directory or file path optionally including wildcards. -When given the name of an existing -.I zip -archive, -.I zip -will replace identically named entries in the -.I zip -archive (matching the relative names as stored in -the archive) or add entries for new names. -For example, -if -.I foo.zip -exists and contains -.I foo/file1 -and -.IR foo/file2 , -and the directory -.I foo -contains the files -.I foo/file1 -and -.IR foo/file3 , -then: -.IP -\fCzip -r foo.zip foo\fP -.LP -or more concisely -.IP -\fCzip -r foo foo\fP -.LP -will replace -.I foo/file1 -in -.I foo.zip -and add -.I foo/file3 -to -.IR foo.zip . -After this, -.I foo.zip -contains -.IR foo/file1 , -.IR foo/file2 , -and -.IR foo/file3 , -with -.I foo/file2 -unchanged from before. -.LP -So if before the zip command is executed \fIfoo.zip\fP has: -.IP -\fC foo/file1 foo/file2 -.LP -and directory foo has: -.IP -\fC file1 file3\fP -.LP -then \fIfoo.zip\fP will have: -.IP -\fC foo/file1 foo/file2 foo/file3\fP -.LP -where \fIfoo/file1\fP is replaced and -\fIfoo/file3\fP is new. -.LP -\fB\-@\ file\ lists.\fP If a file list is specified as -\fB\-@\fP -[Not on MacOS], -.I zip -takes the list of input files from standard input instead of from -the command line. For example, -.IP -\fCzip -@ foo\fP -.LP -will store the files listed one per line on stdin in \fIfoo.zip\fP. -.LP -Under Unix, -this option can be used to powerful effect in conjunction with the -\fIfind\fP\ (1) -command. -For example, -to archive all the C source files in the current directory and -its subdirectories: -.IP -\fCfind . -name "*.[ch]" -print | zip source -@\fP -.LP -(note that the pattern must be quoted to keep the shell from expanding it). -.LP -\fBStreaming\ input\ and\ output.\fP -.I zip -will also accept a single dash ("-") as the zip file name, in which case it -will write the zip file to standard output, allowing the output to be piped -to another program. For example: -.IP -\fCzip -r - . | dd of=/dev/nrst0 obs=16k\fP -.LP -would write the zip output directly to a tape with the specified block size -for the purpose of backing up the current directory. -.LP -.I zip -also accepts a single dash ("-") as the name of a file to be compressed, in -which case it will read the file from standard input, allowing zip to take -input from another program. For example: -.IP -\fCtar cf - . | zip backup -\fP -.LP -would compress the output of the tar command for the purpose of backing up -the current directory. This generally produces better compression than -the previous example using the -r option because -.I zip -can take advantage of redundancy between files. The backup can be restored -using the command -.IP -\fCunzip -p backup | tar xf -\fP -.LP -When no zip file name is given and stdout is not a terminal, -.I zip -acts as a filter, compressing standard input to standard output. -For example, -.IP -\fCtar cf - . | zip | dd of=/dev/nrst0 obs=16k\fP -.LP -is equivalent to -.IP -\fCtar cf - . | zip - - | dd of=/dev/nrst0 obs=16k\fP -.LP -.I zip -archives created in this manner can be extracted with the program -.I funzip -which is provided in the -.I unzip -package, or by -.I gunzip -which is provided in the -.I gzip -package (but some -.I gunzip -may not support this if -.I zip -used the Zip64 extensions). For example: -.IP -\fPdd if=/dev/nrst0 ibs=16k | funzip | tar xvf -\fC -.LP -The stream can also be saved to a file and -.I unzip -used. -.LP -If Zip64 support for large files and archives is enabled and -\fIzip\fR is used as a filter, \fIzip\fR creates a Zip64 archive -that requires a PKZIP 4.5 or later compatible unzip to read it. This is -to avoid amgibuities in the zip file structure as defined in the current -zip standard (PKWARE AppNote) where the decision to use Zip64 needs to -be made before data is written for the entry, but for a stream the size -of the data is not known at that point. If the data is known to be smaller -than 4 GB, the option \fB\-fz\-\fP can be used to prevent use of Zip64, -but \fIzip\fP will exit with an error if Zip64 was in fact needed. -\fIzip\ 3\fR and \fIunzip\ 6\fR and later can read archives with Zip64 -entries. Also, \fIzip\fP removes the Zip64 extensions if not needed -when archive entries are copied (see the \fB\-U\fP (\fB\-\-copy\fP) -option). -.LP -When directing the output to another file, note that all options should be -before the redirection including \fB-x\fP. For example: -.IP -\fPzip archive "*.h" "*.c" -x donotinclude.h orthis.h > tofile\fC -.LP -\fBZip\ files.\fP When changing an existing -.I zip -archive, -.I zip -will write a temporary file with the new contents, -and only replace the old one when the process of creating the new version -has been completed without error. -.LP -If the name of the -.I zip -archive does not contain an extension, the extension -\fB.zip\fP -is added. If the name already contains an extension other than -\fB.zip\fP, -the existing extension is kept unchanged. However, split archives -(archives split over multiple files) require the \fB.zip\fP extension -on the last split. -.PP -\fBScanning\ and\ reading\ files.\fP -When \fIzip\fP starts, it scans for files to process (if needed). If -this scan takes longer than about 5 seconds, \fIzip\fP will display -a "Scanning files" message and start displaying progress dots every 2 seconds -or every so many entries processed, whichever takes longer. If there is more -than 2 seconds between dots it could indicate that finding each file is taking -time and could mean a slow network connection for example. -(Actually the initial file scan is -a two-step process where the directory scan is followed by a sort and these -two steps are separated with a space in the dots. If updating an existing -archive, a space also appears between the existing file scan and the new -file scan.) The scanning files dots are not controlled by the \fB\-ds\fP -dot size option, but the dots are turned off by the \fB\-q\fP quiet option. The -\fB\-sf\fP show files option can be used to scan for files and get the list of -files scanned without actually processing them. -.LP -If \fIzip\fR is not able to read a file, it -issues a warning but -continues. See the \fB\-MM\fP option below for more on how \fIzip\fP handles -patterns that are not matched and files that are not readable. -If some files were skipped, a -warning is issued at the end of the zip operation noting how many files -were read and how many skipped. -.PP -\fBCommand\ modes.\fP \fIzip\fP now supports two distinct types of command -modes, \fBexternal\fP and \fBinternal\fP. The \fBexternal\fP modes -(add, update, and freshen) read files from the file system (as well as from an -existing archive) while the \fBinternal\fP modes (delete and copy) operate -exclusively on entries in an existing archive. -.LP -.TP -.BI add\ \ \ \ \ \ -Update existing entries and add new files. If the archive does not exist -create it. This is the default mode. -.TP -.BI update\ \fP(\fB\-u\fP) -Update existing entries if newer on the file system and add new files. If -the archive does not exist issue warning then create a new archive. -.TP -.BI freshen\ \fP(\fB\-f\fP) -Update existing entries of an archive if newer on the file system. -Does not add new files to the archive. -.TP -.BI delete\ \fP(\fB\-d\fP) -Select entries in an existing archive and delete them. -.TP -.BI copy\ \fP(\fB\-U\fP) -Select entries in an existing archive and copy them to a new archive. -This new mode is similar to \fBupdate\fP but command line patterns -select entries in the existing archive rather than files from -the file system and it uses the \fB\-\-out\fP option to write the -resulting archive to a new file rather than update the existing -archive, leaving the original archive unchanged. -.LP -The new File Sync option (\fB\-FS\fP) is also considered a new mode, -though it is similar to \fBupdate\fP. This mode synchronizes the -archive with the files on the OS, only replacing files in the -archive if the file time or size of the OS file is different, adding -new files, and deleting entries from the archive where there is -no matching file. As this mode can delete entries from the archive, -consider making a backup copy of the archive. - -Also see \fB\-DF\fP for creating difference archives. - -See each option description below for details and the \fBEXAMPLES\fP section -below for examples. -.PP -\fBSplit\ archives.\fP \fIzip\fP version 3.0 and later can create split -archives. A -\fBsplit archive\fP is a standard zip archive split over multiple -files. (Note that split archives are not just archives split in to -pieces, as the offsets of entries are now based on the start of each -split. Concatenating the pieces together will invalidate these offsets, -but \fIunzip\fP can usually deal with it. \fIzip\fP will usually refuse -to process such a spliced archive unless the \fB\-FF\fP fix option is -used to fix the offsets.) -.LP -One use of split archives is storing a large archive on multiple -removable media. -For a split archive with 20 split files the files are typically named (replace -ARCHIVE with the name of your archive) ARCHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19, -ARCHIVE.zip. Note that the last file is the \fB.zip\fP file. In contrast, -\fBspanned archives\fP are the original multi-disk archive generally requiring -floppy disks and using volume labels to store disk numbers. \fIzip\fP supports -split archives but not spanned archives, though a procedure exists for converting -split archives of the right size to spanned archives. The reverse is also true, -where each file of a spanned archive can be copied in order to files with the -above names to create a split archive. -.LP -Use \fB\-s\fP to set the split size and create a split archive. The size is -given as a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB) -(the default is m). The \fB\-sp\fP option can be used to pause \fIzip\fP between -splits to allow changing removable media, for example, but read the descriptions -and warnings for both \fB\-s\fP and \fB\-sp\fP below. -.LP -Though \fIzip\fP does not update split archives, \fIzip\fP provides the new -option \fB\-O\fP (\fB\-\-output\-file\fP or \fB\-\-out\fP) to allow split archives -to be updated and saved in a new archive. For example, -.IP -\fCzip inarchive.zip foo.c bar.c \-\-out outarchive.zip\fP -.LP -reads archive \fBinarchive.zip\fP, even if split, adds the files \fBfoo.c\fP and -\fBbar.c\fP, and writes the resulting archive to \fBoutarchive.zip\fP. If -\fBinarchive.zip\fP is split then \fBoutarchive.zip\fP defaults to the same -split size. Be aware that if \fBoutarchive.zip\fP and any split files that are -created with it already exist, these are always overwritten as needed without -warning. This may be changed in the future. -.PP -\fBUnicode.\fP Though the zip standard requires storing paths in an archive using -a specific character set, in practice zips have stored paths in archives in whatever -the local character set is. This creates problems when an archive is created or -updated on a system using one character set and then extracted on another system -using a different character set. When compiled with Unicode support enabled on -platforms that support wide characters, \fIzip\fP now stores, in addition to the -standard local path for backward compatibility, the UTF-8 translation of the path. -This provides a common universal character set for storing paths that allows these -paths to be fully extracted on other systems that support Unicode and to match as -close as possible on systems that don't. - -On Win32 systems where paths are internally stored as Unicode but represented in -the local character set, it's possible that some paths will be skipped during a -local character set directory scan. \fIzip\fP with Unicode support now can read -and store these paths. Note that Win 9x systems and FAT file systems don't fully -support Unicode. - -Be aware that console windows on Win32 and Unix, for example, sometimes don't -accurately show all characters due to how each operating system switches in -character sets for display. However, directory navigation tools should show the -correct paths if the needed fonts are loaded. -.PP -\fBCommand line format.\fP This version of -.I zip -has updated command line processing and support for long options. -.PP -Short options take the form -.IP -\fC-s[-][s[-]...][value][=value][\ value]\fP -.LP -where s is a one or two character short option. A short option -that takes a value is last in an argument and anything after it is -taken as the value. If the option can be negated and "-" immediately -follows the option, the option is negated. -Short options can also be given as separate arguments -.IP -\fC-s[-][value][=value][\ value]\ -s[-][value][=value][\ value]\ ...\fP -.LP -Short options in general take values either as part of the same -argument or as the following argument. An optional = is also supported. -So -.IP -\fC-ttmmddyyyy\fP -.LP -and -.IP -\fC-tt=mmddyyyy\fP -.LP -and -.IP -\fC-tt mmddyyyy\fP -.LP -all work. The \fB\-x\fP and \fB\-i\fP options accept lists of values -and use a slightly different format described below. See the -\fB\-x\fP and \fB\-i\fP options. -.PP -Long options take the form -.IP -\fC--longoption[-][=value][ value]\fP -.LP -where the option starts with --, has a multicharacter name, can -include a trailing dash to negate the option (if the option -supports it), and can have a value (option argument) specified by -preceeding it with = (no spaces). Values can also follow the -argument. So -.IP -\fC--before-date=mmddyyyy\fP -.LP -and -.IP -\fC--before-date mmddyyyy\fP -.LP -both work. - -Long option names can be shortened to the shortest unique -abbreviation. See the option descriptions below for which -support long options. To avoid confusion, avoid abbreviating -a negatable option with an embedded dash ("-") at the dash -if you plan to negate it (the parser would consider -a trailing dash, such as for the option \fB\-\-some\-option\fP using -\fB\-\-some\-\fP as the option, as part of the name rather -than a negating dash). This may be changed to force the last -dash in \fB\-\-some\-\fP to be negating in the future. -.SH "OPTIONS" -.TP -.PD 0 -.BI \-a -.TP -.PD -.B \-\-ascii -[Systems using EBCDIC] Translate file to ASCII format. - -.TP -.PD 0 -.B \-A -.TP -.PD -.B \-\-adjust-sfx -Adjust self-extracting executable archive. -A self-extracting executable archive is created by prepending -the SFX stub to an existing archive. The -.B \-A -option tells -.I zip -to adjust the entry offsets stored -in the archive to take into account this "preamble" data. -.LP -Note: self-extracting archives for the Amiga are a special case. -At present, only the Amiga port of \fIzip\fP is capable of adjusting -or updating these without corrupting them. -J can be used to remove -the SFX stub if other updates need to be made. - -.TP -.PD 0 -.B \-AC -.TP -.PD -.B \-\-archive-clear -[WIN32] Once archive is created (and tested if \fB\-T\fP is used, -which is recommended), clear the archive bits of files processed. WARNING: -Once the bits are cleared they are cleared. You may want to use the -\fB\-sf\fP show files option to store the list of files processed in case -the archive operation must be repeated. Also consider using -the \fB\-MM\fP must match option. Be sure to check out \fB\-DF\fP as a -possibly better way to do incremental backups. - -.TP -.PD 0 -.B \-AS -.TP -.PD -.B \-\-archive-set -[WIN32] Only include files that have the archive bit set. Directories -are not stored when \fB\-AS\fP is used, though by default the paths -of entries, including directories, are stored as usual and can be used -by most unzips to recreate directories. - -The archive bit is set by the operating system when a file is modified -and, if used with \fB\-AC\fP, \fB\-AS\fP can provide an -incremental backup capability. However, other applications can -modify the archive bit and it may not be a reliable indicator of -which files have changed since the last archive operation. Alternative -ways to create incremental backups are using \fB\-t\fP to use file dates, -though this won't catch old files copied to directories being archived, -and \fB\-DF\fP to create a differential archive. - -.TP -.PD 0 -.B \-B -.TP -.PD -.B \-\-binary -[VM/CMS and MVS] force file to be read binary (default is text). - -.TP -.B \-B\fRn -[TANDEM] set Edit/Enscribe formatting options with n defined as -.RS -bit 0: Don't add delimiter (Edit/Enscribe) -.RE -.RS -bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe) -.RE -.RS -bit 2: Space fill record to maximum record length (Enscribe) -.RE -.RS -bit 3: Trim trailing space (Enscribe) -.RE -.RS -bit 8: Force 30K (Expand) large read for unstructured files -.RE - -.TP -.PD 0 -.BI \-b\ \fRpath -.TP -.PD -.B \-\-temp-path\ \fRpath -Use the specified -.I path -for the temporary -.I zip -archive. For example: -.RS -.IP -\fCzip -b /tmp stuff *\fP -.RE -.IP -will put the temporary -.I zip -archive in the directory -.IR /tmp , -copying over -.I stuff.zip -to the current directory when done. This option is useful when -updating an existing archive and the file system containing this -old archive does not have enough space to hold both old and new archives -at the same time. It may also be useful when streaming in some -cases to avoid the need for data descriptors. Note that using -this option may require \fIzip\fP take additional time to copy -the archive file when done to the destination file system. - -.TP -.PD 0 -.B \-c -.TP -.PD -.B \-\-entry-comments -Add one-line comments for each file. -File operations (adding, updating) are done first, -and the user is then prompted for a one-line comment for each file. -Enter the comment followed by return, or just return for no comment. - -.TP -.PD 0 -.B \-C -.TP -.PD -.B \-\-preserve-case -[VMS] Preserve case all on VMS. Negating this option -(\fB\-C-\fP) downcases. - -.TP -.PD 0 -.B \-C2 -.TP -.PD -.BI \-\-preserve-case-2 -[VMS] Preserve case ODS2 on VMS. Negating this option -(\fB\-C2-\fP) downcases. - -.TP -.PD 0 -.B \-C5 -.TP -.PD -.B \-\-preserve-case-5 -[VMS] Preserve case ODS5 on VMS. Negating this option -(\fB\-C5-\fP) downcases. - -.TP -.PD 0 -.B \-d -.TP -.PD -.B \-\-delete -Remove (delete) entries from a -.I zip -archive. -For example: -.RS -.IP -\fCzip -d foo foo/tom/junk foo/harry/\\* \\*.o\fP -.RE -.IP -will remove the entry -.IR foo/tom/junk , -all of the files that start with -.IR foo/harry/ , -and all of the files that end with -.B \&.o -(in any path). -Note that shell pathname expansion has been inhibited with backslashes, -so that -.I zip -can see the asterisks, -enabling -.I zip -to match on the contents of the -.I zip -archive instead of the contents of the current directory. -(The backslashes are not used on MSDOS-based platforms.) -Can also use quotes to escape the asterisks as in -.RS -.IP -\fCzip -d foo foo/tom/junk "foo/harry/*" "*.o"\fP -.RE -.IP -Not escaping the asterisks on a system where the shell expands -wildcards could result in the asterisks being converted to a -list of files in the current directory and that list used to -delete entries from the archive. -.IP -Under MSDOS, -.B \-d -is case sensitive when it matches names in the -.I zip -archive. -This requires that file names be entered in upper case if they were -zipped by PKZIP on an MSDOS system. (We considered making this -case insensitive on systems where paths were case insensitive, -but it is possible the archive came from a system where case does -matter and the archive could include both \fBBar\fP and \fBbar\fP -as separate files in the archive.) But see the new option \fB\-ic\fP -to ignore case in the archive. - -.TP -.PD 0 -.B \-db -.TP -.PD -.B \-\-display-bytes -Display running byte counts showing the bytes zipped and the bytes to go. - -.TP -.PD 0 -.B \-dc -.TP -.PD -.B \-\-display-counts -Display running count of entries zipped and entries to go. - -.TP -.PD 0 -.B \-dd -.TP -.PD -.B \-\-display-dots -Display dots while each entry is zipped (except on ports that have their own -progress indicator). See \fB-ds\fR below for setting dot size. The default is -a dot every 10 MB of input file processed. The \fB-v\fR option -also displays dots (previously at a much higher rate than this but now \fB\-v\fP -also defaults to 10 MB) and this rate is also controlled by \fB-ds\fR. - -.TP -.PD 0 -.B \-df -.TP -.PD -.B \-\-datafork -[MacOS] Include only data-fork of files zipped into the archive. -Good for exporting files to foreign operating-systems. -Resource-forks will be ignored at all. - -.TP -.PD 0 -.B \-dg -.TP -.PD -.B \-\-display-globaldots -Display progress dots for the archive instead of for each file. The command -.RS -.IP - zip -qdgds 10m -.RE -.IP -will turn off most output except dots every 10 MB. - -.TP -.PD 0 -.B \-ds\ \fRsize -.TP -.PD -.B \-\-dot-size\ \fRsize -Set amount of input file processed for each dot displayed. See \fB-dd\fR to -enable displaying dots. Setting this option implies \fB-dd\fR. Size is -in the format nm where n is a number and m is a multiplier. Currently m can -be k (KB), m (MB), g (GB), or t (TB), so if n is 100 and m is k, size would be -100k which is 100 KB. The default is 10 MB. -.IP -The \fB-v\fR option also displays dots and now defaults to -10 MB also. This rate is also controlled by this option. A size of 0 turns dots off. -.IP -This option does not control the dots from the "Scanning files" message as -\fIzip\fP scans for input files. The dot size for that is fixed at 2 seconds -or a fixed number of entries, whichever is longer. - -.TP -.PD 0 -.B \-du -.TP -.PD -.B \-\-display-usize -Display the uncompressed size of each entry. - -.TP -.PD 0 -.B \-dv -.TP -.PD -.B \-\-display-volume -Display the volume (disk) number each entry is being read from, -if reading an existing archive, and being written to. - -.TP -.PD 0 -.B \-D -.TP -.PD -.B \-\-no-dir-entries -Do not create entries in the -.I zip -archive for directories. Directory entries are created by default so that -their attributes can be saved in the zip archive. -The environment variable ZIPOPT can be used to change the default options. For -example under Unix with sh: -.RS -.IP -ZIPOPT="-D"; export ZIPOPT -.RE -.IP -(The variable ZIPOPT can be used for any option, including \fB\-i\fP and \fB\-x\fP -using a new option format detailed below, and can include several options.) The option -.B \-D -is a shorthand -for -.B \-x -"*/" but the latter previously could not be set as default in the ZIPOPT -environment variable as the contents of ZIPOPT gets inserted near the beginning -of the command line and the file list had to end at the end of the line. -.IP -This version of -.I zip -does allow -.B \-x -and -.B \-i -options in ZIPOPT if the form -.IP -\fC -.BR \-x \ file\ file\ ... \ @\fP -.IP -is used, where the @ (an argument that is just @) terminates -the list. - -.TP -.PD 0 -.B \-DF -.TP -.PD -.B \-\-difference-archive -Create an archive that contains all new and changed files since -the original archive was created. For this to work, the input -file list and current directory must be the same as during the -original \fIzip\fP operation. -.IP -For example, if the existing archive was created using -.RS -.IP -\fCzip -r foofull . -.RE -.IP -from the \fIbar\fP directory, then the command -.RS -.IP -\fCzip -r foofull . -DF --out foonew -.RE -.IP -also from the \fIbar\fP directory creates the archive \fIfoonew\fP -with just the files not in \fIfoofull\fP and the files where -the size or file time of the files do not match those in \fIfoofull\fP. - -Note that the timezone environment variable TZ should be set according to -the local timezone in order for this option to work correctly. A -change in timezone since the original archive was created could -result in no times matching and all files being included. - -A possible approach to backing up a directory might be to create -a normal archive of the contents of the directory as a full -backup, then use this option to create incremental backups. - -.TP -.PD 0 -.B \-e -.TP -.PD -.B \-\-encrypt -Encrypt the contents of the -.I zip -archive using a password which is entered on the terminal in response -to a prompt -(this will not be echoed; if standard error is not a tty, -.I zip -will exit with an error). -The password prompt is repeated to save the user from typing errors. - -.TP -.PD 0 -.B \-E -.TP -.PD -.B \-\-longnames -[OS/2] Use the .LONGNAME Extended Attribute (if found) as filename. - -.TP -.PD 0 -.B \-f -.TP -.PD -.B \-\-freshen -Replace (freshen) an existing entry in the -.I zip -archive only if it has been modified more recently than the -version already in the -.I zip -archive; -unlike the update option -.RB ( \-u ) -this will not add files that are not already in the -.I zip -archive. -For example: -.RS -.IP -\fCzip -f foo\fP -.RE -.IP -This command should be run from the same directory from which the original -.I zip -command was run, since paths stored in -.I zip -archives are always relative. -.IP -Note that the timezone environment variable TZ should be set according to -the local timezone in order for the -\fB\-f\fP, \fB\-u\fP and \fB\-o\fP -options to work correctly. -.IP -The reasons behind this are somewhat subtle but have to do with the differences -between the Unix-format file times (always in GMT) and most of the other -operating systems (always local time) and the necessity to compare the two. -A typical TZ value is ``MET-1MEST'' (Middle European time with automatic -adjustment for ``summertime'' or Daylight Savings Time). -.IP -The format is TTThhDDD, where TTT is the time zone such as MET, hh is the -difference between GMT and local time such as -1 above, and DDD is -the time zone when daylight savings time is in effect. Leave off -the DDD if there is no daylight savings time. For the US Eastern -time zone EST5EDT. - -.TP -.PD 0 -.B \-F -.TP -.B \-\-fix\ \ \ \ \ \ -.TP -.B \-FF -.TP -.PD -.B \-\-fixfix\ \ -Fix the -.I zip -archive. The \fB\-F\fP option can be used if some portions of the archive -are missing, but requires a reasonably intact central directory. -The input archive is scanned as usual, but \fIzip\fP will ignore -some problems. The resulting archive should be valid, but any -inconsistent entries will be left out. -.IP -When doubled as in -\fB\-FF\fP, -the archive is scanned from the beginning and \fIzip\fP scans for special -signatures to identify the limits between the archive members. The -single -.B \-F -is more reliable if the archive is not too much damaged, so try this -option first. -.IP -If the archive is too damaged or the end has been truncated, you -must use \fB\-FF\fP. This is a change from \fIzip\ 2.32\fP, where -the \fB\-F\fP option is able to read a truncated archive. The -\fB\-F\fP option now more reliably fixes archives with minor -damage and the \fB\-FF\fP option is needed to fix archives where -\fB\-F\fP might have been sufficient before. -.IP -Neither option will recover archives that have been incorrectly -transferred in ascii mode instead of binary. After the repair, the -.B \-t -option of -.I unzip -may show that some files have a bad CRC. Such files cannot be recovered; -you can remove them from the archive using the -.B \-d -option of -\fIzip\fP. -.IP -Note that \fB\-FF\fP may have trouble fixing archives that include an -embedded zip archive that was stored (without compression) in the archive -and, depending on the damage, it may find the entries in the embedded -archive rather than the archive itself. Try \fB\-F\fP first as it -does not have this problem. -.IP -The format of the fix commands have changed. For example, to fix -the damaged archive \fIfoo.zip\fP, -.RS -.IP -\fCzip -F foo --out foofix -.RE -.IP -tries to read the entries normally, copying good entries to the -new archive \fIfoofix.zip\fP. If this doesn't work, as when the -archive is truncated, or if some entries you know are in the archive -are missed, then try -.RS -.IP -\fCzip -FF foo --out foofixfix -.RE -.IP -and compare the resulting archive to the archive created by \fB\-F\fP. The -\fB\-FF\fP option may create an inconsistent archive. Depending on -what is damaged, you can then use the \fB\-F\fP option to fix that archive. -.IP -A split archive with missing split files can be fixed using -\fB\-F\fP if you have the last split of the archive (the \fB\.zip\fP file). -If this file is missing, you must use \fB\-FF\fP to fix the archive, -which will prompt you for the splits you have. -.IP -Currently the fix options can't recover entries that have a bad checksum -or are otherwise damaged. - -.TP -.PD 0 -.B \-FI -.TP -.PD -.B \-\-fifo -[Unix] Normally \fIzip\fP skips reading any FIFOs (named pipes) encountered, as -\fIzip\fP can hang if the FIFO is not being fed. This option tells \fIzip\fP to -read the contents of any FIFO it finds. - -.TP -.PD 0 -.B \-FS -.TP -.PD -.B \-\-filesync -Synchronize the contents of an archive with the files on the OS. -Normally when an archive is updated, new files are added and changed -files are updated but files that no longer exist on the OS are not -deleted from the archive. This option enables a new mode that checks -entries in the archive against the file system. If the file time and -file size of the entry matches that of the OS file, the entry is -copied from the old archive instead of being read from the file system -and compressed. If the OS file has changed, the entry is read and -compressed as usual. If the entry in the archive does not match a -file on the OS, the entry is deleted. Enabling this option should -create archives that are the same as new archives, but since existing -entries are copied instead of compressed, updating an existing archive -with \fB\-FS\fP can be much faster than creating a new archive. Also -consider using \fB\-u\fP for updating an archive. -.IP -For this option to work, the archive should be updated from the same -directory it was created in so the relative paths match. If few files -are being copied from the old archive, it may be faster to create a -new archive instead. -.IP -Note that the timezone environment variable TZ should be set according to -the local timezone in order for this option to work correctly. A -change in timezone since the original archive was created could -result in no times matching and recompression of all files. -.IP -This option deletes files from the archive. If you need to preserve -the original archive, make a copy of the archive first or use the -\fB\-\-out\fP option to output the updated archive to a new file. -Even though it may be slower, creating a new archive with a new archive -name is safer, avoids mismatches between archive and OS paths, and -is preferred. - -.TP -.PD 0 -.B \-g -.TP -.PD -.B \-\-grow \ \ \ \ \ \ -Grow (append to) the specified -.I zip -archive, instead of creating a new one. If this operation fails, -.I zip -attempts to restore the archive to its original state. If the restoration -fails, the archive might become corrupted. This option is ignored when -there's no existing archive or when at least one archive member must be -updated or deleted. - -.TP -.PD 0 -.B \-h -.TP -.PD 0 -.B \-? -.TP -.PD -.B \-\-help \ \ \ \ \ \ -Display the -.I zip -help information (this also appears if -.I zip -is run with no arguments). - -.TP -.PD 0 -.B \-h2 -.TP -.PD -.B \-\-more-help -Display extended help including more on command line format, pattern matching, and -more obscure options. - -.TP -.PD 0 -.B \-i\ \fRfiles -.TP -.PD -.B \-\-include\ \fRfiles -Include only the specified files, as in: -.RS -.IP -\fCzip -r foo . -i \\*.c\fP -.RE -.IP -which will include only the files that end in -.IR \& .c -in the current directory and its subdirectories. (Note for PKZIP -users: the equivalent command is -.RS -.IP -\fCpkzip -rP foo *.c\fP -.RE -.IP -PKZIP does not allow recursion in directories other than the current one.) -The backslash avoids the shell filename substitution, so that the -name matching is performed by -.I zip -at all directory levels. -[This is for Unix and other systems where \\ escapes the -next character. For other systems where the shell does not -process * do not use \\ and the above is -.RS -.IP -\fCzip -r foo . -i *.c\fP -.RE -.IP -Examples are for Unix unless otherwise specified.] So to include dir, -a directory directly under the current directory, use -.RS -.IP -\fCzip -r foo . -i dir/\\* -.RE -.IP -or -.RS -.IP -\fCzip -r foo . -i "dir/*" -.RE -.IP -to match paths such as dir/a and dir/b/file.c [on -ports without wildcard expansion in the shell such as MSDOS and Windows -.RS -.IP -\fCzip -r foo . -i dir/* -.RE -.IP -is used.] Note that currently the trailing / is needed -for directories (as in -.RS -.IP -\fCzip -r foo . -i dir/ -.RE -.IP -to include directory dir). -.IP -The long option form of the first example is -.RS -.IP -\fCzip -r foo . --include \\*.c -.RE -.IP -and does the same thing as the short option form. -.IP -Though the command syntax used to require \fB-i\fR at -the end of the command line, this version actually -allows \fB\-i\fP (or \fB\-\-include\fP) anywhere. The -list of files terminates at the next argument starting -with \fB-\fR, the end of the command line, or the list -terminator \fB@\fR (an argument that is just @). So -the above can be given as -.RS -.IP -zip -i \\*.c @ -r foo .\fP -.RE -.IP -for example. There must be a space between -the option and the first file of a list. For just -one file you can use the single value form -.RS -.IP -\fCzip -i\\*.c -r foo .\fP -.RE -.IP -(no space between option and value) or -.RS -.IP -\fCzip --include=\\*.c -r foo .\fP -.RE -.IP -as additional examples. The single value forms are -not recommended because they can be confusing and, -in particular, the \fB\-ifile\fP format can cause -problems if the first letter of \fBfile\fP combines with -\fBi\fP to form a two-letter option starting with -\fBi\fP. Use \fB\-sc\fP to see how your command line -will be parsed. -.IP -Also possible: -.RS -.IP -\fCzip -r foo . -i@include.lst\fP -.RE -.IP -which will only include the files in the current directory and its -subdirectories that match the patterns in the file include.lst. -.IP -Files to \fB\-i\fR and \fB\-x\fR are patterns matching internal archive paths. See -\fB-R\fR for more on patterns. - -.TP -.PD 0 -.B \-I -.TP -.PD -.B \-\-no-image -[Acorn RISC OS] Don't scan through Image files. When used, \fIzip\fP will not -consider Image files (eg. DOS partitions or Spark archives when SparkFS -is loaded) as directories but will store them as single files. - -For example, if you have SparkFS loaded, zipping a Spark archive will result -in a zipfile containing a directory (and its content) while using the 'I' -option will result in a zipfile containing a Spark archive. Obviously this -second case will also be obtained (without the 'I' option) if SparkFS isn't -loaded. - -.TP -.PD 0 -.B \-ic -.TP -.PD -.B \-\-ignore-case -[VMS, WIN32] Ignore case when matching archive entries. This option is -only available on systems where the case of files is ignored. On systems -with case-insensitive file systems, case is normally ignored when matching files -on the file system but is not ignored for -f (freshen), -d (delete), -U (copy), -and similar modes when matching against archive entries (currently -f -ignores case on VMS) because archive entries can be from systems where -case does matter and names that are the same except for case can exist -in an archive. The \fB\-ic\fR option makes all matching case insensitive. -This can result in multiple archive entries matching a command line pattern. - -.TP -.PD 0 -.B \-j -.TP -.PD -.B \-\-junk-paths -Store just the name of a saved file (junk the path), and do not store -directory names. By default, -.I zip -will store the full path (relative to the current directory). - -.TP -.PD 0 -.B \-jj -.TP -.PD -.B \-\-absolute-path -[MacOS] record Fullpath (+ Volname). The complete path including -volume will be stored. By default the relative path will be stored. - -.TP -.PD 0 -.B \-J -.TP -.PD -.B \-\-junk-sfx -Strip any prepended data (e.g. a SFX stub) from the archive. -.TP -.PD 0 -.B \-k -.TP -.PD -.B \-\-DOS-names -Attempt to convert the names and paths to conform to MSDOS, -store only the MSDOS attribute (just the user write attribute from Unix), -and mark the entry as made under MSDOS (even though it was not); -for compatibility with PKUNZIP under MSDOS which cannot handle certain -names such as those with two dots. -.TP -.PD 0 -.B \-l -.TP -.PD -.B \-\-to-crlf -Translate the Unix end-of-line character LF into the -MSDOS convention CR LF. This option should not be used on binary files. -This option can be used on Unix if the zip file is intended for PKUNZIP -under MSDOS. If the input files already contain CR LF, this option adds -an extra CR. This is to ensure that -\fBunzip -a\fP -on Unix will get back an exact copy of the original file, -to undo the effect of -\fBzip -l\fP. See \fB-ll\fR for how binary files are handled. -.TP -.PD 0 -.B \-la -.TP -.PD -.B \-\-log-append -Append to existing logfile. Default is to overwrite. -.TP -.PD 0 -.B \-lf\ \fPlogfilepath -.TP -.PD -.B \-\-logfile-path\ \fPlogfilepath -Open a logfile at the given path. By default any existing file at that location -is overwritten, but the \fB\-la\fP option will result in an existing file being -opened and the new log information appended to any existing information. -Only warnings and errors are written to the log unless the \fB\-li\fP option is -also given, then all information messages are also written to the log. -.TP -.PD 0 -.B \-li -.TP -.PD -.B \-\-log-info -Include information messages, such as file names being zipped, in the log. -The default is to only include the command line, any warnings and errors, and -the final status. -.TP -.PD 0 -.B \-ll -.TP -.PD -.B \-\-from-crlf -Translate the MSDOS end-of-line CR LF into Unix LF. -This option should not be used on binary files. -This option can be used on MSDOS if the zip file is intended for unzip -under Unix. If the file is converted and the file is later determined -to be binary a warning is issued and the file is probably -corrupted. In this release if \fB-ll\fR detects binary in the first buffer -read from a file, \fIzip\fR now issues a warning and skips line end -conversion on the file. This check seems to catch all binary files -tested, but the original check remains and if a converted file is -later determined to be binary that warning is still issued. A new algorithm -is now being used for binary detection that should allow line end conversion -of text files in \fBUTF-8\fR and similar encodings. -.TP -.PD 0 -.B \-L -.TP -.PD -.B \-\-license -Display the -.I zip -license. -.TP -.PD 0 -.B \-m -.TP -.PD -.B \-\-move \ \ \ -Move the specified files into the -.I zip -archive; actually, -this deletes the target directories/files after making the specified -.I zip -archive. If a directory becomes empty after removal of the files, the -directory is also removed. No deletions are done until -.I zip -has created the archive without error. -This is useful for conserving disk space, -but is potentially dangerous so it is recommended to use it in -combination with -.B \-T -to test the archive before removing all input files. -.TP -.PD 0 -.B \-MM -.TP -.PD -.B \-\-must-match -All input patterns must match at least one file and all input files -found must be readable. Normally when an input pattern does not match -a file the "name not matched" warning is issued and when an input file -has been found but later is missing or not readable a missing or not -readable warning is issued. In either case -.I zip -continues creating the archive, with missing or unreadable new files -being skipped and files already in the archive remaining unchanged. -After the archive is created, if any files were not readable -.I zip -returns the OPEN error code (18 on most systems) instead of the normal -success return (0 on most systems). With \fB\-MM\fP set, -.I zip -exits as soon as an input pattern is not matched (whenever the -"name not matched" warning would be issued) or when an input file is -not readable. In either case \fIzip\fR exits with an OPEN error -and no archive is created. -.IP -This option is useful when a known list of files is to be zipped so -any missing or unreadable files will result in an error. It is less -useful when used with wildcards, but \fIzip\fR will still exit with an -error if any input pattern doesn't match at least one file and if any -matched files are unreadable. If you want to create the archive -anyway and only need to know if files were skipped, don't use -.B \-MM -and just check the return code. Also \fB\-lf\fP could be useful. -.TP -.PD 0 -.BI \-n\ \fRsuffixes -.TP -.PD -.B \-\-suffixes\ \fRsuffixes -Do not attempt to compress files named with the given -\fBsuffixes\fR. -Such files are simply stored (0% compression) in the output zip file, -so that -.I zip -doesn't waste its time trying to compress them. -The suffixes are separated by -either colons or semicolons. For example: -.RS -.IP -\fCzip -rn .Z:.zip:.tiff:.gif:.snd foo foo\fP -.RE -.IP -will copy everything from -.I foo -into -.IR foo.zip , -but will store any files that end in -.IR .Z , -.IR .zip , -.IR .tiff , -.IR .gif , -or -.I .snd -without trying to compress them -(image and sound files often have their own specialized compression methods). -By default, -.I zip -does not compress files with extensions in the list -.I .Z:.zip:.zoo:.arc:.lzh:.arj. -Such files are stored directly in the output archive. -The environment variable ZIPOPT can be used to change the default options. For -example under Unix with csh: -.RS -.IP -setenv ZIPOPT "-n .gif:.zip" -.RE -.IP -To attempt compression on all files, use: -.RS -.IP -zip -n : foo -.RE -.IP -The maximum compression option -.B \-9 -also attempts compression on all files regardless of extension. -.IP -On Acorn RISC OS systems the suffixes are actually filetypes (3 hex digit -format). By default, \fIzip\fP does not compress files with filetypes in the list -DDC:D96:68E (i.e. Archives, CFS files and PackDir files). -.TP -.PD 0 -.B \-nw -.TP -.PD -.B \-\-no-wild -Do not perform internal wildcard processing (shell processing of wildcards is still done -by the shell unless the arguments are escaped). Useful if a list of paths is being -read and no wildcard substitution is desired. -.TP -.PD 0 -.B \-N -.TP -.PD -.B \-\-notes -[Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile comments. They can be -restored by using the -N option of \fIunzip\fP. If -c is used also, you are -prompted for comments only for those files that do not have filenotes. -.TP -.PD 0 -.B \-o -.TP -.PD -.B \-\-latest-time -Set the "last modified" time of the -.I zip -archive to the latest (oldest) "last modified" time -found among the entries in the -.I zip -archive. -This can be used without any other operations, if desired. -For example: -.IP -\fCzip -o foo\fP -.IP -will change the last modified time of -\fBfoo.zip\fP -to the latest time of the entries in -.BR foo.zip . -.TP -.PD 0 -.B \-O \fPoutput-file -.TP -.PD -.B \-\-output-file \fPoutput-file -Process the archive changes as usual, but instead of updating the existing archive, -output the new archive to output-file. Useful for updating an archive -without changing the existing archive and the input archive must be a different file -than the output archive. - -This option can be used to create updated split archives. -It can also be used with \fB\-U\fP to copy entries from an existing archive to a new -archive. See the \fBEXAMPLES\fP section below. - -Another use is converting \fIzip\fP files from one split size to another. For instance, -to convert an archive with 700 MB CD splits to one with 2 GB DVD splits, can use: -.RS -.IP -zip -s 2g cd-split.zip --out dvd-split.zip -.RE -.IP -which uses copy mode. See \fB\-U\fP below. Also: -.RS -.IP -zip -s 0 split.zip --out unsplit.zip -.RE -.IP -will convert a split archive to a single-file archive. - -Copy mode will convert stream entries (using data descriptors and which -should be compatible with most unzips) to normal entries (which should -be compatible -with all unzips), except if standard encryption was used. For archives -with encrypted entries, \fIzipcloak\fP will decrypt the entries and convert -them to normal entries. -.TP -.PD 0 -.B \-p -.TP -.PD -.B \-\-paths -Include relative file paths as part of the names of files stored in the archive. -This is the default. The \fB\-j\fP option junks the paths and just stores the -names of the files. -.TP -.PD 0 -.B \-P\ \fRpassword -.TP -.PD -.B \-\-password\ \fRpassword -Use \fIpassword\fP to encrypt zipfile entries (if any). \fBTHIS IS -INSECURE!\fP Many multi-user operating systems provide ways for any user to -see the current command line of any other user; even on stand-alone systems -there is always the threat of over-the-shoulder peeking. Storing the plaintext -password as part of a command line in an automated script is even worse. -Whenever possible, use the non-echoing, interactive prompt to enter passwords. -(And where security is truly important, use strong encryption such as Pretty -Good Privacy instead of the relatively weak standard encryption provided by -zipfile utilities.) -.TP -.PD 0 -.B \-q -.TP -.PD -.B \-\-quiet -Quiet mode; -eliminate informational messages and comment prompts. -(Useful, for example, in shell scripts and background tasks). -.TP -.PD 0 -.BI \-Q\fRn -.TP -.PD -.B \-\-Q\-flag\ \fRn -[QDOS] store information about the file in the file header with n defined as -.RS -bit 0: Don't add headers for any file -.RE -.RS -bit 1: Add headers for all files -.RE -.RS -bit 2: Don't wait for interactive key press on exit -.RE -.TP -.PD 0 -.B \-r -.TP -.PD -.B \-\-recurse\-paths -Travel the directory structure recursively; -for example: -.RS -.IP -zip -r foo.zip foo -.RE -.IP -or more concisely -.RS -.IP -zip -r foo foo -.RE -.IP -In this case, all the files and directories in -.B foo -are saved in a -.I zip -archive named \fBfoo.zip\fP, -including files with names starting with \fB"."\fP, -since the recursion does not use the shell's file-name substitution mechanism. -If you wish to include only a specific subset of the files in directory -\fBfoo\fP -and its subdirectories, use the -\fB\-i\fP -option to specify the pattern of files to be included. -You should not use -\fB\-r\fP -with the name \fB".*"\fP, -since that matches \fB".."\fP -which will attempt to zip up the parent directory -(probably not what was intended). -.IP -Multiple source directories are allowed as in -.RS -.IP -\fCzip -r foo foo1 foo2\fP -.RE -.IP -which first zips up \fBfoo1\fP and then \fBfoo2\fP, going down each directory. -.IP -Note that while wildcards to \fB-r\fR are typically resolved while recursing down -directories in the file system, any \fB-R\fN, \fB-x\fR, and \fB-i\fR wildcards -are applied to internal archive pathnames once the directories are scanned. -To have wildcards apply to files in subdirectories when recursing on -Unix and similar systems where the shell does wildcard substitution, either -escape all wildcards or put all arguments with wildcards in quotes. This lets -\fIzip\fR see the wildcards and match files in subdirectories using them as -it recurses. -.TP -.PD 0 -.B \-R -.TP -.PD -.B \-\-recurse\-patterns -Travel the directory structure recursively starting at the -current directory; -for example: -.RS -.IP -\fCzip -R foo "*.c"\fP -.RE -.IP -In this case, all the files matching \fB*.c\fP in the tree starting at the -current directory are stored into a -.I zip -archive named -\fBfoo.zip\fP. -Note that \fB*.c\fP will match \fBfile.c\fP, \fBa/file.c\fP -and \fBa/b/.c\fP. More than one pattern can be listed as separate -arguments. -Note for PKZIP users: the equivalent command is -.RS -.IP -\fCpkzip -rP foo *.c\fP -.RE -.IP -Patterns are relative file paths as they appear in the archive, or will after -zipping, and can have optional wildcards in them. For example, given -the current directory is \fBfoo\fP and under it are directories \fBfoo1\fP and \fBfoo2\fP -and in \fBfoo1\fP is the file \fBbar.c\fP, -.RS -.IP -\fCzip -R foo/*\fP -.RE -.IP -will zip up \fBfoo\fP, \fBfoo/foo1\fP, \fBfoo/foo1/bar.c\fP, and \fBfoo/foo2\fP. -.RS -.IP -\fCzip -R */bar.c\fP -.RE -.IP -will zip up \fBfoo/foo1/bar.c\fP. See the note for \fB-r\fR on escaping wildcards. - -.TP -.PD 0 -.B \-RE -.TP -.PD -.B \-\-regex -[WIN32] Before \fIzip\fP \fI3.0\fP, regular expression list matching was -enabled by default on Windows platforms. Because of confusion resulting -from the need to escape "[" and "]" in names, it is now off by default for -Windows so "[" and "]" are just normal characters in names. This option -enables [] matching again. - -.TP -.PD 0 -.B \-s\ \fPsplitsize -.TP -.PD -.B \-\-split\-size\ \fPsplitsize -Enable creating a split archive and set the split size. A split archive is an archive -that could be split over many files. As the archive is created, if the size of the -archive reaches the specified split size, that split is closed and the next split -opened. In general all splits but the last will be the split size and the last -will be whatever is left. If the entire archive is smaller than the split size a -single-file archive is created. - -Split archives are stored in numbered files. For example, if the output -archive is named \fBarchive\fP and three splits are required, the resulting -archive will be in the three files \fBarchive.z01\fP, \fBarchive.z02\fP, and -\fBarchive.zip\fP. Do not change the numbering of these files or the archive -will not be readable as these are used to determine the order the splits are read. - -Split size is a number optionally followed by a multiplier. Currently the -number must be an integer. The multiplier can currently be one of -\fBk\fP (kilobytes), \fBm\fP (megabytes), \fBg\fP (gigabytes), or \fBt\fP -(terabytes). As 64k is the minimum split size, numbers without multipliers -default to megabytes. For example, to create a split archive called \fBfoo\fP -with the contents of the \fBbar\fP directory with splits of 670 MB that might -be useful for burning on CDs, the command: -.RS -.IP -zip -s 670m -r foo bar -.RE -.IP -could be used. - -Currently the old splits of a split archive are not excluded from a new -archive, but they can be specifically excluded. If possible, keep -the input and output archives out of the path being zipped when creating -split archives. - -Using \fB\-s\fP without \fB\-sp\fP as above creates all the splits where -\fBfoo\fP is being written, in this case the current directory. This split -mode updates the splits as the archive is being created, requiring all -splits to remain writable, but creates split archives that are readable by -any unzip that supports split archives. See \fB\-sp\fP below for enabling -split pause mode which allows splits to be written directly to removable -media. - -The option \fB\-sv\fP can be used to enable verbose splitting and provide details of -how the splitting is being done. The \fB\-sb\fP option can be used to ring the bell -when \fIzip\fP pauses for the next split destination. - -Split archives cannot be updated, but see the \fB\-O\fP (\fB\-\-out\fP) option for -how a split archive can be updated as it is copied to a new archive. -A split archive can also be converted into a single-file archive using a -split size of 0 or negating the \fB\-s\fP option: -.RS -.IP -zip -s 0 split.zip --out single.zip -.RE -.IP -Also see \fB\-U\fP (\fB\-\-copy\fP) for more on using copy mode. -.TP -.PD 0 -.B \-sb -.TP -.PD -.B \-\-split\-bell -If splitting and using split pause mode, ring the bell when \fIzip\fP pauses -for each split destination. -.TP -.PD 0 -.B \-sc -.TP -.PD -.B \-\-show\-command -Show the command line starting \fIzip\fP as processed and exit. The new command parser -permutes the arguments, putting all options and any values associated with them -before any non-option arguments. This allows an option to appear anywhere in the -command line as long as any values that go with the option go with it. This option -displays the command line as \fIzip\fP sees it, including any arguments from -the environment such as from the \fBZIPOPT\fP variable. Where allowed, options later -in the command line can override options earlier in the command line. -.TP -.PD 0 -.B \-sf -.TP -.PD -.B \-\-show\-files -Show the files that would be operated on, then exit. For instance, if creating -a new archive, this will list the files that would be added. If the option is -negated, \fB\-sf\-\fP, output only to an open log file. Screen display is -not recommended for large lists. -.TP -.PD 0 -.B \-so -.TP -.PD -.B \-\-show\-options -Show all available options supported by \fIzip\fP as compiled on the current system. -As this command reads the option table, it should include all options. Each line -includes the short option (if defined), the long option (if defined), the format -of any value that goes with the option, if the option can be negated, and a -small description. The value format can be no value, required value, optional -value, single character value, number value, or a list of values. The output of -this option is not intended to show how to use any option but only -show what options are available. -.TP -.PD 0 -.B \-sp -.TP -.PD -.B \-\-split\-pause -If splitting is enabled with \fB\-s\fP, enable split pause mode. This -creates split archives as \fB\-s\fP does, but stream writing is used so each -split can be closed as soon as it is written and \fIzip\fP will pause between each -split to allow changing split destination or media. - -Though this split mode allows writing splits directly to removable media, it -uses stream archive format that may not be readable by some unzips. Before -relying on splits created with \fB\-sp\fP, test a split archive with the unzip -you will be using. - -To convert a stream split archive (created with \fB\-sp\fP) to a standard archive -see the \fB\-\-out\fP option. -.TP -.PD 0 -.B \-su -.TP -.PD -.B \-\-show\-unicode -As \fB\-sf\fP, but also show Unicode version of the path if exists. -.TP -.PD 0 -.B \-sU -.TP -.PD -.B \-\-show\-just\-unicode -As \fB\-sf\fP, but only show Unicode version of the path if exists, otherwise show -the standard version of the path. -.TP -.PD 0 -.B \-sv -.TP -.PD -.B \-\-split\-verbose -Enable various verbose messages while splitting, showing how the splitting is being -done. -.TP -.PD 0 -.B \-S -.TP -.PD -.B \-\-system-hidden -[MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files. -.RS -[MacOS] Includes finder invisible files, which are ignored otherwise. -.RE -.TP -.PD 0 -.BI \-t\ \fRmmddyyyy -.TP -.PD -.B \-\-from\-date\ \fRmmddyyyy -Do not operate on files modified prior to the specified date, -where -.B mm -is the month (00-12), -.B dd -is the day of the month (01-31), -and -.B yyyy -is the year. -The -.I ISO\ 8601 -date format -.B yyyy\-mm\-dd -is also accepted. -For example: -.RS -.IP -\fCzip -rt 12071991 infamy foo\fP - -\fCzip -rt 1991-12-07 infamy foo\fP -.RE -.IP -will add all the files in -.B foo -and its subdirectories that were last modified on or after 7 December 1991, -to the -.I zip -archive -.BR infamy.zip . -.TP -.PD 0 -.BI \-tt\ \fRmmddyyyy -.TP -.PD -.B \-\-before\-date\ \fRmmddyyyy -Do not operate on files modified after or at the specified date, -where -.B mm -is the month (00-12), -.B dd -is the day of the month (01-31), -and -.B yyyy -is the year. -The -.I ISO\ 8601 -date format -.B yyyy\-mm\-dd -is also accepted. -For example: -.RS -.IP -\fCzip -rtt 11301995 infamy foo\fP - -\fCzip -rtt 1995-11-30 infamy foo\fP -.RE -.IP -will add all the files in -.B foo -and its subdirectories that were last modified before 30 November 1995, -to the -.I zip -archive -.BR infamy.zip . -.TP -.PD 0 -.B \-T -.TP -.PD -.B \-\-test\ \ \ \ -Test the integrity of the new zip file. If the check fails, the old zip file -is unchanged and (with the -.B -m -option) no input files are removed. -.TP -.PD 0 -.B \-TT\ \fPcmd -.TP -.PD -.B \-\-unzip-command\ \fPcmd -Use command cmd instead of 'unzip -tqq' to test an archive when the \fB\-T\fP -option is used. On Unix, to use a copy of unzip in the current directory instead -of the standard system unzip, could use: -.IP -\fC zip archive file1 file2 -T -TT "./unzip -tqq"\fP -.IP -In cmd, {} is replaced by the name of the temporary archive, otherwise the name -of the archive is appended to the end of the command. -The return code is checked for success (0 on Unix). -.TP -.PD 0 -.B \-u -.TP -.PD -.B \-\-update -Replace (update) an existing entry in the -.I zip -archive only if it has been modified more recently -than the version already in the -.I zip -archive. -For example: -.RS -.IP -\fCzip -u stuff *\fP -.RE -.IP -will add any new files in the current directory, -and update any files which have been modified since the -.I zip -archive -.I stuff.zip -was last created/modified (note that -.I zip -will not try to pack -.I stuff.zip -into itself when you do this). -.IP -Note that the -.B \-u -option with no input file arguments acts like the -.B \-f -(freshen) option. -.TP -.PD 0 -.B \-U -.TP -.PD -.B \-\-copy\-entries -Copy entries from one archive to another. Requires the \fB\-\-out\fP -option to specify a different output file than the input archive. Copy -mode is the reverse of \fB\-d\fP delete. When delete is being used -with \fB\-\-out\fP, the selected entries are deleted from the archive -and all other entries are copied to the new archive, while copy mode -selects the files to include in the new archive. Unlike \fB\-u\fP -update, input patterns on the command line are matched against archive -entries only and not the file system files. For instance, -.RS -.IP -\fCzip inarchive "*.c" --copy --out outarchive\fP -.RE -.IP -copies entries with names ending in \fB\.c\fP from \fBinarchive\fP -to \fBoutarchive\fP. The wildcard must be escaped on some systems -to prevent the shell from substituting names of files from the -file system which may have no relevance to the entries in the archive. - -If no input files appear on the command line and \fB\-\-out\fP is -used, copy mode is assumed: -.RS -.IP -\fCzip inarchive --out outarchive\fP -.RE -.IP -This is useful for changing split size for instance. Encrypting -and decrypting entries is not yet supported using copy mode. Use -\fIzipcloak\fP for that. -.TP -.PD 0 -.B \-UN\ \fRv -.TP -.PD -.B \-\-unicode\ \fRv -Determine what \fIzip\fP should do with Unicode file names. -\fIzip\ 3.0\fP, in addition to the standard file path, now -includes the UTF\-8 translation of the path if the entry path -is not entirely 7-bit ASCII. When an entry -is missing the Unicode path, \fIzip\fP reverts back to the -standard file path. The problem with using the standard path -is this path is in the local character set of the zip that created -the entry, which may contain characters that are not valid in -the character set being used by the unzip. When \fIzip\fP is -reading an archive, if an entry also has a Unicode path, -\fIzip\fP now defaults to using the Unicode path to recreate -the standard path using the current local character set. - -This option can be used to determine what \fIzip\fP should do -with this path if there is a mismatch between the stored standard path -and the stored UTF-8 path (which can happen if the standard path was -updated). In all cases, if there is a mismatch it is -assumed that the standard path is more current and -\fIzip\fP uses that. Values for \fBv\fP are -.RS -.IP -q \- quit if paths do not match -.IP -w \- warn, continue with standard path -.IP -i \- ignore, continue with standard path -.IP -n \- no Unicode, do not use Unicode paths -.RE -.IP -The default is to warn and continue. - -Characters that are not valid in the current character set are -escaped as \fB#Uxxxx\fP and \fB#Lxxxxxx\fP, where x is an -ASCII character for a hex digit. The first is used if a 16-bit -character number is sufficient to represent the Unicode character -and the second if the character needs more than 16 bits to -represent it's Unicode character code. Setting \fB\-UN\fP to -.RS -.IP -e \- escape -.RE -.IP -as in -.RS -.IP -\fCzip archive -sU -UN=e\fP -.RE -.IP -forces \fIzip\fP to escape all characters that are not printable 7-bit -ASCII. - -Normally \fIzip\fP stores UTF\-8 directly in the standard path field -on systems where UTF\-8 is the current character set and stores the -UTF\-8 in the new extra fields otherwise. The option -.RS -.IP -u \- UTF\-8 -.RE -.IP -as in -.RS -.IP -\fCzip archive dir -r -UN=UTF8\fP -.RE -.IP -forces \fIzip\fP to store UTF\-8 as native in the archive. Note that -storing UTF\-8 directly is the default on Unix systems that support it. -This option could be useful on Windows systems where the escaped -path is too large to be a valid path and the UTF\-8 version of the -path is smaller, but native UTF\-8 is not backward compatible on -Windows systems. - -.TP -.PD 0 -.B \-v -.TP -.PD -.B \-\-verbose -Verbose mode or print diagnostic version info. -.IP -Normally, when applied to real operations, this option enables the display of a -progress indicator during compression (see \fB-dd\fR for more on dots) and -requests verbose diagnostic info about zipfile structure oddities. -.IP -However, when -.B \-v -is the only command line argument a diagnostic screen is printed instead. This -should now work even if stdout is redirected to a file, allowing easy saving -of the information for sending with bug reports to Info-ZIP. The version -screen provides the help screen header with program name, version, and release -date, some pointers to the Info-ZIP home and distribution sites, and shows -information about the target environment (compiler type and version, OS -version, compilation date and the enabled optional features used to create the -.I zip -executable). -.TP -.PD 0 -.B \-V -.TP -.PD -.B \-\-VMS\-portable -[VMS] Save VMS file attributes. -(Files are truncated at EOF.) When a -V archive is unpacked on a -non-VMS system, some file types (notably Stream_LF -text files and pure binary files like fixed-512) -should be extracted intact. Indexed files and file -types with embedded record sizes (notably variable-length record types) -will probably be seen as corrupt elsewhere. -.TP -.PD 0 -.B \-VV -.TP -.PD -.B \-\-VMS\-specific -[VMS] Save VMS file attributes, and all allocated -blocks in a file, including any data beyond EOF. -Useful for moving ill-formed files among VMS systems. When a -VV archive is -unpacked on a non-VMS system, almost all files will appear corrupt. -.TP -.PD 0 -.B \-w -.TP -.PD -.B \-\-VMS\-versions -[VMS] Append the version number of the files to the name, -including multiple versions of files. Default is to use only -the most recent version of a specified file. -.TP -.PD 0 -.B \-ww -.TP -.PD -.B \-\-VMS\-dot\-versions -[VMS] Append the version number of the files to the name, -including multiple versions of files, using the \.nnn format. -Default is to use only the most recent version of a specified -file. -.TP -.PD 0 -.BI \-ws -.TP -.PD -.B \-\-wild\-stop\-dirs -Wildcards match only at a directory level. Normally \fIzip\fP handles -paths as strings and given the paths -.RS -.IP -/foo/bar/dir/file1.c -.IP -/foo/bar/file2.c -.RE -.IP -an input pattern such as -.RS -.IP -/foo/bar/* -.RE -.IP -normally would match both paths, the * matching \fBdir/file1.c\fP -and \fBfile2.c\fP. Note that in the first case a directory -boundary (/) was crossed in the match. With \fB\-ws\fP no -directory bounds will be included in the match, making -wildcards local to a specific directory level. So, with -\fB\-ws\fP enabled, only the second path would be matched. - -When using \fB\-ws\fP, use ** to match across directory boundaries as -* does normally. -.TP -.PD 0 -.BI \-x\ \fRfiles -.TP -.PD -.B \-\-exclude\ \fRfiles -Explicitly exclude the specified files, as in: -.RS -.IP -\fCzip -r foo foo -x \\*.o\fP -.RE -.IP -which will include the contents of -.B foo -in -.B foo.zip -while excluding all the files that end in -\fB.o\fP. -The backslash avoids the shell filename substitution, so that the -name matching is performed by -.I zip -at all directory levels. -.IP -Also possible: -.RS -.IP -\fCzip -r foo foo -x@exclude.lst\fP -.RE -.IP -which will include the contents of -.B foo -in -.B foo.zip -while excluding all the files that match the patterns in the file -\fBexclude.lst\fP. -.IP -The long option forms of the above are -.RS -.IP -\fCzip -r foo foo --exclude \\*.o\fP -.RE -.IP -and -.RS -.IP -\fCzip -r foo foo --exclude @exclude.lst\fP -.RE -.IP -Multiple patterns can be specified, as in: -.RS -.IP -\fCzip -r foo foo -x \\*.o \\*.c\fP -.RE -.IP -If there is no space between \fB\-x\fP and -the pattern, just one value is assumed (no list): -.RS -.IP -\fCzip -r foo foo -x\\*.o\fP -.RE -.IP -.IP -See \fB-i\fR for more on include and exclude. -.TP -.PD 0 -.B \-X -.TP -.PD -.B \-\-no\-extra -Do not save extra file attributes (Extended Attributes on OS/2, uid/gid -and file times on Unix). The zip format uses extra fields to include -additional information for each entry. Some extra fields are specific -to particular systems while others are applicable to all systems. -Normally when \fIzip\fP reads entries from an existing archive, it -reads the extra fields it knows, strips the rest, and adds -the extra fields applicable to that system. With \fB\-X\fP, \fIzip\fP strips -all old fields and only includes the Unicode and Zip64 extra fields -(currently these two extra fields cannot be disabled). - -Negating this option, \fB\-X\-\fP, includes all the default extra fields, -but also copies over any unrecognized extra fields. -.TP -.PD 0 -.B \-y -.TP -.PD -.B \-\-symlinks -For UNIX and VMS (V8.3 and later), store symbolic links as such in the -.I zip -archive, instead of compressing and storing the file referred to by -the link. This can avoid multiple copies of files being included in -the archive as \fIzip\fP recurses the directory trees and accesses -files directly and by links. -.TP -.PD 0 -.B \-z -.TP -.PD -.B \-\-archive\-comment -Prompt for a multi-line comment for the entire -.I zip -archive. -The comment is ended by a line containing just a period, -or an end of file condition (^D on Unix, ^Z on MSDOS, OS/2, and VMS). -The comment can be taken from a file: -.RS -.IP -\fCzip -z foo < foowhat\fP -.RE -.TP -.PD 0 -.B \-Z\ \fRcm -.TP -.PD -.B \-\-compression\-method\ \fRcm -Set the default compression method. Currently the main methods supported -by \fIzip\fP are \fBstore\fP and \fBdeflate\fP. Compression method -can be set to: - -\fBstore\fP \- Setting the compression method to \fBstore\fP forces -\fIzip\fP to store entries with no compression. This is generally -faster than compressing entries, but results in no space savings. -This is the same as using \fB\-0\fP (compression level zero). - -\fBdeflate\fP \- This is the default method for \fIzip\fP. If \fIzip\fP -determines that storing is better than deflation, the entry will be -stored instead. - -\fBbzip2\fP \- If \fBbzip2\fP support is compiled in, this compression -method also becomes available. Only some modern unzips currently support -the \fBbzip2\fP compression method, so test the unzip you will be using -before relying on archives using this method (compression method 12). - -For example, to add \fBbar.c\fP to archive \fBfoo\fP using \fBbzip2\fP -compression: -.RS -.IP -zip -Z bzip2 foo bar.c -.RE -.IP -The compression method can be abbreviated: -.RS -.IP -zip -Zb foo bar.c -.RE -.IP -.TP -.PD 0 -.BI \-# -.TP -.PD -.B (\-0, \-1, \-2, \-3, \-4, \-5, \-6, \-7, \-8, \-9) -Regulate the speed of compression using the specified digit -.BR # , -where -.B \-0 -indicates no compression (store all files), -.B \-1 -indicates the fastest compression speed (less compression) -and -.B \-9 -indicates the slowest compression speed (optimal compression, ignores -the suffix list). The default compression level is -.BR \-6. - -Though still being worked, the intention is this setting will control -compression speed for all compression methods. Currently only -deflation is controlled. -.TP -.PD 0 -.B \-! -.TP -.PD -.B \-\-use\-privileges -[WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security. -.TP -.PD 0 -.B \-@ -.TP -.PD -.B \-\-names\-stdin -Take the list of input files from standard input. Only one filename per line. -.TP -.PD 0 -.B \-$ -.TP -.PD -.B \-\-volume\-label -[MSDOS, OS/2, WIN32] Include the volume label for the drive holding -the first file to be compressed. If you want to include only the volume -label or to force a specific drive, use the drive name as first file name, -as in: -.RS -.IP -\fCzip -$ foo a: c:bar\fP -.RE -.IP -.SH "EXAMPLES" -The simplest example: -.IP -\fCzip stuff *\fP -.LP -creates the archive -.I stuff.zip -(assuming it does not exist) -and puts all the files in the current directory in it, in compressed form -(the -\fB\&.zip\fP -suffix is added automatically, unless the archive name contains -a dot already; -this allows the explicit specification of other suffixes). -.LP -Because of the way the shell on Unix does filename substitution, -files starting with "." are not included; -to include these as well: -.IP -\fCzip stuff .* *\fP -.LP -Even this will not include any subdirectories from the current directory. -.LP -To zip up an entire directory, the command: -.IP -\fCzip -r foo foo\fP -.LP -creates the archive -.IR foo.zip , -containing all the files and directories in the directory -.I foo -that is contained within the current directory. -.LP -You may want to make a -.I zip -archive that contains the files in -.IR foo , -without recording the directory name, -.IR foo . -You can use the -.B \-j -option to leave off the paths, -as in: -.IP -\fCzip -j foo foo/*\fP -.LP -If you are short on disk space, -you might not have enough room to hold both the original directory -and the corresponding compressed -.I zip -archive. -In this case, you can create the archive in steps using the -.B \-m -option. -If -.I foo -contains the subdirectories -.IR tom , -.IR dick , -and -.IR harry , -you can: -.IP -\fCzip -rm foo foo/tom\fP -.br -\fCzip -rm foo foo/dick\fP -.br -\fCzip -rm foo foo/harry\fP -.LP -where the first command creates -.IR foo.zip , -and the next two add to it. -At the completion of each -.I zip -command, -the last created archive is deleted, -making room for the next -.I zip -command to function. - - - -.LP -Use \fB\-s\fP to set the split size and create a split archive. The size is given as -a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB). -The command -.IP -\fCzip -s 2g -r split.zip foo\fP -.LP -creates a split archive of the directory foo with splits no bigger than 2\ GB each. If -foo contained 5\ GB of contents and the contents were stored in the split archive without -compression (to make this example simple), this would create three splits, split.z01 at 2\ GB, -split.z02 at 2\ GB, and split.zip at a little over 1\ GB. -.LP -The \fB\-sp\fP option can be used to pause \fIzip\fP between splits to allow changing -removable media, for example, but read the descriptions and warnings for both \fB\-s\fP -and \fB\-sp\fP below. -.LP -Though \fIzip\fP does not update split archives, \fIzip\fP provides the new option \fB\-O\fP -(\fB\-\-output\-file\fP) to allow split archives to be updated and saved in a new archive. For example, -.IP -\fCzip inarchive.zip foo.c bar.c \-\-out outarchive.zip\fP -.LP -reads archive \fBinarchive.zip\fP, even if split, adds the files \fBfoo.c\fP and -\fBbar.c\fP, and writes the resulting archive to \fBoutarchive.zip\fP. If -\fBinarchive.zip\fP is split then \fBoutarchive.zip\fP defaults -to the same split size. Be aware that \fBoutarchive.zip\fP and any split files -that are created with it are always overwritten without warning. This may be changed -in the future. - - - - -.SH "PATTERN MATCHING" -This section applies only to Unix. -Watch this space for details on MSDOS and VMS operation. -However, the special wildcard characters \fB*\fR and \fB[]\fR below apply -to at least MSDOS also. -.LP -The Unix shells (\fIsh\fP, \fIcsh\fP, \fIbash\fP, and others) normally -do filename substitution (also called "globbing") on command arguments. -Generally the special characters are: -.TP -.B ? -match any single character -.TP -.B * -match any number of characters (including none) -.TP -.B [] -match any character in the range indicated within the brackets -(example: [a\-f], [0\-9]). This form of wildcard matching -allows a user to specify a list of characters between square brackets and -if any of the characters match the expression matches. For example: -.RS -.IP -\fCzip archive "*.[hc]"\fP -.RE -.IP -would archive all files in the current directory that end in -\fB.h\fP or \fB.c\fP. - -Ranges of characters are supported: -.RS -.IP -\fCzip archive "[a\-f]*"\fP -.RE -.IP -would add to the archive all files starting with "a" through "f". - -Negation is also supported, where any character in that position not in -the list matches. Negation is supported by adding \fB!\fP or \fB^\fP -to the beginning of the list: -.RS -.IP -\fCzip archive "*.[!o]"\fP -.RE -.IP -matches files that don't end in ".o". - -On WIN32, [] matching needs to be turned on with the -RE option to avoid -the confusion that names with [ or ] have caused. - -.LP -When these characters are encountered -(without being escaped with a backslash or quotes), -the shell will look for files relative to the current path -that match the pattern, -and replace the argument with a list of the names that matched. -.LP -The -.I zip -program can do the same matching on names that are in the -.I zip -archive being modified or, -in the case of the -.B \-x -(exclude) or -.B \-i -(include) options, on the list of files to be operated on, by using -backslashes or quotes to tell the shell not to do the name expansion. -In general, when -.I zip -encounters a name in the list of files to do, it first looks for the name in -the file system. If it finds it, it then adds it to the list of files to do. -If it does not find it, it looks for the name in the -.I zip -archive being modified (if it exists), using the pattern matching characters -described above, if present. For each match, it will add that name to the -list of files to be processed, unless this name matches one given -with the -.B \-x -option, or does not match any name given with the -.B \-i -option. -.LP -The pattern matching includes the path, -and so patterns like \\*.o match names that end in ".o", -no matter what the path prefix is. -Note that the backslash must precede every special character (i.e. ?*[]), -or the entire argument must be enclosed in double quotes (""). -.LP -In general, use backslashes or double quotes for paths -that have wildcards to make -.I zip -do the pattern matching for file paths, and always for -paths and strings that have spaces or wildcards for -\fB\-\i\fP, \fB\-x\fP, \fB\-R\fP, \fB\-d\fP, and \fB\-U\fP -and anywhere \fIzip\fP needs to process the wildcards. -.SH "ENVIRONMENT" -.LP -The following environment variables are read and used by -.I zip -as described. -.TP -.B ZIPOPT\ \ -contains default options that will be used when running -\fIzip\fR. The contents of this environment variable will get -added to the command line just after the \fBzip\fR command. -.TP -.B ZIP\ \ \ \ \ -[Not on RISC OS and VMS] see ZIPOPT -.TP -.B Zip$Options -[RISC OS] see ZIPOPT -.TP -.B Zip$Exts -[RISC OS] contains extensions separated by a : that will cause -native filenames with one of the specified extensions to -be added to the zip file with basename and extension swapped. -.TP -.B ZIP_OPTS -[VMS] see ZIPOPT -.SH "SEE ALSO" -compress(1), -shar(1L), -tar(1), -unzip(1L), -gzip(1L) -.SH DIAGNOSTICS -The exit status (or error level) approximates the exit codes defined by PKWARE -and takes on the following values, except under VMS: -.RS -.IP 0 -normal; no errors or warnings detected. -.IP 2 -unexpected end of zip file. -.IP 3 -a generic error in the zipfile format was detected. Processing may have -completed successfully anyway; some broken zipfiles created by other -archivers have simple work-arounds. -.IP 4 -\fIzip\fP was unable to allocate memory for one or more buffers during -program initialization. -.IP 5 -a severe error in the zipfile format was detected. Processing probably -failed immediately. -.IP 6 -entry too large to be processed (such as input files larger than 2 GB when -not using Zip64 or trying to read an existing archive that is too large) or -entry too large to be split with \fIzipsplit\fP -.IP 7 -invalid comment format -.IP 8 -\fIzip\fP -T failed or out of memory -.IP 9 -the user aborted \fIzip\fP prematurely with control-C (or similar) -.IP 10 -\fIzip\fP encountered an error while using a temp file -.IP 11 -read or seek error -.IP 12 -\fIzip\fP has nothing to do -.IP 13 -missing or empty zip file -.IP 14 -error writing to a file -.IP 15 -\fIzip\fP was unable to create a file to write to -.IP 16 -bad command line parameters -.IP 18 -\fIzip\fP could not open a specified file to read -.IP 19 -\fIzip\fP was compiled with options not supported on this system -.RE -.PP -VMS interprets standard Unix (or PC) return values as other, scarier-looking -things, so \fIzip\fP instead maps them into VMS-style status codes. In -general, \fIzip\fP sets VMS Facility = 1955 (0x07A3), Code = 2* Unix_status, -and an appropriate Severity (as specified in ziperr.h). More details are -included in the VMS-specific documentation. See [.vms]NOTES.TXT and -[.vms]vms_msg_gen.c. -.PD -.SH BUGS -.I zip -3.0 is not compatible with PKUNZIP 1.10. Use -.I zip -1.1 to produce -.I zip -files which can be extracted by PKUNZIP 1.10. -.PP -.I zip -files produced by -.I zip -3.0 must not be -.I updated -by -.I zip -1.1 or PKZIP 1.10, if they contain -encrypted members or if they have been produced in a pipe or on a non-seekable -device. The old versions of -.I zip -or PKZIP would create an archive with an incorrect format. -The old versions can list the contents of the zip file -but cannot extract it anyway (because of the new compression algorithm). -If you do not use encryption and use regular disk files, you do -not have to care about this problem. -.LP -Under VMS, -not all of the odd file formats are treated properly. -Only stream-LF format -.I zip -files are expected to work with -.IR zip . -Others can be converted using Rahul Dhesi's BILF program. -This version of -.I zip -handles some of the conversion internally. -When using Kermit to transfer zip files from VMS to MSDOS, type "set -file type block" on VMS. When transfering from MSDOS to VMS, type -"set file type fixed" on VMS. In both cases, type "set file type -binary" on MSDOS. -.LP -Under some older VMS versions, \fIzip\fP may hang for file -specifications that use DECnet syntax -.I foo::*.*. -.LP -On OS/2, zip cannot match some names, such as those including an -exclamation mark or a hash sign. This is a bug in OS/2 itself: the -32-bit DosFindFirst/Next don't find such names. Other programs such -as GNU tar are also affected by this bug. -.LP -Under OS/2, the amount of Extended Attributes displayed by DIR is (for -compatibility) the amount returned by the 16-bit version of -DosQueryPathInfo(). Otherwise OS/2 1.3 and 2.0 would report different -EA sizes when DIRing a file. -However, the structure layout returned by the 32-bit DosQueryPathInfo() -is a bit different, it uses extra padding bytes and link pointers (it's -a linked list) to have all fields on 4-byte boundaries for portability -to future RISC OS/2 versions. Therefore the value reported by -.I zip -(which uses this 32-bit-mode size) differs from that reported by DIR. -.I zip -stores the 32-bit format for portability, even the 16-bit -MS-C-compiled version running on OS/2 1.3, so even this one shows the -32-bit-mode size. -.SH AUTHORS -Copyright (C) 1997-2008 Info-ZIP. -.LP -Currently distributed under the Info-ZIP license. -.LP -Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly, -Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush and -Paul Kienitz. -.LP -Original copyright: -.LP -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, -that it is not sold for profit, and that this copyright notice -is retained. -.LP -LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES ARE -PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR -IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES -RESULTING FROM THE USE OF THIS SOFTWARE. -.LP -Please send bug reports and comments using the web page at: -.IR www.info-zip.org . -For bug reports, please include the version of -.IR zip -(see \fIzip\ \-h\fR), -the make options used to compile it (see \fIzip\ \-v\fR), -the machine and operating system in use, -and as much additional information as possible. -.SH ACKNOWLEDGEMENTS -Thanks to R. P. Byrne for his -.I Shrink.Pas -program, which inspired this project, -and from which the shrink algorithm was stolen; -to Phil Katz for placing in the public domain the -.I zip -file format, compression format, and .ZIP filename extension, and for -accepting minor changes to the file format; to Steve Burg for -clarifications on the deflate format; to Haruhiko Okumura and Leonid -Broukhis for providing some useful ideas for the compression -algorithm; to Keith Petersen, Rich Wales, Hunter Goatley and Mark -Adler for providing a mailing list and -.I ftp -site for the Info-ZIP group to use; and most importantly, to the -Info-ZIP group itself (listed in the file -.IR infozip.who ) -without whose tireless testing and bug-fixing efforts a portable -.I zip -would not have been possible. -Finally we should thank (blame) the first Info-ZIP moderator, -David Kirschbaum, -for getting us into this mess in the first place. -The manual page was rewritten for Unix by R. P. C. Rodgers and -updated by E. Gordon for \fIzip\fR 3.0. -.\" end of file diff --git a/third_party/infozip/zip/man/zipcloak.1 b/third_party/infozip/zip/man/zipcloak.1 deleted file mode 100644 index 8260b9867..000000000 --- a/third_party/infozip/zip/man/zipcloak.1 +++ /dev/null @@ -1,111 +0,0 @@ -.TH zipcloak 1 "v3.0 of 8 May 2008" -.SH NAME -zipcloak \- encrypt entries in a zipfile - -.SH SYNOPSIS -.I zipcloak -.RB [ \-d ] -.RB [ \-b\ path ] -.RB [ \-h ] -.RB [ \-v ] -.RB [ \-L ] -zipfile - -.SH ARGUMENTS -.in +13 -.ti -13 -zipfile Zipfile to encrypt entries in - -.SH OPTIONS -.TP -.PD 0 -.B \-b\ \fPpath -.TP -.PD -.B \-\-temp\-path \fPpath -Use the directory given by path for the temporary zip file. - -.TP -.PD 0 -.B \-d -.TP -.PD -.B \-\-decrypt -Decrypt encrypted entries (copy if given wrong password). - -.TP -.PD 0 -.B \-h -.TP -.PD -.B \-\-help\ -Show a short help. - -.TP -.PD 0 -.B \-L -.TP -.PD -.B \-\-license -Show software license. - -.TP -.PD 0 -.B \-O\ \fPpath -.TP -.PD -.B \-\-output\-file\ \fPzipfile -Write output to new archive zipfile, leaving original archive as is. - -.TP -.PD 0 -.B \-q -.TP -.PD -.B \-\-quiet -Quiet operation. Suppresses some informational messages. - -.TP -.PD 0 -.B \-v -.TP -.PD -.B \-\-version -Show version information. - -.SH DESCRIPTION -.I zipcloak -encrypts all unencrypted entries in the zipfile. This is the default action. - -.TP -The \-d option is used to decrypt encrypted entries in the zipfile. - -.TP -\fIzipcloak \fBuses original zip encryption which is considered weak. - -.TP -Note: -The encryption code of this program is not copyrighted and is put in -the public domain. It was originally written in Europe and can be freely -distributed from any country including the U.S.A. (Previously if this -program was imported into the U.S.A, it could not be re-exported from -the U.S.A to another country.) See the file README.CR included in the -source distribution for more on this. Otherwise, the Info-ZIP license -applies. - -.SH EXAMPLES -To be added. - -.SH BUGS -Large files (> 2 GB) and large archives not yet supported. - -Split archives not yet supported. A work around is to convert the -split archive to a single-file archive using \fIzip\fP and then -use \fIzipcloak\fP on the single-file archive. If needed, the -resulting archive can then be split again using \fIzip\fP. - - -.SH SEE ALSO -zip(1), unzip(1) -.SH AUTHOR -Info-ZIP diff --git a/third_party/infozip/zip/man/zipnote.1 b/third_party/infozip/zip/man/zipnote.1 deleted file mode 100644 index fb4d18bdf..000000000 --- a/third_party/infozip/zip/man/zipnote.1 +++ /dev/null @@ -1,85 +0,0 @@ -.TH zipnote 1 "v3.0 of 8 May 2008" -.SH NAME -zipnote \- write the comments in zipfile to stdout, edit comments and rename files in zipfile - -.SH SYNOPSIS -.I zipnote -.RB [ \-w ] -.RB [ \-b\ path ] -.RB [ \-h ] -.RB [ \-v ] -.RB [ \-L ] -zipfile - -.SH ARGUMENTS -.in +13 -.ti -13 -zipfile Zipfile to read comments from or edit. - -.SH OPTIONS -.TP -.BI \-w -Write comments to a zipfile from stdin (see below). -.TP -.BI \-b\ \fRpath -Use path for the temporary zip file. -.TP -.BI \-h -Show a short help. -.TP -.BI \-v -Show version information. -.TP -.BI \-L -Show software license. - -.SH DESCRIPTION -.I zipnote -writes the comments in a zipfile to stdout. This is the default mode. A second mode -allows updating the comments in a zipfile as well as allows changing the names -of the files in the zipfile. These modes are described below. - -.SH EXAMPLES -To write all comments in a zipfile to stdout use for example -.LP -.nf - zipnote foo.zip > foo.tmp -.fi -.LP -This writes all comments in the zipfile -.I foo.zip -to the file -.I foo.tmp -in a specific format. - -.LP -If desired, this file can then be edited to change the comments and then used -to update the zipfile. -.LP -.nf - zipnote -w foo.zip < foo.tmp -.fi -.LP -The names of the files in the zipfile can also be changed in this way. This is done by -following lines like -.nf - "@ name" -.fi -in the created temporary file (called -.I foo.tmp -here) with lines like -.nf - "@=newname" -.fi -and then using the -w option as above. - -.SH BUGS -The temporary file format is rather specific and zipnote is rather picky about it. -It should be easier to change file names in a script. - -Does not yet support large (> 2 GB) or split archives. - -.SH SEE ALSO -zip(1), unzip(1) -.SH AUTHOR -Info-ZIP diff --git a/third_party/infozip/zip/man/zipsplit.1 b/third_party/infozip/zip/man/zipsplit.1 deleted file mode 100644 index 4a4de642c..000000000 --- a/third_party/infozip/zip/man/zipsplit.1 +++ /dev/null @@ -1,69 +0,0 @@ -.TH zipnote 1 "v3.0 of 8 May 2008" -.SH NAME -zipsplit \- split a zipfile into smaller zipfiles - -.SH SYNOPSIS -.I zipsplit -.RB [ \-t ] -.RB [ \-i ] -.RB [ \-p ] -.RB [ \-s ] -.RB [ \-n\ size ] -.RB [ \-r\ room ] -.RB [ \-b\ path ] -.RB [ \-h ] -.RB [ \-v ] -.RB [ \-L ] -zipfile - -.SH ARGUMENTS -.in +13 -.ti -13 -zipfile Zipfile to split. - -.SH OPTIONS -.TP -.BI \-t -Report how many files it will take, but don't make them. -.TP -.BI \-i -Make index (zipsplit.idx) and count its size against first zip file. -.TP -.BI \-n\ \fRsize -Make zip files no larger than "size" (default = 36000). -.TP -.BI \-r\ \fRroom -Leave room for "room" bytes on the first disk (default = 0). -.TP -.BI \-b\ \fRpath -Use path for the output zip files. -.TP -.BI \-p -Pause between output zip files. -.TP -.BI \-s -Do a sequential split even if it takes more zip files. -.TP -.BI \-h -Show a short help. -.TP -.BI \-v -Show version information. -.TP -.BI \-L -Show software license. - -.SH DESCRIPTION -.I zipsplit -reads a zipfile and splits it into smaller zipfiles. - -.SH EXAMPLES -To be filled in. - -.SH BUGS -Does not yet support large (> 2 GB) or split archives. - -.SH SEE ALSO -zip(1), unzip(1) -.SH AUTHOR -Info-ZIP diff --git a/third_party/infozip/zip/msdos/README.DOS b/third_party/infozip/zip/msdos/README.DOS deleted file mode 100644 index 0b9a57b57..000000000 --- a/third_party/infozip/zip/msdos/README.DOS +++ /dev/null @@ -1,132 +0,0 @@ -README.DOS - -Some notes about the supplied MSDOS executables and their compilers: - -A) The 32-bit DOS executables "zip.exe" and the auxilary utilities - "zipnote.exe", "zipsplit.exe", "zipcloak.exe" (crypt-enabled distribution - only) were compiled with DJGPP v 2.03, using gcc 2.95.3 as compiler. - They require a DPMI server to run, e.g.: a DOS command prompt window - under WINDOWS 3.x or Windows 9x. To use this program under plain DOS, - you should install the free (GPL'ed) DPMI server CWSDPMI.EXE. Look - for "csdpmi5b.zip" under "simtelnet/gnu/djgpp/v2misc/" on the SimTelNet - home site "ftp.cdrom.com" or any mirror site of the SimtelNet archive. - - We have decided to provide 32-bit rather than 16-bit executables of - the auxilary tools for the following reasons: - - Nowadays, it has become quite unlikely to find PC computers "in action" - that do not at least have an i386 CPU. - - the 32-bit versions do not impose additional archive handling limits - beyond those defined by the Zip archive format - - the 32-bit DJGPP executables can handle long filenames on systems running - Windows 95/98/Me and Windows 2K/XP. - -B) There are two 16-bit MSDOS executables provided in zcr2?x.zip: - zip16.exe regular Zip program, requires ca. 455 KBytes of contiguous - free DOS memory or more. - zip16-sm.exe a variant that was compiled with the SMALL_MEM option - for minimal memory consumption; requires at minimum - 322 KBytes of contiguous free DOS memory. - - The SMALL_MEM variant requires much less space for the compression - buffers, but at the cost of some compression efficiency. - Therefore, we recommend to use the "SMALL_MEM" 16-bit "zip16-sm.exe" only - in case of "out of memory" problems (DOS memory is low and/or very large - number of archive entries), when the 32-bit program cannot be used for - some reason (286 or older; no DPMI server; ...). - -C) Hard limits of the Zip archive format: - Number of entries in Zip archive: 64 k (2^16 - 1 entries) - Compressed size of archive entry: 4 GByte (2^32 - 1 Bytes) - Uncompressed size of entry: 4 GByte (2^32 - 1 Bytes) - Size of single-volume Zip archive: 4 GByte (2^32 - 1 Bytes) - Per-volume size of multi-volume archives: 4 GByte (2^32 - 1 Bytes) - Number of parts for multi-volume archives: 64 k (1^16 - 1 parts) - Total size of multi-volume archive: 256 TByte (4G * 64k) - - The number of archive entries and of multivolume parts are limited by - the structure of the "end-of-central-directory" record, where the these - numbers are stored in 2-Byte fields. - Some Zip and/or UnZip implementations (for example Info-ZIP's) allow - handling of archives with more than 64k entries. (The information - from "number of entries" field in the "end-of-central-directory" record - is not really neccessary to retrieve the contents of a Zip archive; - it should rather be used for consistency checks.) - - Length of an archive entry name: 64 kByte (2^16 - 1) - Length of archive member comment: 64 kByte (2^16 - 1) - Total length of "extra field": 64 kByte (2^16 - 1) - Length of a single e.f. block: 64 kByte (2^16 - 1) - Length of archive comment: 64 KByte (2^16 - 1) - - Additional limitation claimed by PKWARE: - Size of local-header structure (fixed fields of 30 Bytes + filename - local extra field): < 64 kByte - Size of central-directory structure (46 Bytes + filename + - central extra field + member comment): < 64 kByte - -D) Implementation limits of the Zip executables: - - 1. Size limits caused by file I/O and compression handling: - Size of Zip archive: 2 GByte (2^31 - 1 Bytes) - Compressed size of archive entry: 2 GByte (2^31 - 1 Bytes) - Uncompressed size of entry: 2 GByte (2^31 - 1 Bytes), - (could/should be 4 GBytes...) - Multi-volume archive creation is not supported. - - 2. Limits caused by handling of archive contents lists - - 2.1. Number of archive entries (freshen, update, delete) - a) 16-bit executable: 64k (2^16 -1) or 32k (2^15 - 1), - (unsigned vs. signed type of size_t) - a1) 16-bit executable: <16k ((2^16)/4) - (The smaller limit a1) results from the array size limit of - the "qsort()" function.) - 32-bit executables <1G ((2^32)/4) - (usual system limit of the "qsort()" function on 32-bit systems) - - b) stack space needed by qsort to sort list of archive entries - - NOTE: In the current executables, overflows of limits a) and b) are NOT - checked! - - c) amount of free memory to hold "central directory information" of - all archive entries; one entry needs: - 96 bytes (32-bit) resp. 80 bytes (16-bit) - + 3 * length of entry name - + length of zip entry comment (when present) - + length of extra field(s) (when present, e.g.: UT needs 9 bytes) - + some bytes for book-keeping of memory allocation - - Conclusion: - For systems with limited memory space (MSDOS, small AMIGAs, other - environments without virtual memory), the number of archive entries - is most often limited by condition c). - For example, with approx. 100 kBytes of free memory after loading and - initializing the program, a 16-bit DOS Zip cannot process more than 600 - to 1000 (+) archive entries. (For the 16-bit Windows DLL or the 16-bit - OS/2 port, limit c) is less important because Windows or OS/2 executables - are not restricted to the 1024k area of real mode memory. These 16-bit - ports are limited by conditions a1) and b), say: at maximum approx. - 16000 entries!) - - - 2.2. Number of "new" entries (add operation) - In addition to the restrictions above (2.1.), the following limits - caused by the handling of the "new files" list apply: - - a) 16-bit executable: <16k ((2^64)/4) - - b) stack size required for "qsort" operation on "new entries" list. - - NOTE: In the current executables, the overflow checks for these limits - are missing! - - c) amount of free memory to hold the directory info list for new entries; - one entry needs: - 24 bytes (32-bit) resp. 22 bytes (16-bit) - + 3 * length of filename - - -Please report any problems to: Zip-Bugs@lists.wku.edu - -Last updated: 07 July 2001 diff --git a/third_party/infozip/zip/msdos/crc_i86.asm b/third_party/infozip/zip/msdos/crc_i86.asm deleted file mode 100644 index 3ad03490a..000000000 --- a/third_party/infozip/zip/msdos/crc_i86.asm +++ /dev/null @@ -1,497 +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 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 -;=========================================================================== -; Created by Christian Spieler, last modified 07 Jan 2007. -; - TITLE crc_i86.asm - NAME crc_i86 -; -; Optimized 8086 assembler version of the CRC32 calculation loop, intended -; for real mode Info-ZIP programs (Zip 2.1, UnZip 5.2, and later versions). -; Supported compilers are Microsoft C (DOS real mode) and Borland C(++) -; (Turbo C). Watcom C (16bit) should also work. -; This module was inspired by a similar module for the Amiga (Paul Kienitz). -; -; It replaces the `ulg crc32(ulg crc, ZCONST uch *buf, extent len)' function -; in crc32.c. -; -; In March/April 1997, the code has been revised to incorporate Rodney Brown's -; ideas for optimized access to the data buffer. For 8086 real mode code, -; the data buffer is now accessed by aligned word-wide read operations. -; This new optimization may be turned off by defining the macro switch -; NO_16_BIT_LOADS. -; -; In December 1998, the loop branch commands were changed from "loop dest" -; into "dec cx; jnz dest". On modern systems (486 and newer), the latter -; code is usually much faster (e.g. 1 clock cycle compared to 5 for "loop" -; on Pentium MMX). For the 286, the penalty of "dec cx; jnz" is one clock -; cycle (12 vs. 11 cycles); on an 8088 the cycle counts are 22 (dec cx; jnz) -; vs. 18 (loop). I decided to optimize for newer CPU models by default, because -; I expect that old 80286 or 8088 dinosaurier machines may be rarely used -; nowadays. In case you want optimum performance for these old CPU models -; you should define the OPTIMIZE_286_88 macro switch on the assembler's -; command line. -; Likewise, "jcxz" was replaced by "jz", because the latter is faster on -; 486 and newer CPUs (without any penalty on 80286 and older CPU models). -; -; In January 2007, the "hand-made" memory model setup section has been guarded -; against redefinition of @CodeSize and @DataSize symbols, to work around a -; problem with current Open Watcom (version 1.6) wasm assembler. -; -; The code in this module should work with all kinds of C memory models -; (except Borland's __HUGE__ model), as long as the following -; restrictions are not violated: -; -; - The implementation assumes that the char buffer is confined to a -; 64k segment. The pointer `s' to the buffer must be in a format that -; all bytes can be accessed by manipulating the offset part, only. -; This means: -; + no huge pointers -; + char buffer size < 64 kByte -; -; - Since the buffer size argument `n' is of type `size_t' (= unsigned short) -; for this routine, the char buffer size is limited to less than 64 kByte, -; anyway. So, the assumption above should be easily fulfilled. -; -;============================================================================== -; -; Do NOT assemble this source if external crc32 routine from zlib gets used, -; or only the precomputed CRC_32_Table is needed. -; -ifndef USE_ZLIB -ifndef CRC_TABLE_ONLY -; -; Setup of amount of assemble time informational messages: -; -ifdef DEBUG - VERBOSE_INFO EQU 1 -else - ifdef _AS_MSG_ - VERBOSE_INFO EQU 1 - else - VERBOSE_INFO EQU 0 - endif -endif -; -; Selection of memory model, and initialization of memory model -; related macros: -; -ifndef __SMALL__ - ifndef __COMPACT__ - ifndef __MEDIUM__ - ifndef __LARGE__ - ifndef __HUGE__ -; __SMALL__ EQU 1 - endif - endif - endif - endif -endif - -ifdef __HUGE__ -; .MODEL Huge - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - Save_DS EQU 1 - if VERBOSE_INFO - if1 - %out Assembling for C, Huge memory model - endif - endif -else - ifdef __LARGE__ -; .MODEL Large - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Large memory model - endif - endif - else - ifdef __COMPACT__ -; .MODEL Compact - ifndef @CodeSize - @CodeSize EQU 0 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Compact memory model - endif - endif - else - ifdef __MEDIUM__ -; .MODEL Medium - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 0 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Medium memory model - endif - endif - else -; .MODEL Small - ifndef @CodeSize - @CodeSize EQU 0 - endif - ifndef @DataSize - @DataSize EQU 0 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Small memory model - endif - endif - endif - endif - endif -endif - -if @CodeSize - LCOD_OFS EQU 2 -else - LCOD_OFS EQU 0 -endif - -IF @DataSize - LDAT_OFS EQU 2 -else - LDAT_OFS EQU 0 -endif - -ifdef Save_DS -; (di,si,ds)+(size, return address) - SAVE_REGS EQU 6+(4+LCOD_OFS) -else -; (di,si)+(size, return address) - SAVE_REGS EQU 4+(4+LCOD_OFS) -endif - -; -; Selection of the supported CPU instruction set and initialization -; of CPU type related macros: -; -ifdef __686 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on Pentium II/III/IV - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __586 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on Pentium - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __486 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on 32 bit processors - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __386 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on 32 bit processors - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __286 - Use_286_code EQU 1 - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -else -ifdef __186 - Use_186_code EQU 1 - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -else - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -endif ;?__186 -endif ;?__286 -endif ;?__386 -endif ;?__486 -endif ;?__586 -endif ;?__686 - -ifdef Use_286_code - .286 - Have_80x86 EQU 1 -else -ifdef Use_186_code - .186 - Have_80x86 EQU 1 -else - .8086 - Have_80x86 EQU 0 -endif ;?Use_186_code -endif ;?Use_286_code - -; -; Declare the segments used in this module: -; -if @CodeSize -if Alig_PARA -CRC32_TEXT SEGMENT PARA PUBLIC 'CODE' -else -CRC32_TEXT SEGMENT WORD PUBLIC 'CODE' -endif -CRC32_TEXT ENDS -else ;!@CodeSize -if Alig_PARA -_TEXT SEGMENT PARA PUBLIC 'CODE' -else -_TEXT SEGMENT WORD PUBLIC 'CODE' -endif -_TEXT ENDS -endif ;?@CodeSize -_DATA SEGMENT WORD PUBLIC 'DATA' -_DATA ENDS -_BSS SEGMENT WORD PUBLIC 'BSS' -_BSS ENDS -DGROUP GROUP _BSS, _DATA -if @DataSize - ASSUME DS: nothing, SS: DGROUP -else - ASSUME DS: DGROUP, SS: DGROUP -endif - -if @CodeSize -EXTRN _get_crc_table:FAR -else -EXTRN _get_crc_table:NEAR -endif - - -Do_CRC MACRO - mov bl,al - sub bh,bh -if Have_80x86 - shl bx,2 -else - shl bx,1 - shl bx,1 -endif - mov al,ah - mov ah,dl - mov dl,dh - sub dh,dh - xor ax,WORD PTR [bx][si] - xor dx,WORD PTR [bx+2][si] - ENDM -; -Do_1 MACRO -if @DataSize - xor al,BYTE PTR es:[di] -else - xor al,BYTE PTR [di] -endif - inc di - Do_CRC - ENDM -; -Do_2 MACRO -ifndef NO_16_BIT_LOADS -if @DataSize - xor ax,WORD PTR es:[di] -else - xor ax,WORD PTR [di] -endif - add di,2 - Do_CRC - Do_CRC -else - Do_1 - Do_1 -endif - ENDM -; -Do_4 MACRO - Do_2 - Do_2 - ENDM -; - -IF @CodeSize -CRC32_TEXT SEGMENT - ASSUME CS: CRC32_TEXT -else -_TEXT SEGMENT - ASSUME CS: _TEXT -endif -; Line 37 - -; -;ulg crc32(ulg crc, -; ZCONST uch *buf, -; extent len) -; - PUBLIC _crc32 -if @CodeSize -_crc32 PROC FAR -else -_crc32 PROC NEAR -endif -if Have_80x86 - enter WORD PTR 0,0 -else - push bp - mov bp,sp -endif - push di - push si -if @DataSize -; crc = 4+LCOD_OFS DWORD (unsigned long) -; buf = 8+LCOD_OFS DWORD PTR BYTE (uch *) -; len = 12+LCOD_OFS WORD (unsigned int) -else -; crc = 4+LCOD_OFS DWORD (unsigned long) -; buf = 8+LCOD_OFS WORD PTR BYTE (uch *) -; len = 10+LCOD_OFS WORD (unsigned int) -endif -; -if @DataSize - mov ax,WORD PTR [bp+8+LCOD_OFS] ; buf - or ax,WORD PTR [bp+10+LCOD_OFS] ; == NULL ? -else - cmp WORD PTR [bp+8+LCOD_OFS],0 ; buf == NULL ? -endif - jne crc_update - sub ax,ax ; crc = 0 - cwd -ifndef NO_UNROLLED_LOOPS - jmp fine -else - jmp SHORT fine -endif -; -crc_update: - call _get_crc_table -; When used with compilers that conform to the Microsoft/Borland standard -; C calling convention, model-dependent handling is not needed, because -; _get_crc_table returns NEAR pointer. -; But Watcom C is different and does not allow one to assume DS pointing to -; DGROUP. So, we load DS with DGROUP, to be safe. -;if @DataSize -; push ds -; mov ds,dx -; ASSUME DS: nothing -;endif - mov si,ax ;crc_table -if @DataSize - push ds - mov ax,SEG DGROUP - mov ds,ax - ASSUME DS: DGROUP -endif -; - mov ax,WORD PTR [bp+4+LCOD_OFS] ;crc - mov dx,WORD PTR [bp+6+LCOD_OFS] - not ax - not dx -if @DataSize - les di,DWORD PTR [bp+8+LCOD_OFS] ;buf - mov cx,WORD PTR [bp+12+LCOD_OFS] ;len -else - mov di,WORD PTR [bp+8+LCOD_OFS] ;buf - mov cx,WORD PTR [bp+10+LCOD_OFS] ;len -endif -; -ifndef NO_UNROLLED_LOOPS -ifndef NO_16_BIT_LOADS - test cx,cx - jnz start - jmp done -start: test di,1 - jz is_wordaligned - dec cx - Do_1 - mov WORD PTR [bp+10+LDAT_OFS+LCOD_OFS],cx -is_wordaligned: -endif ; !NO_16_BIT_LOADS -if Have_80x86 - shr cx,2 -else - shr cx,1 - shr cx,1 -endif - jz No_Fours -; - align Align_Size ; align destination of branch -Next_Four: - Do_4 -ifndef OPTIMIZE_286_88 - dec cx ; on 286, "loop Next_Four" needs 11 - jnz Next_Four ; clocks, one less than this code -else - loop Next_Four -endif -; -No_Fours: -if @DataSize - mov cx,WORD PTR [bp+12+LCOD_OFS] ;len -else - mov cx,WORD PTR [bp+10+LCOD_OFS] ;len -endif - and cx,00003H -endif ; !NO_UNROLLED_LOOPS - jz done -; - align Align_Size ; align destination of branch -Next_Byte: - Do_1 -ifndef OPTIMIZE_286_88 - dec cx ; on 286, "loop Next_Four" needs 11 - jnz Next_Byte ; clocks, one less than this code -else - loop Next_Four -endif -; -done: -if @DataSize - pop ds -; ASSUME DS: DGROUP - ASSUME DS: nothing -endif - not ax - not dx -; -fine: - pop si - pop di -if Have_80x86 - leave -else - mov sp,bp - pop bp -endif - ret - -_crc32 ENDP - -if @CodeSize -CRC32_TEXT ENDS -else -_TEXT ENDS -endif -; -endif ;!CRC_TABLE_ONLY -endif ;!USE_ZLIB -; -END diff --git a/third_party/infozip/zip/msdos/makebz2.dj2 b/third_party/infozip/zip/msdos/makebz2.dj2 deleted file mode 100644 index 161f1e3b4..000000000 --- a/third_party/infozip/zip/msdos/makebz2.dj2 +++ /dev/null @@ -1,148 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# djgpp 2.x -# -# This simple modified version of makefile.dj2 adds bzip2 support -# to Zip for djgpp 2.x and was donated by Robert Riebisch. -# -# Given standard djgpp 2.x and bzip2 installations, this should create a -# version of Zip 3.0 with bzip2 support. Additional information is in -# bzip2/install.txt. -# -# 27 June 2008 - -VPATH=.;msdos -# ------------- djgpp ------------- -CPPFLAGS=-I. -DDOS -DASM_CRC -DBZIP2_SUPPORT $(LOCAL_ZIP) -ASFLAGS=$(CPPFLAGS) -CFLAGS=-Wall -O2 $(CPPFLAGS) -UTILFLAGS=-c -DUTIL $(CFLAGS) -o -CC=gcc -LD=gcc -LDFLAGS=-s - -# ------------- file packer -------- -# Laszlo Molnar who wrote DJ Packer and Markus F. X. J. Oberhumer who wrote -# the compression library used by the DJ Packer have collaborated on the -# Ultimate Packer for eXecutables, which has recently been released. Look -# for upx???d.zip at http://upx.sourceforge.net -# As an alternative, look for "djp.exe", now two years old, in the archive -# mlp107[b,s].zip, found in the same location as csdpmi?[b,s].zip (see below). -# If you have got an executable packer in your PATH, you may reduce the -# size of the disk image of the zip*.exe's by uncommenting the lines -# containing $(DJP) below where the exe's are built. -#DJP=djp -q -DJP=upx -qq --best - -# variables - -#set CRC32 to crc_gcc.o or nothing, depending on whether ASM_CRC is defined: -CRCA_O = crc_gcc.o - -OBJZ = zip.o crypt.o ttyio.o zipfile.o zipup.o fileio.o util.o \ - crc32.o $(CRCA_O) globals.o -OBJI = deflate.o trees.o match.o msdos.o -OBJU = zipfile_.o fileio_.o util_.o globals.o msdos_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o crc32_.o crypt_.o ttyio.o $(OBJU) -OBJS = zipsplit.o $(OBJU) -LIBS = -lbz2 - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -# rules - -.SUFFIXES: # Delete make's default suffix list -.SUFFIXES: .exe .out .a .ln .o .c .cc .C .p .f .F .y .l .s .S .h - -.c.o: - $(CC) -c $(CFLAGS) $< -o $@ - -zips: zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zip.o: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipfile.o: zipfile.c $(ZIP_H) crc32.h - -zipup.o: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - -fileio.o: fileio.c $(ZIP_H) crc32.h - -util.o: util.c $(ZIP_H) - -globals.o: globals.c $(ZIP_H) - -deflate.o: deflate.c $(ZIP_H) - -trees.o: trees.c $(ZIP_H) - -crc_gcc.o: crc_i386.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S - -crc32.o: crc32.c $(ZIP_H) crc32.h - -crypt.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - -ttyio.o: ttyio.c $(ZIP_H) crypt.h ttyio.h - -msdos.o: msdos/msdos.c $(ZIP_H) - -zipcloak.o: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipnote.o: zipnote.c $(ZIP_H) revision.h - -zipsplit.o: zipsplit.c $(ZIP_H) revision.h - -zipfile_.o: zipfile.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ zipfile.c - -fileio_.o: fileio.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ fileio.c - -util_.o: util.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ util.c - -crc32_.o: crc32.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ crc32.c - -crypt_.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) $(UTILFLAGS) $@ crypt.c - -msdos_.o: msdos/msdos.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ msdos/msdos.c - - -match.o: match.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S - -zip.exe: $(OBJZ) $(OBJI) - echo $(OBJZ) > zip.rsp - echo $(OBJI) >> zip.rsp - echo $(LIBS) >> zip.rsp - $(LD) $(LDFLAGS) -o $@ @zip.rsp - del zip.rsp -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipcloak.exe: $(OBJC) - $(LD) $(LDFLAGS) $(OBJC) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipnote.exe: $(OBJN) - $(LD) $(LDFLAGS) $(OBJN) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipsplit.exe: $(OBJS) - $(LD) $(LDFLAGS) $(OBJS) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -# These stand alone executables require dpmi services to run. When -# running in a DOS window under windows 3.1 or later, the dpmi server -# is automatically present. Under DOS, if a dpmi server is not installed, -# by default the program will look for "cwsdpmi.exe." If found, it will -# be loaded for the duration of the program. -# cwsdpmi is a "free" dpmi server written by Charles W. Sandmann -# (sandman@clio.rice.edu). It may be found, among other sites, on SimTel -# and its mirrors in the .../vendors/djgpp/v2misc directory. diff --git a/third_party/infozip/zip/msdos/makefile.bor b/third_party/infozip/zip/msdos/makefile.bor deleted file mode 100644 index 88ecde4af..000000000 --- a/third_party/infozip/zip/msdos/makefile.bor +++ /dev/null @@ -1,197 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# Borland (Turbo) C++ 1.0 or 2.0. -# Warning: this file is not suitable for Turbo C 2.0. Use makefile.tc instead. - -# To use, do "make -fmakefile.bor" - -# WARNING: the small model is not supported. -# Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce -# the memory requirements. -# Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if -# you do not have tasm. - -# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) -# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added -# to the declaration of LOC here: -LOC = -DDOS -DNO_SECURE_TESTS $(LOCAL_ZIP) - -# Zip requires compact or large memory model. -# with 2.1, compact model exceeds 64k code segment; use large model -ZIPMODEL=l # large model for Zip and ZipUtils - -# name of Flag to select memory model for assembler compiles, supported -# values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ : -ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !! - -# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. -CPU_TYP = 0 - -# Uncomment the following macro to use the optimized assembler -# routines in Zip: -CRCA_O = crc_i86.obj -ASMOBJS = match.obj $(CRCA_O) - -ASCPUFLAG = __$(CPU_TYP)86 -!if $(CPU_TYP) != 0 -CC_CPUFLG = -$(CPU_TYP) -!endif - -VPATH=.;msdos -# ------------- Turbo C++, Borland C++ ------------- -!if $(CC_REV) == 1 -CC = tcc -!else -! if !$(CC_REV) -CC_REV = 3 -! endif -CC = bcc -!endif - -MODEL=-m$(ZIPMODEL) -!if $(CC_REV) == 1 -CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(CC_CPUFLG) $(MODEL) $(LOC) -!else -CFLAGS=-w -w-cln -O2 -Z $(CC_CPUFLG) $(MODEL) $(LOC) -!endif -UTILFLAGS=-DUTIL $(CFLAGS) -o -# for Turbo C++ 1.0, replace bcc with tcc and use the upper version of CFLAGS - -AS=tasm -ASFLAGS=-ml -t -m2 -DDYN_ALLOC -DSS_NEQ_DS -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC) - -LD=$(CC) -LDFLAGS=$(MODEL) - -# ------------- Common declarations: -STRIP=@rem -# If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define: -# (NOTE: upx needs a 386 or higher system to run the exe compressor) -#STRIP=upx --8086 --best -# or -#STRIP=lzexe -# or (if you've registered PKLITE) -#STRIP=pklite -# This makes a big difference in .exe size (and possibly load time) - -# ------------- Used by install rule -# set BIN to the directory you want to install the executables to -BIN = c:\util - -# variables -OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ - crc32.obj globals.obj - -OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj - -OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj msdos_.obj -OBJN = zipnote.obj $(OBJU) -OBJC = zipcloak.obj crc32_.obj crypt_.obj ttyio.obj $(OBJU) -OBJS = zipsplit.obj $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zips: $(ZIPS) - -zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -zipfile.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - $(CC) -c $(CFLAGS) $*.c - -fileio.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -util.obj: util.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -globals.obj: globals.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -deflate.obj: deflate.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -trees.obj: trees.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -crc32.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -msdos.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(CFLAGS) msdos/$*.c - -zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -zipnote.obj: zipnote.c $(ZIP_H) revision.h - $(CC) -c $(CFLAGS) $*.c - -zipsplit.obj: zipsplit.c $(ZIP_H) revision.h - $(CC) -c $(CFLAGS) $*.c - -zipfile_.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$* zipfile.c - -fileio_.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$* fileio.c - -util_.obj: util.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$* util.c - -crc32_.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS) crc32.c - -crypt_.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(UTILFLAGS)$* crypt.c - -msdos_.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$* msdos/msdos.c - -crc_i86.obj: msdos/crc_i86.asm - $(AS) $(ASFLAGS) msdos\crc_i86.asm ; - -match.obj: msdos/match.asm - $(AS) $(ASFLAGS) msdos\match.asm ; - -# we must cut the command line to fit in the MS/DOS 128 byte limit: -zip.exe: $(OBJZ) $(OBJI) - echo $(OBJZ) > zip.rsp - echo $(OBJI) >> zip.rsp - $(LD) $(LDFLAGS) @zip.rsp - del zip.rsp - $(STRIP) zip.exe - -zipcloak.exe: $(OBJC) - echo $(OBJC) > zipc.rsp - $(LD) $(LDFLAGS) @zipc.rsp - del zipc.rsp - $(STRIP) zipcloak.exe - -zipnote.exe: $(OBJN) - echo $(OBJN) > zipn.rsp - $(LD) $(LDFLAGS) @zipn.rsp - del zipn.rsp - $(STRIP) zipnote.exe - -zipsplit.exe: $(OBJS) - echo $(OBJS) > zips.rsp - $(LD) $(LDFLAGS) @zips.rsp - del zips.rsp - $(STRIP) zipsplit.exe - -install: $(ZIPS) - copy /b *.exe $(BIN) - -clean: - del *.obj - del *.exe diff --git a/third_party/infozip/zip/msdos/makefile.dj1 b/third_party/infozip/zip/msdos/makefile.dj1 deleted file mode 100644 index 05137cc96..000000000 --- a/third_party/infozip/zip/msdos/makefile.dj1 +++ /dev/null @@ -1,126 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# djgpp 1.x -VPATH=.;msdos -# ------------- djgpp ------------- -CPPFLAGS=-I. -DDOS -DASM_CRC $(LOCAL_ZIP) -ASFLAGS=$(CPPFLAGS) -CFLAGS=-Wall -O2 -m486 $(CPPFLAGS) -UTILFLAGS=-c -DUTIL $(CFLAGS) -o -CC=gcc -LD=gcc -LDFLAGS=-s - -STRIP=strip - -# Change the STUBIFY definition to the upper version if you want to create -# executables which can be used without any external extender file. -# >>> NOTE: Either copy the go32 extender into your build directory, or -# >>> edit the STUBIFY macro and add the correct path to "go32.exe". -#STUBIFY=coff2exe -s go32.exe -STUBIFY=coff2exe - -# variables - -#set CRCA_O to crc_gcc.o or nothing, depending on whether ASM_CRC is defined: -CRCA_O = crc_gcc.o - -OBJZ = zip.o crypt.o ttyio.o zipfile.o zipup.o fileio.o util.o \ - crc32.o $(CRCA_O) globals.o -OBJI = deflate.o trees.o match.o msdos.o -OBJU = zipfile_.o fileio_.o util_.o globals.o msdos_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o crc32_.o crypt_.o ttyio.o $(OBJU) -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -# rules - -.SUFFIXES: # Delete make's default suffix list -.SUFFIXES: .exe .out .a .ln .o .c .cc .C .p .f .F .y .l .s .S .h - -.c.o: - $(CC) -c $(CFLAGS) $< -o $@ - -zips: zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zip.o: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipfile.o: zipfile.c $(ZIP_H) crc32.h - -zipup.o: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - -fileio.o: fileio.c $(ZIP_H) - -util.o: util.c $(ZIP_H) - -globals.o: globals.c $(ZIP_H) - -deflate.o: deflate.c $(ZIP_H) - -trees.o: trees.c $(ZIP_H) - -crc_gcc.o: crc_i386.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S - -crc32.o: crc32.c $(ZIP_H) crc32.h - -crypt.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - -ttyio.o: ttyio.c $(ZIP_H) crypt.h ttyio.h - -msdos.o: msdos/msdos.c $(ZIP_H) - -zipcloak.o: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipnote.o: zipnote.c $(ZIP_H) revision.h - -zipsplit.o: zipsplit.c $(ZIP_H) revision.h - -zipfile_.o: zipfile.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ zipfile.c - -fileio_.o: fileio.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ fileio.c - -util_.o: util.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ util.c - -crc32_.o: crc32.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ crc32.c - -crypt_.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) $(UTILFLAGS) $@ crypt.c - -msdos_.o: msdos/msdos.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ msdos/msdos.c - -match.o: match.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S - -zip.exe: $(OBJZ) $(OBJI) - echo $(OBJZ) > zip.rsp - echo $(OBJI) >> zip.rsp - $(LD) $(LDFLAGS) -o zip @zip.rsp - del zip.rsp - $(STRIP) zip - $(STUBIFY) zip - del zip - -zipcloak.exe: $(OBJC) - $(LD) $(LDFLAGS) $(OBJC) -o zipcloak - $(STRIP) zipcloak - $(STUBIFY) zipcloak - del zipcloak - -zipnote.exe: $(OBJN) - $(LD) $(LDFLAGS) $(OBJN) -o zipnote - $(STRIP) zipnote - $(STUBIFY) zipnote - del zipnote - -zipsplit.exe: $(OBJS) - $(LD) $(LDFLAGS) $(OBJS) -o zipsplit - $(STRIP) zipsplit - $(STUBIFY) zipsplit - del zipsplit diff --git a/third_party/infozip/zip/msdos/makefile.dj2 b/third_party/infozip/zip/msdos/makefile.dj2 deleted file mode 100644 index 39192ee3e..000000000 --- a/third_party/infozip/zip/msdos/makefile.dj2 +++ /dev/null @@ -1,136 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# djgpp 2.x -VPATH=.;msdos -# ------------- djgpp ------------- -CPPFLAGS=-I. -DDOS -DASM_CRC $(LOCAL_ZIP) -ASFLAGS=$(CPPFLAGS) -CFLAGS=-Wall -O2 $(CPPFLAGS) -UTILFLAGS=-c -DUTIL $(CFLAGS) -o -CC=gcc -LD=gcc -LDFLAGS=-s - -# ------------- file packer -------- -# Laszlo Molnar who wrote DJ Packer and Markus F. X. J. Oberhumer who wrote -# the compression library used by the DJ Packer have collaborated on the -# Ultimate Packer for eXecutables, which has recently been released. Look -# for upx???d.zip at http://upx.sourceforge.net -# As an alternative, look for "djp.exe", now two years old, in the archive -# mlp107[b,s].zip, found in the same location as csdpmi?[b,s].zip (see below). -# If you have got an executable packer in your PATH, you may reduce the -# size of the disk image of the zip*.exe's by uncommenting the lines -# containing $(DJP) below where the exe's are built. -#DJP=djp -q -DJP=upx -qq --best - -# variables - -#set CRC32 to crc_gcc.o or nothing, depending on whether ASM_CRC is defined: -CRCA_O = crc_gcc.o - -OBJZ = zip.o crypt.o ttyio.o zipfile.o zipup.o fileio.o util.o \ - crc32.o $(CRCA_O) globals.o -OBJI = deflate.o trees.o match.o msdos.o -OBJU = zipfile_.o fileio_.o util_.o globals.o msdos_.o -OBJN = zipnote.o $(OBJU) -OBJC = zipcloak.o crc32_.o crypt_.o ttyio.o $(OBJU) -OBJS = zipsplit.o $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -# rules - -.SUFFIXES: # Delete make's default suffix list -.SUFFIXES: .exe .out .a .ln .o .c .cc .C .p .f .F .y .l .s .S .h - -.c.o: - $(CC) -c $(CFLAGS) $< -o $@ - -zips: zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zip.o: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipfile.o: zipfile.c $(ZIP_H) crc32.h - -zipup.o: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - -fileio.o: fileio.c $(ZIP_H) crc32.h - -util.o: util.c $(ZIP_H) - -globals.o: globals.c $(ZIP_H) - -deflate.o: deflate.c $(ZIP_H) - -trees.o: trees.c $(ZIP_H) - -crc_gcc.o: crc_i386.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S - -crc32.o: crc32.c $(ZIP_H) crc32.h - -crypt.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - -ttyio.o: ttyio.c $(ZIP_H) crypt.h ttyio.h - -msdos.o: msdos/msdos.c $(ZIP_H) - -zipcloak.o: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - -zipnote.o: zipnote.c $(ZIP_H) revision.h - -zipsplit.o: zipsplit.c $(ZIP_H) revision.h - -zipfile_.o: zipfile.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ zipfile.c - -fileio_.o: fileio.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ fileio.c - -util_.o: util.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ util.c - -crc32_.o: crc32.c $(ZIP_H) crc32.h - $(CC) $(UTILFLAGS) $@ crc32.c - -crypt_.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) $(UTILFLAGS) $@ crypt.c - -msdos_.o: msdos/msdos.c $(ZIP_H) - $(CC) $(UTILFLAGS) $@ msdos/msdos.c - - -match.o: match.S - $(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S - -zip.exe: $(OBJZ) $(OBJI) - echo $(OBJZ) > zip.rsp - echo $(OBJI) >> zip.rsp - $(LD) $(LDFLAGS) -o $@ @zip.rsp - del zip.rsp -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipcloak.exe: $(OBJC) - $(LD) $(LDFLAGS) $(OBJC) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipnote.exe: $(OBJN) - $(LD) $(LDFLAGS) $(OBJN) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -zipsplit.exe: $(OBJS) - $(LD) $(LDFLAGS) $(OBJS) -o $@ -# stubedit $@ dpmi=cwsdpmi.exe -# $(DJP) $@ - -# These stand alone executables require dpmi services to run. When -# running in a DOS window under windows 3.1 or later, the dpmi server -# is automatically present. Under DOS, if a dpmi server is not installed, -# by default the program will look for "cwsdpmi.exe." If found, it will -# be loaded for the duration of the program. -# cwsdpmi is a "free" dpmi server written by Charles W. Sandmann -# (sandman@clio.rice.edu). It may be found, among other sites, on SimTel -# and its mirrors in the .../vendors/djgpp/v2misc directory. diff --git a/third_party/infozip/zip/msdos/makefile.emx b/third_party/infozip/zip/msdos/makefile.emx deleted file mode 100644 index 3a50b5b19..000000000 --- a/third_party/infozip/zip/msdos/makefile.emx +++ /dev/null @@ -1,169 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit -# using emx 0.9c for DOS. -# By Kai-Uwe Rommel, Chr. Spieler, E-Yen Tan (and others). -# Last updated 7th January 2007. -# -# This Makefile is a stripped down version of win32/Makefile.emx that -# builds executables applying the default MSDOS emx setup. For variant -# targets (using zlib), and cross-compilation for WIN32 or OS/2, take a -# look into "win32/makefile.emx" resp. "os2/makefile.os2". -# -# Supported Make utilities: -# - Microsoft/IBM nmake (e.g. from MSC 6.0 or newer) -# - dmake 3.8 or higher -# - GNU make, at least version 3.68 (GNUish 16-bit port, RSXNT Make 3.75 in a -# Win95/WinNT DOS box, DJGPP v1.12 Make 3.71, some versions of DJGPP v2.x -# 32-bit Make; current DJGPP v2.01 Make 3.76.1 does NOT work) -# - NOT watcom make -# The "smart" Make utilities mentioned below are Christian Spieler's -# enhanced version of GNUish 16-bit Make (3.74) and his adaption of these -# GNU Make sources to EMX (32-bit). - -# Supported 32-bit C Compilers for MSDOS: -# - GNU gcc (emx kit 0.9c or newer, 32-bit) - -# Supported Assemblers: -# - GNU as with GNU gcc - - -# To use, enter "make/nmake/dmake -f msdos/makefile.emx" -# (this makefile depends on its name being "msdos/makefile.emx"). - -# emx 0.9c, gcc, a.out format, for MS-DOS -CC=gcc -O2 -m486 -Wall -CFLAGS=-DDOS -DMSDOS -DASM_CRC -AS=gcc -ASFLAGS=-Di386 -LDFLAGS=-o ./ -LDFLAGS2=-s -Zsmall-conv -OUT=-o -OBJ=.o -CRCA_O=crc_gcc.o -OBJA=matchgcc.o -OBJZS=msdos.o -OBJUS=msdos_.o -OSDEP_H=msdos/osdep.h -ZIPUP_H=msdos/zipup.h - -#default settings for target dependent macros: -DIRSEP = / -AS_DIRSEP = / -RM = del -LOCAL_OPTS = $(LOCAL_ZIP) -CCFLAGS = $(CFLAGS) $(LOCAL_OPTS) - - -OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \ - crc32$(OBJ) $(CRCA_O) -OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \ - ttyio$(OBJ) -OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA) - -OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ) -OBJU = $(OBJU1) $(OBJUS) - -OBJN = zipnote$(OBJ) $(OBJU) -OBJS = zipsplit$(OBJ) $(OBJU) -OBJC1 = zipcloak$(OBJ) crc32_$(OBJ) crypt_$(OBJ) ttyio$(OBJ) -OBJC = $(OBJC1) $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H) - -# rules - -.SUFFIXES: .c $(OBJ) - -.c$(OBJ): - $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $< - -# targets - -all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zip$(OBJ): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipfile$(OBJ): zipfile.c $(ZIP_H) crc32.h -zipup$(OBJ): zipup.c $(ZIP_H) revision.h crc32.h crypt.h $(ZIPUP_H) -fileio$(OBJ): fileio.c $(ZIP_H) crc32.h -util$(OBJ): util.c $(ZIP_H) -globals$(OBJ): globals.c $(ZIP_H) -deflate$(OBJ): deflate.c $(ZIP_H) -trees$(OBJ): trees.c $(ZIP_H) -crc32$(OBJ): crc32.c $(ZIP_H) crc32.h -crypt$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h - -msdos$(OBJ): msdos/msdos.c $(ZIP_H) - $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c - -win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c - -win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c - -nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c - -crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS - $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S - -matchgcc$(OBJ): match.S - $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S - -zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h -zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h - -zipfile_$(OBJ): zipfile.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c - -fileio_$(OBJ): fileio.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c - -util_$(OBJ): util.c $(ZIP_H) - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c - -crc32_$(OBJ): crc32.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crc32.c - -crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c - -msdos_$(OBJ): msdos/msdos.c $(ZIP_H) - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c - -win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c - -# This next bit is nasty, but is needed to overcome the MS-DOS command -# line limit as response files for emx's gcc seem to only work if each -# file is on a different line. DJGPP doesn't do this (if you are at all -# interested). - -zip.exe: $(OBJZ) -# for DUMB make utilities, uncomment the following commands: - -@$(RM) zip.rsp - @for %%f in ($(OBJZ1)) do echo %%f >> zip.rsp - @for %%f in ($(OBJZ2)) do echo %%f >> zip.rsp - @for %%f in ($(OBJZS) $(OBJA)) do echo %%f >> zip.rsp - $(CC) $(LDFLAGS)$@ @zip.rsp $(LDFLAGS2) - @$(RM) zip.rsp -# smart make utilities (like well done ports of GNU Make) can use this: -# $(CC) $(LDFLAGS)$@ $(OBJZ) $(LDFLAGS2) - -zipcloak.exe: $(OBJC) -# for DUMB make utilities, uncomment the following commands: - -@$(RM) zipcloak.rsp - @for %%f in ($(OBJC1)) do echo %%f >> zipcloak.rsp - @for %%f in ($(OBJU1)) do echo %%f >> zipcloak.rsp - @for %%f in ($(OBJUS)) do echo %%f >> zipcloak.rsp - $(CC) $(LDFLAGS)$@ @zipcloak.rsp $(LDFLAGS2) - @$(RM) zipcloak.rsp -# smart make utilities (like well done ports of GNU Make) can use this: -# $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2) - -zipnote.exe: $(OBJN) - $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2) - -zipsplit.exe: $(OBJS) - $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2) diff --git a/third_party/infozip/zip/msdos/makefile.msc b/third_party/infozip/zip/msdos/makefile.msc deleted file mode 100644 index a7ec9c967..000000000 --- a/third_party/infozip/zip/msdos/makefile.msc +++ /dev/null @@ -1,209 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# Microsoft C 5.1 and above. - -# To use, do "make makefile.msc" - -# Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce -# the memory requirements. -# Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if -# you do not have masm. -# -# If you want link Zip against zlib to replace the built-in deflate routines, -# the following changes are required: -# - in the definition of "LOC", add "-DUSE_ZLIB" and remove "-DNO_SECURE_TESTS" -# - comment out the "ASMOBJS" symbol definition -# - modify the linking command blocks for zip and zipcloak according to -# the following scheme: -# add a command line "echo ,,,zlib_$(ZIPMODEL); >> zip[c].rsp" just -# before the "$(LD)..." line; and remove the semicolon character from the -# "echo ..." line immediately preceding the just inserted command - - -# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) -# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added -# to the declaration of LOC here: -LOC = -DDOS -DDYN_ALLOC -DNO_SECURE_TESTS $(LOCAL_ZIP) - -# Zip requires compact or large memory model. -# with 2.1, compact model exceeds 64k code segment; use large model -ZIPMODEL=L # large model for Zip and ZipUtils - -# name of Flag to select memory model for assembler compiles, supported -# values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ : -ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !! - -# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. -CPU_TYP = 0 - -# Uncomment the following macro to use the optimized assembler -# routines in Zip: -ASMOBJS = match.obj crc_i86.obj - -ASCPUFLAG = __$(CPU_TYP)86 - -# ------------- Microsoft C 5.1, 6.0, 7.0 and VC++ Pro 1.0 ------------- -CC=cl -MODEL=-A$(ZIPMODEL) -FP= -# With the feature additions of Zip 3, the default data segment gets occupied -# with too much initialized data to fit into 64k. As a workaround, for some -# source files with large amount of message strings, -Gt is used to -# force data items of size or larger into their own data segments. -COMMON_CFLAGS=-nologo -I. $(MODEL) $(FP) -DMSC $(LOC) -W3 -G$(CPU_TYP) -CFLAGS=$(COMMON_CFLAGS) -Ox -SPECFLAGS=$(COMMON_CFLAGS) -Oaict -Gs -# For MSC/C++ 7.0 and VC++ no special flags are needed: -# SPECFLAGS=$(CFLAGS) -UTILFLAGS=-DUTIL $(CFLAGS) -Fo - -AS=masm -ASFLAGS=-ml -t -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC) -# For MSC 6.0, use: -#AS=ml -#ASFLAGS=-c -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC) -# Supress -DDYN_ALLOC in ASFLAGS if you have suppressed it in CFLAGS - -LD=link -LDFLAGS=/noi/farcall/packcode/e/st:0x1400/m -# If you use an exe packer as recommended below, remove /e from LDFLAGS - -# ------------- Common declarations: -STRIP=rem -# If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define: -# (NOTE: upx needs a 386 or higher system to run the exe compressor) -#STRIP=upx --8086 --best -# or -#STRIP=lzexe -# or (if you've registered PKLITE) -#STRIP=pklite -# and remove /e from LDFLAGS. -# This makes a big difference in .exe size (and possibly load time) - -# ------------- Used by install rule -# set BIN to the directory you want to install the executables to -BIN = c:\util - -# variables -OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ - crc32.obj globals.obj - -OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj - -OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj msdos_.obj -OBJN = zipnote.obj $(OBJU) -OBJC = zipcloak.obj crc32_.obj crypt_.obj ttyio.obj $(OBJU) -OBJS = zipsplit.obj $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zips: $(ZIPS) - -zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) -Gt65 $*.c - -# MSC 5.1 generates bad code on zipfile with -Ox -zipfile.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(SPECFLAGS) $*.c - -zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - $(CC) -c $(CFLAGS) $*.c - -fileio.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -util.obj: util.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -globals.obj: globals.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -deflate.obj: deflate.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -trees.obj: trees.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -crc32.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -msdos.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(CFLAGS) msdos/$*.c - -zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -zipnote.obj: zipnote.c $(ZIP_H) revision.h - $(CC) -c $(CFLAGS) $*.c - -# MSC 5.1 dies on zipsplit with -Ox -zipsplit.obj: zipsplit.c $(ZIP_H) revision.h - $(CC) -c $(SPECFLAGS) $*.c - -# MSC 5.1 generates bad code on zipfile with -Ox -zipfile_.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(SPECFLAGS) -DUTIL -Fo$@ zipfile.c - -fileio_.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$@ fileio.c - -util_.obj: util.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$@ util.c - -crc32_.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$@ crc32.c - -crypt_.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(UTILFLAGS)$@ crypt.c - -msdos_.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$@ msdos/msdos.c - -crc_i86.obj: msdos/crc_i86.asm - $(AS) $(ASFLAGS) msdos\crc_i86.asm ; - -match.obj: msdos/match.asm - $(AS) $(ASFLAGS) msdos\match.asm ; - -# we must cut the command line to fit in the MS/DOS 128 byte limit: -zip.exe: $(OBJZ) $(OBJI) - echo $(OBJZ)+ > zip.rsp - echo $(OBJI); >> zip.rsp - $(LD) $(LDFLAGS) @zip.rsp - del zip.rsp - $(STRIP) zip.exe - -zipcloak.exe: $(OBJC) - echo $(OBJC); > zipc.rsp - $(LD) $(LDFLAGS) @zipc.rsp - del zipc.rsp - $(STRIP) zipcloak.exe - -zipnote.exe: $(OBJN) - echo $(OBJN); > zipn.rsp - $(LD) $(LDFLAGS) @zipn.rsp - del zipn.rsp - $(STRIP) zipnote.exe - -zipsplit.exe: $(OBJS) - echo $(OBJS); > zips.rsp - $(LD) $(LDFLAGS) @zips.rsp - del zips.rsp - $(STRIP) zipsplit.exe - -# No `install' and `clean' target possible as long as MSC's old MAKE utility -# is supported (MSC 5.1 Make always tries to update ALL targets. The result -# is that install and clean are always executed, unless an error occured.) -#install: $(ZIPS) -# copy /b *.exe $(BIN) -# -#clean: -# del *.obj -# del *.exe diff --git a/third_party/infozip/zip/msdos/makefile.tc b/third_party/infozip/zip/msdos/makefile.tc deleted file mode 100644 index 9ce3e3212..000000000 --- a/third_party/infozip/zip/msdos/makefile.tc +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for -# Turbo C 2.0. (Thanks to Andrew Cadach ) - -# To use, do "make -fmakefile.tc" - -# WARNING: the small model is not supported. You must use the large model. -# Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce -# the memory requirements. -# Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if -# you do not have tasm. - -# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) -# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added -# to the declaration of LOC here: -LOC = -DDOS -DNO_SECURE_TESTS $(LOCAL_ZIP) - -# Zip requires compact or large memory model. -# with 2.1, compact model exceeds 64k code segment; use large model -ZIPMODEL=l # large model for Zip and ZipUtils - -# name of Flag to select memory model for assembler compiles, supported -# values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ : -ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !! - -# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. -CPU_TYP = 0 - -# Uncomment the following macro to use the optimized assembler -# routines in Zip: -ASMOBJS = match.obj crc_i86.obj - -ASCPUFLAG = __$(CPU_TYP)86 - -# ------------- Turbo C 2.0 ------------- -MODEL=-m$(ZIPMODEL) -CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(MODEL) $(LOC) -UTILFLAGS=-DUTIL $(CFLAGS) -o -CC=tcc - -# Old versions of tasm (prior to 2.01) may not like the "-m2" option... -AS=tasm -ASFLAGS=-ml -t -m2 -DDYN_ALLOC -DSS_NEQ_DS -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC) - -LD=tcc -LDFLAGS=$(MODEL) - -# ------------- Common declarations: -STRIP=rem -# If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define: -# (NOTE: upx needs a 386 or higher system to run the exe compressor) -#STRIP=upx --8086 --best -# or -#STRIP=lzexe -# or (if you've registered PKLITE) -#STRIP=pklite -# This makes a big difference in .exe size (and possibly load time) - -# ------------- Used by install rule -# set BIN to the directory you want to install the executables to -BIN = c:\util - -# variables -OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ - crc32.obj globals.obj - -OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj - -OBJU = _zipfile.obj _fileio.obj _util.obj globals.obj _msdos.obj -OBJN = zipnote.obj $(OBJU) -OBJC = zipcloak.obj _crc32.obj _crypt.obj ttyio.obj $(OBJU) -OBJS = zipsplit.obj $(OBJU) - -ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h - -ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zips: $(ZIPS) - -zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -zipfile.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h - $(CC) -c $(CFLAGS) $*.c - -fileio.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -util.obj: util.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -globals.obj: globals.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -deflate.obj: deflate.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -trees.obj: trees.c $(ZIP_H) - $(CC) -c $(CFLAGS) $*.c - -crc32.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(CFLAGS) $*.c - -crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h - $(CC) -c $(CFLAGS) $*.c - -msdos.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(CFLAGS) msdos/$*.c - -zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h - $(CC) -c $(CFLAGS) -o$* $*.c - -zipnote.obj: zipnote.c $(ZIP_H) revision.h - $(CC) -c $(CFLAGS) -o$* $*.c - -zipsplit.obj: zipsplit.c $(ZIP_H) revision.h - $(CC) -c $(CFLAGS) -o$* $*.c - -_zipfile.obj: zipfile.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$* zipfile.c - -_fileio.obj: fileio.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$* fileio.c - -_util.obj: util.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$* util.c - -_crc32.obj: crc32.c $(ZIP_H) crc32.h - $(CC) -c $(UTILFLAGS)$* crc32.c - -_crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c $(UTILFLAGS)$* crypt.c - -_msdos.obj: msdos/msdos.c $(ZIP_H) - $(CC) -c $(UTILFLAGS)$* msdos/msdos.c - -crc_i86.obj: msdos/crc_i86.asm - $(AS) $(ASFLAGS) msdos\crc_i86.asm ; - -match.obj: msdos/match.asm - $(AS) $(ASFLAGS) msdos\match.asm ; - -# make sure the command line fits in the MS/DOS 128 byte limit: -zip.exe: $(OBJZ) $(OBJI) - rem ignore any warnings in the following renaming commands: - ren _*.obj _*.ob - ren zipcloak.obj *.ob - ren zipnote.obj *.ob - ren zipsplit.obj *.ob - $(LD) $(LDFLAGS) -ezip.exe *.obj - ren _*.ob _*.obj - ren zip???*.ob *.obj - $(STRIP) zip.exe - -zipcloak.exe: $(OBJC) - $(LD) $(LDFLAGS) -ezipcloak.exe $(OBJC) - $(STRIP) zipcloak.exe - -zipnote.exe: $(OBJN) - $(LD) $(LDFLAGS) -ezipnote.exe $(OBJN) - $(STRIP) zipnote.exe - -zipsplit.exe: $(OBJS) - $(LD) $(LDFLAGS) -ezipsplit.exe $(OBJS) - $(STRIP) zipsplit.exe - -install: $(ZIPS) - copy /b *.exe $(BIN) - -clean: - del *.obj - del *.exe diff --git a/third_party/infozip/zip/msdos/makefile.wat b/third_party/infozip/zip/msdos/makefile.wat deleted file mode 100644 index dd4d8cd27..000000000 --- a/third_party/infozip/zip/msdos/makefile.wat +++ /dev/null @@ -1,256 +0,0 @@ -# WMAKE makefile for 16 bit MSDOS or 32 bit DOS extender (PMODE/W or DOS/4GW) -# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 07 Aug 2005. -# Makes Zip.exe, ZipNote.exe, ZipCloak.exe, and ZipSplit.exe. -# -# Invoke from Zip source dir with "WMAKE -F MSDOS\MAKEFILE.WAT [targets]" -# To build with debug info use "WMAKE DEBUG=1 ..." -# To build with no assembly modules use "WMAKE NOASM=1 ..." -# To make the PMODE/W version use "WMAKE PM=1 ..." -# To make the DOS/4GW version use "WMAKE GW=1 ..." (overrides PM=1) -# Note: specifying PM or GW without NOASM requires that the win32 source -# directory be present, so it can access the 32 bit assembly sources. -# PMODE/W is recommended over DOS/4GW for best performance. -# To create a low memory usage version of Zip, use "WMAKE WSIZE=8192 ..." -# (or whatever power of two less than 32768 you wish) -- this also causes -# SMALL_MEM to be defined. Compression performance will be reduced. -# This currently is not supported with PM=1 or GW=1. -# -# Other options to be fed to the compiler and assembler can be specified in -# an environment variable called LOCAL_ZIP. - -variation = $(%LOCAL_ZIP) - -# Stifle annoying "Delete this file?" questions when errors occur: -.ERASE - -.EXTENSIONS: -.EXTENSIONS: .exe .obj .c .h .asm - -# We maintain multiple sets of object files in different directories so that -# we can compile msdos, dos/4gw or pmode/w, and win32 versions of Zip without -# their object files interacting. The following var must be a directory name -# ending with a backslash. All object file names must include this macro -# at the beginning, for example "$(O)foo.obj". - -!ifdef GW -PM = 1 # both protected mode formats use the same object files -!endif - -!ifdef DEBUG -! ifdef PM -OBDIR = od32d -! else -! ifdef WSIZE -OBDIR = od16l -size = -DWSIZE=$(WSIZE) -DSMALL_MEM -! else -OBDIR = od16d -size = -DMEDIUM_MEM -! endif -! endif -!else -! ifdef PM -OBDIR = ob32d -! else -! ifdef WSIZE -OBDIR = ob16l -size = -DWSIZE=$(WSIZE) -DSMALL_MEM -! else -OBDIR = ob16d -size = -DMEDIUM_MEM -! endif -! endif -!endif -O = $(OBDIR)\ # comment here so backslash won't continue the line - -# The assembly hot-spot code in crc_i[3]86.asm and match[32].asm is -# optional. This section controls its usage. - -!ifdef NOASM - # C source -asmob = -cvars = $+$(cvars)$- -DDYN_ALLOC -DNO_ASM # or ASM_CRC might default on! -# "$+$(foo)$-" means expand foo as it has been defined up to now; normally, -# this make defers inner expansion until the outer macro is expanded. -!else # !NOASM -asmob = $(O)crc.obj $(O)match.obj -! ifdef PM -cvars = $+$(cvars)$- -DASM_CRC -DASMV # no DYN_ALLOC with match32.asm -crc_s = win32\crc_i386.asm # requires that the win32 directory be present -mat_s = win32\match32.asm # ditto -! else -cvars = $+$(cvars)$- -DDYN_ALLOC -DASM_CRC -DASMV -avars = $+$(avars)$- -DDYN_ALLOC -crc_s = msdos\crc_i86.asm -mat_s = msdos\match.asm -! endif -!endif - -# Now we have to pick out the proper compiler and options for it. This gets -# pretty complicated with the PM, GW, DEBUG, and NOASM options... - -link = wlink -asm = wasm - -!ifdef PM -cc = wcc386 -# Use Pentium Pro timings, register args, static strings in code: -cflags = -bt=DOS -mf -6r -zt -zq -aflags = -bt=DOS -mf -3 -zq -cvars = $+$(cvars)$- -DDOS $(variation) -avars = $+$(avars)$- -DWATCOM_DSEG $(variation) - -! ifdef GW -lflags = sys DOS4G -! else -# THIS REQUIRES THAT PMODEW.EXE BE FINDABLE IN THE COMMAND PATH. -# It does NOT require you to add a pmodew entry to wlink.lnk or wlsystem.lnk. -defaultlibs = libpath %WATCOM%\lib386 libpath %WATCOM%\lib386\dos -lflags = format os2 le op osname='PMODE/W' op stub=pmodew.exe $(defaultlibs) -! endif - -!else # plain 16-bit DOS: - -cc = wcc -# Use plain 8086 instructions, large memory model, static strings in code: -cflags = -bt=DOS -ml -0 -zt -zq -aflags = -bt=DOS -ml -0 -zq -cvars = $+$(cvars)$- -DDOS $(size) $(variation) -avars = $+$(avars)$- $(size) $(variation) -lflags = sys DOS -!endif # !PM - -# Specify optimizations, or a nonoptimized debugging version: - -!ifdef DEBUG -cdebug = -od -d2 -ldebug = d w all op symf -!else -! ifdef PM -cdebug = -s -obhikl+rt -oe=100 -zp8 -# -oa helps slightly but might be dangerous. -! else -cdebug = -s -oehiklrt -! endif -ldebug = op el -!endif - -# How to compile most sources: -.c.obj: - $(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@ - -# Our object files. OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for -# ZipNote, and OBJS is for ZipSplit: - -OBJZ2 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)zipfile.obj $(O)zipup.obj -OBJZA = $(OBJZ2) $(O)util.obj $(O)fileio.obj $(O)deflate.obj -OBJZB = $(O)trees.obj $(O)globals.obj $(O)crc32.obj $(asmob) $(O)msdos.obj - -OBJU2 = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj -OBJ_U = $(OBJU2) $(O)msdos_.obj - -OBJC = $(O)zipcloak.obj $(O)crc32_.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U) - -OBJN = $(O)zipnote.obj $(OBJ_U) - -OBJS = $(O)zipsplit.obj $(OBJ_U) - -# Common header files included by all C sources: - -ZIP_H = zip.h ziperr.h tailor.h msdos\osdep.h - - -# HERE WE GO! By default, make all targets: -all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe - -# Convenient shorthand options for single targets: -z: Zip.exe .SYMBOLIC -n: ZipNote.exe .SYMBOLIC -c: ZipCloak.exe .SYMBOLIC -s: ZipSplit.exe .SYMBOLIC - -Zip.exe: $(OBDIR) $(OBJZA) $(OBJZB) $(OBJV) - set WLK_VA=file {$(OBJZA)} - set WLK_VB=file {$(OBJZB) $(OBJV)} - $(link) $(lflags) $(ldebug) name $@ @WLK_VA @WLK_VB - set WLK_VA= - set WLK_VB= -# We use WLK_VA and WLK_VB to keep the size of each command under 256 chars. - -ZipNote.exe: $(OBDIR) $(OBJN) - set WLK_VAR=file {$(OBJN)} - $(link) $(lflags) $(ldebug) name $@ @WLK_VAR - set WLK_VAR= - -ZipCloak.exe: $(OBDIR) $(OBJC) - set WLK_VAR=file {$(OBJC)} - $(link) $(lflags) $(ldebug) name $@ @WLK_VAR - set WLK_VAR= - -ZipSplit.exe: $(OBDIR) $(OBJS) - set WLK_VAR=file {$(OBJS)} - $(link) $(lflags) $(ldebug) name $@ @WLK_VAR - set WLK_VAR= - -# Source dependencies: - -$(O)crc32.obj: crc32.c $(ZIP_H) crc32.h -$(O)crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -$(O)deflate.obj: deflate.c $(ZIP_H) -$(O)fileio.obj: fileio.c $(ZIP_H) crc32.h -$(O)globals.obj: globals.c $(ZIP_H) -$(O)trees.obj: trees.c $(ZIP_H) -$(O)ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h -$(O)util.obj: util.c $(ZIP_H) -$(O)zip.obj: zip.c $(ZIP_H) crc32.h crypt.h revision.h ttyio.h -$(O)zipfile.obj: zipfile.c $(ZIP_H) crc32.h -$(O)zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos\zipup.h -$(O)zipnote.obj: zipnote.c $(ZIP_H) revision.h -$(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -$(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h - -# Special case object files: - -$(O)msdos.obj: msdos\msdos.c $(ZIP_H) - $(cc) $(cdebug) $(cflags) $(cvars) msdos\msdos.c -fo=$@ - -$(O)match.obj: $(mat_s) - $(asm) $(aflags) $(avars) $(mat_s) -fo=$@ - -$(O)crc.obj: $(crc_s) - $(asm) $(aflags) $(avars) $(crc_s) -fo=$@ - -# Variant object files for ZipNote, ZipCloak, and ZipSplit: - -$(O)zipfile_.obj: zipfile.c $(ZIP_H) crc32.h - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@ - -$(O)fileio_.obj: fileio.c $(ZIP_H) crc32.h - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@ - -$(O)util_.obj: util.c $(ZIP_H) - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@ - -$(O)crc32_.obj: crc32.c $(ZIP_H) crc32.h - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crc32.c -fo=$@ - -$(O)crypt_.obj: crypt.c $(ZIP_H) crc32.h crypt.h ttyio.h - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@ - -$(O)msdos_.obj: msdos\msdos.c $(ZIP_H) - $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL msdos\msdos.c -fo=$@ - -# Creation of subdirectory for intermediate files -$(OBDIR): - -mkdir $@ - -# Unwanted file removal: - -clean: .SYMBOLIC - del $(O)*.obj - -cleaner: clean .SYMBOLIC - del Zip.exe - del ZipNote.exe - del ZipCloak.exe - del ZipSplit.exe diff --git a/third_party/infozip/zip/msdos/match.asm b/third_party/infozip/zip/msdos/match.asm deleted file mode 100644 index 998881e43..000000000 --- a/third_party/infozip/zip/msdos/match.asm +++ /dev/null @@ -1,477 +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 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 -;=========================================================================== -; -; match.asm by Jean-loup Gailly. - -; match.asm, optimized version of longest_match() in deflate.c -; Must be assembled with masm -ml. To be used only with C compact model -; or large model. (For large model, assemble with -D__LARGE__). -; This file is only optional. If you don't have masm or tasm, use the -; C version (add -DNO_ASM to CFLAGS in makefile.msc and remove match.obj -; from OBJI). If you have reduced WSIZE in zip.h, then make sure this is -; assembled with an equivalent -DWSIZE=. -; -; The code has been prepared for two different C compiler calling conventions -; and contains some support for dynamically allocated working space. -; The different environments are selected by two conditional flags: -; DYN_ALLOC : select support for malloc'ed working space -; SS_NEQ_DS : relaxes assumption that stack and default data segments -; are identical -; When SS_NEQ_DS is defined, the code segment is used to store some -; local variables. This (bad) coding practice is very likely to break any -; `segment protection scheme', it will most probably only work for real -; mode programs. -; -; Turbo C 2.0 does not support static allocation of more than 64K bytes per -; file, and does not have SS == DS. So TC and BC++ users must use: -; tasm -ml -DDYN_ALLOC -DSS_NEQ_DS match; -; -; To simplify the code, the option -DDYN_ALLOC is supported for OS/2 -; only if the arrays are guaranteed to have zero offset (allocated by -; halloc). We also require SS==DS. This is satisfied for MSC but not Turbo C. -; -; Per default, test code is included to check if the above requirements are -; fulfilled. This test code can be disabled by defining the compile time -; option flag NO_SECURE_TESTS when compiling for a production executable. -; This shortens the code size (but the performance gain is neglectable). -; The security tests should remain enabled, when a new C compiler -; and/or a new set of compilation options is tried. - - name match - -; Do NOT assemble this source if external crc32 routine from zlib gets used. -; -ifndef USE_ZLIB - -ifdef DEBUG - VERBOSE_INFO EQU 1 -else - ifdef _AS_MSG_ - VERBOSE_INFO EQU 1 - else - VERBOSE_INFO EQU 0 - endif -endif - -ifndef __SMALL__ - ifndef __COMPACT__ - ifndef __MEDIUM__ - ifndef __LARGE__ - ifndef __HUGE__ -; __SMALL__ EQU 1 - endif - endif - endif - endif -endif - -ifdef __HUGE__ -; .MODEL Huge - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - Save_DS EQU 1 - if VERBOSE_INFO - if1 - %out Assembling for C, Huge memory model - endif - endif -else - ifdef __LARGE__ -; .MODEL Large - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Large memory model - endif - endif - else - ifdef __COMPACT__ -; .MODEL Compact - ifndef @CodeSize - @CodeSize EQU 0 - endif - ifndef @DataSize - @DataSize EQU 1 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Compact memory model - endif - endif - else - ifdef __MEDIUM__ -; .MODEL Medium - ifndef @CodeSize - @CodeSize EQU 1 - endif - ifndef @DataSize - @DataSize EQU 0 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Medium memory model - endif - endif - else -; .MODEL Small - ifndef @CodeSize - @CodeSize EQU 0 - endif - ifndef @DataSize - @DataSize EQU 0 - endif - if VERBOSE_INFO - if1 - %out Assembling for C, Small memory model - endif - endif - endif - endif - endif -endif - -if @CodeSize - LCOD_OFS EQU 2 -else - LCOD_OFS EQU 0 -endif - -IF @DataSize - LDAT_OFS EQU 2 -else - LDAT_OFS EQU 0 -endif - -ifdef Save_DS -; (di,si,ds)+(size, return address) - SAVE_REGS EQU 6+(4+LCOD_OFS) -else -; (di,si)+(size, return address) - SAVE_REGS EQU 4+(4+LCOD_OFS) -endif - -; -; Selection of the supported CPU instruction set and initialization -; of CPU type related macros: -; -ifdef __586 - Use_286_code EQU 1 - Align_Size EQU 16 ; paragraph alignment on Pentium - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __486 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on 32 bit processors - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __386 - Use_286_code EQU 1 - Align_Size EQU 4 ; dword alignment on 32 bit processors - Alig_PARA EQU 1 ; paragraph aligned code segment -else -ifdef __286 - Use_286_code EQU 1 - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -else -ifdef __186 - Use_186_code EQU 1 - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -else - Align_Size EQU 2 ; word alignment on 16 bit processors - Alig_PARA EQU 0 ; word aligned code segment -endif ;?__186 -endif ;?__286 -endif ;?__386 -endif ;?__486 -endif ;?__586 - -ifdef Use_286_code - .286 - Have_80x86 EQU 1 -else -ifdef Use_186_code - .186 - Have_80x86 EQU 1 -else - .8086 - Have_80x86 EQU 0 -endif ;?Use_186_code -endif ;?Use_286_code - -ifndef DYN_ALLOC - extrn _prev : word - extrn _window : byte - prev equ _prev ; offset part - window equ _window -endif - -_DATA segment word public 'DATA' - extrn _nice_match : word - extrn _match_start : word - extrn _prev_length : word - extrn _good_match : word - extrn _strstart : word - extrn _max_chain_length : word -ifdef DYN_ALLOC - extrn _prev : word - extrn _window : word - prev equ 0 ; offset forced to zero - window equ 0 - window_seg equ _window[2] - window_off equ 0 -else - wseg dw seg _window - window_seg equ wseg - window_off equ offset _window -endif -_DATA ends - -DGROUP group _DATA - -if @CodeSize -if Alig_PARA -MATCH_TEXT SEGMENT PARA PUBLIC 'CODE' -else -MATCH_TEXT SEGMENT WORD PUBLIC 'CODE' -endif - assume cs: MATCH_TEXT, ds: DGROUP -else ;!@CodeSize -if Alig_PARA -_TEXT segment para public 'CODE' -else -_TEXT segment word public 'CODE' -endif - assume cs: _TEXT, ds: DGROUP -endif ;?@CodeSize - - public _match_init - public _longest_match - -ifndef WSIZE - WSIZE equ 32768 ; keep in sync with zip.h ! -endif - MIN_MATCH equ 3 - MAX_MATCH equ 258 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - MAX_DIST equ (WSIZE-MIN_LOOKAHEAD) - -ifdef DYN_ALLOC - ifdef SS_NEQ_DS - prev_ptr dw seg _prev ; pointer to the prev array - endif -else - prev_ptr dw seg _prev ; pointer to the prev array -endif -ifdef SS_NEQ_DS - match_start dw 0 ; copy of _match_start if SS != DS - nice_match dw 0 ; copy of _nice_match if SS != DS -endif - -; initialize or check the variables used in match.asm. - -if @CodeSize -_match_init proc far ; 'proc far' for large model -else -_match_init proc near ; 'proc near' for compact model -endif -ifdef SS_NEQ_DS - ma_start equ cs:match_start ; does not work on OS/2 - nice equ cs:nice_match -else - assume ss: DGROUP - ma_start equ ss:_match_start - nice equ ss:_nice_match - ifndef NO_SECURE_TESTS - mov ax,ds - mov bx,ss - cmp ax,bx ; SS == DS? - jne fatal_err - endif -endif -ifdef DYN_ALLOC - ifndef NO_SECURE_TESTS - cmp _prev[0],0 ; verify zero offset - jne fatal_err - cmp _window[0],0 - jne fatal_err - endif - ifdef SS_NEQ_DS - mov ax,_prev[2] ; segment value - mov cs:prev_ptr,ax ; ugly write to code, crash on OS/2 - prev_seg equ cs:prev_ptr - else - prev_seg equ ss:_prev[2] ; works on OS/2 if SS == DS - endif -else - prev_seg equ cs:prev_ptr -endif - ret -ifndef NO_SECURE_TESTS -if @CodeSize - extrn _exit : far ; 'far' for large model -else - extrn _exit : near ; 'near' for compact model -endif -fatal_err: ; (quiet) emergency stop: - call _exit ; incompatible "global vars interface" -endif - -_match_init endp - -; ----------------------------------------------------------------------- -; Set match_start to the longest match starting at the given string and -; return its length. Matches shorter or equal to prev_length are discarded, -; in which case the result is equal to prev_length and match_start is -; garbage. -; IN assertions: cur_match is the head of the hash chain for the current -; string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - -; int longest_match(cur_match) - - align Align_Size - -if @CodeSize -_longest_match proc far ; 'proc far' for large model -else -_longest_match proc near ; 'proc near' for compact model -endif - push bp - mov bp,sp - push di - push si - push ds - -if @CodeSize - cur_match equ word ptr [bp+6] ; [bp+6] for large model -else - cur_match equ word ptr [bp+4] ; [bp+4] for compact model -endif - -; window equ es:window (es:0 for DYN_ALLOC) -; prev equ ds:prev -; match equ es:si -; scan equ es:di -; chain_length equ bp -; best_len equ bx -; limit equ dx - - mov si,cur_match ; use bp before it is destroyed -ifdef SS_NEQ_DS - mov ax,_nice_match - mov nice,ax ; ugly write to code, crash on OS/2 -endif - mov dx,_strstart - mov bp,_max_chain_length ; chain_length = max_chain_length - mov di,dx - sub dx,MAX_DIST ; limit = strstart-MAX_DIST - cld ; string ops increment si and di - jae limit_ok - sub dx,dx ; limit = NIL -limit_ok: - add di,2+window_off ; di = offset(window + strstart + 2) - mov bx,_prev_length ; best_len = prev_length - mov es,window_seg - mov ax,es:[bx+di-3] ; ax = scan[best_len-1..best_len] - mov cx,es:[di-2] ; cx = scan[0..1] - cmp bx,_good_match ; do we have a good match already? - mov ds,prev_seg ; (does not destroy the flags) - assume ds: nothing - jb do_scan ; good match? -if Have_80x86 - shr bp,2 ; chain_length >>= 2 -else - shr bp,1 ; chain_length >>= 2 - shr bp,1 -endif - jmp short do_scan - - align Align_Size ; align destination of branch -long_loop: -; at this point, ds:di == scan+2, ds:si == cur_match - mov ax,[bx+di-3] ; ax = scan[best_len-1..best_len] - mov cx,[di-2] ; cx = scan[0..1] - mov ds,prev_seg ; reset ds to address the prev array -short_loop: -; at this point, di == scan+2, si = cur_match, -; ax = scan[best_len-1..best_len] and cx = scan[0..1] -if (WSIZE-32768) - and si,WSIZE-1 ; not needed if WSIZE=32768 -endif - shl si,1 ; cur_match as word index - dec bp ; --chain_length - mov si,prev[si] ; cur_match = prev[cur_match] - jz the_end - cmp si,dx ; cur_match <= limit ? - jbe the_end -do_scan: - cmp ax,word ptr es:window[bx+si-1] ; check match at best_len-1 - jne short_loop - cmp cx,word ptr es:window[si] ; check min_match_length match - jne short_loop - - mov cx,es - add si,2+window_off ; si = match - mov ds,cx ; ds = es = window - mov cx,(MAX_MATCH-2)/2 ; scan for at most MAX_MATCH bytes - mov ax,di ; ax = scan+2 - repe cmpsw ; loop until mismatch - je maxmatch ; match of length MAX_MATCH? -mismatch: - mov cl,[di-2] ; mismatch on first or second byte? - xchg ax,di ; di = scan+2, ax = end of scan - sub cl,[si-2] ; cl = 0 if first bytes equal - sub ax,di ; ax = len - sub si,2+window_off ; si = cur_match + len - sub si,ax ; si = cur_match - sub cl,1 ; set carry if cl == 0 (can't use DEC) - adc ax,0 ; ax = carry ? len+1 : len - cmp ax,bx ; len > best_len ? - jle long_loop - mov ma_start,si ; match_start = cur_match - mov bx,ax ; bx = best_len = len - cmp ax,nice ; len >= nice_match ? - jl long_loop -the_end: - pop ds - assume ds: DGROUP -ifdef SS_NEQ_DS - mov ax,ma_start ; garbage if no match found - mov ds:_match_start,ax -endif - pop si - pop di - pop bp - mov ax,bx ; result = ax = best_len - ret -maxmatch: ; come here if maximum match - cmpsb ; increment si and di - jmp mismatch ; force match_length = MAX_LENGTH - -_longest_match endp - -if @CodeSize -MATCH_TEXT ENDS -else -_TEXT ENDS -endif -; -endif ;!USE_ZLIB -; -end diff --git a/third_party/infozip/zip/msdos/msdos.c b/third_party/infozip/zip/msdos/msdos.c deleted file mode 100644 index 4f71397c0..000000000 --- a/third_party/infozip/zip/msdos/msdos.c +++ /dev/null @@ -1,1126 +0,0 @@ -/* - Copyright (c) 1990-2005 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 -*/ -#include "zip.h" - -#ifndef UTIL /* little or no material in this file is used by UTIL */ - -#include -#include - - -#if defined(__GO32__) || defined(__TURBOC__) -# include /* prototypes of find*() */ - typedef struct ffblk ff_dir; -# define FATTR (hidden_files ? FA_HIDDEN+FA_SYSTEM+FA_DIREC : FA_DIREC) -# define FFIRST(n,d,a) findfirst(n,(struct ffblk *)d,a) -# define FNEXT(d) findnext((struct ffblk *)d) -# if (defined(__TURBOC__) || (defined(__DJGPP__) && (__DJGPP__ >=2))) -# if (defined(__DJGPP__) && (__DJGPP__ == 2) && (__DJGPP_MINOR__ == 0)) -# include -# endif -# define GetFileMode(name) _chmod(name, 0) -# define SetFileMode(name, attr) _chmod(name, 1, attr) -# else /* DJGPP v1.x */ -# define GetFileMode(name) bdosptr(0x43, (name), 0) -# endif -#endif /* __GO32__ || __TURBOC__ */ - -#if defined(MSC) || defined(__WATCOMC__) - typedef struct find_t ff_dir; -# define FATTR (hidden_files ? _A_HIDDEN+_A_SYSTEM+_A_SUBDIR : _A_SUBDIR) -# ifndef FA_LABEL -# define FA_LABEL _A_VOLID -# endif -# define FFIRST(n,d,a) _dos_findfirst(n,a,(struct find_t *)d) -# define FNEXT(d) _dos_findnext((struct find_t *)d) -# define ff_name name -# define ff_fdate wr_date -# define ff_ftime wr_time -# define ff_attrib attrib -#endif /* MSC || __WATCOMC__ */ - -#ifdef __EMX__ -# ifdef EMX_OBSOLETE /* emx 0.9b or earlier */ -# define size_t xxx_size_t -# define wchar_t xxx_wchar_t -# define tm xxx_tm -# include -# undef size_t -# undef wchar_t -# undef tm -# else /* !EMX_OBSOLETE */ /* emx 0.9c or newer */ -# include -# endif /* ?EMX_OBSOLETE */ - typedef struct _find ff_dir; -# define FATTR (hidden_files ? _A_HIDDEN+_A_SYSTEM+_A_SUBDIR : _A_SUBDIR) -# define FA_LABEL _A_VOLID -# define FFIRST(n,d,a) __findfirst(n,a,d) -# define FNEXT(d) __findnext(d) -# define ff_name name -# define ff_fdate date -# define ff_ftime time -# define ff_attrib attr -# define GetFileMode(name) __chmod(name, 0, 0) -# define SetFileMode(name, attr) __chmod(name, 1, attr) -#endif /* __EMX__ */ - -#ifndef SetFileMode -# define SetFileMode(name, attr) _dos_setfileattr(name, attr) -#endif - - -#define PAD 0 -#define PATH_END '/' - -/* Library functions not in (most) header files */ -int rmdir OF((const char *)); -int utime OF((char *, ztimbuf *)); - -/* Local functions */ -#ifndef GetFileMode -int GetFileMode OF((char *name)); -#endif /* !GetFileMode */ - -local int initDirSearch OF((char *name, ff_dir *ff_context_p)); -local char *getVolumeLabel OF((int, ulg *, ulg *, time_t *)); -local int wild_recurse OF((char *, char *)); -local int procname_dos OF((char *n, int caseflag, unsigned attribs)); -local int is_running_on_windows OF((void)); - -#define MSDOS_INVALID_ATTR 0xFF -#define getDirEntryAttr(d) ((d)->ff_attrib) - -/* Module level variables */ -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Module level constants */ -local ZCONST char wild_match_all[] = "*.*"; - - -#ifndef GetFileMode -int GetFileMode(char *name) -{ - unsigned int attr = 0; - return (_dos_getfileattr(name, &attr) ? -1 : attr); -} -#endif /* !GetFileMode */ - -local int initDirSearch(name, ff_context_p) - char *name; /* name of directory to scan */ - ff_dir *ff_context_p; /* pointer to FFIRST/FNEXT context structure */ -{ - int r; /* FFIRST return value */ - char *p, *q; /* temporary copy of name, and aux pointer */ - - if ((p = malloc(strlen(name) + (2 + sizeof(wild_match_all)))) == NULL) - return ZE_MEM; - - strcpy(p, name); - q = p + strlen(p); - if (q[-1] == ':') - *q++ = '.'; - if ((q - p) > 0 && *(q - 1) != '/') - *q++ = '/'; - strcpy(q, wild_match_all); - r = FFIRST(p, ff_context_p, FATTR); - free((zvoid *)p); - - return (r ? ZE_MISS : ZE_OK); -} - -local char *getVolumeLabel(drive, vtime, vmode, vutim) - int drive; /* drive name: 'A' .. 'Z' or '\0' for current drive */ - ulg *vtime; /* volume label creation time (DOS format) */ - ulg *vmode; /* volume label file mode */ - time_t *vutim;/* volume label creation time (UNIX format) */ - -/* If a volume label exists for the given drive, return its name and - set its time and mode. The returned name must be static data. */ -{ - static char vol[14]; - ff_dir d; - char *p; - - if (drive) { - vol[0] = (char)drive; - strcpy(vol+1, ":/"); - } else { - strcpy(vol, "/"); - } - strcat(vol, wild_match_all); - if (FFIRST(vol, &d, FA_LABEL) == 0) { - strncpy(vol, d.ff_name, sizeof(vol)-1); - vol[sizeof(vol)-1] = '\0'; /* just in case */ - if ((p = strchr(vol, '.')) != NULL) /* remove dot, though PKZIP doesn't */ - strcpy(p, p + 1); - *vtime = ((ulg)d.ff_fdate << 16) | ((ulg)d.ff_ftime & 0xffff); - *vmode = (ulg)d.ff_attrib; - *vutim = dos2unixtime(*vtime); - return vol; - } - return NULL; -} - - -#ifdef MSDOS16 -#define ONENAMELEN 12 /* no 16-bit compilers supports LFN */ -#else -#define ONENAMELEN 255 -#endif - -/* whole is a pathname with wildcards, wildtail points somewhere in the */ -/* middle of it. All wildcards to be expanded must come AFTER wildtail. */ - -local int wild_recurse(whole, wildtail) -char *whole; -char *wildtail; -{ - ff_dir dir; - char *subwild, *name, *newwhole = NULL, *glue = NULL, plug = 0, plug2; - ush newlen, amatch = 0; - int e = ZE_MISS; - - if (!isshexp(wildtail)) { - struct stat s; /* dummy buffer for stat() */ - - if (!LSSTAT(whole, &s)) /* file exists ? */ - return procname(whole, 0); - else - return ZE_MISS; /* woops, no wildcards! */ - } - - /* back up thru path components till existing dir found */ - do { - name = wildtail + strlen(wildtail) - 1; - for (;;) - if (name-- <= wildtail || *name == PATH_END) { - subwild = name + 1; - plug2 = *subwild; - *subwild = 0; - break; - } - if (glue) - *glue = plug; - glue = subwild; - plug = plug2; - e = initDirSearch(whole, &dir); - } while (e == ZE_MISS && subwild > wildtail); - wildtail = subwild; /* skip past non-wild components */ - if (e != ZE_OK) { - if (glue) - *glue = plug; - goto ohforgetit; - } - subwild = strchr(wildtail + 1, PATH_END); - /* this "+ 1" dodges the ^^^ hole left by *glue == 0 */ - if (subwild != NULL) { - *(subwild++) = 0; /* wildtail = one component pattern */ - newlen = strlen(whole) + strlen(subwild) + (ONENAMELEN + 2); - } else - newlen = strlen(whole) + (ONENAMELEN + 1); - if ((newwhole = malloc(newlen)) == NULL) { - if (glue) - *glue = plug; - e = ZE_MEM; - goto ohforgetit; - } - strcpy(newwhole, whole); - newlen = strlen(newwhole); - if (glue) - *glue = plug; /* repair damage to whole */ - if (!isshexp(wildtail)) { - e = ZE_MISS; /* non-wild name not found */ - goto ohforgetit; - } - - do { - if (strcmp(dir.ff_name, ".") && strcmp(dir.ff_name, "..") - && MATCH(wildtail, dir.ff_name, 0)) { - strcpy(newwhole + newlen, dir.ff_name); - if (subwild) { - name = newwhole + strlen(newwhole); - *(name++) = PATH_END; - strcpy(name, subwild); - e = wild_recurse(newwhole, name); - } else - e = procname_dos(newwhole, 0, getDirEntryAttr(&dir)); - newwhole[newlen] = 0; - if (e == ZE_OK) - amatch = 1; - else if (e != ZE_MISS) - break; - } - } while (FNEXT(&dir) == 0); - - ohforgetit: - if (subwild) - *--subwild = PATH_END; - if (newwhole) - free(newwhole); - if (e == ZE_MISS && amatch) - e = ZE_OK; - return e; -} - -int wild(w) -char *w; /* path/pattern to match */ -/* If not in exclude mode, expand the pattern based on the contents of the - file system. Return an error code in the ZE_ class. */ -{ - char *p; /* path */ - char *q; /* diskless path */ - int e; /* result */ - - if (volume_label == 1) { - volume_label = 2; - label = getVolumeLabel((w != NULL && w[1] == ':') ? to_up(w[0]) : '\0', - &label_time, &label_mode, &label_utim); - if (label != NULL) - (void)newname(label, 0, 0); - if (w == NULL || (w[1] == ':' && w[2] == '\0')) return ZE_OK; - /* "zip -$ foo a:" can be used to force drive name */ - } - /* special handling of stdin request */ - if (strcmp(w, "-") == 0) /* if compressing stdin */ - return newname(w, 0, 0); - - /* Allocate and copy pattern, leaving room to add "." if needed */ - if ((p = malloc(strlen(w) + 2)) == NULL) - return ZE_MEM; - strcpy(p, w); - - /* Normalize path delimiter as '/' */ - for (q = p; *q; q++) /* use / consistently */ - if (*q == '\\') - *q = '/'; - - /* Separate the disk part of the path */ - q = strchr(p, ':'); - if (q != NULL) { - if (strchr(++q, ':')) /* sanity check for safety of wild_recurse */ - return ZE_MISS; - } else - q = p; - - /* Normalize bare disk names */ - if (q > p && !*q) - strcpy(q, "."); - - /* Here we go */ - e = wild_recurse(p, q); - free((zvoid *)p); - return e; -} - -local int procname_dos(n, caseflag, attribs) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -unsigned attribs; /* file attributes, if available */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - ff_dir *d; /* control structure for FFIRST/FNEXT */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - int ff_status; /* return value of FFIRST/FNEXT */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (n == NULL) /* volume_label request in freshen|delete mode ?? */ - return ZE_OK; - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (*n == '\0') return ZE_MISS; - else if (attribs != MSDOS_INVALID_ATTR) - { - /* Avoid calling stat() for performance reasons when it is already known - (from a previous directory scan) that the passed name corresponds to - a "real existing" file. The only information needed further down in - this function is the distinction between directory entries and other - (typically normal file) entries. This distinction can be derived from - the file's attributes that the directory lookup has already provided - "for free". - */ - s.st_mode = ((attribs & MSDOS_DIR_ATTR) ? S_IFDIR : S_IFREG); - } - else if (LSSTAT(n, &s) -#ifdef __TURBOC__ - /* For this compiler, stat() succeeds on wild card names! */ - || isshexp(n) -#endif - ) - { - /* Not a file or directory--search for shell expression in zip file */ - if (caseflag) { - p = malloc(strlen(n) + 1); - if (p != NULL) - strcpy(p, n); - } else - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (z->mark) z->dosflag = 1; /* force DOS attribs for incl. names */ - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - for (p = n; *p; p++) /* use / consistently */ - if (*p == '\\') - *p = '/'; - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0 || strcmp(n, "/.") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse) - { - if ((d = malloc(sizeof(ff_dir))) == NULL || - (m = initDirSearch(n, d)) == ZE_MEM) - { - if (d != NULL) - free((zvoid *)d); - free((zvoid *)p); - return ZE_MEM; - } - for (e = d->ff_name, ff_status = m; - ff_status == 0; - ff_status = FNEXT(d)) - { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - free((zvoid *)d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname_dos(a, caseflag, getDirEntryAttr(d))) - != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - free((zvoid *)d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -{ - return procname_dos(n, caseflag, MSDOS_INVALID_ATTR); -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - - dosflag = 1; - - /* Find starting point in name before doing malloc */ - /* Strip drive specification */ - t = *x && *(x + 1) == ':' ? x + 2 : x; - /* Strip "//host/share/" part of a UNC name */ - if ((!strncmp(x,"//",2) || !strncmp(x,"\\\\",2)) && - (x[2] != '\0' && x[2] != '/' && x[2] != '\\')) { - n = x + 2; - while (*n != '\0' && *n != '/' && *n != '\\') - n++; /* strip host name */ - if (*n != '\0') { - n++; - while (*n != '\0' && *n != '/' && *n != '\\') - n++; /* strip `share' name */ - } - if (*n != '\0') - t = n + 1; - } - /* Strip leading "/" to convert an absolute path into a relative path */ - while (*t == '/' || *t == '\\') - t++; - /* Skip leading "./" as well */ - while (*t == '.' && (t[1] == '/' || t[1] == '\\')) - t += 2; - - /* Make changes, if any, to the copied name (leave original intact) */ - for (n = t; *n; n++) - if (*n == '\\') - *n = '/'; - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (isdir == 42) return n; /* avoid warning on unused variable */ - - if (dosify) - msname(n); - else -#if defined(__DJGPP__) && __DJGPP__ >= 2 - if (_USE_LFN == 0) -#endif - strlwr(n); - if (pdosflag) - *pdosflag = dosflag; - return n; -} - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - - return x; -} - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ -#if defined(__TURBOC__) || defined(__GO32__) - int h; /* file handle */ - - if ((h = open(f, 0)) != -1) - { - setftime(h, (struct ftime *)(void *)&d); - close(h); - } -#else /* !__TURBOC__ && !__GO32__ */ - ztimbuf u; /* argument for utime() */ - - /* Convert DOS time to time_t format in u.actime and u.modtime */ - u.actime = u.modtime = dos2unixtime(d); - - /* Set updated and accessed times of f */ - utime(f, &u); -#endif /* ?(__TURBOC__ || __GO32__) */ -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - int isstdin = !strcmp(f, "-"); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (isstdin) { - if (fstat(fileno(stdin), &s) != 0) { - free(name); - error("fstat(stdin)"); - } - time((time_t *)&s.st_mtime); /* some fstat()s return time zero */ - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)GetFileMode(name)); -#if (S_IFREG != 0x8000) - /* kludge to work around non-standard S_IFREG flag used in DJGPP V2.x */ - if ((s.st_mode & S_IFMT) == S_IFREG) *a |= 0x80000000L; -#endif - } - free(name); - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - return unix2dostime((time_t *)&s.st_mtime); -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - */ -{ - return rmdir(d); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ -{ -#ifdef USE_EF_UT_TIME -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) return ZE_OK; /* skip silently if no valid TZ info */ -#endif - - if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(1))) == NULL) - return ZE_MEM; - - z->extra[0] = 'U'; - z->extra[1] = 'T'; - z->extra[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - z->extra[3] = 0; - z->extra[4] = EB_UT_FL_MTIME; - z->extra[5] = (char)(z_utim->mtime); - z->extra[6] = (char)(z_utim->mtime >> 8); - z->extra[7] = (char)(z_utim->mtime >> 16); - z->extra[8] = (char)(z_utim->mtime >> 24); - - z->cext = z->ext = (EB_HEADSIZE+EB_UT_LEN(1)); - z->cextra = z->extra; - - return ZE_OK; -#else /* !USE_EF_UT_TIME */ - return (int)(z-z); -#endif /* ?USE_EF_UT_TIME */ -} - - -#ifdef MY_ZCALLOC /* Special zcalloc function for MEMORY16 (MSDOS/OS2) */ - -#if defined(__TURBOC__) && !defined(OS2) -/* Small and medium model are for now limited to near allocation with - * reduced MAX_WBITS and MAX_MEM_LEVEL - */ - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - zvoid far *org_ptr; - zvoid far *new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -zvoid far *zcalloc (unsigned items, unsigned size) -{ - zvoid far *buf; - ulg bsize = (ulg)items*size; - - if (bsize < (65536L-16L)) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-NULL) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -zvoid zcfree (zvoid far *ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = next_ptr - 1; n >= 0; n--) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ziperr(ZE_MEM, "zcfree: ptr not found"); -} -#endif /* __TURBOC__ */ - -#if defined(MSC) || defined(__WATCOMC__) -#if (!defined(_MSC_VER) || (_MSC_VER < 700)) -# define _halloc halloc -# define _hfree hfree -#endif - -zvoid far *zcalloc (unsigned items, unsigned size) -{ - return (zvoid far *)_halloc((long)items, size); -} - -zvoid zcfree (zvoid far *ptr) -{ - _hfree((void huge *)ptr); -} -#endif /* MSC || __WATCOMC__ */ - -#endif /* MY_ZCALLOC */ - -#if (defined(__WATCOMC__) && defined(ASMV) && !defined(__386__)) -/* This is a hack to connect "call _exit" in match.asm to exit() */ -#pragma aux xit "_exit" parm caller [] -void xit(void) -{ - exit(20); -} -#endif - -local int is_running_on_windows(void) -{ - char * var = getenv("OS"); - - /* if the OS env.var says 'Windows_NT' then */ - /* we're likely running on a variant of WinNT */ - - if ((NULL != var) && (0 == strcmp("Windows_NT", var))) - { - return 1; - } - - /* if the windir env.var is non-null then */ - /* we're likely running on a variant of Win9x */ - /* DOS mode of Win9x doesn't define windir, only winbootdir */ - /* NT's command.com can't see lowercase env. vars */ - - var = getenv("windir"); - if ((NULL != var) && (0 != var[0])) - { - return 1; - } - - return 0; -} - -void check_for_windows(char *app) -{ - /* Print a warning for users running under Windows */ - /* to reduce bug reports due to running DOS version */ - /* under Windows, when Windows version usually works correctly */ - - /* This is only called from the DOS version */ - - if (is_running_on_windows()) - { - printf("\nzip warning: You are running MSDOS %s on Windows.\n" - "Try the Windows version before reporting any problems.\n", - app); - } -} - -#endif /* !UTIL */ - - -#ifndef WINDLL -/******************************/ -/* Function version_local() */ -/******************************/ - -static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s.\n\n"; - /* At module level to keep Turbo C++ 1.0 happy !! */ - -void version_local() -{ -#if defined(__DJGPP__) || defined(__WATCOMC__) || \ - (defined(_MSC_VER) && (_MSC_VER != 800)) - char buf[80]; -#endif - -/* Define the compiler name and version strings */ -#if defined(__GNUC__) -# if defined(__DJGPP__) - sprintf(buf, "djgpp v%d.%02d / gcc ", __DJGPP__, __DJGPP_MINOR__); -# define COMPILER_NAME1 buf -# elif defined(__GO32__) /* __GO32__ is defined as "1" only (sigh) */ -# define COMPILER_NAME1 "djgpp v1.x / gcc " -# elif defined(__EMX__) /* ...so is __EMX__ (double sigh) */ -# define COMPILER_NAME1 "emx+gcc " -# else -# define COMPILER_NAME1 "gcc " -# endif -# define COMPILER_NAME2 __VERSION__ -#elif defined(__WATCOMC__) -# if (__WATCOMC__ % 10 > 0) -/* We do this silly test because __WATCOMC__ gives two digits for the */ -/* minor version, but Watcom packaging prefers to show only one digit. */ - sprintf(buf, "Watcom C/C++ %d.%02d", __WATCOMC__ / 100, - __WATCOMC__ % 100); -# else - sprintf(buf, "Watcom C/C++ %d.%d", __WATCOMC__ / 100, - (__WATCOMC__ % 100) / 10); -# endif -# define COMPILER_NAME1 buf -# define COMPILER_NAME2 "" -#elif defined(__TURBOC__) -# ifdef __BORLANDC__ -# define COMPILER_NAME1 "Borland C++" -# if (__BORLANDC__ < 0x0200) -# define COMPILER_NAME2 " 1.0" -# elif (__BORLANDC__ == 0x0200) /* James: __TURBOC__ = 0x0297 */ -# define COMPILER_NAME2 " 2.0" -# elif (__BORLANDC__ == 0x0400) -# define COMPILER_NAME2 " 3.0" -# elif (__BORLANDC__ == 0x0410) /* __BCPLUSPLUS__ = 0x0310 */ -# define COMPILER_NAME2 " 3.1" -# elif (__BORLANDC__ == 0x0452) /* __BCPLUSPLUS__ = 0x0320 */ -# define COMPILER_NAME2 " 4.0 or 4.02" -# elif (__BORLANDC__ == 0x0460) /* __BCPLUSPLUS__ = 0x0340 */ -# define COMPILER_NAME2 " 4.5" -# elif (__BORLANDC__ == 0x0500) /* __TURBOC__ = 0x0500 */ -# define COMPILER_NAME2 " 5.0" -# else -# define COMPILER_NAME2 " later than 5.0" -# endif -# else -# define COMPILER_NAME1 "Turbo C" -# if (__TURBOC__ > 0x0401) -# define COMPILER_NAME2 "++ later than 3.0" -# elif (__TURBOC__ == 0x0401) /* Kevin: 3.0 -> 0x0401 */ -# define COMPILER_NAME2 "++ 3.0" -# elif (__TURBOC__ == 0x0296) /* [662] checked by SPC */ -# define COMPILER_NAME2 "++ 1.01" -# elif (__TURBOC__ == 0x0295) /* [661] vfy'd by Kevin */ -# define COMPILER_NAME2 "++ 1.0" -# elif (__TURBOC__ == 0x0201) /* Brian: 2.01 -> 0x0201 */ -# define COMPILER_NAME2 " 2.01" -# elif ((__TURBOC__ >= 0x018d) && (__TURBOC__ <= 0x0200)) /* James: 0x0200 */ -# define COMPILER_NAME2 " 2.0" -# elif (__TURBOC__ > 0x0100) -# define COMPILER_NAME2 " 1.5" /* James: 0x0105? */ -# else -# define COMPILER_NAME2 " 1.0" /* James: 0x0100 */ -# endif -# endif -#elif defined(MSC) -# if defined(_QC) && !defined(_MSC_VER) -# define COMPILER_NAME1 "Microsoft Quick C" -# define COMPILER_NAME2 "" /* _QC is defined as 1 */ -# else -# define COMPILER_NAME1 "Microsoft C " -# ifdef _MSC_VER -# if (_MSC_VER == 800) -# define COMPILER_NAME2 "8.0/8.0c (Visual C++ 1.0/1.5)" -# else -# define COMPILER_NAME2 \ - (sprintf(buf, "%d.%02d", _MSC_VER/100, _MSC_VER%100), buf) -# endif -# else -# define COMPILER_NAME2 "5.1 or earlier" -# endif -# endif -#else -# define COMPILER_NAME1 "unknown compiler" -# define COMPILER_NAME2 "" -#endif - -/* Define the OS name and memory environment strings */ -#if defined(__WATCOMC__) || defined(__TURBOC__) || defined(MSC) || \ - defined(__GNUC__) -# define OS_NAME1 "\nMS-DOS" -#else -# define OS_NAME1 "MS-DOS" -#endif - -#if (defined(__GNUC__) || (defined(__WATCOMC__) && defined(__386__))) -# define OS_NAME2 " (32-bit)" -#elif defined(M_I86HM) || defined(__HUGE__) -# define OS_NAME2 " (16-bit, huge)" -#elif defined(M_I86LM) || defined(__LARGE__) -# define OS_NAME2 " (16-bit, large)" -#elif defined(M_I86MM) || defined(__MEDIUM__) -# define OS_NAME2 " (16-bit, medium)" -#elif defined(M_I86CM) || defined(__COMPACT__) -# define OS_NAME2 " (16-bit, compact)" -#elif defined(M_I86SM) || defined(__SMALL__) -# define OS_NAME2 " (16-bit, small)" -#elif defined(M_I86TM) || defined(__TINY__) -# define OS_NAME2 " (16-bit, tiny)" -#else -# define OS_NAME2 " (16-bit)" -#endif - -/* Define the compile date string */ -#ifdef __DATE__ -# define COMPILE_DATE " on " __DATE__ -#else -# define COMPILE_DATE "" -#endif - - printf(CompiledWith, COMPILER_NAME1, COMPILER_NAME2, - OS_NAME1, OS_NAME2, COMPILE_DATE); - -} /* end function version_local() */ -#endif /* !WINDLL */ - - -#if 0 /* inserted here for future use (clearing of archive bits) */ -#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) - -#include -int volatile _doserrno; - -unsigned _dos_setfileattr(char *name, unsigned attr) -{ -#if 0 /* stripping of trailing '/' is not needed for zip-internal use */ - unsigned namlen = strlen(name); - char *i_name = alloca(namlen + 1); - - strcpy(i_name, name); - if (namlen > 1 && i_name[namlen-1] == '/' && i_name[namlen-2] != ':') - i_name[namlen-1] = '\0'; - asm("movl %0, %%edx": : "g" (i_name)); -#else - asm("movl %0, %%edx": : "g" (name)); -#endif - asm("movl %0, %%ecx": : "g" (attr)); - asm("movl $0x4301, %eax"); - asm("int $0x21": : : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"); - _doserrno = 0; - asm("jnc 1f"); - asm("movl %%eax, %0": "=m" (_doserrno)); - switch (_doserrno) { - case 2: - case 3: - errno = ENOENT; - break; - case 5: - errno = EACCES; - break; - } - asm("1:"); - return (unsigned)_doserrno; -} - -#endif /* DJGPP v1.x */ -#endif /* never (not yet used) */ - - -#if (defined(__DJGPP__) && (__DJGPP__ >= 2)) - -/* Disable determination of "x" bit in st_mode field for [f]stat() calls. */ -int _is_executable (const char *path, int fhandle, const char *ext) -{ - return 0; -} - -/* Prevent globbing of filenames. This gives the same functionality as - * "stubedit globbing=no" did with DJGPP v1. - */ -#ifndef USE_DJGPP_GLOB -char **__crt0_glob_function(char *_arg) -{ - return NULL; -} -#endif - -/* Reduce the size of the executable and remove the functionality to read - * the program's environment from whatever $DJGPP points to. - */ -#if !defined(USE_DJGPP_ENV) || defined(UTIL) -void __crt0_load_environment_file(char *_app_name) -{ -} -#endif - -#endif /* __DJGPP__ >= 2 */ - - -#if defined(_MSC_VER) && _MSC_VER == 700 - -/* - * 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 - * 70 years' worth of seconds for localtime() wrapper function; - * (70*365 regular days + 17 leap days + 1 1899 day) * 86400 == - * (25550 + 17 + 1) * 86400 == 2209075200 seconds. - * Let time() and stat() return seconds since 1970 by using our own - * _dtoxtime() which is the routine that is called by these two functions. - */ - - -#ifdef UTIL -# include -#endif - -#ifndef UTIL -#undef localtime -struct tm *localtime(const time_t *); - -struct tm *msc7_localtime(const time_t *clock) -{ - time_t t = *clock; - - t += 2209075200L; - return localtime(&t); -} -#endif /* !UTIL */ - - -void __tzset(void); -int _isindst(struct tm *); - -extern int _days[]; - -/* 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) - -time_t _dtoxtime(year, month, mday, hour, min, sec) -int year, month, mday, year, hour, min, sec; -{ - struct tm tm; - time_t t; - int days; - - days = _days[month - 1] + mday; - year += 1980; - if (leap(year) && month > 2) - ++days; - tm.tm_yday = days; - tm.tm_mon = month - 1; - tm.tm_year = year - 1900; - tm.tm_hour = hour; - __tzset(); - days += 365 * (year - 1970) + nleap (year); - t = 86400L * days + 3600L * hour + 60 * min + sec + _timezone; - if (_daylight && _isindst(&tm)) - t -= 3600; - return t; -} - -#endif /* _MSC_VER && _MSC_VER == 700 */ - - -#ifdef __WATCOMC__ - -/* This papers over a bug in Watcom 10.6's standard library... sigh */ -/* Apparently it applies to both the DOS and Win32 stat()s. */ - -int stat_bandaid(const char *path, struct stat *buf) -{ - char newname[4]; - if (!stat(path, buf)) - return 0; - else if (!strcmp(path, ".") || (path[0] && !strcmp(path + 1, ":."))) { - strcpy(newname, path); - newname[strlen(path) - 1] = '\\'; /* stat(".") fails for root! */ - return stat(newname, buf); - } else - return -1; -} - -#endif diff --git a/third_party/infozip/zip/msdos/osdep.h b/third_party/infozip/zip/msdos/osdep.h deleted file mode 100644 index 0e0f23f65..000000000 --- a/third_party/infozip/zip/msdos/osdep.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - Copyright (c) 1990-2008 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2007-Mar-4 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 -*/ -/* The symbol DOS is used throughout the Zip source to identify code portions - * specific to the MSDOS port. - * Just to make sure, we check that it is set. - * (Currently, this should should not be neccessary, since currently it has - * to be set on the compiler command line to get this file read in.) - */ -#ifndef DOS -# define DOS -#endif - -/* The symbol MSDOS is consistently used in the generic source files - * to identify code to support for MSDOS (and MSDOS related) stuff. - * e.g: FAT or (FAT like) file systems, - * '\\' as directory separator in paths, - * "\r\n" as record (line) terminator in text files, ... - * - * IMPORTANT Note: - * This symbol is not unique for the MSDOS port !!!!!! - * It is also defined by ports to some other OS which are (to some extend) - * considered DOS compatible. - * Examples are: OS/2 (OS2), Windows NT and Windows 95 (WIN32). - * - */ -#ifndef MSDOS -# define MSDOS -#endif - -/* Power C is similar to Turbo C */ -#ifdef __POWERC -# define __TURBOC__ -#endif /* __POWERC */ - -/* Automatic setting of the common Microsoft C idenfifier MSC. - * NOTE: Watcom also defines M_I*86 ! - */ -#if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__)) -# ifndef MSC -# define MSC /* This should work for older MSC, too! */ -# endif -#endif - -#if !defined(__GO32__) && !defined(__EMX__) -# define NO_UNISTD_H -#endif - -#if defined(__WATCOMC__) && defined(__386__) -# define WATCOMC_386 -#endif - -#ifdef WINDLL -# define MSWIN -# define MEMORY16 -#endif - - -#if !defined(__EMX__) && !defined(__GO32__) && !defined(WATCOMC_386) -#if !defined(WINDLL) -# define MSDOS16 /* 16 bit MSDOS only */ -# define MEMORY16 -#endif -#endif - -#if !defined(NO_ASM) && !defined(ASMV) -# define ASMV -#endif - -/* enable creation of UTC time fields unless explicitely suppressed */ -#if !defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME) -# define USE_EF_UT_TIME -#endif - -/* check that TZ environment variable is defined before using UTC times */ -#if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ)) -# define IZ_CHECK_TZ -#endif - -#ifdef MEMORY16 -# ifndef NO_ASM -# define ASM_CRC 1 -# endif /* ?NO_ASM */ -# ifdef __TURBOC__ -# include -# if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) -# if defined(DYNAMIC_CRC_TABLE) && defined(DYNALLOC_CRCTAB) - error: No dynamic CRC table allocation with Borland C far data models. -# endif /* DYNAMIC_CRC_TABLE */ -# endif /* Turbo/Borland C far data memory models */ -# define nearmalloc malloc -# define nearfree free -# define DYN_ALLOC -# else /* !__TURBOC__ */ -# include -# define nearmalloc _nmalloc -# define nearfree _nfree -# define farmalloc _fmalloc -# define farfree _ffree -# endif /* ?__TURBOC__ */ -# define MY_ZCALLOC 1 -# ifdef SMALL_MEM -# define CBSZ 2048 -# define ZBSZ 2048 -# endif -# ifdef MEDIUM_MEM -# define CBSZ 4096 -# define ZBSZ 4096 -# endif -# ifndef CBSZ -# define CBSZ 8192 -# define ZBSZ 8192 -# endif -#endif /* MEMORY16 */ - - -/* Symbolic links are not supported, but some compilers may define S_IFLNK. */ -#ifndef NO_SYMLINKS -# define NO_SYMLINKS -#endif - -#ifdef MATCH -# undef MATCH -#endif -#define MATCH dosmatch /* use DOS style wildcard matching */ - -#define USE_CASE_MAP - -#define ROUNDED_TIME(time) (((time) + 1) & (~1)) -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#define FOPR "rb" -#define FOPM "r+b" -#define FOPW "wb" - -#include -#include -#include - -#ifdef ZCRYPT_INTERNAL -# ifdef WINDLL -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */ -# else -# ifndef __GO32__ -# include /* getpid() declaration for srand seed */ -# endif -# endif -#endif - -/* - * djgpp 1.x did not declare these - */ -#if defined(__GO32__) && !defined(__DJGPP__) -char *strlwr(char *); -int setmode(int, int); -#endif - -#ifdef __WATCOMC__ -# define NO_MKTEMP -# define HAS_OPENDIR -# define SSTAT stat_bandaid - int stat_bandaid(const char *path, struct stat *buf); - -/* Get asm routines to link properly without using "__cdecl": */ -# ifdef __386__ -# ifdef ASMV -# pragma aux match_init "_*" parm caller [] modify [] -# pragma aux longest_match "_*" parm caller [] value [eax] \ - modify [eax ecx edx] -# endif -# 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 */ -# else /* !__386__ */ -# ifdef ASMV -# pragma aux match_init "_*" parm caller [] loadds modify [ax bx] -# pragma aux longest_match "_*" parm caller [] loadds value [ax] \ - modify [ax bx cx dx es] -# endif /* ASMV */ -# ifndef USE_ZLIB -# pragma aux crc32 "_*" parm caller [] value [ax dx] \ - modify [ax bx cx dx es] -# pragma aux get_crc_table "_*" parm caller [] value [ax] \ - modify [ax bx cx dx] -# endif /* !USE_ZLIB */ -# endif /* ?__386__ */ -#endif /* __WATCOMC__ */ - -/* - * Wrapper function to get around the MSC7 00:00:00 31 Dec 1899 time base, - * see msdos.c for more info - */ - -#if defined(_MSC_VER) && _MSC_VER == 700 -# define localtime(t) msc7_localtime(t) -#endif - -#ifdef __TURBOC__ -# ifdef __FILEIO_C -# include /* supplies mktemp() prototype */ -# endif -#endif - -#if (defined(__TURBOC__) && !defined(__BORLANDC__) && __TURBOC__ <= 0x0201) -# ifndef NO_MKTIME -# define NO_MKTIME /* TC 2.01 and earlier do not supply mktime() */ -# endif -#endif - -void check_for_windows(char *app); diff --git a/third_party/infozip/zip/msdos/zipup.h b/third_party/infozip/zip/msdos/zipup.h deleted file mode 100644 index 78b428a03..000000000 --- a/third_party/infozip/zip/msdos/zipup.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow (O_RDONLY|O_BINARY) -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/novell/MAKEINIT b/third_party/infozip/zip/novell/MAKEINIT deleted file mode 100644 index f9929e7ad..000000000 --- a/third_party/infozip/zip/novell/MAKEINIT +++ /dev/null @@ -1,71 +0,0 @@ -# -# makeinit file for makefiles created with QMK386 -# -# Novell's NetWare SDK - Release 15 -# -# Directories for both the WATCOM and NOVELL tools -# -wat386loc = e:\watcom\ -nlm386loc = c:\novell\ndk\nwsdk\ -nlm386hdr = $(nlm386loc)INCLUDE\NLM;$(nlm386loc)INCLUDE;. -nlm386imp = $(nlm386loc)IMPORTS -nlm386lib = $(wat386loc)LIB386;$(wat386loc)LIB386\NETWARE -# -# Define this macro with your copyright statement -# -#copyright = (C) Copyright 199x NONAME, INC. All Rights Reserved -# -# Macros that point to various tools we'll need to compile -# -wcc386r = WCC386 # location of 386 real mode compiler -wcc386p = WCC386P # protected compiler (last avail on Watcom v9.5 -wcc386 = $(wcc386r) # version we want to use - -linkr = WLINK # location of real mode linker -linkp = WLINKP # protected linker (last avail on Watcom v9.5 -linker = $(linkr) # version we want to use -nlmlinkr = $(nlm386loc)TOOLS\NLMLINKR # location of real mode Novell linker -nlmlinkp = $(nlm386loc)TOOLS\NLMLINKX # location of protected Novell linker -nlmlinker = $(nlmlinkr) # version we want to use - -nlmpackr = $(nlm386loc)TOOLS\NLMPACK # location of real mode NLM compression utility -nlmpackp = $(nlm386loc)TOOLS\NLMPACKP # location of protected NLM compression utility -nlmpack = $(nlmpackr) # location of NLM compression utility - -inc_386 = $(nlm386hdr) -lib_386 = $(nlm386lib) -code_386 = $(wat386loc)BIN\386WCGL.EXE # code generator (last avail on Watcom v9.01 -librarian = $(wat386loc)BINB\WLIB # location of librarian -# -# NLM Import Files -# -startup = $(nlm386imp)\PRELUDE.OBJ # other option is nwpre.obj -allimp = $(nlm386imp)\ALL.IMP # import to include all imports -clibimp = $(nlm386imp)\CLIB.IMP # the clib import file -tliimp = $(nlm386imp)\TLI.IMP # the tli import file -aioimp = $(nlm386imp)\AIO.IMP # the aio import file -socklibimp = $(nlm386imp)\SOCKLIB.IMP # the socket import file -mathlibimp = $(nlm386imp)\MATHLIB.IMP # the math library import file -dsapiimp = $(nlm386imp)\DSAPI.IMP # the NDS import file -nutimp = $(nlm386imp)\NWSNUT.IMP # the NWSNUT import file -appleimp = $(nlm386imp)\APPLTLK.IMP # the AppleTalk import file -nitimp = $(nlm386imp)\NIT.IMP # the legacy NLM import file -nlmlibimp = $(nlm386imp)\NLMLIB.IMP # the NLM-specific import file -requesterimp = $(nlm386imp)\REQUESTR.IMP # the Requester import file -fpsmimp = $(nlm386imp)\FPSM.IMP # floating point support import file -threadsimp = $(nlm386imp)\THREADS.IMP # the threads import file -dseventimp = $(nlm386imp)\DSEVENT.IMP # DS Events import file -psrvimp = $(nlm386imp)\NWPSRV.IMP # print services import file -psrv3ximp = $(nlm386imp)\NWPSRV3X.IMP # 3.x print services import file -streamsimp = $(nlm386imp)\STREAMS.IMP # streams import file -unicodeimp = $(nlm386imp)\UNICODE.IMP # unicode import file -agentimp = $(nlm386imp)\agent.imp # SNMP Agent import file -smileimp = $(nlm386imp)\smile.imp # SMILE (SNMP) import file -# -# Cross-platform Import Files -# -audnlm32imp = $(nlm386imp)\AUDNLM32.IMP # auditing import file -calnlm32imp = $(nlm386imp)\CALNLM32.IMP # NWCALLS import file -clxnlm32imp = $(nlm386imp)\CLXNLM32.IMP # NWCLIENT import file -locnlm32imp = $(nlm386imp)\LOCNLM32.IMP # NWLOCALE import file -netnlm32imp = $(nlm386imp)\NETNLM32.IMP # NWNET import file diff --git a/third_party/infozip/zip/novell/Makefile b/third_party/infozip/zip/novell/Makefile deleted file mode 100644 index c88bf8675..000000000 --- a/third_party/infozip/zip/novell/Makefile +++ /dev/null @@ -1,142 +0,0 @@ -# -# This makefile was generated by QMK386 v2.14 -# -# Program: unzip.NLM -# This makefile rebuilds the zip NetWare Loadable Module -# -# Created: Sun Jan 03 03:54:03 1999 -# -# MAKEINIT defines many of the macros used herein -# The following macros can be set via your environment: -# CCF386 : Set compile options -# QMKVER : Set to 'd' or 'p' to define VERSION -# SILENT : If defined, .SILENT will be set -# -# The following macros are defined for your program: -# vMAJ : Major version number -# vMIN : Minor version number -# vREV : Revision number - -!ifdef %SILENT -.silent -!endif - -program = zip - -pvmaj = 1 # major version number -pvmin = 00 # minor version number -pvrev = 3 # revision number e.g. 0,1,2, ... - -!ifndef %qmkver -! define version p # use 'd' or 'p' here -!else -! define version $(%qmkver) -!endif -!ifeq version d -! define lversion DEBUG -! define debug /dDEBUG -!else -! define lversion PRODUCTION -! define debug -!endif - -nlm_TYPE = Form Novell NLM '$(program)' -nlm_NAME = Name $^& -nlm_SCREEN = Op ScreenName '$(program)' -nlm_THREAD = Op ThreadName '$^&__P ' -nlm_STACK = Op Stack = 8k -nlm_NLMVER = Op Version = $(pvmaj).$(pvmin).$(pvrev) -nlm_COPYRIGHT = Op Copyright '$(copyright)' -linkop = $+$(linkop)$- Caseexact -linkop = $+$(linkop)$- Nod -!ifeq version d -! define linkop $+$(linkop)$- Map -! define linkop $+$(linkop)$- Verbose -! define ldebug debug all debug novell -!endif - -objlst = BITS.OBJ -objlst = $+$(objlst)$- CRC32.OBJ -objlst = $+$(objlst)$- CRYPT.OBJ -objlst = $+$(objlst)$- DEFLATE.OBJ -objlst = $+$(objlst)$- FILEIO.OBJ -objlst = $+$(objlst)$- GLOBALS.OBJ -objlst = $+$(objlst)$- MKTIME.OBJ -objlst = $+$(objlst)$- NETWARE.OBJ -objlst = $+$(objlst)$- SIGNAL.OBJ -objlst = $+$(objlst)$- TREES.OBJ -objlst = $+$(objlst)$- TTYIO.OBJ -objlst = $+$(objlst)$- UTIL.OBJ -objlst = $+$(objlst)$- ZIP.OBJ -objlst = $+$(objlst)$- ZIPFILE.OBJ -objlst = $+$(objlst)$- ZIPUP.OBJ -objlst = $+$(objlst)$- $(startup) - -import = $(allimp) - -module = CLib - -build_msg = Building a $(lversion) version of $(program) - -pgm_ver = /dvMAJ="$(pvmaj)" /dvMIN="$(pvmin)" /dvREV="$(pvrev)" - -!ifndef %ccf386 -! define d_wcc386opt /ms /w4 /e99 /zp1 /3s /ot /d2 /dN_PLAT_NLM /d_FIND_OLD_HEADERS -dNO_ASM -dNLM $(debug) -! define p_wcc386opt /ms /w4 /s /zp1 /3s /oaxt /dN_PLAT_NLM /d_FIND_OLD_HEADERS -dNO_ASM -dNLM -! define x_wcc386opt $($(version)_wcc386opt) $(pgm_ver) -!else -! define x_wcc386opt $(%ccf386) -!endif - -compiler_cmd = $(wcc386) $(x_wcc386opt) $[*.c - -.BEFORE - echo $(build_msg) - set inc386=$(inc_386) - set lib386=$(lib_386) - set wcg386=$(code_386) - -.c.obj: - $(compiler_cmd) - -zip.nlm : $(objlst) zip.LNK - $(linker) @zip - -zip.LNK : MAKEFILE - if exist $^&.LNK del $^&.LNK - %append $^&.LNK $(nlm_TYPE) - %append $^&.LNK $(nlm_NAME) - %append $^&.LNK $(nlm_SCREEN) - %append $^&.LNK $(nlm_THREAD) - %append $^&.LNK $(nlm_STACK) - %append $^&.LNK $(nlm_NLMVER) -!ifdef copyright - %append $^&.LNK $(nlm_COPYRIGHT) -!endif -!ifdef ldebug - %append $^&.LNK $(ldebug) -!endif - for %i in ($(linkop)) do %append $^&.LNK Op %i - for %i in ($(objlst)) do %append $^&.LNK File %i - for %i in ($(import)) do %append $^&.LNK Import @%i - for %i in ($(export)) do %append $^&.LNK Export @%i - for %i in ($(module)) do %append $^&.LNK Module %i - for %i in ($(library)) do %append $^&.LNK Library %i - -clean : .symbolic - del *.MAP - del *.OBJ - del *.ERR - del *.LNK - del *.NLM - -zip : .symbolic - -pkzip -u zip MAKEFILE *.c *.h - -unzip : .symbolic - -pkunzip -n -d zip - -save : .symbolic - %make zip - %make clean - diff --git a/third_party/infozip/zip/novell/Netware.c b/third_party/infozip/zip/novell/Netware.c deleted file mode 100644 index 20efa1668..000000000 --- a/third_party/infozip/zip/novell/Netware.c +++ /dev/null @@ -1,970 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern void UseAccurateCaseForPaths(int); - -#include "zip.h" - - /*------------------------------------------------------------------ - ** Global Variables - */ - -#define skipspace( x ) while( isspace( *x ) ) ++x -#define nextspace( x ) while( *x && !isspace( *x ) ) ++x -#define CWS 0 -#define CWV 1 -#define CWP 2 -#define ALL 99 - -/* Globals */ -extern char *GetWorkArea(void); -extern char *next_arg(char *); -extern int NLM_exiting; -char fid[100]; -static breakkey = FALSE; - -#define MATCH shmatch - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -#define PAD 0 -#define PATH_END '/' - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -void findzip(char *s) -{ - dowhereis(s); -} - -void dowhereis(char *s) -{ - char dir[_MAX_PATH]; - char fsv[_MAX_SERVER+_MAX_VOLUME+1]; - char fdir[_MAX_PATH]; - char fname[_MAX_FNAME],fext[_MAX_EXT], both[_MAX_FNAME+_MAX_EXT]; - char *p = next_arg(s); /* point at argument */ - - if(!*p) - { - printf("No filename specified!"); - return; - } - - //setlocale (LC_ALL, "NORWAY"); - NWLsetlocale (LC_ALL, "NORWAY"); - - strcpy(dir,GetWorkArea()); - - /* get the file name specification */ - _splitpath(p,fsv,fdir,fname,fext); - - //printf ("p %s, fsv %s, fdir %s, fname %s, fext %s\n", p,fsv,fdir,fname,fext); - //getch(); - - sprintf(both,"%s%s",strupr(fname),strupr(fext)); - - breakkey = FALSE; - - /* startup the recursive file find operation */ - chdir(fsv); - UseAccurateCaseForPaths(1); - SetCurrentNameSpace (NW_NS_LONG); - chdir(fdir); - findit(both); -} - -char *GetWorkArea(void) -{ - static char cwd[_MAX_PATH]; - static char serverName[_MAX_SERVER]; - static char volumeName[_MAX_VOLUME + 1]; - static char dirName[_MAX_DIR]; - - if(getcwd(cwd,_MAX_PATH) == NULL) - return NULL; - - ParsePath(cwd,serverName,volumeName,dirName); /* shouldn't fail! */ - - return cwd; -} - -char *next_arg(char *s) -{ - char *p; - - skipspace(s); /* ignore white */ - p = s; - nextspace(s); /* find next blank */ - *s = NULL; - return(p); -} - -static void findit(char *what) -{ - char dir[_MAX_PATH]; - char zipdir[_MAX_PATH]; - char szzipfile[_MAX_PATH]; - char *psz; - DIR *dirStructPtr; - DIR *dirStructPtrSave; - int r; - - getcwd(dir,_MAX_PATH); - - psz = dir; - - while (*psz) - { - if (*psz == ':') - { - strcpy (zipdir, psz + 1); - break; - } - psz++; - } - - dirStructPtrSave = dirStructPtr = opendir(what); - - /* - _A_NORMAL Normal file; read/write permitted - _A_RDONLY Read-only file - _A_HIDDEN Hidden file - _A_SYSTEM System file - _A_VOLID Volume ID entry - _A_SUBDIR Subdirectory - _A_ARCH Archive file - */ - - if (hidden_files) - SetReaddirAttribute (dirStructPtr, _A_NORMAL | _A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH); - else - SetReaddirAttribute (dirStructPtr, _A_NORMAL | _A_ARCH); - - //while(dirStructPtr && !breakkey) - while(dirStructPtr && !NLM_exiting) - { - //printf ("\n NLM_exiting test Line 167.... \n"); - - dirStructPtr = readdir(dirStructPtr); - if((dirStructPtr == NULL) || (dirStructPtr == -1)) - break; - - /* Filen er funnet */ - if(dirStructPtr->d_attr & _A_SUBDIR) - continue; - - strcpy (szzipfile, zipdir); - strcat (szzipfile, "/"); - strcat (szzipfile, dirStructPtr->d_name); - procnamehho (szzipfile); - - //ThreadSwitchWithDelay(); - - //if(kbhit() && getch() == 3) - // printf("^C\n",breakkey = TRUE); - } - - if(dirStructPtrSave) - closedir(dirStructPtrSave); - - if (!recurse) - return; - - /* Now traverse the directories in this path */ - - dirStructPtrSave = dirStructPtr = opendir("*.*"); - if(dirStructPtr == NULL) - return; - - if (hidden_files) - SetReaddirAttribute (dirStructPtr, _A_NORMAL | _A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_ARCH | _A_SUBDIR); - else - SetReaddirAttribute (dirStructPtr, _A_NORMAL | _A_ARCH | _A_SUBDIR); - - //ThreadSwitchWithDelay(); - - while(!NLM_exiting) - { - //printf ("\n NLM_exiting test Line 204.... \n"); getch (); - - dirStructPtr = readdir(dirStructPtr); - if((dirStructPtr == NULL) || (dirStructPtr == -1)) - break; - - if(dirStructPtr->d_attr & _A_SUBDIR) - { - strcpy (szzipfile, zipdir); - strcat (szzipfile, "/"); - strcat (szzipfile, dirStructPtr->d_name); - procnamehho (szzipfile); - - chdir(dirStructPtr->d_name); - findit(what); - chdir(".."); - } - - //if(kbhit() && getch() == 3) - // printf("^C\n",breakkey = TRUE); - } - - if(dirStructPtrSave) - closedir(dirStructPtrSave); -} - - -int wild(w) -char *w; /* path/pattern to match */ -/* If not in exclude mode, expand the pattern based on the contents of the - file system. Return an error code in the ZE_ class. */ -{ - DIR *d; /* stream for reading directory */ - char *e; /* name found in directory */ - int r; /* temporary variable */ - char *n; /* constructed name from directory */ - int f; /* true if there was a match */ - char *a; /* alloc'ed space for name */ - //char *p; /* path */ - char *q; /* name */ - char v[5]; /* space for device current directory */ - - - char dir[_MAX_PATH]; - char fsv[_MAX_SERVER+_MAX_VOLUME+1]; - char fdir[_MAX_PATH]; - char fname[_MAX_FNAME],fext[_MAX_EXT], both[_MAX_FNAME+_MAX_EXT]; - char *p; /* point at argument */ - - p = w; - - - /* Test HHO */ - findzip(p); - - return ZE_OK; - - - strcpy(dir,GetWorkArea()); - - /* get the file name specification */ - - _splitpath(p,fsv,fdir,fname,fext); - sprintf(both,"%s%s",strupr(fname),strupr(fext)); - - /* startup the recursive file find operation */ - - chdir(fsv); - - /* Search that level for matching names */ - if ((d = opendir(both)) == NULL) - { - free((zvoid *)a); - return ZE_MISS; - } - - f = 0; - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..") && MATCH(q, e)) - { - f = 1; - if (strcmp(p, ".") == 0) { /* path is . */ - r = procname(e); /* name is name */ - if (r) { - f = 0; - break; - } - } else - { - if ((n = malloc(strlen(p) + strlen(e) + 2)) == NULL) - { - free((zvoid *)a); - closedir(d); - return ZE_MEM; - } - n = strcpy(n, p); - if (n[r = strlen(n) - 1] != '/' && n[r] != ':') - strcat(n, "/"); - r = procname(strcat(n, e)); /* name is path/name */ - free((zvoid *)n); - if (r) { - f = 0; - break; - } - } - } - } - closedir(d); - - /* Done */ - free((zvoid *)a); - return f ? ZE_OK : ZE_MISS; -} - -int procnamehho (char *n) -{ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - char *a; - - if (n == NULL) /* volume_label request in freshen|delete mode ?? */ - return ZE_OK; - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0); - else if (stat(n, &s) -#if defined(__TURBOC__) || defined(__WATCOMC__) - /* For these 2 compilers, stat() succeeds on wild card names! */ - || isshexp(n) -#endif - ) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname)) - { - z->mark = pcount ? filter(z->zname) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - for (p = n; *p; p++) /* use / consistently */ - if (*p == '\\') - *p = '/'; - - //printf ("\nHHO %s\n", n); - if ((s.st_mode & S_IFDIR) == 0) - { - //printf ("\nHHO1 %s\n", n); - /* add or remove name of file */ - //printf ("\nAdding name %s to list.\n", n); - if ((m = newname(n, 0)) != ZE_OK) - return m; - } else { - - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0 || strcmp(n, "/.") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - //if (dirnames && (m = newname(p, 1)) != ZE_OK) { - if ((m = newname(p, 1)) != ZE_OK) { - free((zvoid *)p); - return m; - } - free ((zvoid *)p); - } - - return ZE_OK; - } - return ZE_OK; -} - -int procname(n) -char *n; /* name to process */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (n == NULL) /* volume_label request in freshen|delete mode ?? */ - return ZE_OK; - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0); - else if (stat(n, &s) -#if defined(__TURBOC__) || defined(__WATCOMC__) - /* For these 2 compilers, stat() succeeds on wild card names! */ - || isshexp(n) -#endif - ) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname)) - { - z->mark = pcount ? filter(z->zname) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - for (p = n; *p; p++) /* use / consistently */ - if (*p == '\\') - *p = '/'; - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0 || strcmp(n, "/.") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *szRelativParameter; -char szRelativ[512]; -int iRelativOK = FALSE; -int iRelativPakking = FALSE; - -int fixRelativpath () -{ - char *szp; - - szp = szRelativParameter; - - if (szRelativParameter[0] == '/' || szRelativParameter[0] == '\\') - szp++; - - while (*szp) { - if (*szp == '\\') - *szp = '/'; - szp++; - } - - szp = szRelativParameter; - if (szRelativParameter[0] == '/') - szp++; - - strcpy (szRelativ, szp); - - if (strlen(szp) == 0) { - szRelativ[0] = '\0'; - return FALSE; - } - return TRUE; -} - - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - char *sztUpper; - - - /* Find starting point in name before doing malloc */ - t = *x && *(x + 1) == ':' ? x + 2 : x; - while (*t == '/' || *t == '\\') - t++; - - /* Make changes, if any, to the copied name (leave original intact) */ - for (n = t; *n; n++) - if (*n == '\\') - *n = '/'; - - if (iRelativPakking) { - //printf ("\n LINE 516 *ex2ex Internt navn %s external name %s.\n", t, x); getch (); - if (!iRelativOK) { - if (!fixRelativpath()) { - iRelativOK = FALSE; - iRelativPakking = FALSE; - } - else { - sztUpper = malloc (strlen(t) + 10); - strcpy (sztUpper, t); - NWLstrupr (sztUpper); - NWLstrupr (szRelativ); - if (strncmp (sztUpper, szRelativ, strlen(szRelativ)) == 0) { - t = t + strlen(szRelativ); - iRelativPakking = TRUE; - iRelativOK = TRUE; - } - else { - iRelativOK = FALSE; - iRelativPakking = FALSE; - } - free (sztUpper); - } - } - else - { - t = t + strlen(szRelativ); - } - } - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - - //if ( !IsFileNameValid(x) ) - //ChangeNameForFAT(x); - - //printf ("\n *in2ex Internt navn %s external name %s.\n", n, x); getch (); - - return x; -} - - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - //SetFileTime(f, d); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - /* convert FNMAX to malloc - 11/8/04 EG */ - char *name; - int len = strlen(f); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - if (strcmp(f, "-") == 0) { - if (fstat(fileno(stdin), &s) != 0) - error("fstat(stdin)"); - } - else if (stat(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - free(name); - - if (a != NULL) { - *a = s.st_attr; // << 16) | !(s.st_mode & S_IWRITE); - //*a = ((ulg)s.st_mode << 16) | !(s.st_mode & S_IWRITE); - //if ((s.st_mode & S_IFMT) == S_IFDIR) { - //*a |= MSDOS_DIR_ATTR; - //} - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; - - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = t->mtime; /* best guess, (s.st_ctime: last status change!!) */ - } - return unix2dostime(&s.st_mtime); -} - - -ulg filetimeHHO(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - char *name; - int len = strlen(f), isstdin = !strcmp(f, "-"); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetimeHHO"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (isstdin) { - /* it is common for some PC based compilers to - fail with fstat() on devices or pipes */ - if (fstat(fileno(stdin), &s) != 0) { - s.st_mode = S_IFREG; s.st_size = -1L; - } - time(&s.st_ctime); - s.st_atime = s.st_mtime = s.st_ctime; - } else if (stat(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - - if (a != NULL) { - //*a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)GetFileMode(name)); - //*a = (ulg)s.st_mode; - *a = s.st_attr; - } - - printf ("\nDette er en test LINE : 721 \n"); getch(); - - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; -#ifdef __WATCOMC__ - /* of course, Watcom always has to make an exception */ - if (s.st_atime == 312764400) - s.st_atime = s.st_mtime; - if (s.st_ctime == 312764400) - s.st_ctime = s.st_mtime; -#endif - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - printf ("\nDette er en test LINE : 735 \n"); getch(); - - //return GetFileTime(name); - free(name); - return t->atime; -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - */ -{ - return rmdir(d); -} - -int set_extra_field(z, z_utim) - struct zlist far *z; - iztimes *z_utim; - /* create extra field and change z->att if desired */ -{ -#ifdef USE_EF_UT_TIME - if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UT_LEN(1))) == NULL) - return ZE_MEM; - - z->extra[0] = 'U'; - z->extra[1] = 'T'; - z->extra[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - z->extra[3] = 0; - z->extra[4] = EB_UT_FL_MTIME; - z->extra[5] = (char)(z_utim->mtime); - z->extra[6] = (char)(z_utim->mtime >> 8); - z->extra[7] = (char)(z_utim->mtime >> 16); - z->extra[8] = (char)(z_utim->mtime >> 24); - - z->cext = z->ext = (EB_HEADSIZE+EB_UT_LEN(1)); - z->cextra = z->extra; - - return ZE_OK; -#else /* !USE_EF_UT_TIME */ - return (int)(z-z); -#endif /* ?USE_EF_UT_TIME */ -} - - -/******************************/ -/* Function version_local() */ -/******************************/ - -static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; - /* At module level to keep Turbo C++ 1.0 happy !! */ - -void version_local() -{ -#if defined(__DJGPP__) || defined(__WATCOMC__) || \ - (defined(_MSC_VER) && (_MSC_VER != 800)) - char buf[80]; -#endif - - printf(CompiledWith, - -#ifdef __GNUC__ -# if defined(__DJGPP__) - (sprintf(buf, "djgpp v%d / gcc ", __DJGPP__), buf), -# elif defined(__GO32__) - "djgpp v1.x / gcc ", -# elif defined(__EMX__) /* ...so is __EMX__ (double sigh) */ - "emx+gcc ", -# else - "gcc ", -# endif - __VERSION__, -#elif defined(__WATCOMC__) -# if (__WATCOMC__ % 10 > 0) -/* We do this silly test because __WATCOMC__ gives two digits for the */ -/* minor version, but Watcom packaging prefers to show only one digit. */ - (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(__TURBOC__) -# ifdef __BORLANDC__ - "Borland C++", -# if (__BORLANDC__ < 0x0200) - " 1.0", -# elif (__BORLANDC__ == 0x0200) /* James: __TURBOC__ = 0x0297 */ - " 2.0", -# elif (__BORLANDC__ == 0x0400) - " 3.0", -# elif (__BORLANDC__ == 0x0410) /* __BCPLUSPLUS__ = 0x0310 */ - " 3.1", -# elif (__BORLANDC__ == 0x0452) /* __BCPLUSPLUS__ = 0x0320 */ - " 4.0 or 4.02", -# elif (__BORLANDC__ == 0x0460) /* __BCPLUSPLUS__ = 0x0340 */ - " 4.5", -# elif (__BORLANDC__ == 0x0500) /* __TURBOC__ = 0x0500 */ - " 5.0", -# else - " later than 5.0", -# endif -# else - "Turbo C", -# if (__TURBOC__ > 0x0401) - "++ later than 3.0" -# elif (__TURBOC__ == 0x0401) /* Kevin: 3.0 -> 0x0401 */ - "++ 3.0", -# elif (__TURBOC__ == 0x0295) /* [661] vfy'd by Kevin */ - "++ 1.0", -# elif ((__TURBOC__ >= 0x018d) && (__TURBOC__ <= 0x0200)) /* James: 0x0200 */ - " 2.0", -# elif (__TURBOC__ > 0x0100) - " 1.5", /* James: 0x0105? */ -# else - " 1.0", /* James: 0x0100 */ -# endif -# endif -#elif defined(MSC) - "Microsoft C ", -# ifdef _MSC_VER -# if (_MSC_VER == 800) - "(Visual C++ v1.1)", -# elif (_MSC_VER == 850) - "(Windows NT v3.5 SDK)", -# elif (_MSC_VER == 900) - "(Visual C++ v2.0/v2.1)", -# elif (_MSC_VER > 900) - (sprintf(buf2, "(Visual C++ v%d.%d)", _MSC_VER/100 - 6, - _MSC_VER%100/10), buf2), -# else - (sprintf(buf, "%d.%02d", _MSC_VER/100, _MSC_VER%100), buf), -# endif -# else - "5.1 or earlier", -# endif -#else - "unknown compiler", "", -#endif - - "MS-DOS", - -#if (defined(__GNUC__) || (defined(__WATCOMC__) && defined(__386__))) - " (32-bit)", -#elif defined(M_I86HM) || defined(__HUGE__) - " (16-bit, huge)", -#elif defined(M_I86LM) || defined(__LARGE__) - " (16-bit, large)", -#elif defined(M_I86MM) || defined(__MEDIUM__) - " (16-bit, medium)", -#elif defined(M_I86CM) || defined(__COMPACT__) - " (16-bit, compact)", -#elif defined(M_I86SM) || defined(__SMALL__) - " (16-bit, small)", -#elif defined(M_I86TM) || defined(__TINY__) - " (16-bit, tiny)", -#else - " (16-bit)", -#endif - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - -} /* end function version_local() */ - - -#ifdef __WATCOMC__ - -/* This papers over a bug in Watcom 10.6's standard library... sigh */ -/* Apparently it applies to both the DOS and Win32 stat()s. */ - -int stat_bandaid(const char *path, struct stat *buf) -{ - char newname[4]; - if (!stat(path, buf)) - return 0; - else if (!strcmp(path, ".") || (path[0] && !strcmp(path + 1, ":."))) { - strcpy(newname, path); - newname[strlen(path) - 1] = '\\'; /* stat(".") fails for root! */ - return stat(newname, buf); - } else - return -1; -} - -#endif - - diff --git a/third_party/infozip/zip/novell/README b/third_party/infozip/zip/novell/README deleted file mode 100644 index a620c1bdb..000000000 --- a/third_party/infozip/zip/novell/README +++ /dev/null @@ -1,9 +0,0 @@ -Unfinished integration into zip 2.4 of novell port to zip 2.2. - -TODO: - -Too much novell specific stuff via ifdef into the main sourcecode, -use atexit() and setjmp()/longjmp() constructions instead. - -If a function doesn't exist (e.g. isatty), just write a wrapper -and put it in Netware.c diff --git a/third_party/infozip/zip/novell/m.cmd b/third_party/infozip/zip/novell/m.cmd deleted file mode 100644 index 04084b3af..000000000 --- a/third_party/infozip/zip/novell/m.cmd +++ /dev/null @@ -1,9 +0,0 @@ -wmake - -copy zip.nlm f: - -attrib -r -h -s g:\hho\*.* /s -del g:\hho\Attrib\*.* -del g:\hho\Attrib\*.* -rmdir g:\hho\Attrib - diff --git a/third_party/infozip/zip/novell/osdep.h b/third_party/infozip/zip/novell/osdep.h deleted file mode 100644 index f7b463c52..000000000 --- a/third_party/infozip/zip/novell/osdep.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -/* The symbol DOS is used throughout the Zip source to identify code portions - * specific to the MSDOS port. - * Just to make sure, we check that it is set. - * (Currently, this should should not be neccessary, since currently it has - * to be set on the compiler command line to get this file read in.) - */ -#ifndef DOS -# define DOS -#endif - -/* The symbol MSDOS is consistently used in the generic source files - * to identify code to support for MSDOS (and MSDOS related) stuff. - * e.g: FAT or (FAT like) file systems, - * '\\' as directory separator in paths, - * "\r\n" as record (line) terminator in text files, ... - * - * IMPORTANT Note: - * This symbol is not unique for the MSDOS port !!!!!! - * It is also defined by ports to some other OS which are (to some extend) - * considered DOS compatible. - * Examples are: OS/2 (OS2), Windows NT and Windows 95 (WIN32). - * - */ -#ifndef MSDOS -# define MSDOS -#endif - -/* Power C is similar to Turbo C */ -#ifdef __POWERC -# define __TURBOC__ -#endif /* __POWERC */ - -/* Automatic setting of the common Microsoft C idenfifier MSC. - * NOTE: Watcom also defines M_I*86 ! - */ -#if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__)) -# ifndef MSC -# define MSC /* This should work for older MSC, too! */ -# endif -#endif - -#if !defined(__GO32__) && !defined(__EMX__) -# define NO_UNISTD_H -#endif - -#if defined(__WATCOMC__) && defined(__386__) -# define WATCOMC_386 -#endif - -#ifdef WINDLL -# define MSWIN -# define MEMORY16 -#endif - - -#if !defined(__EMX__) && !defined(__GO32__) && !defined(WATCOMC_386) -#if !defined(WINDLL) -# define MSDOS16 /* 16 bit MSDOS only */ -# define MEMORY16 -#endif -#endif - -#if !defined(NO_ASM) && !defined(ASMV) -# define ASMV -#endif - -/* enable creation of UTC time fields unless explicitely suppressed */ -#if !defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME) -# define USE_EF_UT_TIME -#endif - -/* check that TZ environment variable is defined before using UTC times */ -#if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ)) -# define IZ_CHECK_TZ -#endif - -#ifdef MEMORY16 -# ifndef NO_ASM -# define ASM_CRC 1 -# endif /* ?NO_ASM */ -# ifdef __TURBOC__ -# include -# if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) -# if defined(DYNAMIC_CRC_TABLE) && defined(DYNALLOC_CRCTAB) - error: No dynamic CRC table allocation with Borland C far data models. -# endif /* DYNAMIC_CRC_TABLE */ -# endif /* Turbo/Borland C far data memory models */ -# define nearmalloc malloc -# define nearfree free -# define DYN_ALLOC -# else /* !__TURBOC__ */ -# include -# define nearmalloc _nmalloc -# define nearfree _nfree -# define farmalloc _fmalloc -# define farfree _ffree -# endif /* ?__TURBOC__ */ -# define MY_ZCALLOC 1 -# ifdef SMALL_MEM -# define CBSZ 2048 -# define ZBSZ 2048 -# endif -# ifdef MEDIUM_MEM -# define CBSZ 4096 -# define ZBSZ 4096 -# endif -# ifndef CBSZ -# define CBSZ 8192 -# define ZBSZ 8192 -# endif -#endif /* MEMORY16 */ - - -#ifdef MATCH -# undef MATCH -#endif -#define MATCH dosmatch /* use DOS style wildcard matching */ - -#define USE_CASE_MAP - -#define ROUNDED_TIME(time) (((time) + 1) & (~1)) -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -#define FOPR "rb" -#define FOPM "r+b" -#define FOPW "wb" - -#include -#include -#include - -#ifdef ZCRYPT_INTERNAL -# ifdef WINDLL -# define ZCR_SEED2 (unsigned)3141592654L /* use PI as seed pattern */ -# else -# ifndef __GO32__ -# include /* getpid() declaration for srand seed */ -# endif -# endif -#endif - -/* - * djgpp 1.x did not declare these - */ -#if defined(__GO32__) && !defined(__DJGPP__) -char *strlwr(char *); -int setmode(int, int); -#endif - -#ifdef __WATCOMC__ -# define NO_MKTEMP -# define HAS_OPENDIR -# define SSTAT stat_bandaid - int stat_bandaid(const char *path, struct stat *buf); - -/* Get asm routines to link properly without using "__cdecl": */ -# ifdef __386__ -# ifdef ASMV -# pragma aux match_init "_*" parm caller [] modify [] -# pragma aux longest_match "_*" parm caller [] value [eax] \ - modify [eax ecx edx] -# endif -# 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 */ -# else /* !__386__ */ -# ifdef ASMV -# pragma aux match_init "_*" parm caller [] loadds modify [ax bx] -# pragma aux longest_match "_*" parm caller [] loadds value [ax] \ - modify [ax bx cx dx es] -# endif /* ASMV */ -# ifndef USE_ZLIB -# pragma aux crc32 "_*" parm caller [] value [ax dx] \ - modify [ax bx cx dx es] -# pragma aux get_crc_table "_*" parm caller [] value [ax] \ - modify [ax bx cx dx] -# endif /* !USE_ZLIB */ -# endif /* ?__386__ */ -#endif /* __WATCOMC__ */ - -/* - * Wrapper function to get around the MSC7 00:00:00 31 Dec 1899 time base, - * see msdos.c for more info - */ - -#if defined(_MSC_VER) && _MSC_VER == 700 -# define localtime(t) msc7_localtime(t) -#endif - -#if (defined(__TURBOC__) && !defined(__BORLANDC__) && __TURBOC__ <= 0x0201) -# ifndef NO_MKTIME -# define NO_MKTIME /* TC 2.01 and earlier do not supply mktime() */ -# endif -#endif diff --git a/third_party/infozip/zip/novell/signal.c b/third_party/infozip/zip/novell/signal.c deleted file mode 100644 index a092bd38b..000000000 --- a/third_party/infozip/zip/novell/signal.c +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include - -/*******************************/ -/* Interupt handler */ -/*******************************/ - -int NLM_mainThreadGroupID; -int NLM_threadCnt = 0; -int NLM_exiting = FALSE; - -#pragma off(unreferenced); -void NLM_SignalHandler(int sig) -#pragma on(unreferenced); -{ - int handlerThreadGroupID; - - switch(sig) - { - case SIGTERM: - NLM_exiting = TRUE; - handlerThreadGroupID = GetThreadGroupID(); - SetThreadGroupID(NLM_mainThreadGroupID); - - /* NLM SDK functions may be called here */ - - while (NLM_threadCnt != 0) - ThreadSwitchWithDelay(); - SetThreadGroupID(handlerThreadGroupID); - break; - case SIGINT: - signal(SIGINT, NLM_SignalHandler); - break; - } - return; -} - -void NLMsignals(void) -{ - ++NLM_threadCnt; - NLM_mainThreadGroupID = GetThreadGroupID(); - signal(SIGTERM, NLM_SignalHandler); - signal(SIGINT, NLM_SignalHandler); -} - -void NLMexit(void) -{ - --NLM_threadCnt; -} diff --git a/third_party/infozip/zip/novell/zip.lnk b/third_party/infozip/zip/novell/zip.lnk deleted file mode 100644 index 19626c754..000000000 --- a/third_party/infozip/zip/novell/zip.lnk +++ /dev/null @@ -1,25 +0,0 @@ -Form Novell NLM 'zip' -Name zip -Op ScreenName 'zip' -Op ThreadName 'zip__P ' -Op Stack = 8k -Op Version = 1.00.3 -Op Caseexact -Op Nod -File BITS.OBJ -File CRC_i386.OBJ -File CRYPT.OBJ -File DEFLATE.OBJ -File FILEIO.OBJ -File GLOBALS.OBJ -File MKTIME.OBJ -File NETWARE.OBJ -File TREES.OBJ -File TTYIO.OBJ -File UTIL.OBJ -File ZIP.OBJ -File ZIPFILE.OBJ -File ZIPUP.OBJ -File c:\novell\ndk\nwsdk\IMPORTS\PRELUDE.OBJ -Import @c:\novell\ndk\nwsdk\IMPORTS\ALL.IMP -Module CLib diff --git a/third_party/infozip/zip/novell/zipup.h b/third_party/infozip/zip/novell/zipup.h deleted file mode 100644 index 78b428a03..000000000 --- a/third_party/infozip/zip/novell/zipup.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow (O_RDONLY|O_BINARY) -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/os2/makefile.os2 b/third_party/infozip/zip/os2/makefile.os2 deleted file mode 100644 index a008ea598..000000000 --- a/third_party/infozip/zip/os2/makefile.os2 +++ /dev/null @@ -1,563 +0,0 @@ -# Makefile for Zip, ZipCloak, ZipNote and ZipSplit - -# Supported Make utilities: -# - Microsoft/IBM nmake -# - dmake 3.8 or higher -# - GNU make, at least version 3.68 -# - NOT watcom make -# For Microsoft and Watcom C, better use NMAKE, -# otherwise it doesn't matter. - -# Supported 16-bit C Compilers (created programs run under OS/2 1.x and 2.x): -# - Microsoft C 6.00A -# - Watcom C/C++ 16-bit - -# Supported 32-bit C Compilers (created programs run under OS/2 2.x only): -# - GNU gcc (emx kit 0.9c or newer) -# - IBM C Set/2 or C Set++ - does not yet work with ASM code -# - Watcom C/C++ 32-bit - does not yet work with ASM code -# - Borland C++ - no ASM code yet -# - MetaWare High C/C++ - no ASM code yet - -# Supported Cross-Compilers for MS-DOS: -# - Microsoft C 6.00A (16-bit) -# - Watcom C/C++ (16- and 32-bit) -# - GNU gcc (emx kit 0.9c or newer, 32-bit) - -# Supported Cross-Compilers for Win32 (WinNT/Win95): -# - GNU gcc (emx kit 0.9c or newer, with RSXNT 1.4 or newer) - -# Supported Assemblers: -# - Microsoft MASM 6.00 with Microsoft C, IBM C -# - Watcom WASM with Watcom C/C++ -# - GNU as with GNU gcc - -# To use MASM 5.x instead of MASM 6.00: -# - set AS="masm -T -Ml" -# - set ASEOL=";" - - -# To use, enter "make/nmake/dmake -f os2/makefile.os2" -# (this makefile depends on its name being "os2/makefile.os2"). - -# Add -DNO_ASM to CFLAGS and define OBJA to `nothing' if you do not have -# masm or ml. -# Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS - -# Note: assembly language modules are really only supported for -# Microsoft 16-bit and GNU gcc 32-bit compilation. - -# Notes on 16-bit (Microsoft C 6.00) compilation: - -# The resulting programs can be used under OS/2 protected mode only. -# A larger stack has to be used for OS/2 because system calls -# use more stack than under DOS, 8k is recommended by Microsoft. -# Note that __STDC__ has to be defined explicitly with C 6.00 when -Ze -# is given, because Microsoft disables __STDC__ when their extensions -# are enabled. This is different from the C 5.10 behaviour. - -# Notes on 32-bit OS/2 compilation: - -# The resulting programs can be used under OS/2 protected -# mode of OS/2 2.x only, not under 1.x and not under DOS. -# It makes no difference if __STDC__ is defined or not. -# Borland C++ works with DYN_ALLOC only. - -# Special Notes on IBM C/C++ compilation: - -# The older C compiler (C Set/2) breaks, while optimizing, on deflate.c -# and trees.c (generates incorrect code). The newer C++ compiler (C Set++) -# doesn't but instead breaks on crypt.c in the initial version and up to -# CSD level 003. Starting with CSD level 004, it doesn't break any longer. - -# Notes on Watcom C/C++ compilation for DOS with the PMODE/W extender: -# -# You need to add the following section to your \watcom\binb\wlsystem.lnk -# file and also need to copy pmodew.exe to the same directory: -# -# system begin pmodew -# option osname='PMODE/W' -# libpath %WATCOM%\lib386 -# libpath %WATCOM%\lib386\dos -# op stub=pmodew.exe -# format os2 le -# end -# -# PMODE/W 1.16 or higher is required. - - -default: - @echo "Enter $(MAKE) -f os2/makefile.os2 target" - @echo "where target is one of:" - @echo " msc mscdos ibm ibmdyn ibmdebug ibmprof metaware borland" - @echo " gcc gccdyn gcczlib gccdebug gccdos gccwin32 gccw32dyn" - @echo " watcom watcom16 watcomdos watcom16dos pmodew" - -# MS C 6.00 for OS/2, 16-bit -msc: - $(MAKE) -f os2/makefile.os2 zips \ - CC="cl -nologo -AL -Ocegit -Gs $(FP)" \ - CFLAGS="-W1 -Zep -J -G2 -D__STDC__ -DOS2 -DASM_CRC" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="-D__LARGE__ -D__286" \ - LDFLAGS="-F 2000 -Lp -Fe" \ - LDFLAGS2="-link /noe /pm:vio" \ - OUT="-Fo" \ - OBJ=".obj" \ - CRCA_O="crc_i86.obj" \ - OBJA="match.obj" \ - DEF="os2\zip.def" - -# MS C 6.00 for OS/2, 16-bit, debug -mscdebug: - $(MAKE) -f os2/makefile.os2 zips \ - CC="cl -nologo -AL -Zi -Od $(FP)" \ - CFLAGS="-W1 -Zep -J -G2 -D__STDC__ -DOS2 -DASM_CRC" \ - AS="ml -nologo -c -Zim -Cp" \ - ASFLAGS="-D__LARGE__ -D__286" \ - LDFLAGS="-F 2000 -Lp -Fe" \ - LDFLAGS2="-link /noe /pm:vio" \ - OUT="-Fo" \ - OBJ=".obj" \ - CRCA_O="crc_i86.obj" \ - OBJA="match.obj" \ - DEF="os2\zip.def" - -# crosscompilation for MS-DOS with MS C 6.00 -mscdos: - $(MAKE) -f os2/makefile.os2 zips \ - CC="cl -nologo -AL -Ocegit -Gs $(FP)" \ - CFLAGS="-W1 -Zep -J -D__STDC__ -DDOS -DASM_CRC -DDYN_ALLOC" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="-D__LARGE__ -DDYN_ALLOC" \ - LDFLAGS="-F 2000 -Lr -Fe" \ - LDFLAGS2="-link /noe /exe" \ - OUT="-Fo" \ - OBJ=".obj" \ - CRCA_O="crc_i86.obj" \ - OBJA="match.obj" \ - OBJ2="msdos.obj" OBJU2="msdos_.obj" \ - OSDEP_H="msdos/osdep.h" ZIPUP_H="msdos/zipup.h" - - -# IBM C Set/2, statically linked runtime -ibm: - $(MAKE) -f os2/makefile.os2 zips \ - CC="icc -Q -O -Gs" \ - CFLAGS="-Sm -Sp1 -DOS2 -DNO_ASM" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="" \ - LDFLAGS="-B/ST:0x50000 -Fe" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DEF="os2/zip.def" - -# IBM C Set/2, dynamically linked runtime -ibmdyn: - $(MAKE) -f os2/makefile.os2 zips \ - CC="icc -Q -O -Gd -Gs" \ - CFLAGS="-Sm -Sp1 -DOS2 -DNO_ASM" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="" \ - LDFLAGS="-B/ST:0x50000 -Fe" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DEF="os2/zip.def" - -# IBM C Set/2, debug version -ibmdebug: - $(MAKE) -f os2/makefile.os2 zips \ - CC="icc -Q -Ti" \ - CFLAGS="-Sm -Sp1 -DOS2 -DNO_ASM -Tm" \ - AS="ml -nologo -c -Zim -Cp" \ - ASFLAGS="" \ - LDFLAGS="-B/ST:0x50000 -Fe" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DEF="os2/zip.def" - -# IBM C Set/2, profiling version for PROFIT -ibmprof: - $(MAKE) -f os2/makefile.os2 zips \ - CC="icc -Q -O -Gs -Gh -Ti" \ - CFLAGS="-Sm -Sp1 -DOS2 -DNO_ASM" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="" \ - LDFLAGS="-B/ST:0x50000 -Fe" \ - LDFLAGS2="profit.obj" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DEF="os2/zip.def" - -# Watcom C/386 9.0 or higher -watcom: - $(MAKE) -f os2/makefile.os2 zips \ - CC="wcl386 -bt=os2v2 -zq -Ox -s" \ - CFLAGS="-Zp1 -DOS2 -DNO_ASM" \ - AS="wasm -zq -bt=os2v2 -3p" \ - ASFLAGS="" \ - LDFLAGS="-k0x50000 -x -l=os2v2 -Fe=" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DIRSEP="\\" \ - AS_DIRSEP="\\" - -# Watcom C/286 9.0 or higher -watcom16: - $(MAKE) -f os2/makefile.os2 zips \ - CC="wcl -bt=os2 -zq -ml -Ox -s" \ - CFLAGS="-Zp1 -DOS2 -DNO_ASM" \ - AS="wasm -zq -bt=os2 -2p -ml" \ - ASFLAGS="" \ - LDFLAGS="/\"option newfiles\" -k0x3000 -x -l=os2 -Fe=" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - DIRSEP="\\" \ - AS_DIRSEP="\\" - -# Watcom C/386 9.0 or higher, crosscompilation for DOS, DOS4GW extender -watcomdos: - $(MAKE) -f os2/makefile.os2 zips \ - CC="wcl386 -bt=dos4g -zq -Ox -s" \ - CFLAGS="-Zp1 -DDOS -DMSDOS -DASM_CRC" \ - AS="wasm -zq -bt=dos4g -3p" \ - ASFLAGS="-DWATCOM_DSEG" \ - LDFLAGS="-k0x50000 -x -l=dos4g -Fe=" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - CRCA_O="crc_i386.obj" \ - OBJA="match32.obj" \ - OBJ2="msdos.obj" \ - OBJU2="msdos_.obj" \ - OSDEP_H="msdos/osdep.h" \ - ZIPUP_H="msdos/zipup.h" \ - DIRSEP="\\" \ - AS_DIRSEP="\\" - -# Watcom C/386 9.0 or higher, crosscompilation for DOS, PMODE/W extender -pmodew: - $(MAKE) -f os2/makefile.os2 zips \ - CC="wcl386 -bt=dos4g -zq -Ox -s" \ - CFLAGS="-Zp1 -DDOS -DMSDOS -DASM_CRC" \ - AS="wasm -zq -bt=dos4g -3p" \ - ASFLAGS="-DWATCOM_DSEG" \ - LDFLAGS="-k0x50000 -x -l=pmodew -Fe=" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - CRCA_O="crc_i386.obj" \ - OBJA="match32.obj" \ - OBJ2="msdos.obj" \ - OBJU2="msdos_.obj" \ - OSDEP_H="msdos/osdep.h" \ - ZIPUP_H="msdos/zipup.h" \ - DIRSEP="\\" \ - AS_DIRSEP="\\" - -# Watcom C/286 9.0 or higher, crosscompilation for DOS -watcom16dos: - $(MAKE) -f os2/makefile.os2 zips \ - CC="wcl -bt=dos -zq -ml -Ox -s" \ - CFLAGS="-Zp1 -DDOS -DMSDOS -DDYN_ALLOC -DNO_ASM" \ - AS="wasm -zq -bt=dos -2 -ml" \ - ASFLAGS="-DDYN_ALLOC" \ - LDFLAGS="-k0x2000 -x -l=dos -Fe=" \ - LDFLAGS2="" \ - OUT="-Fo" \ - OBJ=".obj" \ - OBJA="" \ - OBJ2="msdos.obj" \ - OBJU2="msdos_.obj" \ - OSDEP_H="msdos/osdep.h" \ - ZIPUP_H="msdos/zipup.h" \ - DIRSEP="\\" \ - AS_DIRSEP="\\" - -# MetaWare High C/C++ 3.2 -metaware: - $(MAKE) -f os2/makefile.os2 zips \ - CC="hc -O2" \ - CFLAGS="-D__32BIT__ -DOS2 -DNO_ASM" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="" \ - LDFLAGS="-o " \ - LDFLAGS2="" \ - OUT="-o ./" \ - OBJ=".obj" \ - DEF="-Hdef=os2/zip.def" - -# Borland C++ -borland: - $(MAKE) -f os2/makefile.os2 zips \ - CC="bcc -O" \ - CFLAGS="-w- -DOS2 -DDYN_ALLOC -DNO_ASM" \ - AS="ml -nologo -c -Zm -Cp" \ - ASFLAGS="" \ - LDFLAGS="-e" \ - LDFLAGS2="" \ - OUT="-o" \ - OBJ=".obj" \ - OBJA="" \ - DEF="-sDos2/zip.def" - -# emx 0.9c, gcc, OMF format, statically linked C runtime and emx -gcc: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -Zomf -O -Wimplicit" \ - CFLAGS="-DOS2 -DASM_CRC" \ - AS="gcc -Zomf" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-Zsys -Zstack 320 -s -Zsmall-conv" \ - OUT="-o" \ - OBJ=".obj" \ - CRCA_O="crc_gcc.obj" \ - OBJA="matchgcc.obj" \ - DEF="os2/zip.def" - -# emx 0.9c, gcc, OMF format, dynamically linked C runtime and emx -gccdyn: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -Zomf -O -Wimplicit" \ - CFLAGS="-DOS2 -DASM_CRC" \ - AS="gcc -Zomf" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-Zcrtdll -Zstack 320 -s" \ - OUT="-o" \ - OBJ=".obj" \ - CRCA_O="crc_gcc.obj" \ - OBJA="matchgcc.obj" \ - DEF="os2/zip.def" - -# emx 0.9c, gcc, OMF format, statically linked zlib, C runtime, and emx -gcczlib: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -Zomf -O -Wimplicit" \ - CFLAGS="-DOS2 -DUSE_ZLIB" \ - AS="gcc -Zomf" \ - ASFLAGS="-Di386 -DUSE_ZLIB" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-L. -lzlib -Zsys -Zstack 320 -s -Zsmall-conv" \ - OUT="-o" \ - OBJ=".obj" \ - CRCA_O="" \ - OBJA="" \ - DEF="os2/zip.def" - -# emx 0.9c, gcc, a.out format, with debug info for gdb -gccdebug: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -g -Wimplicit" \ - CFLAGS="-DOS2 -DASM_CRC" \ - AS="gcc" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="" \ - OUT="-o" \ - OBJ=".o" \ - CRCA_O="crc_gcc.o" \ - OBJA="matchgcc.o" \ - DEF="os2/zip.def" - -# emx 0.9c, gcc, a.out format, for MS-DOS -gccdos: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -O -Wimplicit" \ - CFLAGS="-DDOS -DMSDOS -DASM_CRC" \ - AS="gcc" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-s -Zsmall-conv" \ - OUT="-o" \ - OBJ=".o" \ - CRCA_O="crc_gcc.o" \ - OBJA="matchgcc.o" \ - OBJ2="msdos.o" \ - OBJU2="msdos_.o" \ - OSDEP_H="msdos/osdep.h" \ - ZIPUP_H="msdos/zipup.h" - -# emx 0.9c, gcc, RSXNT 1.4, cross-compilation for Win32 -gccwin32: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -Zwin32 -O -m486 -Wall" \ - CFLAGS="-DWIN32 -DASM_CRC" \ - AS="gcc -Zwin32" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-ladvapi32 -Zsys -Zsmall-conv -s" \ - OUT="-o" \ - OBJ=".o" \ - CRCA_O="crc_gcc.o" \ - OBJA="matchgcc.o" \ - OBJ2="win32zip.o win32.o nt.o" \ - OBJU2="win32_.o" \ - OSDEP_H="win32/osdep.h" \ - ZIPUP_H="win32/zipup.h" \ - DEF="win32/zip.def" - -# emx 0.9c, gcc, RSXNT 1.4, cross-compilation for Win32, use emx C rtl DLL -gccw32dyn: - $(MAKE) -f os2/makefile.os2 zips \ - CC="gcc -Zwin32 -Zcrtdll=crtrsxnt -O -m486 -Wall" \ - CFLAGS="-DWIN32 -DASM_CRC" \ - AS="gcc -Zwin32" \ - ASFLAGS="-Di386" \ - LDFLAGS="-o ./" \ - LDFLAGS2="-ladvapi32 -s" \ - OUT="-o" \ - OBJ=".o" \ - CRCA_O="crc_gcc.o" \ - OBJA="matchgcc.o" \ - OBJ2="win32zip.o win32.o nt.o" \ - OBJU2="win32_.o" \ - OSDEP_H="win32/osdep.h" \ - ZIPUP_H="win32/zipup.h" \ - DEF="win32/zip.def" - -# VPATH = .;os2 - -# variables - -#default settings for target dependent macros: -DIRSEP = / -AS_DIRSEP = / -# LOCAL_OPTS = -CCFLAGS = $(CFLAGS) $(LOCAL_OPTS) - -OSDEP_H = os2/osdep.h -ZIPUP_H = os2/os2zip.h os2/zipup.h -CRCA_O = - - -OBJZ = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \ - crc32$(OBJ) $(CRCA_O) globals$(OBJ) \ - deflate$(OBJ) trees$(OBJ) crypt$(OBJ) ttyio$(OBJ) -OBJ2 = os2zip$(OBJ) os2$(OBJ) os2acl$(OBJ) - -OBJU = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ) -OBJU2 = os2zip_$(OBJ) - -OBJN = zipnote$(OBJ) $(OBJU) $(OBJU2) -OBJS = zipsplit$(OBJ) $(OBJU) $(OBJU2) -OBJC = zipcloak$(OBJ) crc32_$(OBJ) crypt_$(OBJ) ttyio$(OBJ) $(OBJU) $(OBJU2) - -ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H) - -# rules - -.SUFFIXES: .c $(OBJ) - -.c$(OBJ): - $(CC) -c -I. $(CCFLAGS) $< - -.asm$(OBJ): - $(AS) $(ASFLAGS) $< $(ASEOL) - -# targets - -zips: zip.exe zipnote.exe zipsplit.exe zipcloak.exe - -zip$(OBJ): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipfile$(OBJ): zipfile.c $(ZIP_H) crc32.h -zipup$(OBJ): zipup.c $(ZIP_H) revision.h crc32.h crypt.h $(ZIPUP_H) -fileio$(OBJ): fileio.c $(ZIP_H) crc32.h -util$(OBJ): util.c $(ZIP_H) -globals$(OBJ): globals.c $(ZIP_H) -deflate$(OBJ): deflate.c $(ZIP_H) -trees$(OBJ): trees.c $(ZIP_H) -crc32$(OBJ): crc32.c $(ZIP_H) crc32.h -crypt$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h -ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h - -os2zip$(OBJ): os2/os2zip.c $(ZIP_H) os2/os2zip.h os2/os2acl.h - $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2zip.c - -os2$(OBJ): os2/os2.c $(ZIP_H) os2/os2zip.h - $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2.c - -os2acl$(OBJ): os2/os2acl.c os2/os2acl.h - $(CC) -c -I. $(CCFLAGS) os2$(DIRSEP)os2acl.c - -msdos$(OBJ): msdos/msdos.c $(ZIP_H) - $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c - -win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c - -win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c - -nt$(OBJ): win32/nt.c win32/nt.h - $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c - -crc_i86$(OBJ): msdos/crc_i86.asm # 16bit only - $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL) - -crc_i386$(OBJ): win32/crc_i386.asm # 32bit, MASM - $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL) - -crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS - $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S - -match$(OBJ): msdos/match.asm - $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)match.asm $(ASEOL) - -match32$(OBJ): win32/match32.asm - $(AS) $(ASFLAGS) win32$(AS_DIRSEP)match32.asm - -matchgcc$(OBJ): match.S - $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S - -zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h -zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h -zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h - -zipfile_$(OBJ): zipfile.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c - -fileio_$(OBJ): fileio.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c - -util_$(OBJ): util.c $(ZIP_H) os2/os2zip.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c - -crc32_$(OBJ): crc32.c $(ZIP_H) crc32.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crc32.c - -crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c - -os2zip_$(OBJ): os2/os2zip.c $(ZIP_H) os2/os2zip.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ os2$(DIRSEP)os2zip.c - -msdos_$(OBJ): msdos/msdos.c $(ZIP_H) - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c - -win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h - $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c - -zip.exe: $(OBJZ) $(OBJ2) $(OBJA) - $(CC) $(LDFLAGS)$@ $(DEF) $(OBJZ) $(OBJ2) $(OBJA) $(LDFLAGS2) - -zipcloak.exe: $(OBJC) - $(CC) $(LDFLAGS)$@ $(DEF) $(OBJC) $(LDFLAGS2) - -zipnote.exe: $(OBJN) - $(CC) $(LDFLAGS)$@ $(DEF) $(OBJN) $(LDFLAGS2) - -zipsplit.exe: $(OBJS) - $(CC) $(LDFLAGS)$@ $(DEF) $(OBJS) $(LDFLAGS2) diff --git a/third_party/infozip/zip/os2/match32.asm b/third_party/infozip/zip/os2/match32.asm deleted file mode 100644 index 4797a739e..000000000 --- a/third_party/infozip/zip/os2/match32.asm +++ /dev/null @@ -1,175 +0,0 @@ -;=========================================================================== -; Copyright (c) 1990-2005 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 -;=========================================================================== -; -; match32.asm by Jean-loup Gailly. - -; match32.asm, optimized version of longest_match() in deflate.c -; To be used only with 32 bit flat model. To simplify the code, the option -; -DDYN_ALLOC is not supported. -; This file is only optional. If you don't have an assembler, use the -; C version (add -DNO_ASM to CFLAGS in makefile and remove match.o -; from OBJI). If you have reduced WSIZE in zip.h, then make sure this is -; assembled with an equivalent -DWSIZE=. - -; Caution: this module works for IBM's C/C++ compiler versions 2 and 3 -; and for Watcom's 32-bit C/C++ compiler. Both pass the first (and only) -; argument for longest_match in the EAX register, not on the stack, with -; the default calling conventions (_System would use the stack). -; -;============================================================================== -; -; Do NOT assemble this source if external crc32 routine from zlib gets used. -; - IFNDEF USE_ZLIB -; - .386 - - name match - -BSS32 segment dword USE32 public 'BSS' - extrn window : byte - extrn prev : word - extrn prev_length : dword - extrn strstart : dword - extrn match_start : dword - extrn max_chain_length : dword - extrn good_match : dword - extrn nice_match : dword -BSS32 ends - -CODE32 segment dword USE32 public 'CODE' - assume cs:CODE32, ds:FLAT, ss:FLAT - - public match_init - public longest_match - - ifndef WSIZE - WSIZE equ 32768 ; keep in sync with zip.h ! - endif - MIN_MATCH equ 3 - MAX_MATCH equ 258 - MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1) - MAX_DIST equ (WSIZE-MIN_LOOKAHEAD) - -; initialize or check the variables used in match.asm. - -match_init proc near - ret -match_init endp - -; ----------------------------------------------------------------------- -; Set match_start to the longest match starting at the given string and -; return its length. Matches shorter or equal to prev_length are discarded, -; in which case the result is equal to prev_length and match_start is -; garbage. -; IN assertions: cur_match is the head of the hash chain for the current -; string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - -; int longest_match(cur_match) - -longest_match proc near - - ; return address ; esp+16 - push ebp ; esp+12 - push edi ; esp+8 - push esi ; esp+4 - - lea ebx,window - add ebx,2 - window_off equ dword ptr [esp] - push ebx ; esp - -; match equ esi -; scan equ edi -; chain_length equ ebp -; best_len equ ebx -; limit equ edx - - mov esi,eax ; cur_match - mov edx,strstart - mov ebp,max_chain_length ; chain_length = max_chain_length - mov edi,edx - sub edx,MAX_DIST ; limit = strstart-MAX_DIST - cld ; string ops increment esi and edi - jae short limit_ok - sub edx,edx ; limit = NIL -limit_ok: - add edi,window_off ; edi = offset(window + strstart + 2) - mov ebx,prev_length ; best_len = prev_length - mov cx,[edi-2] ; cx = scan[0..1] - mov ax,[ebx+edi-3] ; ax = scan[best_len-1..best_len] - cmp ebx,good_match ; do we have a good match already? - jb do_scan - shr ebp,2 ; chain_length >>= 2 - jmp short do_scan - - align 4 ; align destination of branch -long_loop: -; at this point, edi == scan+2, esi == cur_match - mov ax,[ebx+edi-3] ; ax = scan[best_len-1..best_len] - mov cx,[edi-2] ; cx = scan[0..1] -short_loop: -; at this point, edi == scan+2, esi == cur_match, -; ax = scan[best_len-1..best_len] and cx = scan[0..1] - and esi,WSIZE-1 ; not needed if WSIZE=32768 - dec ebp ; --chain_length - shl esi,1 ; cur_match as word index - mov si,prev[esi] ; cur_match = prev[cur_match] - ; top word of esi is still 0 - jz the_end - cmp esi,edx ; cur_match <= limit ? - jbe short the_end -do_scan: - cmp ax,word ptr window[ebx+esi-1] ; check match at best_len-1 - jne short_loop - cmp cx,word ptr window[esi] ; check min_match_length match - jne short_loop - - add esi,window_off ; esi = match - mov ecx,(MAX_MATCH-2)/2 ; scan for at most MAX_MATCH bytes - mov eax,edi ; eax = scan+2 - repe cmpsw ; loop until mismatch - je maxmatch ; match of length MAX_MATCH? -mismatch: - mov cl,[edi-2] ; mismatch on first or second byte? - xchg eax,edi ; edi = scan+2, eax = end of scan - sub cl,[esi-2] ; cl = 0 if first bytes equal - sub eax,edi ; eax = len - sub esi,window_off ; esi = match - (2 + offset(window)) - sub esi,eax ; esi = cur_match (= match - len) - sub cl,1 ; set carry if cl == 0 (can't use DEC) - adc eax,0 ; eax = carry ? len+1 : len - cmp eax,ebx ; len > best_len ? - jle long_loop - mov match_start,esi ; match_start = cur_match - mov ebx,eax ; ebx = best_len = len - ifdef FULL_SEARCH - cmp eax,MAX_MATCH ; len >= MAX_MATCH ? - else - cmp eax,nice_match ; len >= nice_match ? - endif - jl long_loop -the_end: - mov eax,ebx ; result = eax = best_len - pop ebx - pop esi - pop edi - pop ebp - ret -maxmatch: ; come here if maximum match - cmpsb ; increment esi and edi - jmp mismatch ; force match_length = MAX_LENGTH - -longest_match endp - -CODE32 ends -; - ENDIF ; !USE_ZLIB -; - end diff --git a/third_party/infozip/zip/os2/os2.c b/third_party/infozip/zip/os2/os2.c deleted file mode 100644 index b44fe2eb8..000000000 --- a/third_party/infozip/zip/os2/os2.c +++ /dev/null @@ -1,481 +0,0 @@ -/* - Copyright (c) 1990-2005 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 -*/ -#include "zip.h" - -#ifndef UTIL /* the companion #endif is a bit of ways down ... */ - -#include -#if defined(__IBMC__) || defined(MSC) -#include -#endif - -/* Extra malloc() space in names for cutpath() */ -#define PAD 0 -#define PATH_END '/' - - -#include "os2zip.h" - -/* Library functions not in (most) header files */ - -extern char *label; -local ulg label_time = 0; -local ulg label_mode = 0; -local time_t label_utim = 0; - -/* Local functions */ -local char *readd OF((DIR *)); - - -local char *readd(d) -DIR *d; /* directory stream to read from */ -/* Return a pointer to the next name in the directory stream d, or NULL if - no more entries or an error occurs. */ -{ - struct dirent *e; - - e = readdir(d); - return e == NULL ? (char *) NULL : e->d_name; -} - -int wild(w) -char *w; /* path/pattern to match */ -/* If not in exclude mode, expand the pattern based on the contents of the - file system. Return an error code in the ZE_ class. */ -{ - DIR *d; /* stream for reading directory */ - char *e; /* name found in directory */ - int r; /* temporary variable */ - char *n; /* constructed name from directory */ - int f; /* true if there was a match */ - char *a; /* alloc'ed space for name */ - char *p; /* path */ - char *q; /* name */ - char v[5]; /* space for device current directory */ - - if (volume_label == 1) { - volume_label = 2; - label = getVolumeLabel((w != NULL && w[1] == ':') ? to_up(w[0]) : '\0', - &label_time, &label_mode, &label_utim); - if (label != NULL) { - newname(label, 0, 0); - } - if (w == NULL || (w[1] == ':' && w[2] == '\0')) return ZE_OK; - /* "zip -$ foo a:" can be used to force drive name */ - } - - if (w == NULL) - return ZE_OK; - - /* special handling of stdin request */ - if (strcmp(w, "-") == 0) /* if compressing stdin */ - return newname(w, 0, 0); - - /* Allocate and copy pattern */ - if ((p = a = malloc(strlen(w) + 1)) == NULL) - return ZE_MEM; - strcpy(p, w); - - /* catch special case: treat "*.*" as "*" for DOS-impaired people */ - r = strlen(p); - if (strcmp(p + r - 3, "*.*") == 0) - p[r - 2] = '\0'; - - /* Normalize path delimiter as '/'. */ - for (q = p; *q; q++) /* use / consistently */ - if (*q == '\\') - *q = '/'; - - /* Only name can have special matching characters */ - if ((q = isshexp(p)) != NULL && - (strrchr(q, '/') != NULL || strrchr(q, ':') != NULL)) - { - free((zvoid *)a); - return ZE_PARMS; - } - - /* Separate path and name into p and q */ - if ((q = strrchr(p, '/')) != NULL && (q == p || q[-1] != ':')) - { - *q++ = '\0'; /* path/name -> path, name */ - if (*p == '\0') /* path is just / */ - p = strcpy(v, "/."); - } - else if ((q = strrchr(p, ':')) != NULL) - { /* has device and no or root path */ - *q++ = '\0'; - p = strcat(strcpy(v, p), ":"); /* copy device as path */ - if (*q == '/') /* -> device:/., name */ - { - strcat(p, "/"); - q++; - } - strcat(p, "."); - } - else if (recurse && (strcmp(p, ".") == 0 || strcmp(p, "..") == 0)) - { /* current or parent directory */ - /* I can't understand Mark's code so I am adding a hack here to get - * "zip -r foo ." to work. Allow the dubious "zip -r foo .." but - * reject "zip -rm foo ..". - */ - if (dispose && strcmp(p, "..") == 0) - ziperr(ZE_PARMS, "cannot remove parent directory"); - q = "*"; - } - else /* no path or device */ - { - q = p; - p = strcpy(v, "."); - } - if (recurse && *q == '\0') { - q = "*"; - } - /* Search that level for matching names */ - if ((d = opendir(p)) == NULL) - { - free((zvoid *)a); - return ZE_MISS; - } - if ((r = strlen(p)) > 1 && - (strcmp(p + r - 2, ":.") == 0 || strcmp(p + r - 2, "/.") == 0)) - *(p + r - 1) = '\0'; - f = 0; - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..") && MATCH(q, e, 0)) - { - f = 1; - if (strcmp(p, ".") == 0) { /* path is . */ - r = procname(e, 0); /* name is name */ - if (r) { - f = 0; - break; - } - } else - { - if ((n = malloc(strlen(p) + strlen(e) + 2)) == NULL) - { - free((zvoid *)a); - closedir(d); - return ZE_MEM; - } - n = strcpy(n, p); - if (n[r = strlen(n) - 1] != '/' && n[r] != ':') - strcat(n, "/"); - r = procname(strcat(n, e), 0); /* name is path/name */ - free((zvoid *)n); - if (r) { - f = 0; - break; - } - } - } - } - closedir(d); - - /* Done */ - free((zvoid *)a); - return f ? ZE_OK : ZE_MISS; -} - -int procname(n, caseflag) -char *n; /* name to process */ -int caseflag; /* true to force case-sensitive match */ -/* Process a name or sh expression to operate on (or exclude). Return - an error code in the ZE_ class. */ -{ - char *a; /* path and name for recursion */ - DIR *d; /* directory stream from opendir() */ - char *e; /* pointer to name from readd() */ - int m; /* matched flag */ - char *p; /* path for recursion */ - struct stat s; /* result of stat() */ - struct zlist far *z; /* steps through zfiles list */ - - if (n == NULL) /* volume_label request in freshen|delete mode ?? */ - return ZE_OK; - - if (strcmp(n, "-") == 0) /* if compressing stdin */ - return newname(n, 0, caseflag); - else if (LSSTAT(n, &s) -#if defined(__TURBOC__) || defined(__WATCOMC__) - /* For these 2 compilers, stat() succeeds on wild card names! */ - || isshexp(n) -#endif - ) - { - /* Not a file or directory--search for shell expression in zip file */ - p = ex2in(n, 0, (int *)NULL); /* shouldn't affect matching chars */ - m = 1; - for (z = zfiles; z != NULL; z = z->nxt) { - if (MATCH(p, z->iname, caseflag)) - { - z->mark = pcount ? filter(z->zname, caseflag) : 1; - if (verbose) - fprintf(mesg, "zip diagnostic: %scluding %s\n", - z->mark ? "in" : "ex", z->name); - m = 0; - } - } - free((zvoid *)p); - return m ? ZE_MISS : ZE_OK; - } - - /* Live name--use if file, recurse if directory */ - for (p = n; *p; p++) /* use / consistently */ - if (*p == '\\') - *p = '/'; - if ((s.st_mode & S_IFDIR) == 0) - { - /* add or remove name of file */ - if ((m = newname(n, 0, caseflag)) != ZE_OK) - return m; - } else { - /* Add trailing / to the directory name */ - if ((p = malloc(strlen(n)+2)) == NULL) - return ZE_MEM; - if (strcmp(n, ".") == 0 || strcmp(n, "/.") == 0) { - *p = '\0'; /* avoid "./" prefix and do not create zip entry */ - } else { - strcpy(p, n); - a = p + strlen(p); - if (a[-1] != '/') - strcpy(a, "/"); - if (dirnames && (m = newname(p, 1, caseflag)) != ZE_OK) { - free((zvoid *)p); - return m; - } - } - /* recurse into directory */ - if (recurse && (d = opendir(n)) != NULL) - { - while ((e = readd(d)) != NULL) { - if (strcmp(e, ".") && strcmp(e, "..")) - { - if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL) - { - closedir(d); - free((zvoid *)p); - return ZE_MEM; - } - strcat(strcpy(a, p), e); - if ((m = procname(a, caseflag)) != ZE_OK) /* recurse on name */ - { - if (m == ZE_MISS) - zipwarn("name not matched: ", a); - else - ziperr(m, a); - } - free((zvoid *)a); - } - } - closedir(d); - } - free((zvoid *)p); - } /* (s.st_mode & S_IFDIR) == 0) */ - return ZE_OK; -} - -char *ex2in(x, isdir, pdosflag) -char *x; /* external file name */ -int isdir; /* input: x is a directory */ -int *pdosflag; /* output: force MSDOS file attributes? */ -/* Convert the external file name to a zip file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *n; /* internal file name (malloc'ed) */ - char *t; /* shortened name */ - int dosflag; - - dosflag = dosify || IsFileSystemFAT(x) || (x == label); - if (!dosify && use_longname_ea && (t = GetLongPathEA(x)) != NULL) - { - x = t; - dosflag = 0; - } - - /* Find starting point in name before doing malloc */ - /* Strip drive specification */ - t = *x && *(x + 1) == ':' ? x + 2 : x; - /* Strip "//host/share/" part of a UNC name */ - if ((!strncmp(x,"//",2) || !strncmp(x,"\\\\",2)) && - (x[2] != '\0' && x[2] != '/' && x[2] != '\\')) { - n = x + 2; - while (*n != '\0' && *n != '/' && *n != '\\') - n++; /* strip host name */ - if (*n != '\0') { - n++; - while (*n != '\0' && *n != '/' && *n != '\\') - n++; /* strip `share' name */ - } - if (*n != '\0') - t = n + 1; - } - /* Strip leading "/" to convert an absolute path into a relative path */ - while (*t == '/' || *t == '\\') - t++; - /* Strip leading "./" as well as drive letter */ - while (*t == '.' && (t[1] == '/' || t[1] == '\\')) - t += 2; - - /* Make changes, if any, to the copied name (leave original intact) */ - for (n = t; *n; n++) - if (*n == '\\') - *n = '/'; - - if (!pathput) - t = last(t, PATH_END); - - /* Malloc space for internal name and copy it */ - if ((n = malloc(strlen(t) + 1)) == NULL) - return NULL; - strcpy(n, t); - - if (dosify) - msname(n); - - /* Returned malloc'ed name */ - if (pdosflag) - *pdosflag = dosflag; - return n; -} - - -char *in2ex(n) -char *n; /* internal file name */ -/* Convert the zip file name to an external file name, returning the malloc'ed - string or NULL if not enough memory. */ -{ - char *x; /* external file name */ - - if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) - return NULL; - strcpy(x, n); - - return x; -} - - -void stamp(f, d) -char *f; /* name of file to change */ -ulg d; /* dos-style time to change it to */ -/* Set last updated and accessed time of file f to the DOS time d. */ -{ - SetFileTime(f, d); -} - -ulg filetime(f, a, n, t) -char *f; /* name of file to get info on */ -ulg *a; /* return value: file attributes */ -long *n; /* return value: file size */ -iztimes *t; /* return value: access, modific. and creation times */ -/* If file *f does not exist, return 0. Else, return the file's last - modified date and time as an MSDOS date and time. The date and - time is returned in a long with the date most significant to allow - unsigned integer comparison of absolute times. Also, if a is not - a NULL pointer, store the file attributes there, with the high two - bytes being the Unix attributes, and the low byte being a mapping - of that to DOS attributes. If n is not NULL, store the file size - there. If t is not NULL, the file's access, modification and creation - times are stored there as UNIX time_t values. - If f is "-", use standard input as the file. If f is a device, return - a file size of -1 */ -{ - struct stat s; /* results of stat() */ - char *name; - ulg r; - unsigned int len = strlen(f); - int isstdin = !strcmp(f, "-"); - - if (f == label) { - if (a != NULL) - *a = label_mode; - if (n != NULL) - *n = -2L; /* convention for a label name */ - if (t != NULL) - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } - - if ((name = malloc(len + 1)) == NULL) { - ZIPERR(ZE_MEM, "filetime"); - } - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; - /* not all systems allow stat'ing a file with / appended */ - - if (isstdin) { - /* it is common for some PC based compilers to - fail with fstat() on devices or pipes */ - if (fstat(fileno(stdin), &s) != 0) { - s.st_mode = S_IFREG; s.st_size = -1L; - } - time(&s.st_ctime); - s.st_atime = s.st_mtime = s.st_ctime; - } else if (LSSTAT(name, &s) != 0) { - /* Accept about any file kind including directories - * (stored with trailing / with -r option) - */ - free(name); - return 0; - } - - if (a != NULL) { - *a = ((ulg)s.st_mode << 16) | (isstdin ? 0L : (ulg)GetFileMode(name)); - } - if (n != NULL) - *n = (s.st_mode & S_IFMT) == S_IFREG ? s.st_size : -1L; -#ifdef __WATCOMC__ - /* of course, Watcom always has to make an exception */ - if (s.st_atime == 312764400) - s.st_atime = s.st_mtime; - if (s.st_ctime == 312764400) - s.st_ctime = s.st_mtime; -#endif - if (t != NULL) { - t->atime = s.st_atime; - t->mtime = s.st_mtime; - t->ctime = s.st_ctime; - } - - r = GetFileTime(name); - free(name); - - return r; -} - -int deletedir(d) -char *d; /* directory to delete */ -/* Delete the directory *d if it is empty, do nothing otherwise. - Return the result of rmdir(), delete(), or system(). - */ -{ - return rmdir(d); -} - - -#if defined MY_ZCALLOC /* Special zcalloc function for MEMORY16 (MSDOS/OS2) */ - -#ifdef MSC /* Microsoft C */ - -zvoid far *zcalloc (unsigned items, unsigned size) -{ - return (zvoid far *)halloc((long)items, size); -} - -zvoid zcfree (zvoid far *ptr) -{ - hfree((void huge *)ptr); -} - -#endif /* MSC */ - -#endif /* MY_ZCALLOC */ - -#endif /* !UTIL */ diff --git a/third_party/infozip/zip/os2/os2acl.c b/third_party/infozip/zip/os2/os2acl.c deleted file mode 100644 index 4f88643ec..000000000 --- a/third_party/infozip/zip/os2/os2acl.c +++ /dev/null @@ -1,385 +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 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 -*/ -/* os2acl.c - access to OS/2 (LAN Server) ACLs - * - * Author: Kai Uwe Rommel - * Created: Mon Aug 08 1994 - * - */ - -/* - * supported 32-bit compilers: - * - emx+gcc - * - IBM C Set++ 2.1 or newer - * - Watcom C/C++ 10.0 or newer - * - * supported 16-bit compilers: - * - MS C 6.00A - * - Watcom C/C++ 10.0 or newer - * - * supported OS/2 LAN environments: - * - IBM LAN Server/Requester 3.0, 4.0 and 5.0 (Warp Server) - * - IBM Peer 1.0 (Warp Connect) - */ - -#ifdef KUR - static char *rcsid = - "$Id: os2acl.c,v 1.3 1996/04/03 19:18:27 rommel Exp rommel $"; - static char *rcsrev = "$Revision: 1.3 $"; -#endif - -/* - * $Log: os2acl.c,v $ - * Revision 1.3 1996/04/03 19:18:27 rommel - * minor fixes - * - * Revision 1.2 1996/03/30 22:03:52 rommel - * avoid frequent dynamic allocation for every call - * streamlined code - * - * Revision 1.1 1996/03/30 09:35:00 rommel - * Initial revision - * - */ - -#include -#include -#include -#include -#include - -#define INCL_NOPM -#define INCL_DOS -#define INCL_DOSERRORS -#include - -#include "os2/os2acl.h" - -#define UNLEN 20 - -#if defined(__WATCOMC__) && defined(__386__) && !defined(__32BIT__) -#define __32BIT__ -#endif - -#ifdef __32BIT__ -typedef ULONG U_INT; -#ifdef __EMX__ -#define PSTR16 _far16ptr -#define PTR16(x) _emx_32to16(x) -#else /* other 32-bit */ -#define PSTR16 PCHAR16 -#define PTR16(x) ((PCHAR16)(x)) -#endif -#else /* 16-bit */ -typedef USHORT U_INT; -#define PSTR16 PSZ -#define PTR16(x) (x) -#endif - -typedef struct access_list -{ - char acl_ugname[UNLEN+1]; - char acl_pad; - USHORT acl_access; -} -ACCLIST; - -typedef struct access_info -{ - PSTR16 acc_resource_name; - USHORT acc_attr; - USHORT acc_count; -} -ACCINFO; - -static ACCINFO *ai; -static char *path, *data; - -#ifdef __32BIT__ - -#ifdef __EMX__ - -static USHORT (APIENTRY *_NetAccessGetInfo)(PSZ pszServer, PSZ pszResource, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer, PUSHORT pcbTotalAvail); -static USHORT (APIENTRY *_NetAccessSetInfo)(PSZ pszServer, PSZ pszResource, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer, USHORT sParmNum); -static USHORT (APIENTRY *_NetAccessAdd)(PSZ pszServer, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer); - -USHORT NetAccessGetInfo(PSZ pszServer, PSZ pszResource, USHORT sLevel, - PVOID pbBuffer, USHORT cbBuffer, PUSHORT pcbTotalAvail) -{ - return (USHORT) - (_THUNK_PROLOG (4+4+2+4+2+4); - _THUNK_FLAT (pszServer); - _THUNK_FLAT (pszResource); - _THUNK_SHORT (sLevel); - _THUNK_FLAT (pbBuffer); - _THUNK_SHORT (cbBuffer); - _THUNK_FLAT (pcbTotalAvail); - _THUNK_CALLI (_emx_32to16(_NetAccessGetInfo))); -} - -USHORT NetAccessSetInfo(PSZ pszServer, PSZ pszResource, USHORT sLevel, - PVOID pbBuffer, USHORT cbBuffer, USHORT sParmNum) -{ - return (USHORT) - (_THUNK_PROLOG (4+4+2+4+2+2); - _THUNK_FLAT (pszServer); - _THUNK_FLAT (pszResource); - _THUNK_SHORT (sLevel); - _THUNK_FLAT (pbBuffer); - _THUNK_SHORT (cbBuffer); - _THUNK_SHORT (sParmNum); - _THUNK_CALLI (_emx_32to16(_NetAccessSetInfo))); -} - -USHORT NetAccessAdd(PSZ pszServer, USHORT sLevel, - PVOID pbBuffer, USHORT cbBuffer) -{ - return (USHORT) - (_THUNK_PROLOG (4+2+4+2); - _THUNK_FLAT (pszServer); - _THUNK_SHORT (sLevel); - _THUNK_FLAT (pbBuffer); - _THUNK_SHORT (cbBuffer); - _THUNK_CALLI (_emx_32to16(_NetAccessAdd))); -} - -#else /* other 32-bit */ - -APIRET16 (* APIENTRY16 NetAccessGetInfo)(PCHAR16 pszServer, PCHAR16 pszResource, - USHORT sLevel, PVOID16 pbBuffer, USHORT cbBuffer, PVOID16 pcbTotalAvail); -APIRET16 (* APIENTRY16 NetAccessSetInfo)(PCHAR16 pszServer, PCHAR16 pszResource, - USHORT sLevel, PVOID16 pbBuffer, USHORT cbBuffer, USHORT sParmNum); -APIRET16 (* APIENTRY16 NetAccessAdd)(PCHAR16 pszServer, - USHORT sLevel, PVOID16 pbBuffer, USHORT cbBuffer); - -#define _NetAccessGetInfo NetAccessGetInfo -#define _NetAccessSetInfo NetAccessSetInfo -#define _NetAccessAdd NetAccessAdd - -#if !defined(__IBMC__) || !defined(__TILED__) -#define _tmalloc malloc -#define _tfree free -#endif - -#endif -#else /* 16-bit */ - -USHORT (APIENTRY *NetAccessGetInfo)(PSZ pszServer, PSZ pszResource, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer, PUSHORT pcbTotalAvail); -USHORT (APIENTRY *NetAccessSetInfo)(PSZ pszServer, PSZ pszResource, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer, USHORT sParmNum); -USHORT (APIENTRY *NetAccessAdd)(PSZ pszServer, - USHORT sLevel, PVOID pbBuffer, USHORT cbBuffer); - -#define _NetAccessGetInfo NetAccessGetInfo -#define _NetAccessSetInfo NetAccessSetInfo -#define _NetAccessAdd NetAccessAdd - -#define _tmalloc malloc -#define _tfree free - -#define DosQueryProcAddr(handle, ord, name, funcptr) \ - DosGetProcAddr(handle, name, funcptr) -#define DosQueryCurrentDir DosQCurDir -#define DosQueryCurrentDisk DosQCurDisk - -#endif - - -static BOOL acl_init(void) -{ - static BOOL initialized, netapi_avail; - HMODULE netapi; - char buf[256]; - - if (initialized) - return netapi_avail; - - initialized = TRUE; - - if (DosLoadModule(buf, sizeof(buf), "NETAPI", &netapi)) - return FALSE; - - if (DosQueryProcAddr(netapi, 0, "NETACCESSGETINFO", (PFN *) &_NetAccessGetInfo) || - DosQueryProcAddr(netapi, 0, "NETACCESSSETINFO", (PFN *) &_NetAccessSetInfo) || - DosQueryProcAddr(netapi, 0, "NETACCESSADD", (PFN *) &_NetAccessAdd)) - return FALSE; - -#if defined(__WATCOMC__) && defined(__386__) - NetAccessGetInfo = (PVOID) (ULONG) (PVOID16) NetAccessGetInfo; - NetAccessSetInfo = (PVOID) (ULONG) (PVOID16) NetAccessSetInfo; - NetAccessAdd = (PVOID) (ULONG) (PVOID16) NetAccessAdd; -#endif - - if ((path = _tmalloc(CCHMAXPATH)) == NULL) - return FALSE; - if ((data = _tmalloc(ACL_BUFFERSIZE)) == NULL) - return FALSE; - if ((ai = _tmalloc(sizeof(ACCINFO))) == NULL) - return -1; - - netapi_avail = TRUE; - - return netapi_avail; -} - -static void acl_mkpath(char *buffer, const char *source) -{ - char *ptr; - static char cwd[CCHMAXPATH]; - static U_INT cwdlen; - U_INT cdrive; - ULONG drivemap; - - if (isalpha((int)source[0]) && source[1] == ':') - buffer[0] = 0; /* fully qualified names */ - else - { - if (cwd[0] == 0) - { - DosQueryCurrentDisk(&cdrive, &drivemap); - cwd[0] = (char)(cdrive + '@'); - cwd[1] = ':'; - cwd[2] = '\\'; - cwdlen = sizeof(cwd) - 3; - DosQueryCurrentDir(0, cwd + 3, &cwdlen); - cwdlen = strlen(cwd); - } - - if (source[0] == '/' || source[0] == '\\') - { - if (source[1] == '/' || source[1] == '\\') - buffer[0] = 0; /* UNC names */ - else - { - strncpy(buffer, cwd, 2); - buffer[2] = 0; - } - } - else - { - strcpy(buffer, cwd); - if (cwd[cwdlen - 1] != '\\' && cwd[cwdlen - 1] != '/') - strcat(buffer, "/"); - } - } - - strcat(buffer, source); - - for (ptr = buffer; *ptr; ptr++) - if (*ptr == '/') - *ptr = '\\'; - - if (ptr[-1] == '\\') - ptr[-1] = 0; - - strupr(buffer); -} - -static int acl_bin2text(char *data, char *text) -{ - ACCINFO *ai; - ACCLIST *al; - U_INT cnt, offs; - - ai = (ACCINFO *) data; - al = (ACCLIST *) (data + sizeof(ACCINFO)); - - offs = sprintf(text, "ACL1:%X,%d\n", - ai -> acc_attr, ai -> acc_count); - - for (cnt = 0; cnt < ai -> acc_count; cnt++) - offs += sprintf(text + offs, "%s,%X\n", - al[cnt].acl_ugname, al[cnt].acl_access); - - return strlen(text); -} - -int acl_get(char *server, const char *resource, char *buffer) -{ - USHORT datalen; - PSZ srv = NULL; - int rc; - - if (!acl_init()) - return -1; - - if (server) - srv = server; - - acl_mkpath(path, resource); - datalen = 0; - - rc = NetAccessGetInfo(srv, path, 1, data, ACL_BUFFERSIZE, &datalen); - - if (rc == 0) - acl_bin2text(data, buffer); - - return rc; -} - -static int acl_text2bin(char *data, char *text, char *path) -{ - ACCINFO *ai; - ACCLIST *al; - char *ptr, *ptr2; - U_INT cnt; - - ai = (ACCINFO *) data; - ai -> acc_resource_name = PTR16(path); - - if (sscanf(text, "ACL1:%hX,%hd", - &ai -> acc_attr, &ai -> acc_count) != 2) - return ERROR_INVALID_PARAMETER; - - al = (ACCLIST *) (data + sizeof(ACCINFO)); - ptr = strchr(text, '\n') + 1; - - for (cnt = 0; cnt < ai -> acc_count; cnt++) - { - ptr2 = strchr(ptr, ','); - strncpy(al[cnt].acl_ugname, ptr, ptr2 - ptr); - al[cnt].acl_ugname[ptr2 - ptr] = 0; - sscanf(ptr2 + 1, "%hx", &al[cnt].acl_access); - ptr = strchr(ptr, '\n') + 1; - } - - return sizeof(ACCINFO) + ai -> acc_count * sizeof(ACCLIST); -} - -int acl_set(char *server, const char *resource, char *buffer) -{ - USHORT datalen; - PSZ srv = NULL; - - if (!acl_init()) - return -1; - - if (server) - srv = server; - - acl_mkpath(path, resource); - - ai -> acc_resource_name = PTR16(path); - ai -> acc_attr = 0; - ai -> acc_count = 0; - - NetAccessAdd(srv, 1, ai, sizeof(ACCINFO)); - /* Ignore any errors, most probably because ACL already exists. */ - /* In any such case, try updating the existing ACL. */ - - datalen = acl_text2bin(data, buffer, path); - - return NetAccessSetInfo(srv, path, 1, data, datalen, 0); -} - -/* end of os2acl.c */ diff --git a/third_party/infozip/zip/os2/os2acl.h b/third_party/infozip/zip/os2/os2acl.h deleted file mode 100644 index 03bb8a2ab..000000000 --- a/third_party/infozip/zip/os2/os2acl.h +++ /dev/null @@ -1,34 +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 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 -*/ -/* os2acl.h - * - * Author: Kai Uwe Rommel - * Created: Fri Mar 29 1996 - */ - -/* $Id: os2acl.h,v 1.1 1996/03/30 09:35:00 rommel Exp rommel $ */ - -/* - * $Log: os2acl.h,v $ - * Revision 1.1 1996/03/30 09:35:00 rommel - * Initial revision - * - */ - -#ifndef _OS2ACL_H -#define _OS2ACL_H - -#define ACL_BUFFERSIZE 4096 - -int acl_get(char *server, const char *resource, char *buffer); -int acl_set(char *server, const char *resource, char *buffer); - -#endif /* _OS2ACL_H */ - -/* end of os2acl.h */ diff --git a/third_party/infozip/zip/os2/os2zip.c b/third_party/infozip/zip/os2/os2zip.c deleted file mode 100644 index 83bc3bc0f..000000000 --- a/third_party/infozip/zip/os2/os2zip.c +++ /dev/null @@ -1,1213 +0,0 @@ -/* - * @(#)dir.c 1.4 87/11/06 Public Domain. - * - * A public domain implementation of BSD directory routines for - * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield), - * August 1987 - * - * Ported to OS/2 by Kai Uwe Rommel - * Addition of other OS/2 file system specific code - * Placed into the public domain - */ - -/* does also contain EA access code for use in ZIP */ - - -#ifdef OS2 - - -#if defined(__EMX__) && !defined(__32BIT__) -# define __32BIT__ -#endif - -#include "zip.h" - -#include -#include -#include -#ifndef __BORLANDC__ -#include -#endif - -#define INCL_NOPM -#define INCL_DOSNLS -#define INCL_DOSERRORS -#include - -#include "os2zip.h" -#include "os2acl.h" - - -#ifndef max -#define max(a, b) ((a) < (b) ? (b) : (a)) -#endif - - -#ifdef __32BIT__ -#define DosFindFirst(p1, p2, p3, p4, p5, p6) \ - DosFindFirst(p1, p2, p3, p4, p5, p6, 1) -#else -#define DosQueryCurrentDisk DosQCurDisk -#define DosQueryFSAttach(p1, p2, p3, p4, p5) \ - DosQFSAttach(p1, p2, p3, p4, p5, 0) -#define DosQueryFSInfo(d, l, b, s) \ - DosQFSInfo(d, l, b, s) -#define DosQueryPathInfo(p1, p2, p3, p4) \ - DosQPathInfo(p1, p2, p3, p4, 0) -#define DosSetPathInfo(p1, p2, p3, p4, p5) \ - DosSetPathInfo(p1, p2, p3, p4, p5, 0) -#define DosEnumAttribute(p1, p2, p3, p4, p5, p6, p7) \ - DosEnumAttribute(p1, p2, p3, p4, p5, p6, p7, 0) -#define DosFindFirst(p1, p2, p3, p4, p5, p6) \ - DosFindFirst(p1, p2, p3, p4, p5, p6, 0) -#define DosMapCase DosCaseMap -#endif - - -#ifndef UTIL - -extern int noisy; - -#ifndef S_IFMT -#define S_IFMT 0xF000 -#endif - -static int attributes = _A_DIR | _A_HIDDEN | _A_SYSTEM; - -static char *getdirent(char *); -static void free_dircontents(struct _dircontents *); - -#ifdef __32BIT__ -static HDIR hdir; -static ULONG count; -static FILEFINDBUF3 find; -#else -static HDIR hdir; -static USHORT count; -static FILEFINDBUF find; -#endif - -DIR *opendir(const char *name) -{ - struct stat statb; - DIR *dirp; - char c; - char *s; - struct _dircontents *dp; - char nbuf[MAXPATHLEN + 1]; - int len; - - attributes = hidden_files ? (_A_DIR | _A_HIDDEN | _A_SYSTEM) : _A_DIR; - - strcpy(nbuf, name); - if ((len = strlen(nbuf)) == 0) - return NULL; - - if (((c = nbuf[len - 1]) == '\\' || c == '/') && (len > 1)) - { - nbuf[len - 1] = 0; - --len; - - if (nbuf[len - 1] == ':') - { - strcpy(nbuf+len, "\\."); - len += 2; - } - } - else - if (nbuf[len - 1] == ':') - { - strcpy(nbuf+len, "."); - ++len; - } - -#ifndef __BORLANDC__ - /* when will we ever see a Borland compiler that can properly stat !!! */ - if (stat(nbuf, &statb) < 0 || (statb.st_mode & S_IFMT) != S_IFDIR) - return NULL; -#endif - - if ((dirp = malloc(sizeof(DIR))) == NULL) - return NULL; - - if (nbuf[len - 1] == '.' && (len == 1 || nbuf[len - 2] != '.')) - strcpy(nbuf+len-1, "*.*"); - else - if (((c = nbuf[len - 1]) == '\\' || c == '/') && (len == 1)) - strcpy(nbuf+len, "*"); - else - strcpy(nbuf+len, "\\*"); - - /* len is no longer correct (but no longer needed) */ - - dirp -> dd_loc = 0; - dirp -> dd_contents = dirp -> dd_cp = NULL; - - if ((s = getdirent(nbuf)) == NULL) - return dirp; - - do - { - if (((dp = malloc(sizeof(struct _dircontents))) == NULL) || - ((dp -> _d_entry = malloc(strlen(s) + 1)) == NULL) ) - { - if (dp) - free(dp); - free_dircontents(dirp -> dd_contents); - - return NULL; - } - - if (dirp -> dd_contents) - { - dirp -> dd_cp -> _d_next = dp; - dirp -> dd_cp = dirp -> dd_cp -> _d_next; - } - else - dirp -> dd_contents = dirp -> dd_cp = dp; - - strcpy(dp -> _d_entry, s); - dp -> _d_next = NULL; - - dp -> _d_size = find.cbFile; - dp -> _d_mode = find.attrFile; - dp -> _d_time = *(unsigned *) &(find.ftimeLastWrite); - dp -> _d_date = *(unsigned *) &(find.fdateLastWrite); - } - while ((s = getdirent(NULL)) != NULL); - - dirp -> dd_cp = dirp -> dd_contents; - - return dirp; -} - -void closedir(DIR * dirp) -{ - free_dircontents(dirp -> dd_contents); - free(dirp); -} - -struct dirent *readdir(DIR * dirp) -{ - static struct dirent dp; - - if (dirp -> dd_cp == NULL) - return NULL; - - dp.d_namlen = dp.d_reclen = - strlen(strcpy(dp.d_name, dirp -> dd_cp -> _d_entry)); - - dp.d_ino = 0; - - dp.d_size = dirp -> dd_cp -> _d_size; - dp.d_mode = dirp -> dd_cp -> _d_mode; - dp.d_time = dirp -> dd_cp -> _d_time; - dp.d_date = dirp -> dd_cp -> _d_date; - - dirp -> dd_cp = dirp -> dd_cp -> _d_next; - dirp -> dd_loc++; - - return &dp; -} - -void seekdir(DIR * dirp, long off) -{ - long i = off; - struct _dircontents *dp; - - if (off >= 0) - { - for (dp = dirp -> dd_contents; --i >= 0 && dp; dp = dp -> _d_next); - - dirp -> dd_loc = off - (i + 1); - dirp -> dd_cp = dp; - } -} - -long telldir(DIR * dirp) -{ - return dirp -> dd_loc; -} - -static void free_dircontents(struct _dircontents * dp) -{ - struct _dircontents *odp; - - while (dp) - { - if (dp -> _d_entry) - free(dp -> _d_entry); - - dp = (odp = dp) -> _d_next; - free(odp); - } -} - -static char *getdirent(char *dir) -{ - int done; - static int lower; - - if (dir != NULL) - { /* get first entry */ - hdir = HDIR_SYSTEM; - count = 1; - done = DosFindFirst(dir, &hdir, attributes, &find, sizeof(find), &count); - lower = IsFileSystemFAT(dir); - } - else /* get next entry */ - done = DosFindNext(hdir, &find, sizeof(find), &count); - - if (done == 0) - { - if (lower) - StringLower(find.achName); - return find.achName; - } - else - { - DosFindClose(hdir); - return NULL; - } -} - -/* FAT / HPFS detection */ - -int IsFileSystemFAT(char *dir) -{ - static USHORT nLastDrive = -1, nResult; - ULONG lMap; - BYTE bData[64]; - char bName[3]; -#ifdef __32BIT__ - ULONG nDrive, cbData; - PFSQBUFFER2 pData = (PFSQBUFFER2) bData; -#else - USHORT nDrive, cbData; - PFSQBUFFER pData = (PFSQBUFFER) bData; -#endif - - /* We separate FAT and HPFS+other file systems here. - at the moment I consider other systems to be similar to HPFS, - i.e. support long file names and being case sensitive */ - - if (isalpha(dir[0]) && (dir[1] == ':')) - nDrive = to_up(dir[0]) - '@'; - else - DosQueryCurrentDisk(&nDrive, &lMap); - - if (nDrive == nLastDrive) - return nResult; - - bName[0] = (char) (nDrive + '@'); - bName[1] = ':'; - bName[2] = 0; - - nLastDrive = nDrive; - cbData = sizeof(bData); - - if (!DosQueryFSAttach(bName, 0, FSAIL_QUERYNAME, (PVOID) pData, &cbData)) - nResult = !strcmp((char *) pData -> szFSDName + pData -> cbName, "FAT"); - else - nResult = FALSE; - - /* End of this ugly code */ - return nResult; -} - -/* access mode bits and time stamp */ - -int GetFileMode(char *name) -{ -#ifdef __32BIT__ - FILESTATUS3 fs; - return DosQueryPathInfo(name, 1, &fs, sizeof(fs)) ? -1 : fs.attrFile; -#else - USHORT mode; - return DosQFileMode(name, &mode, 0L) ? -1 : mode; -#endif -} - -ulg GetFileTime(char *name) -{ -#ifdef __32BIT__ - FILESTATUS3 fs; -#else - FILESTATUS fs; -#endif - USHORT nDate, nTime; - DATETIME dtCurrent; - - if (strcmp(name, "-") == 0) - { - DosGetDateTime(&dtCurrent); - fs.fdateLastWrite.day = dtCurrent.day; - fs.fdateLastWrite.month = dtCurrent.month; - fs.fdateLastWrite.year = dtCurrent.year - 1980; - fs.ftimeLastWrite.hours = dtCurrent.hours; - fs.ftimeLastWrite.minutes = dtCurrent.minutes; - fs.ftimeLastWrite.twosecs = dtCurrent.seconds / 2; - } - else - if (DosQueryPathInfo(name, 1, (PBYTE) &fs, sizeof(fs))) - return -1; - - nDate = * (USHORT *) &fs.fdateLastWrite; - nTime = * (USHORT *) &fs.ftimeLastWrite; - - return ((ULONG) nDate) << 16 | nTime; -} - -void SetFileTime(char *path, ulg stamp) -{ - FILESTATUS fs; - USHORT fd, ft; - - if (DosQueryPathInfo(path, FIL_STANDARD, (PBYTE) &fs, sizeof(fs))) - return; - - fd = (USHORT) (stamp >> 16); - ft = (USHORT) stamp; - fs.fdateLastWrite = fs.fdateCreation = * (FDATE *) &fd; - fs.ftimeLastWrite = fs.ftimeCreation = * (FTIME *) &ft; - - DosSetPathInfo(path, FIL_STANDARD, (PBYTE) &fs, sizeof(fs), 0); -} - -/* read volume label */ - -char *getVolumeLabel(int drive, unsigned long *vtime, unsigned long *vmode, - time_t *utim) -{ - static FSINFO fi; - - if (DosQueryFSInfo(drive ? drive - 'A' + 1 : 0, - FSIL_VOLSER, (PBYTE) &fi, sizeof(fi))) - return NULL; - - time(utim); - *vtime = unix2dostime(utim); - *vmode = _A_VOLID | _A_ARCHIVE; - - return (fi.vol.cch > 0) ? fi.vol.szVolLabel : NULL; -} - -/* FAT / HPFS name conversion stuff */ - -int IsFileNameValid(char *name) -{ - HFILE hf; -#ifdef __32BIT__ - ULONG uAction; -#else - USHORT uAction; -#endif - - switch(DosOpen(name, &hf, &uAction, 0, 0, FILE_OPEN, - OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, 0)) - { - case ERROR_INVALID_NAME: - case ERROR_FILENAME_EXCED_RANGE: - return FALSE; - case NO_ERROR: - DosClose(hf); - default: - return TRUE; - } -} - -void ChangeNameForFAT(char *name) -{ - char *src, *dst, *next, *ptr, *dot, *start; - static char invalid[] = ":;,=+\"[]<>| \t"; - - if (isalpha(name[0]) && (name[1] == ':')) - start = name + 2; - else - start = name; - - src = dst = start; - if ((*src == '/') || (*src == '\\')) - src++, dst++; - - while (*src) - { - for (next = src; *next && (*next != '/') && (*next != '\\'); next++); - - for (ptr = src, dot = NULL; ptr < next; ptr++) - if (*ptr == '.') - { - dot = ptr; /* remember last dot */ - *ptr = '_'; - } - - if (dot == NULL) - for (ptr = src; ptr < next; ptr++) - if (*ptr == '_') - dot = ptr; /* remember last _ as if it were a dot */ - - if (dot && (dot > src) && - ((next - dot <= 4) || - ((next - src > 8) && (dot - src > 3)))) - { - if (dot) - *dot = '.'; - - for (ptr = src; (ptr < dot) && ((ptr - src) < 8); ptr++) - *dst++ = *ptr; - - for (ptr = dot; (ptr < next) && ((ptr - dot) < 4); ptr++) - *dst++ = *ptr; - } - else - { - if (dot && (next - src == 1)) - *dot = '.'; /* special case: "." as a path component */ - - for (ptr = src; (ptr < next) && ((ptr - src) < 8); ptr++) - *dst++ = *ptr; - } - - *dst++ = *next; /* either '/' or 0 */ - - if (*next) - { - src = next + 1; - - if (*src == 0) /* handle trailing '/' on dirs ! */ - *dst = 0; - } - else - break; - } - - for (src = start; *src != 0; ++src) - if ((strchr(invalid, *src) != NULL) || (*src == ' ')) - *src = '_'; -} - -/* .LONGNAME EA code */ - -typedef struct -{ - ULONG cbList; /* length of value + 22 */ -#ifdef __32BIT__ - ULONG oNext; -#endif - BYTE fEA; /* 0 */ - BYTE cbName; /* length of ".LONGNAME" = 9 */ - USHORT cbValue; /* length of value + 4 */ - BYTE szName[10]; /* ".LONGNAME" */ - USHORT eaType; /* 0xFFFD for length-preceded ASCII */ - USHORT eaSize; /* length of value */ - BYTE szValue[CCHMAXPATH]; -} -FEALST; - -typedef struct -{ - ULONG cbList; -#ifdef __32BIT__ - ULONG oNext; -#endif - BYTE cbName; - BYTE szName[10]; /* ".LONGNAME" */ -} -GEALST; - -char *GetLongNameEA(const char *name) -{ - EAOP eaop; - GEALST gealst; - static FEALST fealst; - char *ptr; - - eaop.fpGEAList = (PGEALIST) &gealst; - eaop.fpFEAList = (PFEALIST) &fealst; - eaop.oError = 0; - - strcpy((char *) gealst.szName, ".LONGNAME"); - gealst.cbName = (BYTE) strlen((char *) gealst.szName); -#ifdef __32BIT__ - gealst.oNext = 0; -#endif - - gealst.cbList = sizeof(gealst); - fealst.cbList = sizeof(fealst); - - if (DosQueryPathInfo(name, FIL_QUERYEASFROMLIST, - (PBYTE) &eaop, sizeof(eaop))) - return NULL; - - if (fealst.cbValue > 4 && fealst.eaType == 0xFFFD) - { - fealst.szValue[fealst.eaSize] = 0; - - for (ptr = fealst.szValue; *ptr; ptr++) - if (*ptr == '/' || *ptr == '\\') - *ptr = '!'; - - return (char *) fealst.szValue; - } - - return NULL; -} - -char *GetLongPathEA(const char *name) -{ - static char nbuf[CCHMAXPATH + 1]; - char tempbuf[CCHMAXPATH + 1]; - char *comp, *next, *ea, sep; - BOOL bFound = FALSE; - - nbuf[0] = 0; - strncpy(tempbuf, name, CCHMAXPATH); - tempbuf[CCHMAXPATH] = '\0'; - next = tempbuf; - - while (*next) - { - comp = next; - - while (*next != '\\' && *next != '/' && *next != 0) - next++; - - sep = *next; - *next = 0; - - ea = GetLongNameEA(tempbuf); - strcat(nbuf, ea ? ea : comp); - bFound = bFound || (ea != NULL); - - if (sep) - { - strcat(nbuf, "\\"); - *next++ = sep; - } - } - - return (nbuf[0] != 0) && bFound ? nbuf : NULL; -} - -/* general EA code */ - -typedef struct -{ - USHORT nID; - USHORT nSize; - ULONG lSize; -} -EFHEADER, *PEFHEADER; - -#ifdef __32BIT__ - -/* Perhaps due to bugs in the current OS/2 2.0 kernel, the success or - failure of the DosEnumAttribute() and DosQueryPathInfo() system calls - depends on the area where the return buffers are allocated. This - differs for the various compilers, for some alloca() works, for some - malloc() works, for some, both work. We'll have to live with that. */ - -/* The use of malloc() is not very convenient, because it requires - backtracking (i.e. free()) at error returns. We do that for system - calls that may fail, but not for malloc() calls, because they are VERY - unlikely to fail. If ever, we just leave some memory allocated - over the usually short lifetime of a zip process ... */ - -#ifdef __GNUC__ -#define alloc(x) alloca(x) -#define unalloc(x) -#else -#define alloc(x) malloc(x) -#define unalloc(x) free(x) -#endif - -void GetEAs(char *path, char **bufptr, size_t *size, - char **cbufptr, size_t *csize) -{ - FILESTATUS4 fs; - PDENA2 pDENA, pFound; - EAOP2 eaop; - PGEA2 pGEA; - PGEA2LIST pGEAlist; - PFEA2LIST pFEAlist; - PEFHEADER pEAblock; - ULONG ulAttributes, ulMemoryBlock; - ULONG nLength; - ULONG nBlock; - char szName[CCHMAXPATH]; - - *size = *csize = 0; - - strcpy(szName, path); - nLength = strlen(szName); - if (szName[nLength - 1] == '/') - szName[nLength - 1] = 0; - - if (DosQueryPathInfo(szName, FIL_QUERYEASIZE, (PBYTE) &fs, sizeof(fs))) - return; - nBlock = max(fs.cbList, 65535); - if ((pDENA = alloc((size_t) nBlock)) == NULL) - return; - - ulAttributes = -1; - - if (DosEnumAttribute(ENUMEA_REFTYPE_PATH, szName, 1, pDENA, nBlock, - &ulAttributes, ENUMEA_LEVEL_NO_VALUE) - || ulAttributes == 0 - || (pGEAlist = alloc((size_t) nBlock)) == NULL) - { - unalloc(pDENA); - return; - } - - pGEA = pGEAlist -> list; - memset(pGEAlist, 0, nBlock); - pFound = pDENA; - - while (ulAttributes--) - { - if (!(strcmp(pFound -> szName, ".LONGNAME") == 0 && use_longname_ea)) - { - pGEA -> cbName = pFound -> cbName; - strcpy(pGEA -> szName, pFound -> szName); - - nLength = sizeof(GEA2) + strlen(pGEA -> szName); - nLength = ((nLength - 1) / sizeof(ULONG) + 1) * sizeof(ULONG); - - pGEA -> oNextEntryOffset = ulAttributes ? nLength : 0; - pGEA = (PGEA2) ((PCH) pGEA + nLength); - } - - pFound = (PDENA2) ((PCH) pFound + pFound -> oNextEntryOffset); - } - - if (pGEA == pGEAlist -> list) /* no attributes to save */ - { - unalloc(pDENA); - unalloc(pGEAlist); - return; - } - - pGEAlist -> cbList = (PCH) pGEA - (PCH) pGEAlist; - - pFEAlist = (PVOID) pDENA; /* reuse buffer */ - pFEAlist -> cbList = nBlock; - - eaop.fpGEA2List = pGEAlist; - eaop.fpFEA2List = pFEAlist; - eaop.oError = 0; - - if (DosQueryPathInfo(szName, FIL_QUERYEASFROMLIST, - (PBYTE) &eaop, sizeof(eaop))) - { - unalloc(pDENA); - unalloc(pGEAlist); - return; - } - - /* The maximum compressed size is (in case of STORE type) the - uncompressed size plus the size of the compression type field - plus the size of the CRC field + 2*5 deflate overhead bytes - for uncompressable data. - (5 bytes per 32Kb block, max compressed size = 2 blocks) */ - - ulAttributes = pFEAlist -> cbList; - ulMemoryBlock = ulAttributes + - sizeof(USHORT) + sizeof(ULONG) + EB_DEFLAT_EXTRA; - pEAblock = (PEFHEADER) malloc(sizeof(EFHEADER) + ulMemoryBlock); - - if (pEAblock == NULL) - { - unalloc(pDENA); - unalloc(pGEAlist); - return; - } - - *bufptr = (char *) pEAblock; - *size = sizeof(EFHEADER); - - pEAblock -> nID = EF_OS2EA; - pEAblock -> nSize = sizeof(pEAblock -> lSize); - pEAblock -> lSize = ulAttributes; /* uncompressed size */ - - nLength = memcompress((char *) (pEAblock + 1), ulMemoryBlock, - (char *) pFEAlist, ulAttributes); - *size += nLength; - pEAblock -> nSize += nLength; - - if ((pEAblock = (PEFHEADER) malloc(sizeof(EFHEADER))) == NULL) - { - unalloc(pDENA); - unalloc(pGEAlist); - return; - } - - *cbufptr = (char *) pEAblock; - *csize = sizeof(EFHEADER); - - pEAblock -> nID = EF_OS2EA; - pEAblock -> nSize = sizeof(pEAblock -> lSize); - pEAblock -> lSize = ulAttributes; - - if (noisy) - printf(" (%ld bytes EA's)", ulAttributes); - - unalloc(pDENA); - unalloc(pGEAlist); -} - -#else /* !__32BIT__ */ - -typedef struct -{ - ULONG oNextEntryOffset; - BYTE fEA; - BYTE cbName; - USHORT cbValue; - CHAR szName[1]; -} -FEA2, *PFEA2; - -typedef struct -{ - ULONG cbList; - FEA2 list[1]; -} -FEA2LIST, *PFEA2LIST; - -void GetEAs(char *path, char **bufptr, size_t *size, - char **cbufptr, size_t *csize) -{ - FILESTATUS2 fs; - PDENA1 pDENA, pFound; - EAOP eaop; - PGEALIST pGEAlist; - PGEA pGEA; - PFEALIST pFEAlist; - PFEA pFEA; - PFEA2LIST pFEA2list; - PFEA2 pFEA2; - EFHEADER *pEAblock; - ULONG ulAttributes; - USHORT nLength, nMaxSize; - char szName[CCHMAXPATH]; - - *size = *csize = 0; - - strcpy(szName, path); - nLength = strlen(szName); - if (szName[nLength - 1] == '/') - szName[nLength - 1] = 0; - - if (DosQueryPathInfo(szName, FIL_QUERYEASIZE, (PBYTE) &fs, sizeof(fs)) - || fs.cbList <= 2 * sizeof(ULONG)) - return; - - ulAttributes = -1; - nMaxSize = (USHORT) min(fs.cbList * 2, 65520L); - - if ((pDENA = malloc((size_t) nMaxSize)) == NULL) - return; - - if (DosEnumAttribute(ENUMEA_REFTYPE_PATH, szName, 1, pDENA, fs.cbList, - &ulAttributes, ENUMEA_LEVEL_NO_VALUE) - || ulAttributes == 0 - || (pGEAlist = malloc(nMaxSize)) == NULL) - { - free(pDENA); - return; - } - - pGEA = pGEAlist -> list; - pFound = pDENA; - - while (ulAttributes--) - { - nLength = strlen(pFound -> szName); - - if (!(strcmp(pFound -> szName, ".LONGNAME") == 0 && use_longname_ea)) - { - pGEA -> cbName = pFound -> cbName; - strcpy(pGEA -> szName, pFound -> szName); - - pGEA++; - pGEA = (PGEA) (((PCH) pGEA) + nLength); - } - - pFound++; - pFound = (PDENA1) (((PCH) pFound) + nLength); - } - - if (pGEA == pGEAlist -> list) - { - free(pDENA); - free(pGEAlist); - return; - } - - pGEAlist -> cbList = (PCH) pGEA - (PCH) pGEAlist; - - pFEAlist = (PFEALIST) pDENA; /* reuse buffer */ - pFEAlist -> cbList = fs.cbList; - pFEA = pFEAlist -> list; - - eaop.fpGEAList = pGEAlist; - eaop.fpFEAList = pFEAlist; - eaop.oError = 0; - - if (DosQueryPathInfo(szName, FIL_QUERYEASFROMLIST, - (PBYTE) &eaop, sizeof(eaop))) - { - free(pDENA); - free(pGEAlist); - return; - } - - /* now convert into new OS/2 2.0 32-bit format */ - - pFEA2list = (PFEA2LIST) pGEAlist; /* reuse buffer */ - pFEA2 = pFEA2list -> list; - - while ((PCH) pFEA - (PCH) pFEAlist < pFEAlist -> cbList) - { - nLength = sizeof(FEA) + pFEA -> cbName + 1 + pFEA -> cbValue; - memcpy((PCH) pFEA2 + sizeof(pFEA2 -> oNextEntryOffset), pFEA, nLength); - memset((PCH) pFEA2 + sizeof(pFEA2 -> oNextEntryOffset) + nLength, 0, 3); - pFEA = (PFEA) ((PCH) pFEA + nLength); - - nLength = sizeof(FEA2) + pFEA2 -> cbName + 1 + pFEA2 -> cbValue; - nLength = ((nLength - 1) / sizeof(ULONG) + 1) * sizeof(ULONG); - /* rounded up to 4-byte boundary */ - pFEA2 -> oNextEntryOffset = - ((PCH) pFEA - (PCH) pFEAlist < pFEAlist -> cbList) ? nLength : 0; - pFEA2 = (PFEA2) ((PCH) pFEA2 + nLength); - } - - pFEA2list -> cbList = (PCH) pFEA2 - (PCH) pFEA2list; - ulAttributes = pFEA2list -> cbList; - - pEAblock = (PEFHEADER) pDENA; /* reuse buffer */ - - *bufptr = (char *) pEAblock; - *size = sizeof(EFHEADER); - - pEAblock -> nID = EF_OS2EA; - pEAblock -> nSize = sizeof(pEAblock -> lSize); - pEAblock -> lSize = ulAttributes; /* uncompressed size */ - - nLength = (USHORT) memcompress((char *) (pEAblock + 1), - nMaxSize - sizeof(EFHEADER), (char *) pFEA2list, ulAttributes); - - *size += nLength; - pEAblock -> nSize += nLength; - - pEAblock = (PEFHEADER) pGEAlist; - - *cbufptr = (char *) pEAblock; - *csize = sizeof(EFHEADER); - - pEAblock -> nID = EF_OS2EA; - pEAblock -> nSize = sizeof(pEAblock -> lSize); - pEAblock -> lSize = ulAttributes; - - if (noisy) - printf(" (%ld bytes EA's)", ulAttributes); -} - -#endif /* __32BIT__ */ - -void GetACL(char *path, char **bufptr, size_t *size, - char **cbufptr, size_t *csize) -{ - static char *buffer; - char *cbuffer; - long bytes, cbytes; - PEFHEADER pACLblock; - - if (buffer == NULL) /* avoid frequent allocation (for every file) */ - if ((buffer = malloc(ACL_BUFFERSIZE)) == NULL) - return; - - if (acl_get(NULL, path, buffer)) - return; /* this will be the most likely case */ - - bytes = strlen(buffer); - - /* The maximum compressed size is (in case of STORE type) the - uncompressed size plus the size of the compression type field - plus the size of the CRC field + 2*5 deflate overhead bytes - for uncompressable data. - (5 bytes per 32Kb block, max compressed size = 2 blocks) */ - - cbytes = bytes + sizeof(USHORT) + sizeof(ULONG) + EB_DEFLAT_EXTRA; - if ((*bufptr = realloc(*bufptr, *size + sizeof(EFHEADER) + cbytes)) == NULL) - return; - - pACLblock = (PEFHEADER) (*bufptr + *size); - - cbuffer = (char *) (pACLblock + 1); - cbytes = memcompress(cbuffer, cbytes, buffer, bytes); - - *size += sizeof(EFHEADER) + cbytes; - - pACLblock -> nID = EF_ACL; - pACLblock -> nSize = sizeof(pACLblock -> lSize) + cbytes; - pACLblock -> lSize = bytes; /* uncompressed size */ - - if ((*cbufptr = realloc(*cbufptr, *csize + sizeof(EFHEADER))) == NULL) - return; - - pACLblock = (PEFHEADER) (*cbufptr + *csize); - *csize += sizeof(EFHEADER); - - pACLblock -> nID = EF_ACL; - pACLblock -> nSize = sizeof(pACLblock -> lSize); - pACLblock -> lSize = bytes; - - if (noisy) - printf(" (%ld bytes ACL)", bytes); -} - -#ifdef USE_EF_UT_TIME - -int GetExtraTime(struct zlist far *z, iztimes *z_utim) -{ - int eb_c_size = EB_HEADSIZE + EB_UT_LEN(1); - int eb_l_size = eb_c_size; - char *eb_c_ptr; - char *eb_l_ptr; - unsigned long ultime; - -#ifdef IZ_CHECK_TZ - if (!zp_tz_is_valid) return ZE_OK; /* skip silently no correct tz info */ -#endif - - eb_c_ptr = realloc(z->cextra, (z->cext + eb_c_size)); - if (eb_c_ptr == NULL) - return ZE_MEM; - z->cextra = eb_c_ptr; - eb_c_ptr += z->cext; - z->cext += eb_c_size; - - eb_c_ptr[0] = 'U'; - eb_c_ptr[1] = 'T'; - eb_c_ptr[2] = EB_UT_LEN(1); /* length of data part of e.f. */ - eb_c_ptr[3] = 0; - eb_c_ptr[4] = EB_UT_FL_MTIME; - ultime = (unsigned long) z_utim->mtime; - eb_c_ptr[5] = (char)(ultime); - eb_c_ptr[6] = (char)(ultime >> 8); - eb_c_ptr[7] = (char)(ultime >> 16); - eb_c_ptr[8] = (char)(ultime >> 24); - - if (z_utim->mtime != z_utim->atime || z_utim->mtime != z_utim->ctime) - { - eb_c_ptr[4] = EB_UT_FL_MTIME | EB_UT_FL_ATIME | EB_UT_FL_CTIME; - eb_l_size = EB_HEADSIZE + EB_UT_LEN(3); /* only on HPFS they can differ */ - /* so only then it makes sense to store all three time stamps */ - } - - eb_l_ptr = realloc(z->extra, (z->ext + eb_l_size)); - if (eb_l_ptr == NULL) - return ZE_MEM; - z->extra = eb_l_ptr; - eb_l_ptr += z->ext; - z->ext += eb_l_size; - - memcpy(eb_l_ptr, eb_c_ptr, eb_c_size); - - if (eb_l_size > eb_c_size) - { - eb_l_ptr[2] = EB_UT_LEN(3); - ultime = (unsigned long) z_utim->atime; - eb_l_ptr[9] = (char)(ultime); - eb_l_ptr[10] = (char)(ultime >> 8); - eb_l_ptr[11] = (char)(ultime >> 16); - eb_l_ptr[12] = (char)(ultime >> 24); - ultime = (unsigned long) z_utim->ctime; - eb_l_ptr[13] = (char)(ultime); - eb_l_ptr[14] = (char)(ultime >> 8); - eb_l_ptr[15] = (char)(ultime >> 16); - eb_l_ptr[16] = (char)(ultime >> 24); - } - - return ZE_OK; -} - -#endif /* USE_EF_UT_TIME */ - -int set_extra_field(struct zlist far *z, iztimes *z_utim) -{ - /* store EA data in local header, and size only in central headers */ - GetEAs(z->name, &z->extra, &z->ext, &z->cextra, &z->cext); - - /* store ACL data in local header, and size only in central headers */ - GetACL(z->name, &z->extra, &z->ext, &z->cextra, &z->cext); - -#ifdef USE_EF_UT_TIME - /* store extended time stamps in both headers */ - return GetExtraTime(z, z_utim); -#else /* !USE_EF_UT_TIME */ - return ZE_OK; -#endif /* ?USE_EF_UT_TIME */ -} - -#endif /* !UTIL */ - -/* Initialize the table of uppercase characters including handling of - country dependent characters. */ - -void init_upper() -{ - COUNTRYCODE cc; - unsigned nCnt, nU; - - for (nCnt = 0; nCnt < sizeof(upper); nCnt++) - upper[nCnt] = lower[nCnt] = (unsigned char) nCnt; - - cc.country = cc.codepage = 0; - DosMapCase(sizeof(upper), &cc, (PCHAR) upper); - - for (nCnt = 0; nCnt < 256; nCnt++) - { - nU = upper[nCnt]; - if (nU != nCnt && lower[nU] == (unsigned char) nU) - lower[nU] = (unsigned char) nCnt; - } - - for (nCnt = 'A'; nCnt <= 'Z'; nCnt++) - lower[nCnt] = (unsigned char) (nCnt - 'A' + 'a'); -} - -char *StringLower(char *szArg) -{ - unsigned char *szPtr; - for (szPtr = (unsigned char *) szArg; *szPtr; szPtr++) - *szPtr = lower[*szPtr]; - return szArg; -} - -#if defined(__IBMC__) && defined(__DEBUG_ALLOC__) -void DebugMalloc(void) -{ - _dump_allocated(0); /* print out debug malloc memory statistics */ -} -#endif - - -/******************************/ -/* Function version_local() */ -/******************************/ - -void version_local() -{ - static ZCONST char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n"; -#if defined(__IBMC__) || defined(__WATCOMC__) || defined(_MSC_VER) - char buf[80]; -#endif - - printf(CompiledWith, - -#ifdef __GNUC__ -# ifdef __EMX__ /* __EMX__ is defined as "1" only (sigh) */ - "emx+gcc ", __VERSION__, -# else - "gcc/2 ", __VERSION__, -# endif -#elif defined(__IBMC__) - "IBM ", -# if (__IBMC__ < 200) - (sprintf(buf, "C Set/2 %d.%02d", __IBMC__/100,__IBMC__%100), buf), -# elif (__IBMC__ < 300) - (sprintf(buf, "C Set++ %d.%02d", __IBMC__/100,__IBMC__%100), buf), -# else - (sprintf(buf, "Visual Age C++ %d.%02d", __IBMC__/100,__IBMC__%100), buf), -# endif -#elif defined(__WATCOMC__) - "Watcom C", (sprintf(buf, " (__WATCOMC__ = %d)", __WATCOMC__), buf), -#elif defined(__TURBOC__) -# ifdef __BORLANDC__ - "Borland C++", -# if (__BORLANDC__ < 0x0460) - " 1.0", -# elif (__BORLANDC__ == 0x0460) - " 1.5", -# else - " 2.0", -# endif -# else - "Turbo C", -# if (__TURBOC__ >= 661) - "++ 1.0 or later", -# elif (__TURBOC__ == 661) - " 3.0?", -# elif (__TURBOC__ == 397) - " 2.0", -# else - " 1.0 or 1.5?", -# endif -# endif -#elif defined(MSC) - "Microsoft C ", -# ifdef _MSC_VER - (sprintf(buf, "%d.%02d", _MSC_VER/100, _MSC_VER%100), buf), -# else - "5.1 or earlier", -# endif -#else - "unknown compiler", "", -#endif /* __GNUC__ */ - - "OS/2", - -/* GRR: does IBM C/2 identify itself as IBM rather than Microsoft? */ -#if (defined(MSC) || (defined(__WATCOMC__) && !defined(__386__))) -# if defined(M_I86HM) || defined(__HUGE__) - " (16-bit, huge)", -# elif defined(M_I86LM) || defined(__LARGE__) - " (16-bit, large)", -# elif defined(M_I86MM) || defined(__MEDIUM__) - " (16-bit, medium)", -# elif defined(M_I86CM) || defined(__COMPACT__) - " (16-bit, compact)", -# elif defined(M_I86SM) || defined(__SMALL__) - " (16-bit, small)", -# elif defined(M_I86TM) || defined(__TINY__) - " (16-bit, tiny)", -# else - " (16-bit)", -# endif -#else - " 2.x/3.x (32-bit)", -#endif - -#ifdef __DATE__ - " on ", __DATE__ -#else - "", "" -#endif - ); - - /* temporary debugging code for Borland compilers only */ -#ifdef __TURBOC__ - printf("\t(__TURBOC__ = 0x%04x = %d)\n", __TURBOC__, __TURBOC__); -#ifdef __BORLANDC__ - printf("\t(__BORLANDC__ = 0x%04x)\n",__BORLANDC__); -#else - printf("\tdebug(__BORLANDC__ not defined)\n"); -#endif -#ifdef __TCPLUSPLUS__ - printf("\t(__TCPLUSPLUS__ = 0x%04x)\n", __TCPLUSPLUS__); -#else - printf("\tdebug(__TCPLUSPLUS__ not defined)\n"); -#endif -#ifdef __BCPLUSPLUS__ - printf("\t(__BCPLUSPLUS__ = 0x%04x)\n\n", __BCPLUSPLUS__); -#else - printf("\tdebug(__BCPLUSPLUS__ not defined)\n\n"); -#endif -#endif /* __TURBOC__ */ - -} /* end function version_local() */ - -#endif /* OS2 */ diff --git a/third_party/infozip/zip/os2/os2zip.h b/third_party/infozip/zip/os2/os2zip.h deleted file mode 100644 index 06d0a025d..000000000 --- a/third_party/infozip/zip/os2/os2zip.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * @(#) dir.h 1.4 87/11/06 Public Domain. - * - * A public domain implementation of BSD directory routines for - * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield), - * August 1987 - * - * Ported to OS/2 by Kai Uwe Rommel - * Addition of other OS/2 file system specific code - * Placed into the public domain - */ - - -#define MAXNAMLEN 256 -#define MAXPATHLEN 256 - -#define _A_RONLY 0x01 -#define _A_HIDDEN 0x02 -#define _A_SYSTEM 0x04 -#define _A_VOLID 0x08 -#define _A_DIR 0x10 -#define _A_ARCHIVE 0x20 - - -struct dirent -{ - ino_t d_ino; /* a bit of a farce */ - int d_reclen; /* more farce */ - int d_namlen; /* length of d_name */ - char d_name[MAXNAMLEN + 1]; /* null terminated */ - /* nonstandard fields */ - long d_size; /* size in bytes */ - unsigned d_mode; /* DOS or OS/2 file attributes */ - unsigned d_time; - unsigned d_date; -}; - -/* The fields d_size and d_mode are extensions by me (Kai Uwe Rommel). - * The find_first and find_next calls deliver this data without any extra cost. - * If this data is needed, these fields save a lot of extra calls to stat() - * (each stat() again performs a find_first call !). - */ - -struct _dircontents -{ - char *_d_entry; - long _d_size; - unsigned _d_mode, _d_time, _d_date; - struct _dircontents *_d_next; -}; - -typedef struct _dirdesc -{ - int dd_id; /* uniquely identify each open directory */ - long dd_loc; /* where we are in directory entry is this */ - struct _dircontents *dd_contents; /* pointer to contents of dir */ - struct _dircontents *dd_cp; /* pointer to current position */ -} -DIR; - - -extern DIR *opendir(const char *); -extern struct dirent *readdir(DIR *); -extern void seekdir(DIR *, long); -extern long telldir(DIR *); -extern void closedir(DIR *); -#define rewinddir(dirp) seekdir(dirp, 0L) - -int GetFileMode(char *name); -ulg GetFileTime(char *name); -void SetFileTime(char *path, ulg stamp); -char *getVolumeLabel(int drive, unsigned long *time, unsigned long *mode, - time_t *utim); - -int IsFileNameValid(char *name); -int IsFileSystemFAT(char *dir); -void ChangeNameForFAT(char *name); - -char *GetLongNameEA(const char *name); -char *GetLongPathEA(const char *name); -void GetEAs(char *name, char **bufptr, size_t *size, - char **cbufptr, size_t *csize); - -char *StringLower(char *); diff --git a/third_party/infozip/zip/os2/osdep.h b/third_party/infozip/zip/os2/osdep.h deleted file mode 100644 index ea2c3f9c8..000000000 --- a/third_party/infozip/zip/os2/osdep.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#if defined(__OS2__) && !defined(OS2) -# define OS2 -#endif - -/* Automatic setting of the common Microsoft C idenfifier MSC. - * NOTE: Watcom also defines M_I*86 ! - */ -#if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__)) -# ifndef MSC -# define MSC /* This should work for older MSC, too! */ -# endif -#endif - -#if defined(__WATCOMC__) && defined(__386__) -# define WATCOMC_386 -#endif - -#if defined(__EMX__) || defined(WATCOMC_386) || defined(__BORLANDC__) -# if (defined(OS2) && !defined(__32BIT__)) -# define __32BIT__ -# endif -#endif - -#if defined(OS2) && !defined(__32BIT__) -# define MEMORY16 -#endif - -#ifndef NO_ASM -# define ASMV -/* # define ASM_CRC */ -#endif - -/* enable creation of UTC time fields unless explicitely suppressed */ -#if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)) -# define USE_EF_UT_TIME -#endif - -/* check that TZ environment variable is defined before using UTC times */ -#if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ)) -# define IZ_CHECK_TZ -#endif - -#ifndef ZP_NEED_MEMCOMPR -# define ZP_NEED_MEMCOMPR -#endif - -#ifdef MEMORY16 -# ifdef __TURBOC__ -# include -# if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__) -# if defined(DYNAMIC_CRC_TABLE) && defined(DYNALLOC_CRCTAB) - error: No dynamic CRC table allocation with Borland C far data models. -# endif /* DYNAMIC_CRC_TABLE */ -# endif /* Turbo/Borland C far data memory models */ -# define nearmalloc malloc -# define nearfree free -# define DYN_ALLOC -# else /* !__TURBOC__ */ -# include -# define nearmalloc _nmalloc -# define nearfree _nfree -# define farmalloc _fmalloc -# define farfree _ffree -# endif /* ?__TURBOC__ */ -# define MY_ZCALLOC 1 -#endif /* MEMORY16 */ - - -/* The symbol MSDOS is consistently used in the generic source files - * to identify code to support for MSDOS (and MSDOS related) stuff. - * e.g: FAT or (FAT like) file systems, - * '\\' as directory separator in paths, - * "\r\n" as record (line) terminator in text files, ... - * - * MSDOS is defined anyway with MS C 16-bit. So the block above works. - * For the 32-bit compilers, MSDOS must not be defined in the block above. - */ -#if (defined(OS2) && !defined(MSDOS)) -# define MSDOS -/* inherit MS-DOS file system etc. stuff */ -#endif - -#define USE_CASE_MAP -#define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ - procname(n, 1)) - -/* time stamp resolution of file system is 2 seconds */ -#define ROUNDED_TIME(time) ((time_t)(((unsigned long)(time) + 1) & (~1))) - -#define FOPR "rb" -#define FOPM "r+b" -#define FOPW "wb" - -#ifdef __32BIT__ -# define CBSZ 0x40000 -# define ZBSZ 0x40000 -#else -# define CBSZ 0xE000 -# define ZBSZ 0x7F00 /* Some libraries do not allow a buffer size > 32K */ -#endif - -#include -#include -#include - -#ifdef ZCRYPT_INTERNAL -# ifndef __GO32__ -# include /* getpid() declaration for srand seed */ -# endif -#endif - -/* for some (all ?) versions of IBM C Set/2 and IBM C Set++ */ -#ifndef S_IFMT -# define S_IFMT 0xF000 -#endif /* !S_IFMT */ - -#ifdef MSC -# define NO_UNISTD_H -#endif - -#ifdef __WATCOMC__ -# define NO_MKTEMP -/* Get asm routines to link properly without using "__cdecl": */ -# ifdef __386__ -# ifdef ASMV -# pragma aux window "*"; -# pragma aux prev "*"; -# pragma aux prev_length "*"; -# pragma aux strstart "*"; -# pragma aux match_start "*"; -# pragma aux max_chain_length "*"; -# pragma aux good_match "*"; -# pragma aux nice_match "*"; -# pragma aux match_init "*"; -# pragma aux longest_match "*"; -# endif -# 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 */ -# else /* !__386__ */ -# if defined(ASMV) || defined(ASM_CRC) -/*# error 16 bit assembly modules currently DO NOT WORK with Watcom C. */ -# endif -# ifdef ASMV -# pragma aux match_init "_*" parm caller [] loadds modify [ax bx] -# pragma aux longest_match "_*" parm caller [] loadds value [ax] \ - modify [ax bx cx dx es] -# endif -# ifndef USE_ZLIB -# pragma aux crc32 "_*" parm caller [] value [ax dx] \ - modify [ax bx cx dx es] -# pragma aux get_crc_table "_*" parm caller [] value [ax] \ - modify [ax bx cx dx] -# endif /* !USE_ZLIB */ -# endif /* ?__386__ */ -#endif - -#ifdef __IBMC__ -# define NO_UNISTD_H -# define NO_MKTEMP -# define timezone _timezone /* (underscore names work with */ -# define tzset _tzset /* all versions of C Set) */ -#endif diff --git a/third_party/infozip/zip/os2/zip.def b/third_party/infozip/zip/os2/zip.def deleted file mode 100644 index 7404eeeb0..000000000 --- a/third_party/infozip/zip/os2/zip.def +++ /dev/null @@ -1,3 +0,0 @@ -NAME WINDOWCOMPAT NEWFILES -DESCRIPTION 'The world-famous zip utilities from Info-ZIP' -; STACKSIZE 0x50000 diff --git a/third_party/infozip/zip/os2/zipup.h b/third_party/infozip/zip/os2/zipup.h deleted file mode 100644 index 592cff89e..000000000 --- a/third_party/infozip/zip/os2/zipup.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - Copyright (c) 1990-1999 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 1999-Oct-05 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, both of these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -*/ -#define fhow (O_RDONLY|O_BINARY) -#define fbad (-1) -typedef int ftype; -#define zopen(n,p) open(n,p) -#define zread(f,b,n) read(f,b,n) -#define zclose(f) close(f) -#define zerr(f) (k == (extent)(-1L)) -#define zstdin 0 diff --git a/third_party/infozip/zip/proginfo/3rdparty.bug b/third_party/infozip/zip/proginfo/3rdparty.bug deleted file mode 100644 index 32e782378..000000000 --- a/third_party/infozip/zip/proginfo/3rdparty.bug +++ /dev/null @@ -1,114 +0,0 @@ -Known, current PKZIP bugs/limitations: -------------------------------------- - - - PKUNZIP 2.04g is reported to corrupt some files when compressing them with - the -ex option; when tested, the files fail the CRC check, and comparison - with the original file shows bogus data (6K in one case) embedded in the - middle. PKWARE apparently characterized this as a "known problem." - - - PKUNZIP 2.04g considers volume labels valid only if originated on a FAT - file system, but other OSes and file systems (e.g., Amiga and OS/2 HPFS) - support volume labels, too. - - - PKUNZIP 2.04g can restore volume labels created by Zip 2.x but not by - PKZIP 2.04g (OS/2 DOS box only??). - - - PKUNZIP 2.04g gives an error message for stored directory entries created - under other OSes (although it creates the directory anyway), and PKZIP -vt - does not report the directory attribute bit as being set, even if it is. - - - PKZIP 2.04g mangles unknown extra fields (especially OS/2 extended attri- - butes) when adding new files to an existing zipfile [example: Walnut Creek - Hobbes March 1995 CD-ROM, FILE_ID.DIZ additions]. - - - PKUNZIP 2.04g is unable to detect or deal with prepended junk in a zipfile, - reporting CRC errors in valid compressed data. - - - PKUNZIP 2.04g (registered version) incorrectly updates/freshens the AV extra - field in authenticated archives. The resultant extra block length and total - extra field length are inconsistent. - - - [Windows version 2.01] Win95 long filenames (VFAT) are stored OK, but the - file system is always listed as ordinary DOS FAT. - - - [Windows version 2.50] NT long filenames (NTFS) are stored OK, but the - file system is always listed as ordinary DOS FAT. - - - PKZIP 2.04 for DOS encrypts using the OEM code page for 8-bit passwords, - while PKZIP 2.50 for Windows uses Latin-1 (ISO 8859-1). This means an - archive encrypted with an 8-bit password with one of the two PKZIP versions - cannot be decrypted with the other version. - - - PKZIP for Windows GUI (v 2.60), PKZIP for Windows command line (v 2.50) and - PKZIP for Unix (v 2.51) save the host's native file timestamps, but - only in a local extra field. Thus, timestamp-related selections (update - or freshen, both in extraction or archiving operations) use the DOS-format - localtime records in the Zip archives for comparisons. This may result - in wrong decisions of the program when updating archives that were - previously created in a different local time zone. - - - PKZIP releases newer than PKZIP for DOS 2.04g (PKZIP for Windows, both - GUI v 2.60 and console v 2.50; PKZIP for Unix v 2.51; probably others too) - use different code pages for storing filenames in central (OEM Codepage) - and local (ANSI / ISO 8859-1 Codepage) headers. When a stored filename - contains extended-ASCII characters, the local and central filename fields - do not match. As a consequence, Info-ZIP's Zip program considers such - archives as being corrupt and does not allow to modify them. Beginning - with release 5.41, Info-ZIP's UnZip contains a workaround to list AND - extract such archives with the correct filenames. - Maybe PKWARE has implemented this "feature" to allow extraction of their - "made-by-PKZIP for Unix/Windows" archives using old (v5.2 and earlier) - versions of Info-ZIP's UnZip for Unix/WinNT ??? (UnZip versions before - v 5.3 assumed that all archive entries were encoded in the codepage of - the UnZip program's host system.) - - - PKUNZIP 2.04g is reported to have problems with archives created on and/or - copied from Iomega ZIP drives (irony, eh?). - -Known, current WinZip bugs/limitations: --------------------------------------- - - - [16-bit version 6.1a] NT short filenames (FAT) are stored OK, but the - file system is always listed as NTFS. - - - WinZip doesn't allow 8-bit passwords, which means it cannot decrypt an - archive created with an 8-bit password (by PKZIP or Info-ZIP's Zip). - - - WinZip (at least Versions 6.3 PL1, 7.0 SR1) fails to remove old extra - fields when freshening existing archive entries. When updating archives - created by Info-ZIP's Zip that contain UT time stamp extra field blocks, - UnZip cannot display or restore the updated (DOS) time stamps of the - freshened archive members. - -Known, current other third-party Zip utils bugs/limitations: ------------------------------------------------------------- - - - Asi's PKZip clones for Macintosh (versions 2.3 and 2.10d) are thoroughly - broken. They create invalid Zip archives! - a) For the first entry, both compressed size and uncompressed length - are recorded as 0, despite the fact that compressed data of non-zero - length has been added. - b) Their program creates extra fields with an (undocumented) internal - structure that violates the requirements of PKWARE's Zip format - specification document "appnote.txt": Their extra field seems to - contain pure data; the 4-byte block header consisting of block ID - and data length is missing. - -Possibly current PKZIP bugs: ---------------------------- - - - PKZIP (2.04g?) can silently ignore read errors on network drives, storing - the correct CRC and compressed length but an incorrect and inconsistent - uncompressed length. - - - PKZIP (2.04g?), when deleting files from within a zipfile on a Novell - drive, sometimes only zeros out the data while failing to shrink the - zipfile. - -Other limitations: ------------------ - - - PKZIP 1.x and 2.x encryption has been cracked (known-plaintext approach; - see http://www.cryptography.com/ for details). - -[many other bugs in PKZIP 1.0, 1.1, 1.93a, 2.04c and 2.04e] diff --git a/third_party/infozip/zip/proginfo/ZipPorts b/third_party/infozip/zip/proginfo/ZipPorts deleted file mode 100644 index 2d946d304..000000000 --- a/third_party/infozip/zip/proginfo/ZipPorts +++ /dev/null @@ -1,285 +0,0 @@ -__________________________________________________________________________ - - This is the Info-ZIP file ZipPorts, last updated on 17 February 1996. -__________________________________________________________________________ - - -This document defines a set of rules and guidelines for those who wish to -contribute patches to Zip and UnZip (or even entire ports to new operating -systems). The list below is something between a style sheet and a "Miss -Manners" etiquette guide. While Info-ZIP encourages contributions and -fixes from anyone who finds something worth changing, we are also aware -of the fact that no two programmers have the programming style and that -unrestrained changes by a few dozen contributors would result in hideously -ugly (and unmaintainable) Frankenstein code. So consider the following an -attempt by the maintainers to maintain sanity as well as useful code. - -(The first version of this document was called either "ZipRules" or the -"No Feelthy ..." file and was compiled by David Kirschbaum in consulta- -tion with Mark Adler, Cave McNewt and others. The current incarnation -expands upon the original with insights gained from a few more years of -happy hacking...) - - -Summary: - - (0) The Platinum Rule: DON'T BREAK EXISTING PORTS -(0.1) The Golden Rule: DO UNTO THE CODE AS OTHERS HAVE DONE BEFORE -(0.2) The Silver Rule: DO UNTO THE LATEST BETA CODE -(0.3) The Bronze Rule: NO FEELTHY PIGGYBACKS - - (1) NO FEELTHY TABS - (2) NO FEELTHY CARRIAGE RETURNS - (3) NO FEELTHY 8-BIT CHARS - (4) NO FEELTHY LEFT-JUSTIFIED DASHES - (5) NO FEELTHY FANCY_FILENAMES - (6) NO FEELTHY NON-ZIPFILES AND NO FEELTHY E-MAIL BETAS - (7) NO FEELTHY E-MAIL BINARIES - - -Explanations: - - (0) The Platinum Rule: DON'T BREAK EXISTING PORTS - - No doubt about it, this is the one which really pisses us off and - pretty much guarantees that your port or patch will be ignored and/ - or laughed at. Examples range from the *really* severe cases which - "port" by ripping out all of the existing multi-OS code, to more - subtle oopers like relying on a local capability which doesn't exist - on other OSes or in older compilers (e.g., the use of ANSI "#elif" - or "#pragma" or "##" constructs, C++ comments, GNU extensions, etc.). - As to the former, use #ifdefs for your new code (see rule 0.3). And - as to the latter, trust us--there are few things we'd like better - than to be able to use some of the elegant "new" features out there - (many of which have been around for a decade or more). But our code - still compiles on machines dating back even longer, at least in spirit - --e.g., the AT&T 3B1 family and Dynix/ptx. Until we say otherwise, - dinosaurs are supported. - - -(0.1) The Golden Rule: DO UNTO THE CODE AS OTHERS HAVE DONE BEFORE - - In other words, try to fit into the local style of programming--no - matter how painful it may be. This includes cosmetic aspects like - indenting the same amount (both in the main C code and in the in- - clude files), using braces and comments similarly, NO TABS (see rule - #1), etc.; but also more substantive things like (for UnZip) putting - character strings into static (far) variables and using the LoadFar- - String macros to avoid overflowing limited MS-DOS data segments, and - using the ugly Info() macro instead of the more usual *printf() - functions so that dynamic-link-library ports are simpler. NEVER put - single-OS code (e.g., OS/2) of more than two or three lines into the - main (generic) modules; those are shared by everybody, and nobody else - cares about it or wants to see it. - - Note that not only do Zip and UnZip differ in these respects, so do - individual parts of each program. While it would be nice to have - global consistency, cosmetic changes are not a high priority; for - now we'll settle for local consistency--i.e., don't make things any - worse than they already are. - - Exception (BIG exception): single-letter variable names. Despite - the prevailing practice in much of Zip and parts of UnZip, and de- - spite the fact that one-letter variables allow you to pack really - cool, compact and complicated expressions onto one line, they also - make the code very difficult to maintain and are therefore *strongly* - discouraged. Don't ask us who is responsible in the first place; - while this sort of brain damage is not uncommon among former BASIC - programmers, it is nevertheless a lifelong embarrassment, and we do - try to pity the poor sod (that is, when we're not chasing bugs and - cursing him). :-) - - -(0.2) The Silver Rule: DO UNTO THE LATEST BETA CODE - - Few things are as annoying as receiving a large patch which obviously - represents a lot of time and careful work but which is relative to - an old version of Info-ZIP code. As wonderful as Larry Wall's patch - program is at applying context diffs to modified code, we regularly - make near-global changes and/or reorganize big chunks of the sources - (particularly in UnZip), and "patch" can't work miracles--big changes - invariably break any patch which is relative to an old version of the - code. - - Bottom line: contact the Info-ZIP core team FIRST (via the zip-bugs - e-mail address) and get up to date with the latest code before begin- - ning a big new port. And try to *stay* up to date while working on - your port--at least, as much as possible. - - -(0.3) The Bronze Rule: NO FEELTHY PIGGYBACKS - - UnZip is currently ported to something like 12 operating systems - (a few more or less depending on how one counts), and each of these, - with the possible exception of VM/CMS, has a unique macro identifying - it: AMIGA, ATARI_ST, __human68k__, MACOS, MSDOS, MVS, OS2, TOPS20, - UNIX, VMS, WIN32. Zip is moving in the same direction. New ports - should NOT piggyback one of the existing ports unless they are sub- - stantially similar--for example, Minix and Coherent are basically Unix - and therefore are included in the UNIX macro, but DOS djgpp ports and - OS/2 emx ports (both of which use the Unix-originated GNU C compiler - and often have "unix" defined by default) are obviously *not* Unix. - [The existing MTS port is a special exception; basically only one per- - son knows what MTS really is, and he's not telling. Presumably it's - not very close to Unix, but it's not worth arguing about it now.] - Along the same lines, neither OS/2 nor Human68K is the same as (or - even close to) MS-DOS. MVS and VM/CMS, on the other hand, are quite - similar to each other and are therefore combined in most places. - - Bottom line: when adding a new port (e.g., QDOS), create a new macro - for it ("QDOS"), a new subdirectory ("qdos") and a new source file for - OS-specific code ("qdos/qdos.c"). Use #ifdefs to fit any OS-specific - changes into the existing code (e.g., unzpriv.h). If it's close enough - to an existing port that piggybacking is a temptation, define a new - "combination macro" (e.g., "CMS_MVS") and replace the old macros as - required. (This last applies to UnZip, at least; the old preference - in Zip was fewer macros and long #ifdef lines, so talk to Onno or Jean- - loup about that.) See also rule 0.1. - - (Note that, for UnZip, new ports need not attempt to deal with all - features. Among other things, the wildcard-zipfile code in do_wild() - may be replaced with a supplied dummy version, since opendir/readdir/ - closedir() or the equivalent can be difficult to implement.) - - - (1) NO FEELTHY TABS - - Some editors and e-mail systems either have no capability to use - and/or display tab characters (ASCII 9) correctly, or they use non- - standard or variable-width tab columns, or other horrors. Some edi- - tors auto-convert spaces to tabs, after which the blind use of "diff - -c" results in a huge and mostly useless patch. Yes, *we* know about - diff's "-b" option, but not everyone does. And yes, we also know this - makes the source files bigger, even after compression; so be it. If - we *really* cared that much about the size of the sources, we'd still - be writing Unix-only utilities. - - Bottom line: use spaces, not tabs. - - Exception: some of the makefiles (the Unix one in particular) require - tabs as part of the syntax. - - Related utility programs: - Unix, OS/2 and MS-DOS: expand, unexpand. - MS-DOS: Buerg's TABS; Toad Hall's TOADSOFT. - And some editors have the conversion built-in. - - - (2) NO FEELTHY CARRIAGE RETURNS - - All source, documentation and other text files shall have Unix style - line endings (LF only, a.k.a. ctrl-J), not the DOS/OS2/NT CR+LF or Mac - CR-only line endings. - - Reason: "real programmers" in any environment can convert back and - forth between Unix and DOS/Mac style. All PC compilers but a few old - Borland versions can use either Unix or MS-DOS end-of-lines. Buerg's - LIST (file-display utility) for MS-DOS can use Unix or MS-DOS EOLs. - Both Zip and UnZip can convert line-endings as appropriate. But Unix - utilities like diff and patch die a horrible death (or produce horrible - output) if the target files have CRs. - - Related utilities: flip for Unix, OS/2 and MS-DOS; Unix "tr". - - Exceptions: documentation in pre-compiled binary distributions should - be in the local (target) format. - - - (3) NO FEELTHY 8-BIT CHARS - - Do all your editing in a plain-text ASCII editor. No WordPerfect, MS - Word, WordStar document mode, or other word processor files, thenkyew. - No desktop publishing. *Especially* no EBCDIC. No TIFFs, no GIFs, no - embedded pictures or dancing ladies (too bad, Cave Newt). [Sigh... -CN] - - Reason: compatibility with different consoles. My old XT clone is - the most limited! - - Exceptions: some Macintosh makefiles apparently require some 8-bit - characters; the Human68k port uses 8-bit characters for Kanji or Kana - comments (I think); etc. - - Related utilities: vi, emacs, EDLIN, Turbo C editor, other programmers' - editors, various word processor -> text conversion utilities. - - - (4) NO FEELTHY LEFT-JUSTIFIED DASHES - - Always precede repeated dashes (------) with one or more leading non- - dash characters: spaces, tabs, pound signs (#), comments (/*), what- - ever. - - Reason: sooner or later your source file will be e-mailed through an - undigestifier utility, most of which treat leading dashes as end-of- - message separators. We'd rather not have your code broken up into a - dozen separate untitled messages, thank you. - - - (5) NO FEELTHY FANCY_FILENAMES - - Assume the worst: that someone on a brain-damaged DOS system has to - work with everything your magic fingers produced. Keep the filenames - unimaginative and within MS-DOS limits (i.e., ordinary A..Z, 1..9, - "-$_!"-type characters, in the 8.3 "filename.ext" format). Mac and - Unix users, giggle all you want, but no spaces or multiple dots. - - Reason: compatibility with different file systems. MS-DOS FAT is the - most limited, with the exception of CompuServe (6.3, argh). - - Exceptions: slightly longer names are occasionally acceptable within - OS-specific subdirectories, but don't do that unless there's a good - reason for it. - - - (6) NO FEELTHY NON-ZIPFILES AND NO FEELTHY E-MAIL BETAS - - Beta testers and developers are in general expected to have both - ftp capability and the ability to deal with zipfiles. Those without - should either find a friend who does or else learn about ftp-mailers. - - Reason: the core development team barely has time to work on the - code, much less prepare oddball formats and/or mail betas out (and - the situation is getting worse, sigh). - - Exceptions: anyone seriously proposing to do a new port will be - given special treatment, particularly with respect to UnZip; we - obviously realize that bootstrapping a completely new port can be - quite difficult and have no desire to make it even harder due to - lack of access to the latest code (rule 0.2). - - Public releases of UnZip, on the other hand, will be available in - two formats: .tar.Z (16-bit compress'd tar) and .zip (either "plain" - or self-extracting). Zip sources and executables will generally only - be distributed in .zip format, since Zip is pretty much useless without - UnZip. - - - (7) NO FEELTHY E-MAIL BINARIES - - Binary files (e.g., executables, test zipfiles, etc.) should NEVER - be mailed raw. Where possible, they should be uploaded via ftp in - BINARY mode; if that's impossible, Mark's "ship" ASCII-encoder should - be used; and if that's unavailable, uuencode or xxencode should be - used. Weirdo NeXTmail, mailtool and MIME formats are also Right Out. - - Files larger than 50KB may need to be broken into pieces for mailing - (be sure to label them in order!), unless "ship" is used (it can - auto-split, label and mail files if told to do so). If Down Under - is involved, files must be broken into under-20KB chunks. - - Reasons: to prevent sounds of gagging mailers from resounding through- - out the land. To be relatively efficient in the binary->ASCII conver- - sion. (Yeah, yeah, I know, there's better conversions out there. But - not as widely known, and they often break on BITNET gateways.) - - Related utilities: ship, uuencode, uudecode, uuxfer20, quux, others. - Just make sure they don't leave embedded or trailing spaces (that is, - they should use the "`" character in place of ASCII 32). Otherwise - mailers are prone to truncate or whatever. - - -Greg Roelofs (a.k.a. Cave Newt) -Info-ZIP UnZip maintainer - -David Kirschbaum -former Info-ZIP Coordinator diff --git a/third_party/infozip/zip/proginfo/algorith.txt b/third_party/infozip/zip/proginfo/algorith.txt deleted file mode 100644 index 867e30bc2..000000000 --- a/third_party/infozip/zip/proginfo/algorith.txt +++ /dev/null @@ -1,68 +0,0 @@ -Zip's deflation algorithm is a variation of LZ77 (Lempel-Ziv 1977, see -reference below). It finds duplicated strings in the input data. The -second occurrence of a string is replaced by a pointer to the previous -string, in the form of a pair (distance, length). Distances are -limited to 32K bytes, and lengths are limited to 258 bytes. When a -string does not occur anywhere in the previous 32K bytes, it is -emitted as a sequence of literal bytes. (In this description, -'string' must be taken as an arbitrary sequence of bytes, and is not -restricted to printable characters.) - -Literals or match lengths are compressed with one Huffman tree, and -match distances are compressed with another tree. The trees are stored -in a compact form at the start of each block. The blocks can have any -size (except that the compressed data for one block must fit in -available memory). A block is terminated when zip determines that it -would be useful to start another block with fresh trees. (This is -somewhat similar to compress.) - -Duplicated strings are found using a hash table. All input strings of -length 3 are inserted in the hash table. A hash index is computed for -the next 3 bytes. If the hash chain for this index is not empty, all -strings in the chain are compared with the current input string, and -the longest match is selected. - -The hash chains are searched starting with the most recent strings, to -favor small distances and thus take advantage of the Huffman encoding. -The hash chains are singly linked. There are no deletions from the -hash chains, the algorithm simply discards matches that are too old. - -To avoid a worst-case situation, very long hash chains are arbitrarily -truncated at a certain length, determined by a runtime option (zip -1 -to -9). So zip does not always find the longest possible match but -generally finds a match which is long enough. - -zip also defers the selection of matches with a lazy evaluation -mechanism. After a match of length N has been found, zip searches for a -longer match at the next input byte. If a longer match is found, the -previous match is truncated to a length of one (thus producing a single -literal byte) and the longer match is emitted afterwards. Otherwise, -the original match is kept, and the next match search is attempted only -N steps later. - -The lazy match evaluation is also subject to a runtime parameter. If -the current match is long enough, zip reduces the search for a longer -match, thus speeding up the whole process. If compression ratio is more -important than speed, zip attempts a complete second search even if -the first match is already long enough. - -The lazy match evaluation is not performed for the fastest compression -modes (speed options -1 to -3). For these fast modes, new strings -are inserted in the hash table only when no match was found, or -when the match is not too long. This degrades the compression ratio -but saves time since there are both fewer insertions and fewer searches. - -Jean-loup Gailly -jloup@chorus.fr - -References: - -[LZ77] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data -Compression", IEEE Transactions on Information Theory", Vol. 23, No. 3, -pp. 337-343. - -APPNOTE.TXT documentation file in PKZIP 1.93a. It is available by -ftp in ftp.cso.uiuc.edu:/pc/exec-pc/pkz193a.exe [128.174.5.59] - -'Deflate' Compressed Data Format Specification: -ftp://ftp.uu.net/pub/archiving/zip/doc/deflate-1.1.doc diff --git a/third_party/infozip/zip/proginfo/ebcdic.msg b/third_party/infozip/zip/proginfo/ebcdic.msg deleted file mode 100644 index 1a7bbad49..000000000 --- a/third_party/infozip/zip/proginfo/ebcdic.msg +++ /dev/null @@ -1,63 +0,0 @@ -From dima@mitrah.ru Mon Nov 10 02:25:38 2003 -Return-Path: -Received: from b.mx.sonic.net (eth0.b.mx.sonic.net [209.204.159.4]) - by eth0.a.lds.sonic.net (8.12.10/8.12.9) with ESMTP id hAAAPccT025257 - for ; Mon, 10 Nov 2003 02:25:38 -0800 -Received: from icicle.pobox.com (icicle.pobox.com [207.8.214.2]) - by b.mx.sonic.net (8.12.10/8.12.7) with ESMTP id hAAAPar9007141 - for ; Mon, 10 Nov 2003 02:25:37 -0800 -Received: from icicle.pobox.com (localhost[127.0.0.1]) - by icicle.pobox.com (Postfix) with ESMTP id 9BA347A96B - for ; Sat, 8 Nov 2003 06:15:13 -0500 (EST) -Delivered-To: newt@pobox.com -Received: from mail.ropnet.ru (mail.ropnet.ru[212.42.37.90]) - by icicle.pobox.com (Postfix) with ESMTP id A96817A8F7 - for ; Sat, 8 Nov 2003 06:15:04 -0500 (EST) -Received: from d34-67.ropnet.ru (d34-67.ropnet.ru [212.42.34.67]) - by mail.ropnet.ru (8.11.7/8.11.7) with ESMTP id hA8BEjF76200 - for ; Sat, 8 Nov 2003 14:14:46 +0300 (MSK) -Resent-Date: Sat, 8 Nov 2003 14:14:46 +0300 (MSK) -Resent-Message-Id: <200311081114.hA8BEjF76200@mail.ropnet.ru> -Date: Sat, 8 Nov 2003 14:18:18 +0300 -From: Dmitri Koulikov -X-Mailer: The Bat! (v1.62r) Personal -Reply-To: Dmitri Koulikov -X-Priority: 3 (Normal) -Message-ID: <815640011.20031108141818@mitrah.ru> -To: newt@pobox.com -Subject: unzip and zip lack NLS - 2 -Resent-From: Dmitri Koulikov -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary="----------EB1581C42AB86662" -Status: R - -------------EB1581C42AB86662 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hello Greg Roelofs, - - By mistake I sent you wrong version of ebcdic.h. Now it is as it -have to. - Additionally I found that zip works with Russian filenames good. -But fails to process -D switch. So I have to chahge zipfile.c. Most -probably this is not good but it works. - --- -Best regards, - Dmitri - -mailto:dima@mitrah.ru -------------EB1581C42AB86662 -Content-Type: application/octet-stream; name="ebcdic.h" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="ebcdic.h" - -------------EB1581C42AB86662 -Content-Type: application/octet-stream; name="zipfile.c" -Content-Transfer-Encoding: base64 -Content-Disposition: attachment; filename="zipfile.c" - -------------EB1581C42AB86662-- - - diff --git a/third_party/infozip/zip/proginfo/extrafld.txt b/third_party/infozip/zip/proginfo/extrafld.txt deleted file mode 100644 index 624e05c65..000000000 --- a/third_party/infozip/zip/proginfo/extrafld.txt +++ /dev/null @@ -1,1372 +0,0 @@ -The following are the known types of zipfile extra fields as of this -writing. Extra fields are documented in PKWARE's appnote.txt and are -intended to allow for backward- and forward-compatible extensions to -the zipfile format. Multiple extra-field types may be chained together, -provided that the total length of all extra-field data is less than 64KB. -(In fact, PKWARE requires that the total length of the entire file header, -including timestamp, file attributes, filename, comment, extra field, etc., -be no more than 64KB.) - -Each extra-field type (or subblock) must contain a four-byte header con- -sisting of a two-byte header ID and a two-byte length (little-endian) for -the remaining data in the subblock. If there are additional subblocks -within the extra field, the header for each one will appear immediately -following the data for the previous subblock (i.e., with no padding for -alignment). - -All integer fields in the descriptions below are in little-endian (Intel) -format unless otherwise specified. Note that "Short" means two bytes, -"Long" means four bytes, and "Long-Long" means eight bytes, regardless -of their native sizes. Unless specifically noted, all integer fields should -be interpreted as unsigned (non-negative) numbers. - -Christian Spieler, 20010517 - -Updated to include the Unicode extra fields. Added new Unix extra field. - -Ed Gordon, 20060819, 20070607, 20070909, 20080426, 20080509 - - ------------------------- - - Header ID's of 0 thru 31 are reserved for use by PKWARE. - The remaining ID's can be used by third party vendors for - proprietary usage. - - The current Header ID mappings defined by PKWARE are: - - 0x0001 ZIP64 extended information extra field - 0x0007 AV Info - 0x0009 OS/2 extended attributes (also Info-ZIP) - 0x000a NTFS (Win9x/WinNT FileTimes) - 0x000c OpenVMS (also Info-ZIP) - 0x000d Unix - 0x000f Patch Descriptor - 0x0014 PKCS#7 Store for X.509 Certificates - 0x0015 X.509 Certificate ID and Signature for - individual file - 0x0016 X.509 Certificate ID for Central Directory - - The Header ID mappings defined by Info-ZIP and third parties are: - - 0x0065 IBM S/390 attributes - uncompressed - 0x0066 IBM S/390 attributes - compressed - 0x07c8 Info-ZIP Macintosh (old, J. Lee) - 0x2605 ZipIt Macintosh (first version) - 0x2705 ZipIt Macintosh v 1.3.5 and newer (w/o full filename) - 0x334d Info-ZIP Macintosh (new, D. Haase's 'Mac3' field ) - 0x4154 Tandem NSK - 0x4341 Acorn/SparkFS (David Pilling) - 0x4453 Windows NT security descriptor (binary ACL) - 0x4704 VM/CMS - 0x470f MVS - 0x4854 Theos, old inofficial port - 0x4b46 FWKCS MD5 (see below) - 0x4c41 OS/2 access control list (text ACL) - 0x4d49 Info-ZIP OpenVMS (obsolete) - 0x4d63 Macintosh SmartZIP, by Macro Bambini - 0x4f4c Xceed original location extra field - 0x5356 AOS/VS (binary ACL) - 0x5455 extended timestamp - 0x5855 Info-ZIP Unix (original; also OS/2, NT, etc.) - 0x554e Xceed unicode extra field - 0x6375 Info-ZIP Unicode Comment - 0x6542 BeOS (BeBox, PowerMac, etc.) - 0x6854 Theos - 0x7075 Info-ZIP Unicode Path - 0x756e ASi Unix - 0x7855 Info-ZIP Unix (previous new) - 0x7875 Info-ZIP Unix (new) - 0xfb4a SMS/QDOS - -The following are detailed descriptions of the known extra-field block types: - - -OS/2 Extended Attributes Extra Field: - ==================================== - - The following is the layout of the OS/2 extended attributes "extra" - block. (Last Revision 19960922) - - Note: all fields stored in Intel low-byte/high-byte order. - - Local-header version: - - Value Size Description - ----- ---- ----------- - (OS/2) 0x0009 Short tag for this extra block type - TSize Short total data size for this block - BSize Long uncompressed EA data size - CType Short compression type - EACRC Long CRC value for uncompressed EA data - (var.) variable compressed EA data - - Central-header version: - - Value Size Description - ----- ---- ----------- - (OS/2) 0x0009 Short tag for this extra block type - TSize Short total data size for this block (4) - BSize Long size of uncompressed local EA data - - The value of CType is interpreted according to the "compression - method" section above; i.e., 0 for stored, 8 for deflated, etc. - - The OS/2 extended attribute structure (FEA2LIST) is compressed and - then stored in its entirety within this structure. There will only - ever be one block of data in the variable-length field. - - - -OS/2 Access Control List Extra Field: - ==================================== - - The following is the layout of the OS/2 ACL extra block. - (Last Revision 19960922) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (ACL) 0x4c41 Short tag for this extra block type ("AL") - TSize Short total data size for this block - BSize Long uncompressed ACL data size - CType Short compression type - EACRC Long CRC value for uncompressed ACL data - (var.) variable compressed ACL data - - Central-header version: - - Value Size Description - ----- ---- ----------- - (ACL) 0x4c41 Short tag for this extra block type ("AL") - TSize Short total data size for this block (4) - BSize Long size of uncompressed local ACL data - - The value of CType is interpreted according to the "compression - method" section above; i.e., 0 for stored, 8 for deflated, etc. - - The uncompressed ACL data consist of a text header of the form - "ACL1:%hX,%hd\n", where the first field is the OS/2 ACCINFO acc_attr - member and the second is acc_count, followed by acc_count strings - of the form "%s,%hx\n", where the first field is acl_ugname (user - group name) and the second acl_access. This block type will be - extended for other operating systems as needed. - - - -Windows NT Security Descriptor Extra Field: - ========================================== - - The following is the layout of the NT Security Descriptor (another - type of ACL) extra block. (Last Revision 19960922) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (SD) 0x4453 Short tag for this extra block type ("SD") - TSize Short total data size for this block - BSize Long uncompressed SD data size - Version Byte version of uncompressed SD data format - CType Short compression type - EACRC Long CRC value for uncompressed SD data - (var.) variable compressed SD data - - Central-header version: - - Value Size Description - ----- ---- ----------- - (SD) 0x4453 Short tag for this extra block type ("SD") - TSize Short total data size for this block (4) - BSize Long size of uncompressed local SD data - - The value of CType is interpreted according to the "compression - method" section above; i.e., 0 for stored, 8 for deflated, etc. - Version specifies how the compressed data are to be interpreted - and allows for future expansion of this extra field type. Currently - only version 0 is defined. - - For version 0, the compressed data are to be interpreted as a single - valid Windows NT SECURITY_DESCRIPTOR data structure, in self-relative - format. - - - -PKWARE Win95/WinNT Extra Field: - ============================== - - The following description covers PKWARE's "NTFS" attributes - "extra" block, introduced with the release of PKZIP 2.50 for - Windows. (Last Revision 20001118) - - (Note: At this time the Mtime, Atime and Ctime values may - be used on any WIN32 system.) - [Info-ZIP note: In the current implementations, this field has - a fixed total data size of 32 bytes and is only stored as local - extra field.] - - Value Size Description - ----- ---- ----------- - (NTFS) 0x000a Short Tag for this "extra" block type - TSize Short Total Data Size for this block - Reserved Long for future use - Tag1 Short NTFS attribute tag value #1 - Size1 Short Size of attribute #1, in bytes - (var.) SubSize1 Attribute #1 data - . - . - . - TagN Short NTFS attribute tag value #N - SizeN Short Size of attribute #N, in bytes - (var.) SubSize1 Attribute #N data - - For NTFS, values for Tag1 through TagN are as follows: - (currently only one set of attributes is defined for NTFS) - - Tag Size Description - ----- ---- ----------- - 0x0001 2 bytes Tag for attribute #1 - Size1 2 bytes Size of attribute #1, in bytes (24) - Mtime 8 bytes 64-bit NTFS file last modification time - Atime 8 bytes 64-bit NTFS file last access time - Ctime 8 bytes 64-bit NTFS file creation time - - The total length for this block is 28 bytes, resulting in a - fixed size value of 32 for the TSize field of the NTFS block. - - The NTFS filetimes are 64-bit unsigned integers, stored in Intel - (least significant byte first) byte order. They determine the - number of 1.0E-07 seconds (1/10th microseconds!) past WinNT "epoch", - which is "01-Jan-1601 00:00:00 UTC". - - - -PKWARE OpenVMS Extra Field: - ========================== - - The following is the layout of PKWARE's OpenVMS attributes "extra" - block. (Last Revision 12/17/91) - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (VMS) 0x000c Short Tag for this "extra" block type - TSize Short Total Data Size for this block - CRC Long 32-bit CRC for remainder of the block - Tag1 Short OpenVMS attribute tag value #1 - Size1 Short Size of attribute #1, in bytes - (var.) Size1 Attribute #1 data - . - . - . - TagN Short OpenVMS attribute tage value #N - SizeN Short Size of attribute #N, in bytes - (var.) SizeN Attribute #N data - - Rules: - - 1. There will be one or more of attributes present, which - will each be preceded by the above TagX & SizeX values. - These values are identical to the ATR$C_XXXX and - ATR$S_XXXX constants which are defined in ATR.H under - OpenVMS C. Neither of these values will ever be zero. - - 2. No word alignment or padding is performed. - - 3. A well-behaved PKZIP/OpenVMS program should never produce - more than one sub-block with the same TagX value. Also, - there will never be more than one "extra" block of type - 0x000c in a particular directory record. - - - -Info-ZIP VMS Extra Field: - ======================== - - The following is the layout of Info-ZIP's VMS attributes extra - block for VAX or Alpha AXP. The local-header and central-header - versions are identical. (Last Revision 19960922) - - Value Size Description - ----- ---- ----------- - (VMS2) 0x4d49 Short tag for this extra block type ("JM") - TSize Short total data size for this block - ID Long block ID - Flags Short info bytes - BSize Short uncompressed block size - Reserved Long (reserved) - (var.) variable compressed VMS file-attributes block - - The block ID is one of the following unterminated strings: - - "VFAB" struct FAB - "VALL" struct XABALL - "VFHC" struct XABFHC - "VDAT" struct XABDAT - "VRDT" struct XABRDT - "VPRO" struct XABPRO - "VKEY" struct XABKEY - "VMSV" version (e.g., "V6.1"; truncated at hyphen) - "VNAM" reserved - - The lower three bits of Flags indicate the compression method. The - currently defined methods are: - - 0 stored (not compressed) - 1 simple "RLE" - 2 deflated - - The "RLE" method simply replaces zero-valued bytes with zero-valued - bits and non-zero-valued bytes with a "1" bit followed by the byte - value. - - The variable-length compressed data contains only the data corre- - sponding to the indicated structure or string. Typically multiple - VMS2 extra fields are present (each with a unique block type). - - - -Info-ZIP Macintosh Extra Field: - ============================== - - The following is the layout of the (old) Info-ZIP resource-fork extra - block for Macintosh. The local-header and central-header versions - are identical. (Last Revision 19960922) - - Value Size Description - ----- ---- ----------- - (Mac) 0x07c8 Short tag for this extra block type - TSize Short total data size for this block - "JLEE" beLong extra-field signature - FInfo 16 bytes Macintosh FInfo structure - CrDat beLong HParamBlockRec fileParam.ioFlCrDat - MdDat beLong HParamBlockRec fileParam.ioFlMdDat - Flags beLong info bits - DirID beLong HParamBlockRec fileParam.ioDirID - VolName 28 bytes volume name (optional) - - All fields but the first two are in native Macintosh format - (big-endian Motorola order, not little-endian Intel). The least - significant bit of Flags is 1 if the file is a data fork, 0 other- - wise. In addition, if this extra field is present, the filename - has an extra 'd' or 'r' appended to indicate data fork or resource - fork. The 28-byte VolName field may be omitted. - - - -ZipIt Macintosh Extra Field (long): - ================================== - - The following is the layout of the ZipIt extra block for Macintosh. - The local-header and central-header versions are identical. - (Last Revision 19970130) - - Value Size Description - ----- ---- ----------- - (Mac2) 0x2605 Short tag for this extra block type - TSize Short total data size for this block - "ZPIT" beLong extra-field signature - FnLen Byte length of FileName - FileName variable full Macintosh filename - FileType Byte[4] four-byte Mac file type string - Creator Byte[4] four-byte Mac creator string - - - -ZipIt Macintosh Extra Field (short): - =================================== - - The following is the layout of a shortened variant of the - ZipIt extra block for Macintosh (without "full name" entry). - This variant is used by ZipIt 1.3.5 and newer for entries that - do not need a "full Mac filename" record. - The local-header and central-header versions are identical. - (Last Revision 19980903) - - Value Size Description - ----- ---- ----------- - (Mac2b) 0x2705 Short tag for this extra block type - TSize Short total data size for this block (12) - "ZPIT" beLong extra-field signature - FileType Byte[4] four-byte Mac file type string - Creator Byte[4] four-byte Mac creator string - - - -Info-ZIP Macintosh Extra Field (new): - ==================================== - - The following is the layout of the (new) Info-ZIP extra - block for Macintosh, designed by Dirk Haase. - All values are in little-endian. - (Last Revision 19981005) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (Mac3) 0x334d Short tag for this extra block type ("M3") - TSize Short total data size for this block - BSize Long uncompressed finder attribute data size - Flags Short info bits - fdType Byte[4] Type of the File (4-byte string) - fdCreator Byte[4] Creator of the File (4-byte string) - (CType) Short compression type - (CRC) Long CRC value for uncompressed MacOS data - Attribs variable finder attribute data (see below) - - - Central-header version: - - Value Size Description - ----- ---- ----------- - (Mac3) 0x334d Short tag for this extra block type ("M3") - TSize Short total data size for this block - BSize Long uncompressed finder attribute data size - Flags Short info bits - fdType Byte[4] Type of the File (4-byte string) - fdCreator Byte[4] Creator of the File (4-byte string) - - The third bit of Flags in both headers indicates whether - the LOCAL extra field is uncompressed (and therefore whether CType - and CRC are omitted): - - Bits of the Flags: - bit 0 if set, file is a data fork; otherwise unset - bit 1 if set, filename will be not changed - bit 2 if set, Attribs is uncompressed (no CType, CRC) - bit 3 if set, date and times are in 64 bit - if zero date and times are in 32 bit. - bit 4 if set, timezone offsets fields for the native - Mac times are omitted (UTC support deactivated) - bits 5-15 reserved; - - - Attributes: - - Attribs is a Mac-specific block of data in little-endian format with - the following structure (if compressed, uncompress it first): - - Value Size Description - ----- ---- ----------- - fdFlags Short Finder Flags - fdLocation.v Short Finder Icon Location - fdLocation.h Short Finder Icon Location - fdFldr Short Folder containing file - - FXInfo 16 bytes Macintosh FXInfo structure - FXInfo-Structure: - fdIconID Short - fdUnused[3] Short unused but reserved 6 bytes - fdScript Byte Script flag and number - fdXFlags Byte More flag bits - fdComment Short Comment ID - fdPutAway Long Home Dir ID - - FVersNum Byte file version number - may be not used by MacOS - ACUser Byte directory access rights - - FlCrDat ULong date and time of creation - FlMdDat ULong date and time of last modification - FlBkDat ULong date and time of last backup - These time numbers are original Mac FileTime values (local time!). - Currently, date-time width is 32-bit, but future version may - support be 64-bit times (see flags) - - CrGMTOffs Long(signed!) difference "local Creat. time - UTC" - MdGMTOffs Long(signed!) difference "local Modif. time - UTC" - BkGMTOffs Long(signed!) difference "local Backup time - UTC" - These "local time - UTC" differences (stored in seconds) may be - used to support timestamp adjustment after inter-timezone transfer. - These fields are optional; bit 4 of the flags word controls their - presence. - - Charset Short TextEncodingBase (Charset) - valid for the following two fields - - FullPath variable Path of the current file. - Zero terminated string (C-String) - Currently coded in the native Charset. - - Comment variable Finder Comment of the current file. - Zero terminated string (C-String) - Currently coded in the native Charset. - - - -SmartZIP Macintosh Extra Field: - ==================================== - - The following is the layout of the SmartZIP extra - block for Macintosh, designed by Marco Bambini. - - Local-header version: - - Value Size Description - ----- ---- ----------- - 0x4d63 Short tag for this extra block type ("cM") - TSize Short total data size for this block (64) - "dZip" beLong extra-field signature - fdType Byte[4] Type of the File (4-byte string) - fdCreator Byte[4] Creator of the File (4-byte string) - fdFlags beShort Finder Flags - fdLocation.v beShort Finder Icon Location - fdLocation.h beShort Finder Icon Location - fdFldr beShort Folder containing file - CrDat beLong HParamBlockRec fileParam.ioFlCrDat - MdDat beLong HParamBlockRec fileParam.ioFlMdDat - frScroll.v Byte vertical pos. of folder's scroll bar - fdScript Byte Script flag and number - frScroll.h Byte horizontal pos. of folder's scroll bar - fdXFlags Byte More flag bits - FileName Byte[32] full Macintosh filename (pascal string) - - All fields but the first two are in native Macintosh format - (big-endian Motorola order, not little-endian Intel). - The extra field size is fixed to 64 bytes. - The local-header and central-header versions are identical. - - - -Acorn SparkFS Extra Field: - ========================= - - The following is the layout of David Pilling's SparkFS extra block - for Acorn RISC OS. The local-header and central-header versions are - identical. (Last Revision 19960922) - - Value Size Description - ----- ---- ----------- - (Acorn) 0x4341 Short tag for this extra block type ("AC") - TSize Short total data size for this block (20) - "ARC0" Long extra-field signature - LoadAddr Long load address or file type - ExecAddr Long exec address - Attr Long file permissions - Zero Long reserved; always zero - - The following bits of Attr are associated with the given file - permissions: - - bit 0 user-writable ('W') - bit 1 user-readable ('R') - bit 2 reserved - bit 3 locked ('L') - bit 4 publicly writable ('w') - bit 5 publicly readable ('r') - bit 6 reserved - bit 7 reserved - - - -VM/CMS Extra Field: - ================== - - The following is the layout of the file-attributes extra block for - VM/CMS. The local-header and central-header versions are - identical. (Last Revision 19960922) - - Value Size Description - ----- ---- ----------- - (VM/CMS) 0x4704 Short tag for this extra block type - TSize Short total data size for this block - flData variable file attributes data - - flData is an uncompressed fldata_t struct. - - - -MVS Extra Field: - =============== - - The following is the layout of the file-attributes extra block for - MVS. The local-header and central-header versions are identical. - (Last Revision 19960922) - - Value Size Description - ----- ---- ----------- - (MVS) 0x470f Short tag for this extra block type - TSize Short total data size for this block - flData variable file attributes data - - flData is an uncompressed fldata_t struct. - - - -PKWARE Unix Extra Field: - ======================== - - The following is the layout of PKWARE's Unix "extra" block. - It was introduced with the release of PKZIP for Unix 2.50. - Note: all fields are stored in Intel low-byte/high-byte order. - (Last Revision 19980901) - - This field has a minimum data size of 12 bytes and is only stored - as local extra field. - - Value Size Description - ----- ---- ----------- - (Unix0) 0x000d Short Tag for this "extra" block type - TSize Short Total Data Size for this block - AcTime Long time of last access (UTC/GMT) - ModTime Long time of last modification (UTC/GMT) - UID Short Unix user ID - GID Short Unix group ID - (var) variable Variable length data field - - The variable length data field will contain file type - specific data. Currently the only values allowed are - the original "linked to" file names for hard or symbolic - links, and the major and minor device node numbers for - character and block device nodes. Since device nodes - cannot be either symbolic or hard links, only one set of - variable length data is stored. Link files will have the - name of the original file stored. This name is NOT NULL - terminated. Its size can be determined by checking TSize - - 12. Device entries will have eight bytes stored as two 4 - byte entries (in little-endian format). The first entry - will be the major device number, and the second the minor - device number. - - [Info-ZIP note: The fixed part of this field has the same layout as - Info-ZIP's abandoned "Unix1 timestamps & owner ID info" extra field; - only the two tag bytes are different.] - - - -PATCH Descriptor Extra Field: - ============================ - - The following is the layout of the Patch Descriptor "extra" - block. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (Patch) 0x000f Short Tag for this "extra" block type - TSize Short Size of the total "extra" block - Version Short Version of the descriptor - Flags Long Actions and reactions (see below) - OldSize Long Size of the file about to be patched - OldCRC Long 32-bit CRC of the file about to be patched - NewSize Long Size of the resulting file - NewCRC Long 32-bit CRC of the resulting file - - - Actions and reactions - - Bits Description - ---- ---------------- - 0 Use for autodetection - 1 Treat as selfpatch - 2-3 RESERVED - 4-5 Action (see below) - 6-7 RESERVED - 8-9 Reaction (see below) to absent file - 10-11 Reaction (see below) to newer file - 12-13 Reaction (see below) to unknown file - 14-15 RESERVED - 16-31 RESERVED - - Actions - - Action Value - ------ ----- - none 0 - add 1 - delete 2 - patch 3 - - Reactions - - Reaction Value - -------- ----- - ask 0 - skip 1 - ignore 2 - fail 3 - - - -PKCS#7 Store for X.509 Certificates: - =================================== - - This field is contains the information about each - certificate a file is signed with. This field should only - appear in the first central directory record, and will be - ignored in any other record. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (Store) 0x0014 2 bytes Tag for this "extra" block type - SSize 2 bytes Size of the store data - SData (variable) Data about the store - - SData - Value Size Description - ----- ---- ----------- - Version 2 bytes Version number, 0x0001 for now - StoreD (variable) Actual store data - - The StoreD member is suitable for passing as the pbData - member of a CRYPT_DATA_BLOB to the CertOpenStore() function - in Microsoft's CryptoAPI. The SSize member above will be - cbData + 6, where cbData is the cbData member of the same - CRYPT_DATA_BLOB. The encoding type to pass to - CertOpenStore() should be - PKCS_7_ANS_ENCODING | X509_ASN_ENCODING. - - - -X.509 Certificate ID and Signature for individual file: - ====================================================== - - This field contains the information about which certificate - in the PKCS#7 Store was used to sign the particular file. - It also contains the signature data. This field can appear - multiple times, but can only appear once per certificate. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (CID) 0x0015 2 bytes Tag for this "extra" block type - CSize 2 bytes Size of Method - Method (variable) - - Method - Value Size Description - ----- ---- ----------- - Version 2 bytes Version number, for now 0x0001 - AlgID 2 bytes Algorithm ID used for signing - IDSize 2 bytes Size of Certificate ID data - CertID (variable) Certificate ID data - SigSize 2 bytes Size of Signature data - Sig (variable) Signature data - - CertID - Value Size Description - ----- ---- ----------- - Size1 4 bytes Size of CertID, should be (IDSize - 4) - Size1 4 bytes A bug in version one causes this value - to appear twice. - IssSize 4 bytes Issuer data size - Issuer (variable) Issuer data - SerSize 4 bytes Serial Number size - Serial (variable) Serial Number data - - The Issuer and IssSize members are suitable for creating a - CRYPT_DATA_BLOB to be the Issuer member of a CERT_INFO - struct. The Serial and SerSize members would be the - SerialNumber member of the same CERT_INFO struct. This - struct would be used to find the certificate in the store - the file was signed with. Those structures are from the MS - CryptoAPI. - - Sig and SigSize are the actual signature data and size - generated by signing the file with the MS CryptoAPI using a - hash created with the given AlgID. - - - -X.509 Certificate ID and Signature for central directory: - ======================================================== - - This field contains the information about which certificate - in the PKCS#7 Store was used to sign the central directory. - It should only appear with the first central directory - record, along with the store. The data structure is the - same as the CID, except that SigSize will be 0, and there - will be no Sig member. - - This field is also kept after the last central directory - record, as the signature data (ID 0x05054b50, it looks like - a central directory record of a different type). This - second copy of the data is the Signature Data member of the - record, and will have a SigSize that is non-zero, and will - have Sig data. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (CDID) 0x0016 2 bytes Tag for this "extra" block type - CSize 2 bytes Size of Method - Method (variable) - - - -ZIP64 Extended Information Extra Field: - ====================================== - - The following is the layout of the ZIP64 extended - information "extra" block. If one of the size or - offset fields in the Local or Central directory - record is too small to hold the required data, - a ZIP64 extended information record is created. - The order of the fields in the ZIP64 extended - information record is fixed, but the fields will - only appear if the corresponding Local or Central - directory record field is set to 0xFFFF or 0xFFFFFFFF. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (ZIP64) 0x0001 2 bytes Tag for this "extra" block type - Size 2 bytes Size of this "extra" block - Original - Size 8 bytes Original uncompresseed file size - Compressed - Size 8 bytes Size of compressed data - Relative Header - Offset 8 bytes Offset of local header record - Disk Start - Number 4 bytes Number of the disk on which - this file starts - - This entry in the Local header must include BOTH original - and compressed file sizes. - - - -Extended Timestamp Extra Field: - ============================== - - The following is the layout of the extended-timestamp extra block. - (Last Revision 19970118) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (time) 0x5455 Short tag for this extra block type ("UT") - TSize Short total data size for this block - Flags Byte info bits - (ModTime) Long time of last modification (UTC/GMT) - (AcTime) Long time of last access (UTC/GMT) - (CrTime) Long time of original creation (UTC/GMT) - - Central-header version: - - Value Size Description - ----- ---- ----------- - (time) 0x5455 Short tag for this extra block type ("UT") - TSize Short total data size for this block - Flags Byte info bits (refers to local header!) - (ModTime) Long time of last modification (UTC/GMT) - - The central-header extra field contains the modification time only, - or no timestamp at all. TSize is used to flag its presence or - absence. But note: - - If "Flags" indicates that Modtime is present in the local header - field, it MUST be present in the central header field, too! - This correspondence is required because the modification time - value may be used to support trans-timezone freshening and - updating operations with zip archives. - - The time values are in standard Unix signed-long format, indicating - the number of seconds since 1 January 1970 00:00:00. The times - are relative to Coordinated Universal Time (UTC), also sometimes - referred to as Greenwich Mean Time (GMT). To convert to local time, - the software must know the local timezone offset from UTC/GMT. - - The lower three bits of Flags in both headers indicate which time- - stamps are present in the LOCAL extra field: - - bit 0 if set, modification time is present - bit 1 if set, access time is present - bit 2 if set, creation time is present - bits 3-7 reserved for additional timestamps; not set - - Those times that are present will appear in the order indicated, but - any combination of times may be omitted. (Creation time may be - present without access time, for example.) TSize should equal - (1 + 4*(number of set bits in Flags)), as the block is currently - defined. Other timestamps may be added in the future. - - - -Info-ZIP Unix Extra Field (type 1): - ================================== - - The following is the layout of the old Info-ZIP extra block for - Unix. It has been replaced by the extended-timestamp extra block - (0x5455) and the Unix type 2 extra block (0x7855). - (Last Revision 19970118) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (Unix1) 0x5855 Short tag for this extra block type ("UX") - TSize Short total data size for this block - AcTime Long time of last access (UTC/GMT) - ModTime Long time of last modification (UTC/GMT) - UID Short Unix user ID (optional) - GID Short Unix group ID (optional) - - Central-header version: - - Value Size Description - ----- ---- ----------- - (Unix1) 0x5855 Short tag for this extra block type ("UX") - TSize Short total data size for this block - AcTime Long time of last access (GMT/UTC) - ModTime Long time of last modification (GMT/UTC) - - The file access and modification times are in standard Unix signed- - long format, indicating the number of seconds since 1 January 1970 - 00:00:00. The times are relative to Coordinated Universal Time - (UTC), also sometimes referred to as Greenwich Mean Time (GMT). To - convert to local time, the software must know the local timezone - offset from UTC/GMT. The modification time may be used by non-Unix - systems to support inter-timezone freshening and updating of zip - archives. - - The local-header extra block may optionally contain UID and GID - info for the file. The local-header TSize value is the only - indication of this. Note that Unix UIDs and GIDs are usually - specific to a particular machine, and they generally require root - access to restore. - - This extra field type is obsolete, but it has been in use since - mid-1994. Therefore future archiving software should continue to - support it. Some guidelines: - - An archive member should either contain the old "Unix1" - extra field block or the new extra field types "time" and/or - "Unix2". - - If both the old "Unix1" block type and one or both of the new - block types "time" and "Unix2" are found, the "Unix1" block - should be considered invalid and ignored. - - Unarchiving software should recognize both old and new extra - field block types, but the info from new types overrides the - old "Unix1" field. - - Archiving software should recognize "Unix1" extra fields for - timestamp comparison but never create it for updated, freshened - or new archive members. When copying existing members to a new - archive, any "Unix1" extra field blocks should be converted to - the new "time" and/or "Unix2" types. - - - -Info-ZIP Unix Extra Field (type 2): - ================================== - - The following is the layout of the new Info-ZIP extra block for - Unix. (Last Revision 19960922) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (Unix2) 0x7855 Short tag for this extra block type ("Ux") - TSize Short total data size for this block (4) - UID Short Unix user ID - GID Short Unix group ID - - Central-header version: - - Value Size Description - ----- ---- ----------- - (Unix2) 0x7855 Short tag for this extra block type ("Ux") - TSize Short total data size for this block (0) - - The data size of the central-header version is zero; it is used - solely as a flag that UID/GID info is present in the local-header - extra field. If additional fields are ever added to the local - version, the central version may be extended to indicate this. - - Note that Unix UIDs and GIDs are usually specific to a particular - machine, and they generally require root access to restore. - - - -ASi Unix Extra Field: - ==================== - - The following is the layout of the ASi extra block for Unix. The - local-header and central-header versions are identical. - (Last Revision 19960916) - - Value Size Description - ----- ---- ----------- - (Unix3) 0x756e Short tag for this extra block type ("nu") - TSize Short total data size for this block - CRC Long CRC-32 of the remaining data - Mode Short file permissions - SizDev Long symlink'd size OR major/minor dev num - UID Short user ID - GID Short group ID - (var.) variable symbolic link filename - - Mode is the standard Unix st_mode field from struct stat, containing - user/group/other permissions, setuid/setgid and symlink info, etc. - - If Mode indicates that this file is a symbolic link, SizDev is the - size of the file to which the link points. Otherwise, if the file - is a device, SizDev contains the standard Unix st_rdev field from - struct stat (includes the major and minor numbers of the device). - SizDev is undefined in other cases. - - If Mode indicates that the file is a symbolic link, the final field - will be the name of the file to which the link points. The file- - name length can be inferred from TSize. - - [Note that TSize may incorrectly refer to the data size not counting - the CRC; i.e., it may be four bytes too small.] - - - -BeOS Extra Field: - ================ - - The following is the layout of the file-attributes extra block for - BeOS. (Last Revision 19970531) - - Local-header version: - - Value Size Description - ----- ---- ----------- - (BeOS) 0x6542 Short tag for this extra block type ("Be") - TSize Short total data size for this block - BSize Long uncompressed file attribute data size - Flags Byte info bits - (CType) Short compression type - (CRC) Long CRC value for uncompressed file attribs - Attribs variable file attribute data - - Central-header version: - - Value Size Description - ----- ---- ----------- - (BeOS) 0x6542 Short tag for this extra block type ("Be") - TSize Short total data size for this block (5) - BSize Long size of uncompr. local EF block data - Flags Byte info bits - - The least significant bit of Flags in both headers indicates whether - the LOCAL extra field is uncompressed (and therefore whether CType - and CRC are omitted): - - bit 0 if set, Attribs is uncompressed (no CType, CRC) - bits 1-7 reserved; if set, assume error or unknown data - - Currently the only supported compression types are deflated (type 8) - and stored (type 0); the latter is not used by Info-ZIP's Zip but is - supported by UnZip. - - Attribs is a BeOS-specific block of data in big-endian format with - the following structure (if compressed, uncompress it first): - - Value Size Description - ----- ---- ----------- - Name variable attribute name (null-terminated string) - Type Long attribute type (32-bit unsigned integer) - Size Long Long data size for this sub-block (64 bits) - Data variable attribute data - - The attribute structure is repeated for every attribute. The Data - field may contain anything--text, flags, bitmaps, etc. - - - -SMS/QDOS Extra Field: - ==================== - - The following is the layout of the file-attributes extra block for - SMS/QDOS. The local-header and central-header versions are identical. - (Last Revision 19960929) - - Value Size Description - ----- ---- ----------- - (QDOS) 0xfb4a Short tag for this extra block type - TSize Short total data size for this block - LongID Long extra-field signature - (ExtraID) Long additional signature/flag bytes - QDirect 64 bytes qdirect structure - - LongID may be "QZHD" or "QDOS". In the latter case, ExtraID will - be present. Its first three bytes are "02\0"; the last byte is - currently undefined. - - QDirect contains the file's uncompressed directory info (qdirect - struct). Its elements are in native (big-endian) format: - - d_length beLong file length - d_access byte file access type - d_type byte file type - d_datalen beLong data length - d_reserved beLong unused - d_szname beShort size of filename - d_name 36 bytes filename - d_update beLong time of last update - d_refdate beLong file version number - d_backup beLong time of last backup (archive date) - - - -AOS/VS Extra Field: - ================== - - The following is the layout of the extra block for Data General - AOS/VS. The local-header and central-header versions are identical. - (Last Revision 19961125) - - Value Size Description - ----- ---- ----------- - (AOSVS) 0x5356 Short tag for this extra block type ("VS") - TSize Short total data size for this block - "FCI\0" Long extra-field signature - Version Byte version of AOS/VS extra block (10 = 1.0) - Fstat variable fstat packet - AclBuf variable raw ACL data ($MXACL bytes) - - Fstat contains the file's uncompressed fstat packet, which is one of - the following: - - normal fstat packet (P_FSTAT struct) - DIR/CPD fstat packet (P_FSTAT_DIR struct) - unit (device) fstat packet (P_FSTAT_UNIT struct) - IPC file fstat packet (P_FSTAT_IPC struct) - - AclBuf contains the raw ACL data; its length is $MXACL. - - - -Tandem NSK Extra Field: - ====================== - - The following is the layout of the file-attributes extra block for - Tandem NSK. The local-header and central-header versions are - identical. (Last Revision 19981221) - - Value Size Description - ----- ---- ----------- - (TA) 0x4154 Short tag for this extra block type ("TA") - TSize Short total data size for this block (20) - NSKattrs 20 Bytes NSK attributes - - - -THEOS Extra Field: - ================= - - The following is the layout of the file-attributes extra block for - Theos. The local-header and central-header versions are identical. - (Last Revision 19990206) - - Value Size Description - ----- ---- ----------- - (Theos) 0x6854 Short 'Th' signature - size Short size of extra block - flags Byte reserved for future use - filesize Long file size - fileorg Byte type of file (see below) - keylen Short key length for indexed and keyed files, - data segment size for 16 bits programs - reclen Short record length for indexed,keyed and direct, - text segment size for 16 bits programs - filegrow Byte growing factor for indexed,keyed and direct - protect Byte protections (see below) - reserved Short reserved for future use - - File types - ========== - - 0x80 library (keyed access list of files) - 0x40 directory - 0x10 stream file - 0x08 direct file - 0x04 keyed file - 0x02 indexed file - 0x0e reserved - 0x01 16 bits real mode program (obsolete) - 0x21 16 bits protected mode program - 0x41 32 bits protected mode program - - Protection codes - ================ - - User protection - --------------- - 0x01 non readable - 0x02 non writable - 0x04 non executable - 0x08 non erasable - - Other protection - ---------------- - 0x10 non readable - 0x20 non writable - 0x40 non executable Theos before 4.0 - 0x40 modified Theos 4.x - 0x80 not hidden - - - -THEOS old inofficial Extra Field: - ================================ - - The following is the layout of an inoffical former version of a - Theos file-attributes extra blocks. This layout was never published - and is no longer created. However, UnZip can optionally support it - when compiling with the option flag OLD_THEOS_EXTRA defined. - Both the local-header and central-header versions are identical. - (Last Revision 19990206) - - Value Size Description - ----- ---- ----------- - (THS0) 0x4854 Short 'TH' signature - size Short size of extra block - flags Short reserved for future use - filesize Long file size - reclen Short record length for indexed,keyed and direct, - text segment size for 16 bits programs - keylen Short key length for indexed and keyed files, - data segment size for 16 bits programs - filegrow Byte growing factor for indexed,keyed and direct - reserved 3 Bytes reserved for future use - - - -FWKCS MD5 Extra Field: - ===================== - - The FWKCS Contents_Signature System, used in automatically - identifying files independent of filename, optionally adds - and uses an extra field to support the rapid creation of - an enhanced contents_signature. - There is no local-header version; the following applies - only to the central header. (Last Revision 19961207) - - Central-header version: - - Value Size Description - ----- ---- ----------- - (MD5) 0x4b46 Short tag for this extra block type ("FK") - TSize Short total data size for this block (19) - "MD5" 3 bytes extra-field signature - MD5hash 16 bytes 128-bit MD5 hash of uncompressed data - (low byte first) - - When FWKCS revises a .ZIP file central directory to add - this extra field for a file, it also replaces the - central directory entry for that file's uncompressed - file length with a measured value. - - FWKCS provides an option to strip this extra field, if - present, from a .ZIP file central directory. In adding - this extra field, FWKCS preserves .ZIP file Authenticity - Verification; if stripping this extra field, FWKCS - preserves all versions of AV through PKZIP version 2.04g. - - FWKCS, and FWKCS Contents_Signature System, are - trademarks of Frederick W. Kantor. - - (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer - Science and RSA Data Security, Inc., April 1992. - ll.76-77: "The MD5 algorithm is being placed in the - public domain for review and possible adoption as a - standard." - - - -Info-ZIP Unicode Path Extra Field: - ================================= - - Stores the UTF-8 version of the entry path as stored in the - local header and central directory header. - (Last Revision 20070912) - - Value Size Description - ----- ---- ----------- - (UPath) 0x7075 Short tag for this extra block type ("up") - TSize Short total data size for this block - Version 1 byte version of this extra field, currently 1 - NameCRC32 4 bytes File Name Field CRC32 Checksum - UnicodeName Variable UTF-8 version of the entry File Name - - Currently Version is set to the number 1. If there is a need - to change this field, the version will be incremented. Changes - may not be backward compatible so this extra field should not be - used if the version is not recognized. - - The NameCRC32 is the standard zip CRC32 checksum of the File Name - field in the header. This is used to verify that the header - File Name field has not changed since the Unicode Path extra field - was created. This can happen if a utility renames the entry but - does not update the UTF-8 path extra field. If the CRC check fails, - this UTF-8 Path Extra Field should be ignored and the File Name field - in the header used instead. - - The UnicodeName is the UTF-8 version of the contents of the File Name - field in the header. As UnicodeName is defined to be UTF-8, no UTF-8 - byte order mark (BOM) is used. The length of this field is determined - by subtracting the size of the previous fields from TSize. If both - the File Name and Comment fields are UTF-8, the new General Purpose - Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to - indicate that both the header File Name and Comment fields are UTF-8 - and, in this case, the Unicode Path and Unicode Comment extra fields - are not needed and should not be created. Note that, for backward - compatibility, bit 11 should only be used if the native character set - of the paths and comments being zipped up are already in UTF-8. The - same method, either bit 11 or extra fields, should be used in both - the local and central directory headers. - - - -Info-ZIP Unicode Comment Extra Field: - ==================================== - - Stores the UTF-8 version of the entry comment as stored in the - central directory header. - (Last Revision 20070912) - - Value Size Description - ----- ---- ----------- - (UCom) 0x6375 Short tag for this extra block type ("uc") - TSize Short total data size for this block - Version 1 byte version of this extra field, currently 1 - ComCRC32 4 bytes Comment Field CRC32 Checksum - UnicodeCom Variable UTF-8 version of the entry comment - - Currently Version is set to the number 1. If there is a need - to change this field, the version will be incremented. Changes - may not be backward compatible so this extra field should not be - used if the version is not recognized. - - The ComCRC32 is the standard zip CRC32 checksum of the Comment - field in the central directory header. This is used to verify that - the comment field has not changed since the Unicode Comment extra field - was created. This can happen if a utility changes the Comment field - but does not update the UTF-8 Comment extra field. If the CRC check - fails, this Unicode Comment extra field should be ignored and the - Comment field in the header used. - - The UnicodeCom field is the UTF-8 version of the entry comment field - in the header. As UnicodeCom is defined to be UTF-8, no UTF-8 byte - order mark (BOM) is used. The length of this field is determined by - subtracting the size of the previous fields from TSize. If both the - File Name and Comment fields are UTF-8, the new General Purpose Bit - Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate - both the header File Name and Comment fields are UTF-8 and, in this - case, the Unicode Path and Unicode Comment extra fields are not - needed and should not be created. Note that, for backward - compatibility, bit 11 should only be used if the native character set - of the paths and comments being zipped up are already in UTF-8. The - same method, either bit 11 or extra fields, should be used in both - the local and central directory headers. - - - -Info-ZIP New Unix Extra Field: - ==================================== - - Currently stores Unix UIDs/GIDs up to 32 bits. - (Last Revision 20080509) - - Value Size Description - ----- ---- ----------- - (UnixN) 0x7875 Short tag for this extra block type ("ux") - TSize Short total data size for this block - 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 - - Currently Version is set to the number 1. If there is a need - to change this field, the version will be incremented. Changes - may not be backward compatible so this extra field should not be - used if the version is not recognized. - - UIDSize is the size of the UID field in bytes. This size should - match the size of the UID field on the target OS. - - UID is the UID for this entry in standard little endian format. - - GIDSize is the size of the GID field in bytes. This size should - match the size of the GID field on the target OS. - - GID is the GID for this entry in standard little endian format. - - If both the old 16-bit Unix extra field (tag 0x7855, Info-ZIP Unix) - and this extra field are present, the values in this extra field - supercede the values in that extra field. diff --git a/third_party/infozip/zip/proginfo/fileinfo.cms b/third_party/infozip/zip/proginfo/fileinfo.cms deleted file mode 100644 index 9d21935ba..000000000 --- a/third_party/infozip/zip/proginfo/fileinfo.cms +++ /dev/null @@ -1,231 +0,0 @@ -[Quoting from a C/370 manual, courtesy of Carl Forde.] - - C/370 supports three types of input and output: text streams, binary - streams, and record I/O. Text and binary streams are both ANSI - standards; record I/O is a C/370 extension. - -[...] - - Record I/O is a C/370 extension to the ANSI standard. For files - opened in record format, C/370 reads and writes one record at a - time. If you try to write more data to a record than the record - can hold, the data is truncated. For record I/O, C/370 only allows - the use of fread() and fwrite() to read and write to the files. Any - other functions (such as fprintf(), fscanf(), getc(), and putc()) - fail. For record-orientated files, records do not change size when - you update them. If the new data has fewer characters than the - original record, the new data fills the first n characters, where - n is the number of characters of the new data. The record will - remain the same size, and the old characters (those after) n are - left unchanged. A subsequent update begins at the next boundary. - For example, if you have the string "abcdefgh": - - abcdefgh - - and you overwrite it with the string "1234", the record will look - like this: - - 1234efgh - - C/370 record I/O is binary. That is, it does not interpret any of - the data in a record file and therefore does not recognize control - characters. - - - The record model consists of: - - * A record, which is the unit of data transmitted to and from a - program - * A block, which is the unit of data transmitted to and from a - device. Each block may contain one or more records. - - In the record model of I/O, records and blocks have the following - attributes: - - RECFM Specifies the format of the data or how the data is organized - on the physical device. - LRECL Specifies the length of logical records (as opposed to - physical ones). - - BLKSIZE Specifies the length of physical records (blocks on the - physical device). - - - Opening a File by Filename - - The filename that you specify on the call to fopen() or freopen() - must be in the following format: - - >> ----filename---- ----filetype-------------------- - | | | | - --.-- -- --filemode-- - | | - --.-- - where - - filename is a 1- to 8-character string of any of the characters, - A-Z, a-z, 0-9, and +, -, $, #, @, :, and _. You can separate it - from the filetype with one or more spaces, or with a period. - [Further note: filenames are fully case-sensitive, as in Unix.] - - filetype is a 1- to 8-character string of any of the characters, - A-Z, a-z, 0-9, and +, -, $, #, @, :, and _. You can separate it - from the filemode with one or more spaces, or with a period. The - separator between filetype and filemode must be the same as the - one between filename and filetype. - - filemode is a 1- to 2-character string. The first must be any of - the characters A-Z, a-z, or *. If you use the asis parameter on - the fopen() or freopen() call, the first character of the filemode - must be a capital letter or an asterisk. Otherwise, the function - call fails. The second character of filemode is optional; if you - specify it, it must be any of the digits 0-6. You cannot specify - the second character if you have specified * for the first one. - - If you do not use periods as separators, there is no limit to how - much whitespace you can have before and after the filename, the - filetype, and filemode. - - - Opening a File without a File Mode Specified - - If you omit the file mode or specify * for it, C/370 does one - of the following when you call fopen() or freopen(): - - * If you have specified a read mode, C/370 looks for the named file - on all the accessed readable disks, in order. If it does not find - the file, the fopen() or freopen() call fails. - * If you have specified any of the write modes, C/370 writes the file - on the first writable disk you have accessed. Specifying a write - mode on an fopen() or freopen() call that contains the filename of - an existing file destroys that file. If you do not have any - writable disks accessed, the call fails. - - - fopen() and freopen() parameters - - recfm - CMS supports only two RECFMs, V and F. [note that MVS supports - 27(!) different RECFMs.] If you do not specify the RECFM for a - file, C/370 determines whether is is in fixed or variable format. - - lrecl and blksize - For files in fixed format, CMS allows records to be read and - written in blocks. To have a fixed format CMS file treated as a - fixed blocked CMS file, you can open the file with recfm=fb and - specify the lrecl and blksize. If you do not specify a recfm on - the open, the blksize can be a multiple of the lrecl, and the - file is treated as if it were blocked. - - For files in variable format, the CMS LRECL is different from the - LRECL for the record model. In the record model, the LRECL is - equal to the data length plus 4 bytes (for the record descriptor - word), and the BLKSIZE is equal to the LRECL plus 4 bytes (for - the block descriptor word). In CMS, BDWs and RDWs do not exist, - but because CMS follows the record model, you must still account - for them. When you specify V, you must still allocate the record - descriptor word and block descriptor word. That is, if you want - a maximum of n bytes per record, you must specify a minimum LRECL - of n+4 and a minimum BLKSIZE of n+8. - - When you are appending to V files, you can enlarge the record size - dynamically, but only if you have not specified LRECL or BLKSIZE - on the fopen() or freopen() command that opened the file. - - type - If you specify this parameter, the only valid value for CMS disk - files is type =record. This opens a file for record I/O. - - asis - If you use this parameter, you can open files with mixed-case - filenames such as JaMeS dAtA or pErCy.FILE. If you specify this - parameter, the file mode that you specify must be a capital letter - (if it is not an asterisk); otherwise; the function call fails and - the value returned is NULL. - - - Reading from Record I/O Files - fread() is the only interface allowed for reading record I/O files. - Each time you call fread() for a record I/O file, fread() reads - one record from the system. If you call fread() with a request for - less than a complete record, the requested bytes are copied to your - buffer, and the file position is set to the start fo the next - record. If the request is for more bytes that are in the record, - one record is read and the position is set to the start of the next - record. C/370 does not strip any blank characters or interpret any - data. - - fread() returns the number of items read successfully, so if you - pass a size argument equal to 1 and a count argument equal to the - maximum expected length of the record, fread() returns the length, - in bytes, of the record read. If you pass a size argument equal - to the maximum expected length of the record, and a count argument - equal to 1, fread() returns either 0 or 1, indicating whether a - record of length size read. If a record is read successfully but - is less than size bytes long, fread() returns 0. - - - Writing to Record I/O Files - fwrite() is the only interface allowed for writing to a file - opened for record I/O. Only one record is written at a time. If - you attempt to write more new data than a full record can hold or - try to update a record with more data than it currently has, C/370 - truncates your output at the record boundary. When C/370 performs - a truncation, it sets errno and raises SIGIOERR, if SIGIOERR is not - set to SIG_IGN. - - When you are writing new records to a fixed-record I/O file, if you - try to write a short record, C/370 pads the record with nulls out - to LRECL. - - At the completion of an fwrite(), the file position is at the start - of the next record. For new data, the block is flushed out to the - system as soon as it is full. - - - fldata() Behavior - When you call the fldata() function for an open CMS minidisk file, - it returns a data structure that looks like this: - - struct __filedata { - unsigned int __recfmF : 1, /* fixed length records */ - __recfmV : 1, /* variable length records */ - __recfmU : 1, /* n/a */ - __recfmS : 1, /* n/a */ - __recfmBlk : 1, /* n/a */ - __recfmASA : 1, /* text mode and ASA */ - __recfmM : 1, /* n/a */ - __dsorgPO : 1, /* n/a */ - __dsorgPDSmem : 1, /* n/a */ - __dsorgPDSdir : 1, /* n/a */ - __dsorgPS : 1, /* sequential data set */ - __dsorgConcat : 1, /* n/a */ - __dsorgMem : 1, /* n/a */ - __dsorgHiper : 1, /* n/a */ - __dsorgTemp : 1, /* created with tmpfile() */ - __dsorgVSAM : 1, /* n/a */ - __reserve1 : 1, /* n/a */ - __openmode : 2, /* see below 1 */ - __modeflag : 4, /* see below 2 */ - __reserve2 : 9, /* n/a */ - - char __device; __DISK - unsigned long __blksize, /* see below 3 */ - __maxreclen; /* see below 4 */ - unsigned short __vsamtype; /* n/a */ - unsigned long __vsamkeylen; /* n/a */ - unsigned long __vsamRKP; /* n/a */ - char * __dsname; /* fname ftype fmode */ - unsigned int __reserve4; /* n/a */ - - /* note 1: values are: __TEXT, __BINARY, __RECORD - note 2: values are: __READ, __WRITE, __APPEND, __UPDATE - these values can be added together to determine - the return value; for example, a file opened with - a+ will have the value __READ + __APPEND. - note 3: total block size of the file, including ASA - characters as well as RDW information - note 4: maximum record length of the data only (includes - ASA characters but excludes RDW information). - */ - }; diff --git a/third_party/infozip/zip/proginfo/infozip.who b/third_party/infozip/zip/proginfo/infozip.who deleted file mode 100644 index 994851c67..000000000 --- a/third_party/infozip/zip/proginfo/infozip.who +++ /dev/null @@ -1,242 +0,0 @@ -These members of the Info-ZIP group contributed to the development and -testing of portable Zip. They are responsible for whatever works in -Zip. Whatever doesn't work is solely the fault of the authors of Zip -(Mark Adler, Rich Wales, Jean-loup Gailly, Kai Uwe Rommel, Igor Mandrichenko, -Onno van der Linden, Christian Spieler, John Bush, Paul Kienitz, Sergio Monesi -and Karl Davis, but see the license for the latest list). If you have -contributed and your name has been forgotten, please send a reminder to us -using the contact information in the Readme file. The names are given here -in alphabetical order, because it's impossible to classify them by importance -of the contribution. Some have made a complete port to a new target, some -have provided a one line fix. All are to be thanked. - - -Mark Adler madler@tybalt.caltech.edu NeXT 2.x, Mac - alan@spri.levels.unisa.edu.au Linux -Jeffrey Altman jaltman@watsun.cc.columbia.edu fseek bug on NT -Glenn J. Andrews oper1%drcv06.decnet@drcvax.af.mil VAX VMS -James Van Artsdalen james@raid.dell.com bug report -Eric Backus ericb@lsid.hp.com bug report -Quentin Barnes qbarnes@urbana.css.mot.com unix/Makefile mode of - installed files -Elmar Bartel bartel@informatik.tu-muenchen.de -Mark E. Becker mbecker@cs.uml.edu bug report -Paul von Behren Paul_von_Behren@stortek.com OS/390 port -Jon Bell swy@wsdot.wa.gov Intergraph/CLIX -Myles Bennett - Initial UnZip 6.0 large - files beta -Michael Bernardi mike@childsoc.demon.co.uk RS6000 -Tom Betz marob!upaya!tbetz@phri.nyu.edu SCO Xenix 2.3.1 -James Birdsall jwbirdsa@picarefy.com AT&T 3B1 -George boer@fwi.uva.nl OS/2 -Michael Bolton bolton@vaxc.erim.org VAX/VMS -Wim Bonner 27313853@WSUVM1.CSC.WSU.EDU HP 9000/840a HPUX -Paul Borman prb@cray.com Cray-X/YMP,2 UNICOS 6-8 -Kurt Van den Branden kvd2@bipsy.se.bel.alcatel.be VAX VMS -Scott Briggs briggs@nashua.progress.com Windows NT -Leslie C. Brown lbrown@BRL.MIL Pyramid MIS-4 -Ralf Brown ralf@b.gp.cs.cmu.edu Pyramid MIS-4 -Rodney Brown rdb@cmutual.com.au SunOS 4.1.3 DGUX OSF/1 - HP-UX CRC optimization -Jeremy Daniel Buhler jbuhler@owlnet.rice.edu BC++ -John Bush john.bush@east.sun.com Amiga (SAS/C) -Pietro Caselli zaphod@petruz.sublink.org Minix 1.5.10 -Andrew A. Chernov ache@astral.msk.su FreeBSD -Jeff Coffler jeffcof@microsoft.com Windows NT -David Dachtera David.Dachtera@advocatehealth.com VMS - link_zip.com bug -Bill Davidsen davidsen@crdos1.crd.ge.com Xenix (on what?) -Karl Davis riscman@geko.com.au Acorn -Daniel Deimert daniel@pkmab.se zeus3.21 Zilog S8000 -David Denholm denholm@sotona.physics.southampton.ac.uk VMS -Harald Denker harry@hal.westfalen.de ATARI -Matthew J. D'Errico doc@magna.com Bull -L. Peter Deutsch ghost@aladdin.com Linux -Uwe Doering gemini@geminix.in-berlin.de 386 Unix -Jean-Michel Dubois jmdubois@ibcfrance.fr Theos support -James P. Dugal jpd@usl.edu Pyramid 90X OSx4.1 -"Evil Ed" esaffle@gmuvax2.gmu.edu Ultrix-32 V3.1 (Rev. 9) -Patrick Ellis pellis@aic.mdc.com VMS zip -h appearance -Thomas Esken esken@uni-muenster.de Acorn fix -Dwight Estep estep@dlo10.enet.dec.com MSDOS -David A. Feinleib t-davefe@microsoft.com Windows NT -Joshua Felsteiner joshua@phys1.technion.ac.il Linux -Greg Flint afc@klaatu.cc.purdue.edu ETA-10P* hybrid Sys V -Carl Forde cforde@bcsc02.gov.bc.ca VM/CMS -Jeff Foy jfoy@glia.biostr.washington.edu IRIX Sys V Rel 3.3.1 -Mike Freeman mikef@pacifier.com Vax VMS -Kevin M. Fritz kmfritz@apgea.army.mil Turbo C++ 1.0 - Pyramid -Jean-loup Gailly jloup@chorus.fr MS-DOS Microsoft C 5.1 -Scott D. Galloway sgallowa@letterkenn-emh1.army.mil Sperry 5000 SysV.3 -Rainer Gerling gerling@faupt101.physik.uni-erlangen.de HPUX, MSDOS -Henry Gessau henryg@kullmar.kullmar.se Windows NT -Ed Gordon - Zip 3.0, VB, Unicode, - large files, splits, DLLs -Ian E. Gorman ian@iosphere.net ported zip 2.2 to VM/CMS -Wayne R. Graves graves@csa2.lbl.gov Vax VMS -George Grimes grimes@netcom.com Apollo Domain SR10.4 -Hunter Goatley goathunter@MadGoat.com VMS (VAX & Alpha), - web and ftp sites -Arnt Gulbrandsen agulbra@pvv.unit.no Linux -David Gundlach david@rolf.stat.uga.edu Sun SS1+ SunOS 4.1 -Peter Gutmann pgut1@cs.aukuni.ac.nz bug report -Dirk Haase d_haase@sitec.de MacOS port -Mark Hanning-Lee markhl@iris-355.jpl.nasa.gov SGI -Walter Haidinger e9225662@student.tuwien.ac.at Amiga and general fixes -Charles Hannum mycroft@ai.mit.edu bug report -Greg Hartwig ghartwig@ix.netcom.com VM/CMS cleanup -Tanvir Hassan tanvir.hassan@autodesk.com NT -Bob Hardy hardy@lucid.com Power C on MSDOS -Zachary Heilig heilig@plains.nodak.edu Turbo C++ 3.0 -Chris Herborth chrish@pobox.com BeOS port -Jonathan Hudson jrhudson@bigfoot.com QDOS port -Mark William Jacobs mark@mensch.stanford.edu MSDOS -Aubrey Jaffer jaffer@martigny.ai.mit.edu Pixel -Peter Jones jones.peter@uqam.ca MIPS UMIPS 4.0 - +Onolimit fix for HP-UX -Kjetil W. J{\o}rgensen jorgens@lise.unit.no OSF/1, DJGPP v2 -Bruce Kahn bkahn@archive.webo.dg.com MS-DOS Microsoft C 5.1 -Jonathan I. Kamens jik@pit-manager.mit.edu ultrix on DECstation -Dave Kapalko d.kapalko@att.com bug report -Bob Kemp Robert.V.Kemp@att.com AT&T 3B2 SysV 3.2v2 -Vivek Khera khera@cs.duke.edu SunOS -Earl Kiech KIECH@utkvx.utk.edu VAX VMS V5.4-1A -Paul Kienitz Paul.Kienitz@shelter.sf.ca.us Amiga, Watcom C -David Kirschbaum kirsch@usasoc.soc.mil He got us all in this - mess in the first place -Thomas Klausner wiz@danbala.tuwien.ac.at cygwin32 and -k fix -D. Krumbholz krumbh00@marvin.informatik.uni-dortmund.de - Acorn filetype and - timestamp bug report - -Bo Kullmar bk@kullmar.se DNIX 5.3, SunOS 4.1 -Baden Kudrenecky baden@unixg.ubc.ca OS/2 -Giuseppe La Sala lasala@mail.esa.esrin.it VMS -Jean-Marc Lasgouttes jean-marc.lasgouttes@inria.fr Bug report -Harry Langenbacher harry@neuron6.Jpl.Nasa.Gov Sun SS1+ SunOS 4.1 -Michael D. Lawler mdlawler@gwmicro.com Mt.Xinu BSD 4.3 on VAX - Borland C++ 4.51 -Johnny Lee johnnyl@microsoft.com Microsoft C 7.0 -Michael Lemke michael@io.as.utexas.edu VMS -David Lemson lemson@ux1.cso.uiuc.edu Sequent Dynix 3.0.17 -Tai-Shan Lin tlin@snakeyes.eecs.wsu.edu OS/2 -Onno van der Linden onno@simplex.nl NetBSD, Borland C++, - MSC 7.0, DJGPP 2 - -Michel loehden%mv13.decnet@vax.hrz.uni-marburg.de VMS -Warner Losh imp@Solbourne.COM packing algorithm help -Dave Lovelace davel@grex.cyberspace.org DG AOS/VS -Erik Luijten erik@tntnhb3.tn.tudelft.nl problem report -John Lundin lundin@urvax.urich.edu VAX VMS -Igor Mandrichenko mandrichenko@m10.ihep.su VAX VMS -Cliff Manis root@csoftec.csf.com SCO 2.3.1 (386) -Fulvio Marino fulvio@iconet.ico.olivetti.it X/OS 2.3 & 2.4 -Bill Marsh bmarsh@cod.nosc.mil SGI Iris 4D35 -Michael Mauch mauch@gmx.de djgpp LFN attribute fix -Peter Mauzey ptm@mtdcr.mt.lucent.com AT&T 6300, 7300 -Rafal Z. Maszkowski rzm@mat.torun.edu.pl Convex -Robert McBroom (?) rm3@ornl.gov DECsystem 5810 -Tom McConnell tmcconne@sedona.intel.com NCR SVR4 -Frank P. McIngvale frankm@eng.auburn.edu Bug report -Conor McMenamin C.S.McMenamin@sussex.ac.uk MSDOS -Will Menninger Win32, MinGW -John Messenger jlm@proteon.com Bug report -Michael kuch@mailserv.zdv.uni-tuebingen.de SGI -Dan Mick dmick@pongo.west.sun.com Solaris -Alan Modra alan@spri.levels.unisa.edu.au Linux -Laszlo Molnar lmolnar@goliat.eik.bme.hu DJGPP v2 -Jim Mollmann jmq@nccibm1.bitnet OS/2 & MVS -Sergio Monesi pel0015@cdc8g5.cdc.polimi.it Acorn -J. Mukherjee jmukherj@ringer.cs.utsa.edu OS/2 -Anthony Naggs amn@ubik.demon.co.uk bug report -Matti Narkia matti.narkia@ntc.nokia.com VAX VMS -Rainer Nausedat Zip 3.0, large files -Robert E. Newman Jr. newmanr@ssl.msfc.nasa.gov bug report -Robert Nielsen NielsenRJ@ems.com 2.2 -V VMS bug report -Christian Michel cmichel@de.ibm.com 2.2 check_dup OS/2 bug - report -Thomas S. Opheys opheys@kirk.fmi.uni-passau.de OS/2 -Humberto Ortiz-Zuazaga zuazaga@ucunix.san.uc.edu Linux -James E. O'Dell jim@fpr.com MacOS -William O'Shaughnessy williamo@hpcupt1.cup.hp.com HPUX -Neil Parks neil.parks@pcohio.com MSDOS -Enrico Renato Palmerini palmer@vxscaq.cineca.it UNISYS 7000 Sys 5 r2.3 -Geoff Pennington Geoff.Pennington@sgcs.co.uk -q output bug -Keith Petersen w8sdz@simtel20.army.mil Pyramid UCB OSx4.4c -George Petrov VM/CMS, MVS -Alan Phillips postmaster@lancaster.ac.uk Dynix/ptx 1.3 -Bruno Pillard bp@chorus.fr SunOS 4.1 -Piet W. Plomp piet@icce.rug.nl MSC 7.0, SCO 3.2v4.0 -John Poltorak j.poltorak@bradford.ac.uk problem report -Kenneth Porter 72420.2436@compuserve.com OS/2 -Norbert Pueschel pueschel@imsdd.meb.uni-bonn.de Amiga time.lib -Yuval Rakavy yuval@cs.huji.ac.il MSDOS -David A Rasmussen dave@convex.csd.uwm.edu Convex C220 with 9.0 OS -Eric Raymond esr@snark.thyrsus.com Unix -Jim Read 74312.3103@compuserve.com OS/2 -Michael Regoli mr@cica.indiana.edu Ultrix 3.1 VAX 8650 - BSD 4.3 IBM RT/125 - BSD 4.3 MicroVAX 3500 - SunOS 4.0.3 Sun 4/330 -Jochen Roderburg roderburg@rrz.uni-koeln.de Digital Unix with - AFS/NFS converter -Rick Rodgers rodgers@maxwell.mmwb.ucsf.EDU Unix man page -Greg Roelofs roe2@midway.uchicago.edu SunOS 4.1.1,4.1.2 Sun 4 - Unicos 5.1--6.1.5 Cray - OS/2 1.3 MS C 6.0 - Ultrix 4.1,4.2 DEC 5810 - VMS 5.2, 5.4 VAX 8600 - Irix 3.3.2, SGI Iris 4D - UTS 1.2.4 Amdahl 5880 -Phil Ritzenthaler phil@cgrg.ohio-state.edu SYSV -Kai Uwe Rommel rommel@ars.de or rommel@leo.org OS/2 -Markus Ruppel m.ruppel@imperial.ac.uk OS/2 -Shimazaki Ryo eririn@ma.mailbank.ne.jp human68k -Jon Saxton jrs@panix.com Microsoft C 6.0 -Steve Salisbury stevesa@msn.com Microsoft C 8.0 -Timo Salmi ts@uwasa.fi bug report -Darren Salt ds@youmustbejoking.demon.co.uk RISC OS -NIIMI Satoshi a01309@cfi.waseda.ac.jp Human68K -Tom Schmidt tschmidt@micron.com SCO 286 -Martin Schulz martin.schulz@isltd.insignia.com Windows NT, Atari -Steven Schweda VMS, Unix, large files -Dan Seyb dseyb@halnet.com AIX -Mark Shadley shadcat@catcher.com unix fixes -Timur Shaporev tim@rd.relcom.msk.su MSDOS -W. T. Sidney sidney@picard.med.ge.com bug report -Dave Sisson daves@vtcosy.cns.vt.edu AIX 1.1.1 PS/2 & 3090 -Dave Smith smithdt@bp.com Tandem port -Fred Smith fredex@fcshome.stoneham.ma.us Coherent -Christian Spieler spieler@ikp.tu-darmstadt.de VMS, MSDOS, emx, djgpp, - WIN32, Linux -Ron Srodawa srodawa@vela.acs.oakland.edu SCO Xenix/386 2.3.3 -Adam Stanley astanley@winternet.com MSDOS -Bertil Stenstr|m stenis@heron.dafa.se HP-UX 7.0 HP9000/835 -Carl Streeter streeter@oshkoshw.bitnet OS/2 -Reuben Sumner rasumner@undergrad.math.uwaterloo.ca Suggestions -E-Yen Tan e-yen.tan@brasenose.oxford.ac.uk Borland C++ win32 -Yoshioka Tsuneo tsuneo-y@is.aist-nara.ac.jp Multibyte charset - support -Paul Telles paul@pubnet.com SCO Xenix -Julian Thompson jrt@oasis.icl.co.uk bug report -Christopher C. Tjon tjon@plains.nodak.edu bug report -Robert F Tobler rft@cs.stanford.edu bug report -Eric Tomio tomio@acri.fr bug report -Cosmin Truta cosmint@cs.ubbcluj.ro win32 gcc based + asm -Anthony R. Venson cevens@unix1.sncc.lsu.edu MSDOS/emx -Antoine Verheijen antoine@sysmail.ucs.ualberta.ca envargs fix -Arjan de Vet devet@info.win.tue.nl SunOS 4.1, MSC 5.1 -Santiago Vila Doncel sanvila@ba.unex.es MSDOS -Johan Vromans jv@mh.nl bug report -Rich Wales wales@cs.ucla.edu SunOS 4.0.3 Sun-3/50 -Scott Walton scottw@io.com BSD/386 -Frank J. Wancho wancho@wsmr-simtel20.army.mil TOPS-20 - oyvind@stavanger.sgp.slb.com Bug report. -Takahiro Watanabe wata@first.tsukuba.ac.jp fixes for INSTALL -Mike White mwhite@pumatech.com wizzip DLL -Ray Wickert wickert@dc-srv.pa-x.dec.com MSDOS/DJGPP -Winfried Winkler willi@wap0109.chem.tu-berlin.de AIX -Norman J. Wong as219@freenet.carleton.ca MSDOS -Martin Zinser m.zinser@gsi.de VMS 7.x - diff --git a/third_party/infozip/zip/proginfo/ntsd.txt b/third_party/infozip/zip/proginfo/ntsd.txt deleted file mode 100644 index 8ac31ba17..000000000 --- a/third_party/infozip/zip/proginfo/ntsd.txt +++ /dev/null @@ -1,111 +0,0 @@ -Info-ZIP portable Zip/UnZip Windows NT security descriptor support -================================================================== -Scott Field (sfield@microsoft.com), 8 October 1996 - - -This version of Info-ZIP's Win32 code allows for processing of Windows -NT security descriptors if they were saved in the .zip file using the -appropriate Win32 Zip running under Windows NT. This also requires -that the file system that Zip/UnZip operates on supports persistent -Acl storage. When the operating system is not Windows NT and the -target file system does not support persistent Acl storage, no security -descriptor processing takes place. - -A Windows NT security descriptor consists of any combination of the -following components: - - an owner (Sid) - a primary group (Sid) - a discretionary ACL (Dacl) - a system ACL (Sacl) - qualifiers for the preceding items - -By default, Zip will save all aspects of the security descriptor except -for the Sacl. The Sacl contains information pertaining to auditing of -the file, and requires a security privilege be granted to the calling -user in addition to being enabled by the calling application. In order -to save the Sacl during Zip, the user must specify the -! switch on the -Zip commandline. The user must also be granted either the SeBackupPrivilege -"Backup files and directories" or the SeSystemSecurityPrivilege "Manage -auditing and security log". - -By default, UnZip will not restore any aspects of the security descriptor. -If the -X option is specified to UnZip, the Dacl is restored to the file. -The other items in the security descriptor on the new file will receive -default values. If the -XX option is specified to UnZip, as many aspects -of the security descriptor as possible will be restored. If the calling -user is granted the SeRestorePrivilege "Restore files and directories", -all aspects of the security descriptor will be restored. If the calling -user is only granted the SeSystemSecurityPrivilege "Manage auditing and -security log", only the Dacl and Sacl will be restored to the new file. - -Note that when operating on files that reside on remote volumes, the -privileges specified above must be granted to the calling user on that -remote machine. Currently, there is no way to directly test what privileges -are present on a remote machine, so Zip and UnZip make a remote privilege -determination based on an indirect method. - -UnZip considerations --------------------- - -In order for file security to be processed correctly, any directory entries -that have a security descriptor will be processed at the end of the unzip -cycle. This allows for unzip to process files within the newly created -directory regardless of the security descriptor associated with the directory -entry. This also prevents security inheritance problems that can occur as -a result of creating a new directory and then creating files in that directory -that will inherit parent directory permissions; such inherited permissions may -prevent the security descriptor taken from the zip file from being applied -to the new file. - -If directories exist which match directory/extract paths in the .zip file, -file security is not updated on the target directory. It is assumed that if -the target directory already exists, then appropriate security has already -been applied to that directory. - -"unzip -t" will test the integrity of stored security descriptors when -present and the operating system is Windows NT. - -ZipInfo (unzip -Z) will display information on stored security descriptor -when "unzip -Zv" is specifed. - - -Potential uses -============== - -The obvious use for this new support is to better support backup and restore -operations in a Windows NT environment where NTFS file security is utilized. -This allows individuals and organizations to archive files in a portable -fashion and transport these files across the organization. - -Another potential use of this support is setup and installation. This -allows for distribution of Windows NT based applications that have preset -security on files and directories. For example, prior to creation of the -.zip file, the user can set file security via File Manager or Explorer on -the files to be contained in the .zip file. In many cases, it is appropriate -to only grant Everyone Read access to .exe and .dll files, while granting -Administrators Full control. Using this support in conjunction with the -unzipsfx.exe self-extractor stub can yield a useful and powerful way to -install software with preset security (note that -X or -XX should be -specified on the self-extractor commandline). - -When creating .zip files with security which are intended for transport -across systems, it is important to take into account the relevance of -access control entries and the associated Sid of each entry. For example, -if a .zip file is created on a Windows NT workstation, and file security -references local workstation user accounts (like an account named Fred), -this access entry will not be relevant if the .zip file is transported to -another machine. Where possible, take advantage of the built-in well-known -groups, like Administrators, Everyone, Network, Guests, etc. These groups -have the same meaning on any Windows NT machine. Note that the names of -these groups may differ depending on the language of the installed Windows -NT, but this isn't a problem since each name has well-known ID that, upon -restore, translates to the correct group name regardless of locale. - -When access control entries contain Sid entries that reference Domain -accounts, these entries will only be relevant on systems that recognize -the referenced domain. Generally speaking, the only side effects of -irrelevant access control entries is wasted space in the stored security -descriptor and loss of complete intended access control. Such irrelevant -access control entries will show up as "Account Unknown" when viewing file -security with File Manager or Explorer. diff --git a/third_party/infozip/zip/proginfo/perform.dos b/third_party/infozip/zip/proginfo/perform.dos deleted file mode 100644 index 98744ee13..000000000 --- a/third_party/infozip/zip/proginfo/perform.dos +++ /dev/null @@ -1,183 +0,0 @@ -Date: Wed, 27 Mar 1996 01:31:50 CET +0100 -From: Christian Spieler (IKDA, THD, D-64289 Darmstadt) -Subject: More detailed comparison of MSDOS Info-ZIP programs' performance - -Hello all, - -In response to some additional questions and requests concerning -my previous message about DOS performance of 16/32-bit Info-ZIP programs, -I have produced a more detailed comparison: - -System: -Cx486DX-40, VL-bus, 8MB; IDE hard disk; -DOS 6.2, HIMEM, EMM386 NOEMS NOVCPI, SMARTDRV 3MB, write back. - -I have used the main directory of UnZip 5.20p as source, including the -objects and executable of an EMX compile for unzip.exe (to supply some -binary test files). - -Tested programs were (my current updated sources!) Zip 2.0w and UnZip 5.20p -- 16-bit MSC 5.1, compressed with LZEXE 0.91e -- 32-bit Watcom C 10.5, as supplied by Kai Uwe Rommel (PMODE 1.22) -- 32-bit EMX 0.9b -- 32-bit DJGPP v2 -- 32-bit DJGPP v1.12m4 - -The EMX and DJ1 (GO32) executables were bound with the full extender, to -create standalone executables. - -A) Tests of Zip - Command : "\zip.exe -q<#> tes.zip unz/*" (unz/*.* for Watcom!!) - where <#> was: 0, 1, 6, 9. - The test archive "tes.zip" was never deleted, this test - measured "time to update archive". - - The following table contains average execution seconds (averaged over - at least 3 runs, with the first run discarted to fill disk cache); - numbers in parenteses specify the standard deviation of the last - digits. - - cmpr level| 0 | 1 | 6 | 9 - =============================================================== - EMX win95 | 7.77 | 7.97 | 12.82 | 22.31 - --------------------------------------------------------------- - EMX | 7.15(40) | 8.00(6) | 12.52(25) | 20.93 - DJ2 | 13.50(32) | 14.20(7) | 19.05 | 28.48(9) - DJ1 | 13.56(30) | 14.48(3) | 18.70 | 27.43(13) - WAT | 6.94(22) | 8.93 | 15.73(34) | 30.25(6) - MSC | 5.99(82) | 9.40(4) | 13.59(9) | 20.77(4) - =============================================================== - - The "EMX win95" line was created for comparison, to check the performance - of emx 0.9 with the RSX extender in a DPMI environment. (This line was - produced by applying the "stubbed" EMX executable in a full screen DOS box.) - - -B) Tests of UnZip - Commands : \unzip.exe -qt tes.zip (testing performance) - \unzip.exe -qo tes.zip -dtm (extracting performance) - - The tes.zip archive created by maximum compression with the Zip test - was used as example archive. Contents (archive size was 347783 bytes): - 1028492 bytes uncompressed, 337235 bytes compressed, 67%, 85 files - - The extraction directory tm was not deleted between the individual runs, - thus this measurement checks the "overwrite all" time. - - | testing | extracting - =================================================================== - EMX | 1.98 | 6.43(8) - DJ2 | 2.09 | 11.85(39) - DJ1 | 2.09 | 7.46(9) - WAT | 2.42 | 7.10(27) - MSC | 4.94 | 9.57(31) - -Remarks: - -The executables compiled by me were generated with all "performance" -options enabled (ASM_CRC, and ASMV for Zip), and with full crypt support. -For DJ1 and DJ2, the GCC options were "-O2 -m486", for EMX "-O -m486". - -The Watcom UnZip was compiled with ASM_CRC code enabled as well, -but the Watcom Zip example was made without any optional assembler code! - - - -Discussion of the results: - -In overall performance, the EMX executables clearly win. -For UnZip, emx is by far the fastest program, and the Zip performance is -comparable to the 16-bit "reference". - -Whenever "real" work including I/O is requested, the DJGPP versions -lose badly because of poor I/O performance, this is the case especially -for the "newer" DJGPP v2 !!! -(I tried to tweak with the transfer buffer size, but without any success.) -An interesting result is that DJ v1 UnZip works remarkably better than -DJ v2 (in contrast to Zip, where both executables' performance is -approximately equal). - -The Watcom C programs show a clear performance deficit in the "computational -part" (Watcom C compiler produces code that is far from optimal), but -the extender (which is mostly responsible for the I/O throughput) seems -to be quite fast. - -The "natural" performance deficit of the 16-bit MSC code, which can be -clearly seen in the "testing task" comparison for UnZip, is (mostly, -for Zip more than) compensated by the better I/O throughput (due to the -"direct interface" between "C RTL" and "DOS services", without any mode -switching). - -But performance is only one aspect when choosing which compiler should -be used for official distribution: - -Sizes of the executables: - | Zip || UnZip - | standalone stub || standalone | stub -====================================================================== -EMX | 143,364 (1) | 94,212 || 159,748 (1) | 110,596 -DJ2 | 118,272 (2) | -- || 124,928 (2) | -- -DJ1 | 159,744 | 88,064 || 177,152 | 105,472 -WAT | 140,073 | -- || 116,231 | -- -MSC | 49,212 (3) | -- || 45,510 (3) | -- - -(1) does not run in "DPMI only" environment (Windows DOS box) -(2) requires externally supplied DPMI server -(3) compressed with LZexe 0.91 - -Caveats/Bugs/Problems of the different extenders: - -EMX: -- requires two different extenders to run in all DOS-compatible environments, - EMX for "raw/himem/vcpi" and RSX for "dpmi" (Windows). -- does not properly support time zones (no daylight savings time) - -DJv2: -- requires an external (freely available) DPMI extender when run on plain - DOS; this extender cannot (currently ??) be bound into the executable. - -DJv1: -- uses up large amount of "low" dos memory (below 1M) when spawning - another program, each instance of a DJv1 program requires its private - GO32 extender copy in low dos memory (may be problem for the zip - "-T" feature) - -Watcom/PMODE: -- extended memory is allocated statically (default: ALL available memory) - This means that a spawned program does not get any extended memory. - You can work around this problem by setting a hard limit on the amount - of extended memory available to the PMODE program, but this limit is - "hard" and restricts the allocatable memory for the program itself. - In detail: - The Watcom zip.exe as distributed did not allow the "zip -T" feature; - there was no extended memory left to spawn unzip. - I could work around this problem by applying PMSETUP to change the - amount of allocated extended memory to 2.0 MByte (I had 4MB free extended - memory on my test system). But, this limit cannot be enlarged at - runtime, when zip needs more memory to store "header info" while - zipping up a huge drive, and on a system with less free memory, this - method is not applicable, either. - -Summary: - -For Zip: -Use the 16-bit executable whenever possible (unless you need the -larger memory capabilities when zipping up a huge amount of files) - -As 32-bit executable, we may distribute Watcom C (after we have confirmed -that enabling ASMV and ASM_CRC give us some better computational -performance.) -The alternative for 32-bit remains DJGPP v1, which shows the least problems -(to my knowledge); v2 and EMX cannot be used because of their lack of -"universality". - -For UnZip: -Here, the Watcom C 32-bit executable is probably the best compromise, -but DJ v1 could be used as well. -And, after all, the 16-bit version does not lose badly when doing -"real" extraction! For the SFX stub, the 16-bit version remains first -choice because of its much smaller size! - -Best regards - -Christian Spieler diff --git a/third_party/infozip/zip/proginfo/timezone.txt b/third_party/infozip/zip/proginfo/timezone.txt deleted file mode 100644 index 786809332..000000000 --- a/third_party/infozip/zip/proginfo/timezone.txt +++ /dev/null @@ -1,85 +0,0 @@ -Timezone strings: ------------------ -This is a description of valid timezone strings for ENV[ARC]:TZ: -"XPG3TZ - time zone information" -The form of the time zone information is based on the XPG3 specification of -the TZ environment variable. Spaces are allowed only in timezone -designations, where they are significant. The following description -closely follows the XPG3 specification, except for the paragraphs starting -**CLARIFICATION**. - -[[],[/