Skip to content

Commit

Permalink
add stuffit support
Browse files Browse the repository at this point in the history
  • Loading branch information
srirangav committed Aug 1, 2022
1 parent ca8d324 commit 2608e0c
Show file tree
Hide file tree
Showing 12 changed files with 2,049 additions and 492 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ DerivedData
.idea/
*.dmg
qlZipInfo-*
devel/
8 changes: 4 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
README
------

qlZipInfo v1.1.10
By Sriranga Veeraraghavan <[email protected]>
qlZipInfo v1.1.11

Homepage:

Expand All @@ -14,8 +13,8 @@ Overview:
tar.gz (.tgz), tar.bz2 (.tbz2/.tbz), tar.Z (.tZ), xar
(.xar, .pkg), debian (.deb), Redhat Package Manager
(.rpm), 7zip (.7z), xz, Microsoft cabinet (.cab), gzip
(.gz), lha, and Binhex 4.0 (.hqx) archives and ISO9660
(.iso, .cdr, .toast) images.
(.gz), lha, Binhex 4.0 (.hqx), and StuffIf (.sit)
archives and ISO9660 (.iso, .cdr, .toast) images.

qlZipInfo relies on libarchive (https://libarchive.org/).

Expand Down Expand Up @@ -80,6 +79,7 @@ Known Issues:

History:

v1.1.11 - add support for some Stuffit files
v1.1.10 - update to libarchive v.3.6.1 and lzma headers from
xz v.5.2.5
v1.1.9 - add support for (some?) CD/DVD images created by
Expand Down
22 changes: 19 additions & 3 deletions qlZipInfo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,17 @@
26909FB4267C89A8000272C5 /* archive_write_disk_set_standard_lookup.c in Sources */ = {isa = PBXBuildFile; fileRef = 26909FA2267C08F4000272C5 /* archive_write_disk_set_standard_lookup.c */; settings = {COMPILER_FLAGS = "-D HAVE_CONFIG_H"; }; };
26909FB7267D2BCA000272C5 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 26909FB6267D2BCA000272C5 /* libbz2.tbd */; };
26909FB9267D2CF0000272C5 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 26909FB8267D2CF0000272C5 /* libz.tbd */; };
26A629D12897B40200713E91 /* macosroman2ascii.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A629CF2897B40200713E91 /* macosroman2ascii.h */; };
26A629D22897B40200713E91 /* macosroman2ascii.c in Sources */ = {isa = PBXBuildFile; fileRef = 26A629D02897B40200713E91 /* macosroman2ascii.c */; };
26BC4AB126807928005C136F /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC4AB026807928005C136F /* lzma.h */; };
26CA45D91B8461BA00B08F29 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 26CA45D81B8461BA00B08F29 /* GenerateThumbnailForURL.m */; };
26CA45DB1B8461BA00B08F29 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 26CA45DA1B8461BA00B08F29 /* GeneratePreviewForURL.m */; };
26CA45DD1B8461BA00B08F29 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 26CA45DC1B8461BA00B08F29 /* main.c */; };
26D414431BA9E23200216180 /* GTMDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D414401BA9E23200216180 /* GTMDefines.h */; };
26D414441BA9E23200216180 /* GTMNSString+HTML.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D414411BA9E23200216180 /* GTMNSString+HTML.h */; };
26D414451BA9E23200216180 /* GTMNSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 26D414421BA9E23200216180 /* GTMNSString+HTML.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
26D60C462895056300713E91 /* sit.c in Sources */ = {isa = PBXBuildFile; fileRef = 26D60C442895056300713E91 /* sit.c */; };
26D60C472895056300713E91 /* sit.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D60C452895056300713E91 /* sit.h */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -261,6 +265,8 @@
26909FB8267D2CF0000272C5 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
26909FC0267D3B1A000272C5 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
26909FC1267D3B1A000272C5 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
26A629CF2897B40200713E91 /* macosroman2ascii.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macosroman2ascii.h; sourceTree = "<group>"; };
26A629D02897B40200713E91 /* macosroman2ascii.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = macosroman2ascii.c; sourceTree = "<group>"; };
26BC4AB026807928005C136F /* lzma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzma.h; sourceTree = "<group>"; };
26BC4AB5268079A8005C136F /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
26BC4AB7268079F3005C136F /* lzma12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzma12.h; sourceTree = "<group>"; };
Expand All @@ -284,6 +290,8 @@
26D414401BA9E23200216180 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
26D414411BA9E23200216180 /* GTMNSString+HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSString+HTML.h"; sourceTree = "<group>"; };
26D414421BA9E23200216180 /* GTMNSString+HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSString+HTML.m"; sourceTree = "<group>"; };
26D60C442895056300713E91 /* sit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sit.c; sourceTree = "<group>"; };
26D60C452895056300713E91 /* sit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sit.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -499,8 +507,12 @@
261D47E126A94A0800028CA3 /* GeneratePreviewForURL.h */,
26CA45DA1B8461BA00B08F29 /* GeneratePreviewForURL.m */,
26CA45D81B8461BA00B08F29 /* GenerateThumbnailForURL.m */,
26546104274054D600713E91 /* binhex.c */,
265461062740557400713E91 /* binhex.h */,
26546104274054D600713E91 /* binhex.c */,
26D60C452895056300713E91 /* sit.h */,
26D60C442895056300713E91 /* sit.c */,
26A629CF2897B40200713E91 /* macosroman2ascii.h */,
26A629D02897B40200713E91 /* macosroman2ascii.c */,
26CA45DC1B8461BA00B08F29 /* main.c */,
26CA45D61B8461BA00B08F29 /* Supporting Files */,
);
Expand Down Expand Up @@ -547,10 +559,12 @@
files = (
26BC4AB126807928005C136F /* lzma.h in Headers */,
26909F9A267C07FA000272C5 /* archive_pathmatch.h in Headers */,
26A629D12897B40200713E91 /* macosroman2ascii.h in Headers */,
26909F59267B429D000272C5 /* archive_hmac_private.h in Headers */,
26909FB3267C0AB4000272C5 /* archive_getdate.h in Headers */,
26909EDD267B37E5000272C5 /* archive_entry.h in Headers */,
26D414441BA9E23200216180 /* GTMNSString+HTML.h in Headers */,
26D60C472895056300713E91 /* sit.h in Headers */,
26909F9C267C07FA000272C5 /* archive_platform_xattr.h in Headers */,
26909EEF267B39AD000272C5 /* archive_entry_private.h in Headers */,
26909ED5267B374C000272C5 /* archive.h in Headers */,
Expand Down Expand Up @@ -696,13 +710,15 @@
26909F6E267B4410000272C5 /* filter_fork_posix.c in Sources */,
26909EFD267B3EDA000272C5 /* archive_read_open_filename.c in Sources */,
26909F35267B407B000272C5 /* archive_read_support_format_cpio.c in Sources */,
26D60C462895056300713E91 /* sit.c in Sources */,
26909F51267B4194000272C5 /* archive_cryptor.c in Sources */,
26909F34267B407B000272C5 /* archive_read_support_filter_program.c in Sources */,
26909FB2267C0AB4000272C5 /* archive_getdate.c in Sources */,
26909EF5267B3CEA000272C5 /* archive_check_magic.c in Sources */,
26909FAD267C0A52000272C5 /* archive_options.c in Sources */,
26909F7F267BE461000272C5 /* archive_read_add_passphrase.c in Sources */,
26909F65267B433C000272C5 /* archive_blake2sp_ref.c in Sources */,
26A629D22897B40200713E91 /* macosroman2ascii.c in Sources */,
26909EF9267B3DA1000272C5 /* archive_entry_sparse.c in Sources */,
26909FAF267C0A89000272C5 /* archive_match.c in Sources */,
26909F9B267C07FA000272C5 /* archive_pathmatch.c in Sources */,
Expand Down Expand Up @@ -856,7 +872,7 @@
INFOPLIST_FILE = qlZipInfo/Info.plist;
INSTALL_PATH = /Library/QuickLook;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.10;
MARKETING_VERSION = 1.1.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.calalum.ranga.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -875,7 +891,7 @@
INFOPLIST_FILE = qlZipInfo/Info.plist;
INSTALL_PATH = /Library/QuickLook;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.10;
MARKETING_VERSION = 1.1.11;
PRODUCT_BUNDLE_IDENTIFIER = "org.calalum.ranga.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
26 changes: 18 additions & 8 deletions qlZipInfo/GeneratePreviewForURL.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
/*
GeneratePreviewForURL.h - constants for qlZipInfo
History:
v. 0.1.0 (07/22/2021) - initial release
v. 0.2.0 (11/13/2021) - add binhex support
Copyright (c) 2021 Sriranga R. Veeraraghavan <[email protected]>
v. 0.3.0 (08/01/2022) - add stuffit support
Copyright (c) 2015-2022 Sriranga R. Veeraraghavan <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software") to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Expand Down Expand Up @@ -112,6 +113,8 @@ static const NSString *gFilePkgIcon = @"&#x1F4E6";
/* unknown file name */

static const char *gFileNameUnavilable = "[Unavailable]";
static const NSString *gFileNameUnavilableStr =
@"[Unavailable]";

/* default font style - sans serif */

Expand All @@ -132,7 +135,9 @@ static const char *gMacFileTypeSIT5 = "SIT5";
/* UTIs for files that may require special handling */

static const CFStringRef gUTIGZip = CFSTR("org.gnu.gnu-zip-archive");
static const CFStringRef gUITBinHex = CFSTR("com.apple.binhex-archive");
static const CFStringRef gUTIBinHex = CFSTR("com.apple.binhex-archive");
static const CFStringRef gUTISIT1 = CFSTR("com.stuffit.archive.sit");
static const CFStringRef gUTISIT2 = CFSTR("com.allume.stuffit-archive");

/* structs */

Expand All @@ -154,6 +159,11 @@ static OSStatus GeneratePreviewForHQX(void *thisInterface,
CFURLRef url,
CFStringRef contentTypeUTI,
CFDictionaryRef options);
static OSStatus GeneratePreviewForSIT(void *thisInterface,
QLPreviewRequestRef preview,
CFURLRef url,
CFStringRef contentTypeUTI,
CFDictionaryRef options);
void CancelPreviewGeneration(void *thisInterface,
QLPreviewRequestRef preview);
static off_t getGZExpandedFileSize(const char *zipFileNameStr);
Expand Down
Loading

0 comments on commit 2608e0c

Please sign in to comment.