├── .gitignore ├── CP.sln ├── DIST ├── License.txt ├── NList.Data.TXT ├── ReadMe.txt ├── mfc140u.dll ├── vcruntime140.dll └── with-mdc.deploy ├── LICENSE.txt ├── README-linux.md ├── README.md ├── app ├── ACUArchive.cpp ├── ACUArchive.h ├── AboutDialog.cpp ├── AboutDialog.h ├── ActionProgressDialog.cpp ├── ActionProgressDialog.h ├── Actions.cpp ├── AddClashDialog.cpp ├── AddClashDialog.h ├── AddFilesDialog.cpp ├── AddFilesDialog.h ├── AppleSingleArchive.cpp ├── AppleSingleArchive.h ├── ArchiveInfoDialog.cpp ├── ArchiveInfoDialog.h ├── BNYArchive.cpp ├── BNYArchive.h ├── BasicImport.cpp ├── BasicImport.h ├── CassImpTargetDialog.cpp ├── CassImpTargetDialog.h ├── CassetteDialog.cpp ├── CassetteDialog.h ├── ChooseAddTargetDialog.cpp ├── ChooseAddTargetDialog.h ├── ChooseDirDialog.h ├── CiderPress.rc ├── Clipboard.cpp ├── ConfirmOverwriteDialog.cpp ├── ConfirmOverwriteDialog.h ├── ContentList.cpp ├── ContentList.h ├── ConvDiskOptionsDialog.cpp ├── ConvDiskOptionsDialog.h ├── ConvFileOptionsDialog.cpp ├── ConvFileOptionsDialog.h ├── CreateImageDialog.cpp ├── CreateImageDialog.h ├── CreateSubdirDialog.cpp ├── CreateSubdirDialog.h ├── DEFileDialog.cpp ├── DEFileDialog.h ├── DiskArchive.cpp ├── DiskArchive.h ├── DiskConvertDialog.cpp ├── DiskConvertDialog.h ├── DiskEditDialog.cpp ├── DiskEditDialog.h ├── DiskEditOpenDialog.cpp ├── DiskEditOpenDialog.h ├── DiskFSTree.cpp ├── DiskFSTree.h ├── DoneOpenDialog.h ├── EOLScanDialog.cpp ├── EOLScanDialog.h ├── EditAssocDialog.cpp ├── EditAssocDialog.h ├── EditCommentDialog.cpp ├── EditCommentDialog.h ├── EditPropsDialog.cpp ├── EditPropsDialog.h ├── EnterRegDialog.cpp ├── EnterRegDialog.h ├── ExtractOptionsDialog.cpp ├── ExtractOptionsDialog.h ├── FileNameConv.cpp ├── FileNameConv.h ├── GenericArchive.cpp ├── GenericArchive.h ├── Graphics │ ├── ChooseFolder.bmp │ ├── CiderPress.ico │ ├── FileViewer.ico │ ├── NewFolder.bmp │ ├── binary2.ico │ ├── diskimage.ico │ ├── fslogo.bmp │ ├── hdrbar.bmp │ ├── list-pics.bmp │ ├── nufx.ico │ ├── toolbar1.bmp │ ├── tree_pics.bmp │ └── vol_pics.bmp ├── Help │ ├── CiderPress.chm │ ├── CiderPress.hhc │ ├── CiderPress.hhk │ ├── CiderPress.hhp │ ├── PopUp.txt │ ├── PopUpIds.h │ ├── README.txt │ └── html │ │ ├── t10.htm │ │ ├── t109.htm │ │ ├── t111.htm │ │ ├── t112.htm │ │ ├── t13.htm │ │ ├── t18.htm │ │ ├── t187.htm │ │ ├── t19.htm │ │ ├── t20.htm │ │ ├── t201.htm │ │ ├── t203.htm │ │ ├── t21.htm │ │ ├── t215.htm │ │ ├── t216.htm │ │ ├── t22.htm │ │ ├── t23.htm │ │ ├── t233.htm │ │ ├── t24.htm │ │ ├── t241.htm │ │ ├── t244.htm │ │ ├── t245.htm │ │ ├── t247.htm │ │ ├── t25.htm │ │ ├── t257.htm │ │ ├── t258.htm │ │ ├── t259.htm │ │ ├── t262.htm │ │ ├── t263.htm │ │ ├── t268.htm │ │ ├── t272.htm │ │ ├── t273.htm │ │ ├── t277.htm │ │ ├── t28.htm │ │ ├── t284.htm │ │ ├── t29.htm │ │ ├── t38.htm │ │ ├── t39.htm │ │ ├── t41.htm │ │ ├── t42.htm │ │ ├── t43.htm │ │ ├── t44.htm │ │ ├── t45.htm │ │ ├── t46.htm │ │ ├── t47.htm │ │ ├── t48.htm │ │ ├── t49.htm │ │ ├── t50.htm │ │ ├── t51.htm │ │ ├── t52.htm │ │ ├── t53.htm │ │ ├── t54.htm │ │ ├── t55.htm │ │ ├── t56.htm │ │ ├── t57.htm │ │ ├── t58.htm │ │ ├── t59.htm │ │ ├── t60.htm │ │ ├── t61.htm │ │ ├── t62.htm │ │ ├── t63.htm │ │ ├── t64.htm │ │ ├── t65.htm │ │ ├── t66.htm │ │ ├── t67.htm │ │ ├── t68.htm │ │ └── t69.htm ├── HelpTopics.h ├── ImageFormatDialog.cpp ├── ImageFormatDialog.h ├── Main.cpp ├── Main.h ├── MyApp.cpp ├── MyApp.h ├── NewDiskSize.cpp ├── NewDiskSize.h ├── NufxArchive.cpp ├── NufxArchive.h ├── OpenVolumeDialog.cpp ├── OpenVolumeDialog.h ├── PasteSpecialDialog.cpp ├── PasteSpecialDialog.h ├── Preferences.cpp ├── Preferences.h ├── PrefsDialog.cpp ├── PrefsDialog.h ├── Print.cpp ├── Print.h ├── ProgressCounterDialog.h ├── RecompressOptionsDialog.cpp ├── RecompressOptionsDialog.h ├── Registry.cpp ├── Registry.h ├── RenameEntryDialog.cpp ├── RenameEntryDialog.h ├── RenameVolumeDialog.cpp ├── RenameVolumeDialog.h ├── Squeeze.cpp ├── Squeeze.h ├── StdAfx.cpp ├── StdAfx.h ├── SubVolumeDialog.cpp ├── SubVolumeDialog.h ├── Tools.cpp ├── TwoImgPropsDialog.cpp ├── TwoImgPropsDialog.h ├── UseSelectionDialog.cpp ├── UseSelectionDialog.h ├── ViewFilesDialog.cpp ├── ViewFilesDialog.h ├── VolumeCopyDialog.cpp ├── VolumeCopyDialog.h ├── app.vcxproj ├── app.vcxproj.filters ├── app.vcxproj.user ├── postbuild.bat ├── resource.h ├── resource.hm └── targetver.h ├── diskimg ├── ASPI.cpp ├── ASPI.h ├── CFFA.cpp ├── CPM.cpp ├── CP_WNASPI32.H ├── CP_ntddscsi.h ├── Container.cpp ├── DDD.cpp ├── DIUtil.cpp ├── DOS33.cpp ├── DOSImage.cpp ├── DiskFS.cpp ├── DiskImg.cpp ├── DiskImg.h ├── DiskImgDetail.h ├── DiskImgPriv.h ├── FAT.cpp ├── FDI.cpp ├── FocusDrive.cpp ├── GenericFD.cpp ├── GenericFD.h ├── Global.cpp ├── Gutenberg.cpp ├── HFS.cpp ├── ImageWrapper.cpp ├── MacPart.cpp ├── Makefile ├── MicroDrive.cpp ├── Nibble.cpp ├── Nibble35.cpp ├── OuterWrapper.cpp ├── OzDOS.cpp ├── Pascal.cpp ├── ProDOS.cpp ├── RDOS.cpp ├── README.md ├── SCSIDefs.h ├── SPTI.cpp ├── SPTI.h ├── StdAfx.cpp ├── StdAfx.h ├── TwoImg.cpp ├── TwoImg.h ├── UNIDOS.cpp ├── VolumeUsage.cpp ├── Win32BlockIO.cpp ├── Win32BlockIO.h ├── Win32Extra.h ├── diskimg.vcxproj ├── diskimg.vcxproj.filters ├── diskimg.vcxproj.user └── libhfs │ ├── COPYRIGHT │ ├── Makefile │ ├── README │ ├── apple.h │ ├── block.c │ ├── block.h │ ├── btree.c │ ├── btree.h │ ├── config.h │ ├── data.c │ ├── data.h │ ├── file.c │ ├── file.h │ ├── hfs.c │ ├── hfs.h │ ├── libhfs.h │ ├── libhfs.vcxproj │ ├── libhfs.vcxproj.filters │ ├── low.c │ ├── low.h │ ├── medium.c │ ├── medium.h │ ├── memcmp.c │ ├── node.c │ ├── node.h │ ├── os.c │ ├── os.h │ ├── record.c │ ├── record.h │ ├── version.c │ ├── version.h │ ├── volume.c │ └── volume.h ├── linux ├── .gitignore ├── Convert.cpp ├── GetFile.cpp ├── MDC.cpp ├── MakeDisk.cpp ├── Makefile ├── PackDDD.cpp ├── SSTAsm.cpp └── StringArray.h ├── mdc ├── AboutDlg.cpp ├── AboutDlg.h ├── Main.cpp ├── Main.h ├── ProgressDlg.cpp ├── ProgressDlg.h ├── StdAfx.cpp ├── StdAfx.h ├── mdc.ICO ├── mdc.clw ├── mdc.cpp ├── mdc.h ├── mdc.rc ├── mdc.vcxproj ├── mdc.vcxproj.filters ├── mdc.vcxproj.user └── resource.h ├── nufxlib ├── .gitignore ├── Archive.c ├── ArchiveIO.c ├── Bzip2.c ├── COPYING-LIB ├── ChangeLog.txt ├── Charset.c ├── Compress.c ├── Crc16.c ├── Debug.c ├── Deferred.c ├── Deflate.c ├── Entry.c ├── Expand.c ├── FileIO.c ├── Funnel.c ├── INSTALL ├── Lzc.c ├── Lzw.c ├── Makefile.in ├── Makefile.msc ├── MiscStuff.c ├── MiscStuff.h ├── MiscUtils.c ├── NOTES.md ├── NufxLib.h ├── NufxLibPriv.h ├── README.txt ├── Record.c ├── SourceSink.c ├── Squeeze.c ├── SysDefs.h ├── Thread.c ├── Value.c ├── Version.c ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.in ├── install-sh ├── mkinstalldirs ├── nufxlib.def ├── nufxlib.vcxproj ├── nufxlib.vcxproj.filters └── samples │ ├── Common.h │ ├── Exerciser.c │ ├── ImgConv.c │ ├── Launder.c │ ├── Makefile.in │ ├── Makefile.msc │ ├── README-S.txt │ ├── TestBasic.c │ ├── TestExtract.c │ ├── TestNames.c │ ├── TestSimple.c │ └── TestTwirl.c ├── reformat ├── AWGS.cpp ├── AWGS.h ├── AppleWorks.cpp ├── AppleWorks.h ├── Asm.cpp ├── Asm.h ├── BASIC.cpp ├── BASIC.h ├── CPMFiles.cpp ├── CPMFiles.h ├── Charset.cpp ├── Charset.h ├── Directory.cpp ├── Directory.h ├── Disasm.cpp ├── Disasm.h ├── DisasmTable.cpp ├── DoubleHiRes.cpp ├── DoubleHiRes.h ├── DreamGrafix.cpp ├── HiRes.cpp ├── HiRes.h ├── MacPaint.cpp ├── MacPaint.h ├── NiftyList.cpp ├── PascalFiles.cpp ├── PascalFiles.h ├── PrintShop.cpp ├── PrintShop.h ├── Reformat.cpp ├── Reformat.h ├── ReformatBase.cpp ├── ReformatBase.h ├── ResourceFork.cpp ├── ResourceFork.h ├── Simple.cpp ├── Simple.h ├── StdAfx.cpp ├── StdAfx.h ├── SuperHiRes.cpp ├── SuperHiRes.h ├── Teach.cpp ├── Teach.h ├── Text8.cpp ├── Text8.h ├── reformat.vcxproj └── reformat.vcxproj.filters ├── util ├── CancelDialog.h ├── FaddenStd.h ├── ImageDataObject.cpp ├── ImageDataObject.h ├── Modeless.h ├── MyBitmapButton.cpp ├── MyBitmapButton.h ├── MyDIBitmap.cpp ├── MyDIBitmap.h ├── MyDebug.cpp ├── MyDebug.h ├── MyEdit.cpp ├── MyEdit.h ├── MySpinCtrl.cpp ├── MySpinCtrl.h ├── PathName.cpp ├── PathName.h ├── Pidl.cpp ├── Pidl.h ├── ProgressCancelDialog.h ├── SelectFilesDialog.cpp ├── SelectFilesDialog.h ├── SoundFile.cpp ├── SoundFile.h ├── StdAfx.cpp ├── StdAfx.h ├── Util.cpp ├── Util.h ├── UtilLib.h ├── util.vcxproj └── util.vcxproj.filters └── zlib ├── ChangeLog ├── FAQ ├── INDEX ├── README ├── adler32.c ├── compress.c ├── crc32.c ├── crc32.h ├── deflate.c ├── deflate.h ├── gzclose.c ├── gzguts.h ├── gzlib.c ├── gzread.c ├── gzwrite.c ├── infback.c ├── inffast.c ├── inffast.h ├── inffixed.h ├── inflate.c ├── inflate.h ├── inftrees.c ├── inftrees.h ├── trees.c ├── trees.h ├── uncompr.c ├── zconf.h ├── zlib.h ├── zlib.vcxproj ├── zlib.vcxproj.filters ├── zutil.c └── zutil.h /DIST/License.txt: -------------------------------------------------------------------------------- 1 | End-User License Agreement for CiderPress 2 | Copyright (C) 2017, CiderPress project authors 3 | All rights reserved. 4 | 5 | AGREEMENT. After reading this agreement carefully, if you ("Customer") do 6 | not agree to all of the terms of this agreement, you may not use 7 | CiderPress ("Software"). Your use of this Software indicates your 8 | acceptance of this license agreement and warranty. All updates to the 9 | Software shall be considered part of the Software and subject to the terms 10 | of this Agreement. Changes to this Agreement may accompany updates to the 11 | Software, in which case by installing such update Customer accepts the 12 | terms of the Agreement as changed. The Agreement is not otherwise subject 13 | to addition, amendment, modification, or exception unless in writing 14 | signed by an officer of both Customer and FaddenSoft, LLC ("FaddenSoft"). 15 | 16 | 1. LICENSE. This is free software, distributed under the terms of the 17 | BSD License. See "LICENSE.txt" for details. 18 | 19 | 2. LIMITED WARRANTY. THE SOFTWARE IS PROVIDED AS IS AND FADDENSOFT 20 | DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE, WHETHER EXPRESSED OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF 22 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 23 | 24 | 3. LIMITATION ON DAMAGES. NEITHER FADDENSOFT NOR ANYONE INVOLVED IN THE 25 | CREATION, PRODUCTION, OR DELIVERY OF THIS SOFTWARE SHALL BE LIABLE FOR ANY 26 | INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES ARISING OUT OF THE USE OR 27 | INABILITY TO USE SUCH SOFTWARE EVEN IF FADDENSOFT HAS BEEN ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO EVENT SHALL FADDENSOFT'S 29 | LIABILITY FOR ANY DAMAGES EXCEED THE PRICE PAID FOR THE LICENSE TO USE THE 30 | SOFTWARE, REGARDLESS OF THE FORM OF CLAIM. THE PERSON USING THE SOFTWARE 31 | BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. 32 | 33 | 4. GOVERNING LAW AND GENERAL PROVISIONS. This Agreement will be governed 34 | by the laws of the State of California, U.S.A. If any part of this 35 | Agreement is found void and unenforceable, it will not affect the validity 36 | of the balance of the Agreement, which shall remain valid and enforceable 37 | according to its terms. This Agreement shall automatically terminate upon 38 | failure by Customer to comply with its terms. 39 | -------------------------------------------------------------------------------- /DIST/ReadMe.txt: -------------------------------------------------------------------------------- 1 | faddenSoft CiderPress(tm) 2 | 3 | CiderPress is a Windows utility for accessing Apple II archives and 4 | disk images. A wide range of formats are supported, including 5 | ShrinkIt (NuFX) archives and disk images with DOS, ProDOS, Pascal, 6 | CP/M, and RDOS filesystems. 7 | 8 | This program used to be shareware, but is now free. 9 | 10 | If you have any questions, please visit the CiderPress 11 | web site at http://a2ciderpress.com/. 12 | -------------------------------------------------------------------------------- /DIST/mfc140u.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/DIST/mfc140u.dll -------------------------------------------------------------------------------- /DIST/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/DIST/vcruntime140.dll -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, CiderPress project authors 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of FaddenSoft, LLC nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY FaddenSoft, LLC ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL FaddenSoft, LLC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | 26 | -------------------------------------------------------------------------------- /README-linux.md: -------------------------------------------------------------------------------- 1 | CiderPress Linux Utilities 2 | ========================== 3 | 4 | CiderPress is a Windows app, but the code for accessing NuFX (ShrinkIt) 5 | archives and disk images can be built as libraries on Linux and used 6 | from applications. A few samples are provided. Most are really just 7 | API demos, but they may come in handy. 8 | 9 | You need to build NufxLib, the diskimg library, and then the samples. 10 | 11 | Build Instructions 12 | ------------------ 13 | 14 | 1. Configure and build NufxLib library 15 | 16 | cd nufxlib 17 | ./configure 18 | make 19 | 20 | 2. build diskimg library 21 | 22 | cd ../diskimg 23 | make 24 | 25 | 3. build libhfs library 26 | 27 | cd libhfs 28 | make 29 | 30 | 4. build samples 31 | 32 | cd ../../linux 33 | make 34 | 35 | The build system could use some work. 36 | 37 | 38 | Sample Programs 39 | --------------- 40 | 41 | The current sample programs are: 42 | 43 | `getfile disk-image filename` -- 44 | Extract a file from a disk image The file is written to stdout. 45 | 46 | `makedisk {dos|prodos|pascal} size image-filename.po file1 ...` -- 47 | Create a new disk image, with the specified size and format, and copy the 48 | specified files onto it. The NON file type is used. 49 | 50 | `mdc file1 ...` -- 51 | This is a Linux port of the MDC utility that ships with CiderPress. 52 | It recursively scans all files and directories specified, displaying 53 | the contents of any disk images it finds. 54 | 55 | 56 | ### Bonus Programs ### 57 | 58 | `iconv infile outfile` -- 59 | Convert an image from one format to another. This was used for testing. 60 | 61 | `packddd infile outfile` -- 62 | The DDD code was originally developed under Linux. This code is here 63 | for historical reasons. 64 | 65 | `sstasm part1 part2` -- 66 | The SST re-assembly code was originally developed under Linux. The code 67 | is here for historical reasons. 68 | 69 | -------------------------------------------------------------------------------- /app/AboutDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Class definition for About dialog. 8 | */ 9 | #ifndef APP_ABOUTDIALOG_H 10 | #define APP_ABOUTDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | /* 15 | * A simple dialog with an overridden initialization so we can tweak the 16 | * controls slightly. 17 | */ 18 | class AboutDialog : public CDialog { 19 | public: 20 | AboutDialog(CWnd* pParentWnd = NULL) : 21 | CDialog(IDD_ABOUTDLG, pParentWnd) 22 | {} 23 | 24 | protected: 25 | /* 26 | * Update the static strings with DLL version numbers. 27 | */ 28 | virtual BOOL OnInitDialog(void) override; 29 | 30 | /* 31 | * User hit the "Credits" button. 32 | */ 33 | afx_msg void OnAboutCredits(void); 34 | 35 | //afx_msg void OnEnterReg(void); 36 | //void ShowRegistrationInfo(void); 37 | 38 | DECLARE_MESSAGE_MAP() 39 | }; 40 | 41 | #endif /*APP_ABOUTDIALOG_H*/ 42 | -------------------------------------------------------------------------------- /app/ActionProgressDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Show the progress of an action like "add" or "extract". 8 | */ 9 | #ifndef APP_ACTIONPROGRESSDIALOG_H 10 | #define APP_ACTIONPROGRESSDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | /* 15 | * Modeless dialog; must be allocated on the heap. 16 | */ 17 | class ActionProgressDialog : public ProgressCancelDialog { 18 | public: 19 | typedef enum { 20 | kActionUnknown = 0, 21 | kActionAdd, 22 | kActionAddDisk, 23 | kActionExtract, 24 | kActionDelete, 25 | kActionTest, 26 | kActionRecompress, 27 | kActionConvDisk, 28 | kActionConvFile, 29 | } Action; 30 | 31 | ActionProgressDialog(void) : fAction(kActionUnknown), fCancel(false) { } 32 | virtual ~ActionProgressDialog(void) { } 33 | 34 | BOOL Create(Action action, CWnd* pParentWnd = NULL) { 35 | fAction = action; 36 | pParentWnd->EnableWindow(FALSE); 37 | return ProgressCancelDialog::Create(&fCancel, IDD_ACTION_PROGRESS, 38 | IDC_PROG_PROGRESS, pParentWnd); 39 | } 40 | void Cleanup(CWnd* pParentWnd) { 41 | pParentWnd->EnableWindow(TRUE); 42 | DestroyWindow(); 43 | } 44 | 45 | /* 46 | * Set the name of the file as it appears in the archive. 47 | */ 48 | void SetArcName(const WCHAR* str); 49 | 50 | /* 51 | * Set the name of the file as it appears under Windows. 52 | */ 53 | void SetFileName(const WCHAR* str); 54 | 55 | /* 56 | * Get the name of the file as it appears under Windows. 57 | */ 58 | const CString GetFileName(void); 59 | 60 | /* 61 | * Update the progress meter. 62 | * 63 | * We take a percentage, but the underlying control uses 1000ths. 64 | */ 65 | int SetProgress(int perc); 66 | 67 | private: 68 | /* 69 | * Initialize the static text controls to say something reasonable. 70 | */ 71 | virtual BOOL OnInitDialog(void) override; 72 | 73 | Action fAction; 74 | bool fCancel; 75 | 76 | DECLARE_MESSAGE_MAP() 77 | }; 78 | 79 | #endif /*APP_ACTIONPROGRESSDIALOG_H*/ 80 | -------------------------------------------------------------------------------- /app/AddClashDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #include "stdafx.h" 7 | #include "ConfirmOverwriteDialog.h" 8 | #include "AddClashDialog.h" 9 | 10 | BEGIN_MESSAGE_MAP(AddClashDialog, CDialog) 11 | ON_BN_CLICKED(IDC_CLASH_RENAME, OnRename) 12 | ON_BN_CLICKED(IDC_CLASH_SKIP, OnSkip) 13 | END_MESSAGE_MAP() 14 | 15 | /* 16 | * Replaces some static text fields. 17 | */ 18 | BOOL AddClashDialog::OnInitDialog(void) 19 | { 20 | CWnd* pWnd; 21 | 22 | pWnd = GetDlgItem(IDC_CLASH_WINNAME); 23 | ASSERT(pWnd != NULL); 24 | pWnd->SetWindowText(fWindowsName); 25 | 26 | pWnd = GetDlgItem(IDC_CLASH_STORAGENAME); 27 | ASSERT(pWnd != NULL); 28 | pWnd->SetWindowText(fStorageName); 29 | 30 | return CDialog::OnInitDialog(); 31 | } 32 | 33 | void AddClashDialog::OnSkip(void) 34 | { 35 | fDoRename = false; 36 | CDialog::OnOK(); 37 | } 38 | 39 | void AddClashDialog::OnRename(void) 40 | { 41 | RenameOverwriteDialog dlg; 42 | 43 | dlg.fNewFileSource = fWindowsName; 44 | dlg.fExistingFile = fStorageName; 45 | dlg.fNewName = fStorageName; 46 | if (dlg.DoModal() == IDOK) { 47 | fNewName = dlg.fNewName; 48 | fDoRename = true; 49 | CDialog::OnOK(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/AddClashDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #ifndef APP_ADDCLASHDIALOG_H 7 | #define APP_ADDCLASHDIALOG_H 8 | 9 | /* 10 | * Dialog for resolving a filename clash. 11 | */ 12 | class AddClashDialog : public CDialog { 13 | public: 14 | AddClashDialog(CWnd* pParentWnd = NULL) : 15 | CDialog(IDD_ADD_CLASH, pParentWnd) 16 | { 17 | fDoRename = false; 18 | } 19 | ~AddClashDialog(void) {} 20 | 21 | CString fWindowsName; 22 | CString fStorageName; 23 | 24 | bool fDoRename; // if "false", skip this file 25 | CString fNewName; 26 | 27 | private: 28 | afx_msg void OnRename(void); 29 | afx_msg void OnSkip(void); 30 | 31 | virtual BOOL OnInitDialog(void) override; 32 | 33 | DECLARE_MESSAGE_MAP() 34 | }; 35 | 36 | #endif /*APP_ADDCLASHDIALOG_H*/ 37 | -------------------------------------------------------------------------------- /app/AddFilesDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * File selection dialog, a sub-class of "Open" that allows multiple selection 8 | * of both files and directories. 9 | */ 10 | #ifndef APP_ADDFILESDIALOG_H 11 | #define APP_ADDFILESDIALOG_H 12 | 13 | #include "../diskimg/DiskImg.h" 14 | #include "../util/UtilLib.h" 15 | #include "resource.h" 16 | 17 | /* 18 | * Choose files and folders to add. 19 | * 20 | * This gets passed down through the file add stuff, so it needs to carry some 21 | * extra data along as well. 22 | */ 23 | class AddFilesDialog : public SelectFilesDialog { 24 | public: 25 | AddFilesDialog(CWnd* pParentWnd = NULL) : 26 | SelectFilesDialog(L"IDD_ADD_FILES", true, pParentWnd) 27 | { 28 | SetWindowTitle(L"Add Files..."); 29 | fStoragePrefix = ""; 30 | fStoragePrefixEnable = true; 31 | fIncludeSubfolders = FALSE; 32 | fStripFolderNames = FALSE; 33 | fStripFolderNamesEnable = true; 34 | fOverwriteExisting = FALSE; 35 | fTypePreservation = 0; 36 | fConvEOL = 0; 37 | fConvEOLEnable = true; 38 | 39 | fpTargetDiskFS = NULL; 40 | //fpTargetSubdir = NULL; 41 | fpDiskImg = NULL; 42 | } 43 | virtual ~AddFilesDialog(void) {} 44 | 45 | /* values from dialog */ 46 | CString fStoragePrefix; 47 | bool fStoragePrefixEnable; 48 | BOOL fIncludeSubfolders; 49 | BOOL fStripFolderNames; 50 | bool fStripFolderNamesEnable; 51 | BOOL fOverwriteExisting; 52 | 53 | enum { kPreserveNone = 0, kPreserveTypes, kPreserveAndExtend }; 54 | int fTypePreservation; 55 | 56 | enum { kConvEOLNone = 0, kConvEOLType, kConvEOLAuto, kConvEOLAll }; 57 | int fConvEOL; 58 | bool fConvEOLEnable; 59 | 60 | /* carryover from ChooseAddTargetDialog */ 61 | DiskImgLib::DiskFS* fpTargetDiskFS; 62 | //DiskImgLib::A2File* fpTargetSubdir; 63 | 64 | /* kluge; we carry this around for the benefit of AddDisk */ 65 | DiskImgLib::DiskImg* fpDiskImg; 66 | 67 | private: 68 | virtual bool MyDataExchange(bool saveAndValidate) override; 69 | 70 | // User hit the Help button. 71 | virtual void HandleHelp() override; 72 | 73 | // Make sure the storage prefix they entered is valid. 74 | bool ValidateStoragePrefix(); 75 | 76 | //DECLARE_MESSAGE_MAP() 77 | }; 78 | 79 | #endif /*APP_ADDFILESDIALOG_H*/ 80 | -------------------------------------------------------------------------------- /app/CassImpTargetDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Choose file name and characteristics for a file imported from an audio 8 | * cassette tape. 9 | */ 10 | #ifndef APP_CASSIMPTARGETDIALOG_H 11 | #define APP_CASSIMPTARGETDIALOG_H 12 | 13 | #include "resource.h" 14 | 15 | /* 16 | * Get a filename, allow them to override the file type, and get a hexadecimal 17 | * start address for binary files. 18 | */ 19 | class CassImpTargetDialog : public CDialog { 20 | public: 21 | CassImpTargetDialog(CWnd* pParentWnd = NULL) : 22 | CDialog(IDD_CASSIMPTARGET, pParentWnd), 23 | fStartAddr(0x0800), 24 | fFileTypeIndex(0) 25 | {} 26 | virtual ~CassImpTargetDialog(void) {} 27 | 28 | /* 29 | * Get the selected file type. Call this after the modal dialog exits. 30 | */ 31 | long GetFileType(void) const; 32 | 33 | /* 34 | * Convert a ProDOS file type into a radio button enum. 35 | */ 36 | void SetFileType(long type); 37 | 38 | CString fFileName; 39 | unsigned short fStartAddr; // start addr for BIN files 40 | long fFileLength; // used for BIN display 41 | 42 | private: 43 | virtual BOOL OnInitDialog(void) override; 44 | virtual void DoDataExchange(CDataExchange* pDX) override; 45 | 46 | /* 47 | * They selected a different file type. Enable or disable the address 48 | * entry window. 49 | */ 50 | afx_msg void OnTypeChange(void); 51 | 52 | /* 53 | * If the user changes the address, update the "end of range" field. 54 | */ 55 | afx_msg void OnAddrChange(void); 56 | 57 | MyEdit fAddrEdit; // replacement edit ctrl for addr field 58 | 59 | /* 60 | * Get the start address (entered as a 4-digit hex value). 61 | * 62 | * Returns -1 if something was wrong with the string (e.g. empty or has 63 | * invalid chars). 64 | */ 65 | long GetStartAddr(void) const; 66 | 67 | /* for radio button; enum must match order of controls in dialog */ 68 | enum { kTypeBAS = 0, kTypeINT, kTypeBIN }; 69 | int fFileTypeIndex; 70 | 71 | DECLARE_MESSAGE_MAP() 72 | }; 73 | 74 | #endif /*APP_CASSIMPTARGETDIALOG_H*/ 75 | -------------------------------------------------------------------------------- /app/ChooseAddTargetDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Choose the sub-volume and directory where added files will be put. 8 | */ 9 | #ifndef APP_CHOOSEADDTARGETDIALOG_H 10 | #define APP_CHOOSEADDTARGETDIALOG_H 11 | 12 | #include "resource.h" 13 | #include "DiskFSTree.h" 14 | #include "../diskimg/DiskImg.h" 15 | 16 | /* 17 | * The dialog has a tree structure representing the sub-volumes and the 18 | * directory structure within each sub-volume. 19 | */ 20 | class ChooseAddTargetDialog : public CDialog { 21 | public: 22 | ChooseAddTargetDialog(CWnd* pParentWnd = NULL) : 23 | CDialog(IDD_CHOOSE_ADD_TARGET, pParentWnd) 24 | { 25 | fpDiskFS = fpChosenDiskFS = NULL; 26 | fpChosenSubdir = NULL; 27 | } 28 | virtual ~ChooseAddTargetDialog(void) {} 29 | 30 | /* set this before calling DoModal */ 31 | DiskImgLib::DiskFS* fpDiskFS; 32 | 33 | /* results; fpChosenSubdir will be NULL if root vol selected */ 34 | DiskImgLib::DiskFS* fpChosenDiskFS; 35 | DiskImgLib::A2File* fpChosenSubdir; 36 | 37 | private: 38 | /* 39 | * Initialize the dialog box. This requires scanning the provided disk 40 | * archive. 41 | */ 42 | virtual BOOL OnInitDialog(void) override; 43 | 44 | virtual void DoDataExchange(CDataExchange* pDX) override; 45 | 46 | afx_msg void OnHelp(void) { 47 | MyApp::HandleHelp(this, HELP_TOPIC_CHOOSE_TARGET); 48 | } 49 | 50 | DiskFSTree fDiskFSTree; 51 | 52 | DECLARE_MESSAGE_MAP() 53 | }; 54 | 55 | #endif /*APP_CHOOSEADDTARGETDIALOG_H*/ 56 | -------------------------------------------------------------------------------- /app/ChooseDirDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Dialog for choosing a directory. 8 | */ 9 | #ifndef APP_CHOOSEDIRDIALOG 10 | #define APP_CHOOSEDIRDIALOG 11 | 12 | #include 13 | 14 | 15 | /* 16 | * Choose a directory. This is distinctly different from what the standard 17 | * "Open" and "Save As" dialogs do, because those want to choose normal files 18 | * only, while this wants to select a folder. 19 | * 20 | * Win2K added the shell "browse for folder" dialog, which does exactly 21 | * what we want. 22 | */ 23 | class ChooseDirDialog { 24 | public: 25 | ChooseDirDialog(CWnd* pParent = NULL) { 26 | fpParent = pParent; 27 | } 28 | ~ChooseDirDialog() {} 29 | 30 | // Gets the pathname. Call this after DoModal has updated it. 31 | const CString& GetPathName(void) const { 32 | return fPathName; 33 | } 34 | 35 | // Sets the pathname. Call before DoModal(). 36 | void SetPathName(const CString& str) { 37 | fPathName = str; 38 | } 39 | 40 | // Returns false if nothing was selected (e.g. the dialog was canceled). 41 | BOOL DoModal() { 42 | CShellManager* pMan = gMyApp.GetShellManager(); 43 | CString outFolder; 44 | BOOL result = pMan->BrowseForFolder(outFolder, fpParent, fPathName, 45 | L"Select folder:", BIF_RETURNONLYFSDIRS | BIF_USENEWUI); 46 | fPathName = outFolder; 47 | return result; 48 | } 49 | 50 | private: 51 | CWnd* fpParent; 52 | CString fPathName; 53 | }; 54 | 55 | #endif /*APP_CHOOSEDIRDIALOG*/ 56 | -------------------------------------------------------------------------------- /app/CiderPress.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/CiderPress.rc -------------------------------------------------------------------------------- /app/ConvFileOptionsDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #include "stdafx.h" 7 | #include "ConvFileOptionsDialog.h" 8 | 9 | 10 | void ConvFileOptionsDialog::DoDataExchange(CDataExchange* pDX) 11 | { 12 | //DDX_Check(pDX, IDC_CONVFILE_CONVDOS, fConvDOSText); 13 | //DDX_Check(pDX, IDC_CONVFILE_CONVPASCAL, fConvPascalText); 14 | DDX_Check(pDX, IDC_CONVFILE_PRESERVEDIR, fPreserveEmptyFolders); 15 | 16 | UseSelectionDialog::DoDataExchange(pDX); 17 | } 18 | -------------------------------------------------------------------------------- /app/ConvFileOptionsDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Options for converting a disk image to a file archive. 8 | */ 9 | #ifndef APP_CONFFILEOPTIONSDIALOG_H 10 | #define APP_CONFFILEOPTIONSDIALOG_H 11 | 12 | #include "UseSelectionDialog.h" 13 | #include "resource.h" 14 | 15 | /* 16 | * Get some options. 17 | */ 18 | class ConvFileOptionsDialog : public UseSelectionDialog { 19 | public: 20 | ConvFileOptionsDialog(int selCount, CWnd* pParentWnd = NULL) : 21 | UseSelectionDialog(selCount, pParentWnd, IDD_CONVFILE_OPTS) 22 | { 23 | fPreserveEmptyFolders = FALSE; 24 | } 25 | virtual ~ConvFileOptionsDialog(void) {} 26 | 27 | //BOOL fConvDOSText; 28 | //BOOL fConvPascalText; 29 | BOOL fPreserveEmptyFolders; 30 | 31 | private: 32 | virtual void DoDataExchange(CDataExchange* pDX) override; 33 | 34 | //DECLARE_MESSAGE_MAP() 35 | }; 36 | 37 | #endif /*APP_CONFFILEOPTIONSDIALOG_H*/ 38 | -------------------------------------------------------------------------------- /app/CreateSubdirDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Implementation of CreateSubdirDialog. 8 | * 9 | * Gets the name from the user, validates it against the supplied 10 | * GenericArchive, and returns. 11 | */ 12 | #include "stdafx.h" 13 | #include "CreateSubdirDialog.h" 14 | 15 | BEGIN_MESSAGE_MAP(CreateSubdirDialog, CDialog) 16 | ON_WM_HELPINFO() 17 | END_MESSAGE_MAP() 18 | 19 | BOOL CreateSubdirDialog::OnInitDialog(void) 20 | { 21 | /* do the DoDataExchange stuff */ 22 | CDialog::OnInitDialog(); 23 | 24 | /* select the default text and set the focus */ 25 | CEdit* pEdit = (CEdit*) GetDlgItem(IDC_CREATESUBDIR_NEW); 26 | ASSERT(pEdit != NULL); 27 | pEdit->SetSel(0, -1); 28 | pEdit->SetFocus(); 29 | 30 | return FALSE; // we set the focus 31 | } 32 | 33 | void CreateSubdirDialog::DoDataExchange(CDataExchange* pDX) 34 | { 35 | CString msg, failed; 36 | 37 | CheckedLoadString(&failed, IDS_MB_APP_NAME); 38 | 39 | /* put fNewName last so it gets the focus after failure */ 40 | DDX_Text(pDX, IDC_CREATESUBDIR_BASE, fBasePath); 41 | DDX_Text(pDX, IDC_CREATESUBDIR_NEW, fNewName); 42 | 43 | /* validate the path field */ 44 | if (pDX->m_bSaveAndValidate) { 45 | if (fNewName.IsEmpty()) { 46 | msg = L"You must specify a new name."; 47 | goto fail; 48 | } 49 | 50 | msg = fpArchive->TestPathName(fpParentEntry, fBasePath, fNewName, 51 | '\0'); 52 | if (!msg.IsEmpty()) 53 | goto fail; 54 | } 55 | 56 | return; 57 | 58 | fail: 59 | ASSERT(!msg.IsEmpty()); 60 | MessageBox(msg, failed, MB_OK); 61 | pDX->Fail(); 62 | return; 63 | } 64 | -------------------------------------------------------------------------------- /app/CreateSubdirDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Create a subdirectory (e.g. on a ProDOS disk image). 8 | */ 9 | #ifndef APP_CREATESUBDIRDIALOG_H 10 | #define APP_CREATESUBDIRDIALOG_H 11 | 12 | #include "GenericArchive.h" 13 | #include "resource.h" 14 | 15 | /* 16 | * Get the name of the subdirectory to create. 17 | */ 18 | class CreateSubdirDialog : public CDialog { 19 | public: 20 | CreateSubdirDialog(CWnd* pParentWnd = NULL) : 21 | CDialog(IDD_CREATE_SUBDIR, pParentWnd) 22 | { 23 | fpArchive = NULL; 24 | fpParentEntry = NULL; 25 | } 26 | virtual ~CreateSubdirDialog(void) {} 27 | 28 | CString fBasePath; // where subdir will be created 29 | CString fNewName; 30 | const GenericArchive* fpArchive; 31 | const GenericEntry* fpParentEntry; 32 | 33 | protected: 34 | // overrides 35 | virtual BOOL OnInitDialog(void) override; 36 | virtual void DoDataExchange(CDataExchange* pDX) override; 37 | 38 | // Context help request (question mark button). 39 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 40 | return MyApp::HandleHelpInfo(lpHelpInfo); 41 | } 42 | 43 | private: 44 | 45 | DECLARE_MESSAGE_MAP() 46 | }; 47 | 48 | #endif /*APP_CREATESUBDIRDIALOG_H*/ 49 | -------------------------------------------------------------------------------- /app/DEFileDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Implementation of Disk Editor "open file" dialog. 8 | */ 9 | #include "stdafx.h" 10 | #include "DEFileDialog.h" 11 | 12 | 13 | BEGIN_MESSAGE_MAP(DEFileDialog, CDialog) 14 | ON_EN_CHANGE(IDC_DEFILE_FILENAME, OnChange) 15 | ON_WM_HELPINFO() 16 | END_MESSAGE_MAP() 17 | 18 | BOOL DEFileDialog::OnInitDialog(void) 19 | { 20 | CWnd* pWnd = GetDlgItem(IDOK); 21 | ASSERT(pWnd != NULL); 22 | pWnd->EnableWindow(FALSE); 23 | 24 | return CDialog::OnInitDialog(); 25 | } 26 | 27 | void DEFileDialog::DoDataExchange(CDataExchange* pDX) 28 | { 29 | DDX_Text(pDX, IDC_DEFILE_FILENAME, fName); 30 | DDX_Check(pDX, IDC_DEFILE_RSRC, fOpenRsrcFork); 31 | } 32 | 33 | void DEFileDialog::OnChange(void) 34 | { 35 | CEdit* pEdit = (CEdit*) GetDlgItem(IDC_DEFILE_FILENAME); 36 | ASSERT(pEdit != NULL); 37 | 38 | CString str; 39 | pEdit->GetWindowText(str); 40 | //LOGI("STR is '%ls' (%d)", str, str.GetLength()); 41 | 42 | CWnd* pWnd = GetDlgItem(IDOK); 43 | ASSERT(pWnd != NULL); 44 | pWnd->EnableWindow(!str.IsEmpty()); 45 | } 46 | -------------------------------------------------------------------------------- /app/DEFileDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Disk Edit "open file" dialog. 8 | * 9 | * If the dialog returns with IDOK, "fName" will be a string at least 1 10 | * character long. 11 | * 12 | * Currently this is a trivial edit box that asks for a name. In the future 13 | * this might present a list or tree view to choose from. 14 | * 15 | * NOTE: we probably want to have a read-only flag here, defaulted to the 16 | * state of the sector editor. The read-only state of the underlying FS 17 | * doesn't matter, since we're writing sectors, not really editing files. 18 | */ 19 | #ifndef APP_DEFILEDIALOG_H 20 | #define APP_DEFILEDIALOG_H 21 | 22 | #include "resource.h" 23 | #include "../diskimg/DiskImg.h" 24 | 25 | using namespace DiskImgLib; 26 | 27 | 28 | /* 29 | * Class declaration. Nothing special. 30 | */ 31 | class DEFileDialog : public CDialog { 32 | public: 33 | DEFileDialog(CWnd* pParentWnd = NULL) : CDialog(IDD_DEFILE, pParentWnd) 34 | { 35 | fOpenRsrcFork = false; 36 | fName = L""; 37 | } 38 | virtual ~DEFileDialog(void) {} 39 | 40 | void Setup(DiskFS* pDiskFS) { 41 | fpDiskFS = pDiskFS; 42 | } 43 | 44 | CString fName; 45 | int fOpenRsrcFork; 46 | 47 | protected: 48 | /* 49 | * Turn off the "OK" button, which is only active when some text 50 | * has been typed in the window. 51 | */ 52 | virtual BOOL OnInitDialog(void) override; 53 | 54 | /* 55 | * Get the filename and the "open resource fork" check box. 56 | */ 57 | virtual void DoDataExchange(CDataExchange* pDX) override; 58 | 59 | /* 60 | * The text has changed. If there's nothing in the box, dim the 61 | * "OK" button. 62 | */ 63 | afx_msg virtual void OnChange(void); 64 | 65 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 66 | return MyApp::HandleHelpInfo(lpHelpInfo); 67 | } 68 | 69 | private: 70 | DiskFS* fpDiskFS; 71 | 72 | DECLARE_MESSAGE_MAP() 73 | }; 74 | 75 | #endif /*APP_DEFILEDIALOG_H*/ 76 | -------------------------------------------------------------------------------- /app/DiskEditOpenDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Simple dialog class that returns when any of its buttons are hit. 8 | */ 9 | #include "StdAfx.h" 10 | #include "DiskEditOpenDialog.h" 11 | 12 | BEGIN_MESSAGE_MAP(DiskEditOpenDialog, CDialog) 13 | ON_BN_CLICKED(IDC_DEOW_FILE, OnButtonFile) 14 | ON_BN_CLICKED(IDC_DEOW_VOLUME, OnButtonVolume) 15 | ON_BN_CLICKED(IDC_DEOW_CURRENT, OnButtonCurrent) 16 | END_MESSAGE_MAP() 17 | 18 | 19 | BOOL DiskEditOpenDialog::OnInitDialog(void) 20 | { 21 | if (!fArchiveOpen) { 22 | CButton* pButton = (CButton*) GetDlgItem(IDC_DEOW_CURRENT); 23 | ASSERT(pButton != NULL); 24 | pButton->EnableWindow(FALSE); 25 | } 26 | 27 | return CDialog::OnInitDialog(); 28 | } 29 | 30 | void DiskEditOpenDialog::OnButtonFile(void) 31 | { 32 | fOpenWhat = kOpenFile; 33 | OnOK(); 34 | } 35 | 36 | void DiskEditOpenDialog::OnButtonVolume(void) 37 | { 38 | fOpenWhat = kOpenVolume; 39 | OnOK(); 40 | } 41 | 42 | void DiskEditOpenDialog::OnButtonCurrent(void) 43 | { 44 | fOpenWhat = kOpenCurrent; 45 | OnOK(); 46 | } 47 | -------------------------------------------------------------------------------- /app/DiskEditOpenDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Decide how to open the disk editor. 8 | */ 9 | #ifndef APP_DISKEDITOPENDIALOG_H 10 | #define APP_DISKEDITOPENDIALOG_H 11 | 12 | #include 13 | #include "resource.h" 14 | 15 | /* 16 | * Very simple dialog class with three buttons (plus "cancel"). 17 | * 18 | * The button chosen will be returned in "fOpenWhat". 19 | */ 20 | class DiskEditOpenDialog : public CDialog { 21 | public: 22 | typedef enum { 23 | kOpenUnknown = 0, 24 | kOpenFile, 25 | kOpenVolume, 26 | kOpenCurrent, 27 | } OpenWhat; 28 | 29 | DiskEditOpenDialog(CWnd* pParentWnd = NULL) : 30 | CDialog(IDD_DISKEDIT_OPENWHICH, pParentWnd), 31 | fArchiveOpen(false), fOpenWhat(kOpenUnknown) 32 | {} 33 | 34 | // set this if the main content list has a file open 35 | bool fArchiveOpen; 36 | // return value -- which button was hit 37 | OpenWhat fOpenWhat; 38 | 39 | private: 40 | virtual BOOL OnInitDialog(void) override; 41 | 42 | afx_msg void OnButtonFile(void); 43 | afx_msg void OnButtonVolume(void); 44 | afx_msg void OnButtonCurrent(void); 45 | 46 | DECLARE_MESSAGE_MAP() 47 | }; 48 | 49 | #endif /*APP_DISKEDITOPENDIALOG_H*/ 50 | -------------------------------------------------------------------------------- /app/DoneOpenDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Simple dialog to offer the opportunity to open the file we just created. 8 | */ 9 | #ifndef APP_DONEOPENDIALOG_H 10 | #define APP_DONEOPENDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | class DoneOpenDialog : public CDialog { 15 | public: 16 | DoneOpenDialog(CWnd* pParentWnd = NULL) : CDialog(IDD_DONEOPEN, pParentWnd) 17 | {} 18 | virtual ~DoneOpenDialog(void) {} 19 | }; 20 | 21 | #endif /*APP_DONEOPENDIALOG_H*/ 22 | -------------------------------------------------------------------------------- /app/EOLScanDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Trivial implementation of EOLScanDialog. 8 | * 9 | * I'd stuff the whole thing in the header, but I need the "help" button to 10 | * work, and it's easiest to do that through a message map. 11 | */ 12 | #include "StdAfx.h" 13 | #include "EOLScanDialog.h" 14 | 15 | BEGIN_MESSAGE_MAP(EOLScanDialog, CDialog) 16 | ON_COMMAND(IDHELP, OnHelp) 17 | END_MESSAGE_MAP() 18 | 19 | BOOL EOLScanDialog::OnInitDialog(void) 20 | { 21 | CWnd* pWnd; 22 | CString fmt; 23 | 24 | fmt.Format(L"%ld", fCountChars); 25 | pWnd = GetDlgItem(IDC_EOLSCAN_CHARS); 26 | pWnd->SetWindowText(fmt); 27 | 28 | fmt.Format(L"%ld", fCountCR); 29 | pWnd = GetDlgItem(IDC_EOLSCAN_CR); 30 | pWnd->SetWindowText(fmt); 31 | 32 | fmt.Format(L"%ld", fCountLF); 33 | pWnd = GetDlgItem(IDC_EOLSCAN_LF); 34 | pWnd->SetWindowText(fmt); 35 | 36 | fmt.Format(L"%ld", fCountCRLF); 37 | pWnd = GetDlgItem(IDC_EOLSCAN_CRLF); 38 | pWnd->SetWindowText(fmt); 39 | 40 | fmt.Format(L"%ld", fCountHighASCII); 41 | pWnd = GetDlgItem(IDC_EOLSCAN_HIGHASCII); 42 | pWnd->SetWindowText(fmt); 43 | 44 | return CDialog::OnInitDialog(); 45 | } 46 | -------------------------------------------------------------------------------- /app/EOLScanDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * A simple dialog to display the results of an EOL scan. 8 | */ 9 | #ifndef APP_EOLSCANDIALOG_H 10 | #define APP_EOLSCANDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | /* 15 | * Entire class is here. 16 | */ 17 | class EOLScanDialog : public CDialog { 18 | public: 19 | EOLScanDialog(CWnd* pParentWnd = NULL) : 20 | CDialog(IDD_EOLSCAN, pParentWnd), 21 | fCountChars(0), 22 | fCountCR(0), 23 | fCountLF(0), 24 | fCountCRLF(0), 25 | fCountHighASCII(0) 26 | {} 27 | virtual ~EOLScanDialog(void) {} 28 | 29 | long fCountChars; 30 | long fCountCR; 31 | long fCountLF; 32 | long fCountCRLF; 33 | long fCountHighASCII; 34 | 35 | private: 36 | BOOL OnInitDialog(void) override; 37 | 38 | afx_msg void OnHelp(void) { 39 | MyApp::HandleHelp(this, HELP_TOPIC_EOL_SCAN); 40 | } 41 | 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | 45 | #endif /*APP_EOLSCANDIALOG_H*/ 46 | -------------------------------------------------------------------------------- /app/EditAssocDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * File associations edit dialog. 8 | */ 9 | #ifndef APP_EDITASSOCDIALOG_H 10 | #define APP_EDITASSOCDIALOG_H 11 | #ifdef CAN_UPDATE_FILE_ASSOC 12 | #include "resource.h" 13 | 14 | /* 15 | * Edit whatever associations our registry class cares about. 16 | */ 17 | class EditAssocDialog : public CDialog { 18 | public: 19 | EditAssocDialog(CWnd* pParentWnd = NULL) : 20 | CDialog(IDD_ASSOCIATIONS, pParentWnd), 21 | fOurAssociations(NULL) 22 | {} 23 | virtual ~EditAssocDialog() { 24 | delete[] fOurAssociations; 25 | } 26 | 27 | // Which associations are ours. This should be left uninitialized; 28 | // Setup() takes care of that. The caller may "steal" the array 29 | // afterward, freeing it with delete[]. 30 | bool* fOurAssociations; 31 | 32 | protected: 33 | virtual BOOL OnInitDialog(void) override; 34 | void DoDataExchange(CDataExchange* pDX) override; 35 | 36 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 37 | return MyApp::HandleHelpInfo(lpHelpInfo); 38 | } 39 | afx_msg void OnHelp(void) { 40 | MyApp::HandleHelp(this, HELP_TOPIC_EDIT_ASSOC); 41 | } 42 | 43 | /* 44 | * Load the list view control. 45 | * 46 | * This list isn't sorted, so we don't need to stuff anything into lParam to 47 | * keep the list and source data tied. 48 | * 49 | * If "loadAssoc" is true, we also populate the fOurAssocations table. 50 | */ 51 | void Setup(bool loadAssoc); 52 | 53 | DECLARE_MESSAGE_MAP() 54 | }; 55 | 56 | #endif 57 | #endif /*APP_EDITASSOCDIALOG_H*/ 58 | -------------------------------------------------------------------------------- /app/EditCommentDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Support for EditCommentDialog. 8 | */ 9 | #include "stdafx.h" 10 | #include "EditCommentDialog.h" 11 | 12 | BEGIN_MESSAGE_MAP(EditCommentDialog, CDialog) 13 | ON_BN_CLICKED(IDC_COMMENT_DELETE, OnDelete) 14 | ON_WM_HELPINFO() 15 | ON_COMMAND(IDHELP, OnHelp) 16 | END_MESSAGE_MAP() 17 | 18 | 19 | BOOL EditCommentDialog::OnInitDialog(void) 20 | { 21 | /* 22 | * If this is a new comment, don't show the delete button. 23 | */ 24 | if (fNewComment) { 25 | CWnd* pWnd = GetDlgItem(IDC_COMMENT_DELETE); 26 | pWnd->EnableWindow(FALSE); 27 | } 28 | 29 | return CDialog::OnInitDialog(); 30 | } 31 | 32 | void EditCommentDialog::DoDataExchange(CDataExchange* pDX) 33 | { 34 | DDX_Text(pDX, IDC_COMMENT_EDIT, fComment); 35 | } 36 | 37 | void EditCommentDialog::OnDelete(void) 38 | { 39 | CString question, title; 40 | int result; 41 | 42 | CheckedLoadString(&title, IDS_EDIT_COMMENT); 43 | CheckedLoadString(&question, IDS_DEL_COMMENT_OK); 44 | result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION); 45 | if (result == IDCANCEL) 46 | return; 47 | 48 | EndDialog(kDeleteCommentID); 49 | } 50 | -------------------------------------------------------------------------------- /app/EditCommentDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Edit a comment. 8 | */ 9 | #ifndef APP_EDITCOMMENTDIALOG_H 10 | #define APP_EDITCOMMENTDIALOG_H 11 | 12 | #include "GenericArchive.h" 13 | #include "resource.h" 14 | 15 | /* 16 | * Edit a comment. We don't currently put a length limit on the comment 17 | * field. 18 | */ 19 | class EditCommentDialog : public CDialog { 20 | public: 21 | EditCommentDialog(CWnd* pParentWnd = NULL) : 22 | CDialog(IDD_COMMENT_EDIT, pParentWnd) 23 | { 24 | fNewComment = false; 25 | } 26 | virtual ~EditCommentDialog(void) {} 27 | 28 | enum { kDeleteCommentID = IDC_COMMENT_DELETE }; 29 | 30 | CString fComment; 31 | bool fNewComment; // entry doesn't already have one 32 | 33 | protected: 34 | virtual BOOL OnInitDialog(void) override; 35 | virtual void DoDataExchange(CDataExchange* pDX) override; 36 | 37 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 38 | return MyApp::HandleHelpInfo(lpHelpInfo); 39 | } 40 | afx_msg void OnHelp(void) { 41 | MyApp::HandleHelp(this, HELP_TOPIC_EDIT_COMMENT); 42 | } 43 | 44 | /* 45 | * User wants to delete the comment. Verify first. 46 | */ 47 | afx_msg void OnDelete(void); 48 | 49 | private: 50 | DECLARE_MESSAGE_MAP() 51 | }; 52 | 53 | #endif /*APP_EDITCOMMENTDIALOG_H*/ 54 | -------------------------------------------------------------------------------- /app/EnterRegDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Dialog allowing the user to enter registration data. 8 | */ 9 | #ifndef APP_ENTERREGDIALOG_H 10 | #define APP_ENTERREGDIALOG_H 11 | 12 | #include "../util/UtilLib.h" 13 | #include "resource.h" 14 | 15 | /* 16 | * Straightforward dialog. We validate the registration key in the DDX 17 | * function, so an IDOK is a guarantee that they have entered valid data. It 18 | * is up to the caller to store the values in the registry. 19 | * 20 | * [ This was only used in the shareware product. ] 21 | */ 22 | class EnterRegDialog : public CDialog { 23 | public: 24 | EnterRegDialog(CWnd* pParent = NULL) : CDialog(IDD_REGISTRATION, pParent) 25 | { fDepth = 0; } 26 | virtual ~EnterRegDialog(void) {} 27 | 28 | CString fUserName; 29 | CString fCompanyName; 30 | CString fRegKey; 31 | 32 | /* 33 | * Get registration info from the user. This is a static utility function 34 | * that can be called from elsewhere in the app. 35 | * 36 | * Returns 0 on successful registration, nonzero on failure or if the user 37 | * cancels out of the dialog. 38 | */ 39 | static int GetRegInfo(CWnd* pWnd); 40 | 41 | private: 42 | virtual BOOL OnInitDialog(void) override; 43 | virtual void DoDataExchange(CDataExchange* pDX) override; 44 | 45 | afx_msg void OnUserChange(void); 46 | afx_msg void OnCompanyChange(void); 47 | afx_msg void OnRegChange(void); 48 | afx_msg void OnHelp(void); 49 | 50 | /* 51 | * Call this when the text in an edit field has changed. 52 | * 53 | * If there's nothing in the "user name" or "reg key" fields, dim the OK 54 | * button. 55 | */ 56 | void HandleEditChange(int editID, int crcID); 57 | 58 | MyEdit fMyEdit; 59 | int fDepth; 60 | 61 | DECLARE_MESSAGE_MAP() 62 | }; 63 | 64 | #endif /*APP_ENTERREGDIALOG_H*/ 65 | -------------------------------------------------------------------------------- /app/Graphics/ChooseFolder.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/ChooseFolder.bmp -------------------------------------------------------------------------------- /app/Graphics/CiderPress.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/CiderPress.ico -------------------------------------------------------------------------------- /app/Graphics/FileViewer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/FileViewer.ico -------------------------------------------------------------------------------- /app/Graphics/NewFolder.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/NewFolder.bmp -------------------------------------------------------------------------------- /app/Graphics/binary2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/binary2.ico -------------------------------------------------------------------------------- /app/Graphics/diskimage.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/diskimage.ico -------------------------------------------------------------------------------- /app/Graphics/fslogo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/fslogo.bmp -------------------------------------------------------------------------------- /app/Graphics/hdrbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/hdrbar.bmp -------------------------------------------------------------------------------- /app/Graphics/list-pics.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/list-pics.bmp -------------------------------------------------------------------------------- /app/Graphics/nufx.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/nufx.ico -------------------------------------------------------------------------------- /app/Graphics/toolbar1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/toolbar1.bmp -------------------------------------------------------------------------------- /app/Graphics/tree_pics.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/tree_pics.bmp -------------------------------------------------------------------------------- /app/Graphics/vol_pics.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Graphics/vol_pics.bmp -------------------------------------------------------------------------------- /app/Help/CiderPress.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Help/CiderPress.chm -------------------------------------------------------------------------------- /app/Help/README.txt: -------------------------------------------------------------------------------- 1 | Updating Help 2 | ============= 3 | 4 | Make any edits, then: 5 | 6 | 1. Launch HTML Help Workshop 7 | 2. Open CiderPress.hhp 8 | 3. File > Compile 9 | 10 | This should update the CiderPress.chm in the app/Help directory. You can 11 | copy it into the CiderPress directory, or just rebuild CiderPress to have 12 | it copied automatically. 13 | 14 | NOTE: pop-up text must be added to PopUp.txt, PopUpIds.h, and the 15 | PopUpHelpIds table in MyApp.cpp. 16 | -------------------------------------------------------------------------------- /app/Help/html/t20.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Disk Image Characteristics 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Disk Image Characteristics

14 |

 

15 |

This comes up when you are opening a disk image and have either checked the "Confirm disk image format" box in Disk Image Preferences or are opening a disk that CiderPress does not fully recognize.

16 |

 

17 |

If CiderPress doesn't recognize the disk, you will probably need to choose a filesystem format, and may need to select the sector ordering.  For more information about these fields, see the detailed disk image discussion.

18 |

 

19 |

When opening an image with the disk sector viewer, you can select one of the "generic" formats if you don't know what format the disk is in.  The format you choose is combined with the sector ordering value to determine how blocks or sectors are read from the disk.  If you're trying to open the image in the file list, the "generic" formats will not be available.

20 |

21 |

22 | 23 | -------------------------------------------------------------------------------- /app/Help/html/t257.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Select Location 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Select Location

13 |

 

14 |

Select the disk or subdirectory where the files will be added.  If the current disk has sub-volumes (e.g. embedded DOS 3.3 volumes or CFFA partitions), they will be shown under the encapsulating disk volume.

15 |

 

16 |

Disks in formats that cannot be written are shown with a red 'X' through the disk icon.  This commonly appears in the root volume of a partitioned image.  For example, you can add files to CFFA partitions, but you can't add files to the CFFA entry because it only contains other partitions.  It can also appear for partitions that appear to be damaged or hold damaged files.

17 |

 

18 |

You can skip this step on ProDOS disks by selecting a directory before using "add files".  The files will be placed in the selected directory.

19 |

 

20 |

If you want to add or extract partitions, use the volume copier tool instead.

21 |

22 |

23 | 24 | -------------------------------------------------------------------------------- /app/Help/html/t263.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Creating Subdirectories 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Creating Subdirectories

14 |

 

15 |

To create a new subdirectory on a ProDOS disk, select the subdirectory in which it will reside, then use the File->Create Subdirectory command.

16 |

 

17 |

This feature is disabled for ShrinkIt archives, because they don't store subdirectories explicitly.  You can, however, rename files to make them appear as if they were in a subdirectory.

18 |

19 |

20 | 21 | -------------------------------------------------------------------------------- /app/Help/html/t29.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Preferences - Compression 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Compression Preferences

14 |

 

15 |

You can access the Compression Preferences by selecting "Preferences..." from the "Edit" menu, and then clicking on the "Compression" tab.

16 |

 

17 |

This screen lets you choose the default compression method.  This will be used for all files added to an archive, and will be the default choice when you ask CiderPress to re-compress files.  It's also used by the disk image conversion tools.

18 |

 

19 |

The compression algorithms are described in detail here.

20 |

21 |

22 | 23 | -------------------------------------------------------------------------------- /app/Help/html/t38.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Choose Folder 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Choose Folder

14 |

 

15 |

This allows you to choose a folder on a local disk or across a network.  Click on the folder you want in the "tree" display, then click "Select".  Click on '+' signs to expand branches of the tree, '-' signs to collapse branches.

16 |

 

17 |

The full name of the folder that is currently selected is shown in the grey box underneath the tree.  Some folders, such as "My Computer", are special and do not have a pathname.  When these are selected in the tree, the "Select" button will be dimmed.

18 |

 

19 |

If you know the full pathname of the folder you want, you can type it in where it says "type the folder name" and then click on "Expand Tree".  The folder you entered will be selected in the tree.

20 |

 

21 |

If you click on the button next to the grey box (looks like a folder with a star in the upper right corner), CiderPress brings up the "New Folder" dialog.  This allows you to create a new folder inside the currently-selected folder.

22 |

23 |

24 | 25 | -------------------------------------------------------------------------------- /app/Help/html/t42.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/app/Help/html/t42.htm -------------------------------------------------------------------------------- /app/Help/html/t44.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Edit File Associations 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Edit File Associations

13 |

 

14 |

CiderPress can be "associated" with file types, meaning that when a file with an associated extension is opened (usually by double-clicking on it from Windows Explorer), CiderPress is launched to handle it.  The recognized extensions, and the default behavior when opening them, are listed here.

15 |

 

16 |

When CiderPress is first installed, all recognized extensions that do not already have an association are linked to it.  You can use this dialog to associate or disassociate any of the file types by clicking in the checkbox next to the extension.

17 |

 

18 |

This dialog changes the settings but does not make them permanent.  Hit "OK" or "Apply" in the preferences pages to actually make the update, or "Cancel" to undo the changes.

19 |

20 |

21 | 22 | -------------------------------------------------------------------------------- /app/Help/html/t46.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | How (and Why) to Register 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

How (and Why) to Register

14 |

 

15 |

Registration is no longer required.

16 |

17 |

18 | 19 | -------------------------------------------------------------------------------- /app/Help/html/t52.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Selecting Commands 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Selecting Commands

13 |

 

14 |

There are three distinct ways to perform actions:

15 |

 

16 |

1. Select a command from the menu at the top of the screen.

17 |

2. Select a command from the toolbar below the menu.

18 |

3. When a file is open, right-click and select a command from the menu that pops up.

19 |

 

20 |

All three approaches produce the same results.

21 |

 

22 |

There is a fourth way to initiate action: double-click on an item in the file listing.  The exact behavior depends on what it is you clicked on.  See Working With the File List for details.

23 |

 

24 |

Most features will be disabled unless an archive or disk image is open.  Some will be disabled until you select one or more entries from the list.  Some are only active for ShrinkIt archives, or will be dimmed if the file is opened read-only.

25 |

26 |

27 | 28 | -------------------------------------------------------------------------------- /app/Help/html/t53.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Printing 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Printing

14 |

 

15 |

The output sent to the printer looks very much like the file list when all columns are enabled.  The sort order matches the current file list.

16 |

 

17 |

Select "Print..." from the "File" menu to bring up a standard Windows print dialog.  Choose your printer and, optionally, a range of pages to print.

18 |

19 |

20 | 21 | -------------------------------------------------------------------------------- /app/Help/html/t54.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Viewing Files 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Viewing Files

14 |

 

15 |

To use the "View..." command, first select the files you want to view.  Select the "View..." menu item or click on the toolbar button.  The File Viewer opens.

16 |

 

17 |

Double-clicking on most kinds of files will open the file viewer.  However, if you double-click on a ShrinkIt archive or disk image, a new instance of CiderPress will be launched with the file displayed in it.  (You can get the same behavior with disk images by selecting the image and then using "Open as disk image" from the Actions menu.)

18 |

19 |

20 | 21 | -------------------------------------------------------------------------------- /app/Help/html/t56.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Testing Archives 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

Testing Archives

14 |

 

15 |

This feature does not work on disk images, because they don't have any sort of checksum or CRC on the files.  Every file on a disk archive is scanned when the disk is opened, and any obviously damaged files are labeled as such in the file list.

16 |

 

17 |

Files in ShrinkIt, Binary II, and AppleLink Compression Utility archives can be tested, but not all of those have CRCs either.  In those cases CiderPress will read the data to verify that the archive hasn't been truncated.  Errors in compressed data can sometimes be detected without a CRC.  The overall structure of the archive, including any CRCs on header fields, is verified when the archive is opened.

18 |

 

19 |

For files that do have checksums or CRCs, CiderPress will use the appropriate error detection algorithm, uncompressing the data when necessary.  Testing an archive essentially does a full extraction, doing everything except write the data to disk. 20 | 21 |

22 | 23 | -------------------------------------------------------------------------------- /app/Help/html/t57.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Delete Entries 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Delete Entries

13 |

 

14 |

Use this feature to delete some or all files in an archive or disk image.  Select the files you want to delete in the file list, then activate the "Delete..." function.  When you confirm by pressing "OK", all entries are immediately deleted.

15 |

 

16 |

There is no "undo" or "undelete" feature.  The entries you delete are gone forever as soon as you press "OK".  Use this feature with caution.

17 |

 

18 |

If you delete all entries from a ShrinkIt archive, and close the archive without adding any new ones, the archive file will be removed.

19 |

 

20 |

If you select a folder on a ProDOS disk image, all files in the folder will automatically be selected for you when you click "delete".  You cannot delete the volume directory.

21 |

22 |

23 | 24 | -------------------------------------------------------------------------------- /app/Help/html/t61.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Aux Type 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

List - Aux Type

14 |

 

15 |

The auxiliary type of the file.  The exact meaning of this varies depending on the archive or disk image.

16 |

 

17 | 22 |

 

23 |

ShrinkIt is capable of storing Macintosh files from HFS volumes, in which case the "aux type" field will hold a 32-bit creator type.

24 |

25 |

26 | 27 | -------------------------------------------------------------------------------- /app/Help/html/t62.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Mod Date 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

List - Mod Date

15 |

 

16 |

The modification date of the entry.

17 |

 

18 |

ShrinkIt archives use the IIgs "DateTime" format, which includes year/month/day and hours/minutes/seconds.

19 |

 

20 |

ProDOS disks and Binary II archives use the ProDOS date format, which has year/month/day and hours/minutes but not seconds.

21 |

 

22 |

Pascal disks use the Pascal date format, which has year/month/day but no time.

23 |

 

24 |

DOS 3.3, CP/M, and RDOS do not store dates.

25 |

 

26 |

When no date is available, "[no date]" is shown.  This is expected on disk images and archives created on systems without clocks.  If the stored date is invalid (e.g. February 31st), it will be shown as "<invalid>".

27 |

28 |

29 | 30 | -------------------------------------------------------------------------------- /app/Help/html/t63.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Format 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

List - Format

14 |

 

15 |

For ShrinkIt archives, this describes the compression format used.  Possible values are described here.

16 |

 

17 |

For Binary II archives, this holds a guess at whether the file is stored uncompressed or "squeezed".  There is no 100% reliable way to determine if a file stored in Binary II was squeezed, so a quick examination of the file contents is used to determine the status.

18 |

 

19 |

For disk archives, the name of the file system is shown.  This is done to emphasize that files with the same file type may be structurally different on different file systems.  For example, DOS text files use ASCII characters with the high bit set, while ProDOS text files leave the high bit unset.

20 |

 

21 |

It's also useful on mixed-filesystem disks, such as ProSel "Uni-DOS" 800K disks that have a 200K DOS 3.3 filesystem embedded in an 800K ProDOS volume.

22 |

23 |

24 | 25 | -------------------------------------------------------------------------------- /app/Help/html/t64.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Size 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

List - Size

14 |

 

15 |

This is the full length of the file when uncompressed and "sparse" blocks filled are in.

16 |

 

17 |

The size does not reflect format conversions (e.g. converting a graphic to a BMP) or text conversions (changing end-of-line markers), either of which can result in significantly different extracted sizes.  The size will be accurate only when all conversions are off ("preservation mode").

18 |

19 |

20 | 21 | -------------------------------------------------------------------------------- /app/Help/html/t65.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Ratio 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

List - Ratio

14 |

 

15 |

This is simply the ratio of  the "Size" field to the "Packed" field.  An uncompressed, non-sparse file is displayed as "100%".

16 |

17 |

18 | 19 | -------------------------------------------------------------------------------- /app/Help/html/t66.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Packed 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

List - Packed

14 |

 

15 |

This represents the compressed size of data in a ShrinkIt archive.  The size does not include archive overhead (e.g. storage of the filename, CRCs, and file attributes).

16 |

 

17 |

On a disk archive, this indicates the size needed to store the file.  Some files take less space than you might expect because they are "sparse".  On filesystems that support sparse files (ProDOS, and to some extent DOS 3.3), a block filled entirely with zeros isn't actually stored on the disk.  Instead, the file system structure is updated to indicate that there is a gap, and when the file is read the missing data is filled in with zero bytes.

18 |

19 |

20 | 21 | -------------------------------------------------------------------------------- /app/Help/html/t67.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | List - Access 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

List - Access

16 |

 

17 |

This column shows the ProDOS access permissions for each entry.  The letters are:

18 |

 

19 |

d - file may be deleted

20 |

n - file may be renamed

21 |

b - backup needed

22 |

i - file is invisible

23 |

w - file may be modified

24 |

r - file may be read

25 |

 

26 |

DOS 3.3 and CP/M only understand "locked" and "unlocked", which correspond to "r" and "dnwr", respectively.  For Pascal and RDOS disks, all files are effectively "unlocked".

27 |

28 |

29 | 30 | -------------------------------------------------------------------------------- /app/HelpTopics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Constants for help topics. 8 | */ 9 | #ifndef APP_HELP_TOPICS_H 10 | #define APP_HELP_TOPICS_H 11 | 12 | #define HELP_TOPIC_WELCOME 10 13 | #define HELP_TOPIC_DISKEDIT 13 14 | #define HELP_TOPIC_PREFS_GENERAL 19 15 | #define HELP_TOPIC_DISK_IMAGES 20 16 | #define HELP_TOPIC_PREFS_FVIEW 23 17 | #define HELP_TOPIC_CREDITS 24 18 | #define HELP_TOPIC_FILE_VIEWER 25 19 | #define HELP_TOPIC_PREFS_FILES 28 20 | #define HELP_TOPIC_PREFS_COMPRESSION 29 21 | #define HELP_TOPIC_CHOOSE_FOLDER 38 22 | #define HELP_TOPIC_EXT_OPTIONS 39 23 | #define HELP_TOPIC_ADD_FILES_DLG 41 24 | #define HELP_TOPIC_RENAME_ENTRY 42 25 | #define HELP_TOPIC_EDIT_COMMENT 43 26 | #define HELP_TOPIC_EDIT_ASSOC 44 27 | #define HELP_TOPIC_ORDERING_INFO 46 28 | #define HELP_TOPIC_ENTER_REG_DATA 49 29 | #define HELP_TOPIC_IMPORT_CASSETTE 111 30 | #define HELP_TOPIC_IMPORT_BASIC 112 31 | #define HELP_TOPIC_DISK_CONV 187 32 | #define HELP_TOPIC_EDIT_PROPS 203 33 | #define HELP_TOPIC_BULK_DISK_CONV 233 34 | #define HELP_TOPIC_OPEN_VOLUME 241 35 | #define HELP_TOPIC_VOLUME_COPIER 245 36 | #define HELP_TOPIC_IMAGE_CREATOR 247 37 | #define HELP_TOPIC_CHOOSE_TARGET 257 38 | #define HELP_TOPIC_ARCHIVE_INFO 258 39 | #define HELP_TOPIC_PREFS_DISK_IMAGE 259 40 | #define HELP_TOPIC_RENAME_VOLUME 268 41 | #define HELP_TOPIC_EOL_SCAN 272 42 | 43 | #endif /*APP_HELP_TOPICS_H*/ 44 | -------------------------------------------------------------------------------- /app/MyApp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * The application object. 8 | */ 9 | #ifndef APP_MYAPP_H 10 | #define APP_MYAPP_H 11 | 12 | #include "Registry.h" 13 | 14 | /* CiderPress version numbers */ 15 | #define kAppMajorVersion 4 16 | #define kAppMinorVersion 1 17 | #define kAppBugVersion 1 18 | #define kAppDevString L"" 19 | 20 | /* 21 | * Windows application object. 22 | */ 23 | class MyApp: public CWinAppEx 24 | { 25 | public: 26 | MyApp(); 27 | virtual ~MyApp(void); 28 | 29 | #ifdef CAN_UPDATE_FILE_ASSOC 30 | MyRegistry fRegistry; 31 | #endif 32 | 33 | const WCHAR* GetExeFileName(void) const { return fExeFileName; } 34 | const WCHAR* GetExeBaseName(void) const { return fExeBaseName; } 35 | 36 | /* 37 | * Handles pop-up help requests. Call this from OnHelpInfo. 38 | */ 39 | static BOOL HandleHelpInfo(HELPINFO* lpHelpInfo); 40 | 41 | /* 42 | * Handles help topic requests. Call this from OnHelp. 43 | */ 44 | static void HandleHelp(CWnd* pWnd, DWORD topicId); 45 | 46 | private: 47 | virtual BOOL InitInstance(void) override; 48 | virtual BOOL OnIdle(LONG lCount) override; 49 | 50 | /* 51 | * Show where we got something from. Handy for checking DLL load locations. 52 | * 53 | * If "name" is NULL, we show the EXE info. 54 | */ 55 | void LogModuleLocation(const WCHAR* name); 56 | 57 | /* 58 | * This holds pairs of control IDs and popup help IDs, for use by 59 | * HtmlHelp HH_TP_HELP_WM_HELP. 60 | * 61 | * The control and help ID values are identical just to make life 62 | * simpler, but we need a table anyway. 63 | */ 64 | static const DWORD PopUpHelpIds[]; 65 | 66 | CString fExeFileName; 67 | CString fExeBaseName; 68 | }; 69 | 70 | extern MyApp gMyApp; 71 | 72 | #endif /*APP_MYAPP_H*/ 73 | -------------------------------------------------------------------------------- /app/NewDiskSize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Functions to manage the "new disk size" radio button set in dialogs. 8 | */ 9 | #ifndef APP_NEWDISKSIZE_H 10 | #define APP_NEWDISKSIZE_H 11 | 12 | /* 13 | * All members are static. Don't instantiate the class. 14 | */ 15 | class NewDiskSize { 16 | public: 17 | NewDiskSize(void) { ASSERT(false); } 18 | 19 | /* 20 | * Return the #of entries in the table. 21 | */ 22 | static unsigned int GetNumSizeEntries(void); 23 | 24 | /* 25 | * Return the "size" field from an array entry. 26 | */ 27 | static long GetDiskSizeByIndex(int idx); 28 | 29 | enum { kSpecified = -1 }; 30 | 31 | static void EnableButtons(CDialog* pDialog, BOOL state = true); 32 | 33 | /* 34 | * Run through the set of radio buttons, disabling any that don't have enough 35 | * space to hold the ProDOS volume with the specified parameters. 36 | * 37 | * The space required is equal to the blocks required for data plus the blocks 38 | * required for the free-space bitmap. Since the free-space bitmap size is 39 | * smaller for smaller volumes, we have to adjust it for each. 40 | * 41 | * Pass in the total blocks and #of blocks used on a particular ProDOS volume. 42 | * This will compute how much space would be required for larger and smaller 43 | * volumes, and enable or disable radio buttons as appropriate. (You can get 44 | * these values from DiskFS::GetFreeBlockCount()). 45 | */ 46 | static void EnableButtons_ProDOS(CDialog* pDialog, long totalBlocks, 47 | long blocksUsed); 48 | 49 | /* 50 | * Compute the #of blocks needed to hold the ProDOS block bitmap. 51 | */ 52 | static long GetNumBitmapBlocks_ProDOS(long totalBlocks); 53 | 54 | /* 55 | * Update the "specify size" edit box. 56 | */ 57 | static void UpdateSpecifyEdit(CDialog* pDialog); 58 | 59 | private: 60 | typedef struct { 61 | int ctrlID; 62 | long blocks; 63 | } RadioCtrlMap; 64 | 65 | static const RadioCtrlMap kCtrlMap[]; 66 | }; 67 | 68 | #endif /*APP_NEWDISKSIZE_H*/ 69 | -------------------------------------------------------------------------------- /app/PasteSpecialDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Support for PasteSpecialDialog. 8 | */ 9 | #include "StdAfx.h" 10 | #include "PasteSpecialDialog.h" 11 | 12 | #if 0 13 | BEGIN_MESSAGE_MAP(PasteSpecialDialog, CDialog) 14 | END_MESSAGE_MAP() 15 | 16 | BOOL 17 | PasteSpecialDialog::OnInitDialog(void) 18 | { 19 | CString countStr; 20 | CWnd* pWnd; 21 | 22 | countStr.Format(IDS_PASTE_SPECIAL_COUNT, 3); 23 | pWnd = GetDlgItem(IDC_PASTE_SPECIAL_COUNT); 24 | pWnd->SetWindowText(countStr); 25 | 26 | return CDialog::OnInitDialog(); 27 | } 28 | #endif 29 | 30 | void PasteSpecialDialog::DoDataExchange(CDataExchange* pDX) 31 | { 32 | /* 33 | * Initialize radio control with value from fPasteHow. 34 | */ 35 | 36 | if (!pDX->m_bSaveAndValidate) { 37 | UINT ctrlId; 38 | 39 | if (fPasteHow == kPastePaths) 40 | ctrlId = IDC_PASTE_SPECIAL_PATHS; 41 | else 42 | ctrlId = IDC_PASTE_SPECIAL_NOPATHS; 43 | 44 | CButton* pButton = (CButton*) GetDlgItem(ctrlId); 45 | pButton->SetCheck(BST_CHECKED); 46 | } else { 47 | CButton* pButton = (CButton*) GetDlgItem(IDC_PASTE_SPECIAL_PATHS); 48 | 49 | if (pButton->GetCheck() == BST_CHECKED) 50 | fPasteHow = kPastePaths; 51 | else 52 | fPasteHow = kPasteNoPaths; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/PasteSpecialDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Paste Special dialog. 8 | */ 9 | #ifndef APP_PASTESPECIALDIALOG_H 10 | #define APP_PASTESPECIALDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | /* 15 | * Simple dialog with a radio button. 16 | */ 17 | class PasteSpecialDialog : public CDialog { 18 | public: 19 | PasteSpecialDialog(CWnd* pParentWnd = NULL) : 20 | CDialog(IDD_PASTE_SPECIAL, pParentWnd), 21 | fPasteHow(kPastePaths) 22 | {} 23 | virtual ~PasteSpecialDialog() {} 24 | 25 | /* right now this is boolean, but that may change */ 26 | /* (e.g. "paste clipboard contents into new text file") */ 27 | enum { 28 | kPasteUnknown = 0, 29 | kPastePaths, 30 | kPasteNoPaths, 31 | }; 32 | int fPasteHow; 33 | 34 | protected: 35 | //virtual BOOL OnInitDialog(void); 36 | void DoDataExchange(CDataExchange* pDX) override; 37 | 38 | //DECLARE_MESSAGE_MAP() 39 | }; 40 | 41 | #endif /*APP_PASTESPECIALDIALOG_H*/ 42 | -------------------------------------------------------------------------------- /app/ProgressCounterDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Show the progress of something that has no definite bound. Because we 8 | * don't know when we need to stop, we just count upward. 9 | */ 10 | #ifndef APP_PROGRESSCOUNTERDIALOG_H 11 | #define APP_PROGRESSCOUNTERDIALOG_H 12 | 13 | #include "resource.h" 14 | 15 | /* 16 | * Modeless dialog; must be allocated on the heap. 17 | */ 18 | class ProgressCounterDialog : public CancelDialog { 19 | public: 20 | BOOL Create(const CString& descr, CWnd* pParentWnd = NULL) { 21 | fpParentWnd = pParentWnd; 22 | fDescr = descr; 23 | fCountFormat = L"%d"; 24 | fCancel = false; 25 | 26 | /* disable the parent window before we're created */ 27 | if (pParentWnd != NULL) 28 | pParentWnd->EnableWindow(FALSE); 29 | return CancelDialog::Create(&fCancel, IDD_PROGRESS_COUNTER, 30 | pParentWnd); 31 | } 32 | 33 | /* enable the parent window before we're destroyed */ 34 | virtual BOOL DestroyWindow(void) { 35 | if (fpParentWnd != NULL) 36 | fpParentWnd->EnableWindow(TRUE); 37 | return ModelessDialog::DestroyWindow(); 38 | } 39 | 40 | /* set a format string, e.g. "Processing file %d" */ 41 | void SetCounterFormat(const CString& fmt) { fCountFormat = fmt; } 42 | 43 | /* set the current count */ 44 | void SetCount(int count) { 45 | CString msg; 46 | msg.Format(fCountFormat, count); 47 | GetDlgItem(IDC_PROGRESS_COUNTER_COUNT)->SetWindowText(msg); 48 | } 49 | 50 | /* get the status of the "cancelled" flag */ 51 | bool GetCancel(void) const { return fCancel; } 52 | 53 | private: 54 | BOOL OnInitDialog(void) override { 55 | CancelDialog::OnInitDialog(); 56 | 57 | CWnd* pWnd = GetDlgItem(IDC_PROGRESS_COUNTER_DESC); 58 | pWnd->SetWindowText(fDescr); 59 | pWnd = GetDlgItem(IDC_PROGRESS_COUNTER_COUNT); 60 | pWnd->SetWindowText(L""); 61 | pWnd->SetFocus(); // get focus off of the Cancel button 62 | return FALSE; // accept our focus 63 | } 64 | 65 | CWnd* fpParentWnd; 66 | CString fDescr; 67 | CString fCountFormat; 68 | bool fCancel; 69 | }; 70 | 71 | #endif /*APP_PROGRESSCOUNTERDIALOG_H*/ 72 | -------------------------------------------------------------------------------- /app/RecompressOptionsDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #include "stdafx.h" 7 | #include "RecompressOptionsDialog.h" 8 | #include "NufxArchive.h" 9 | 10 | //BEGIN_MESSAGE_MAP(UseSelectionDialog, CDialog) 11 | // ON_WM_HELPINFO() 12 | // //ON_COMMAND(IDHELP, OnHelp) 13 | //END_MESSAGE_MAP() 14 | 15 | 16 | BOOL RecompressOptionsDialog::OnInitDialog(void) 17 | { 18 | fCompressionIdx = LoadComboBox((NuThreadFormat) fCompressionType); 19 | 20 | return UseSelectionDialog::OnInitDialog(); 21 | } 22 | 23 | int RecompressOptionsDialog::LoadComboBox(NuThreadFormat fmt) 24 | { 25 | static const struct { 26 | NuThreadFormat format; 27 | const WCHAR* name; 28 | } kComboStrings[] = { 29 | { kNuThreadFormatUncompressed, L"No compression" }, 30 | { kNuThreadFormatHuffmanSQ, L"Squeeze" }, 31 | { kNuThreadFormatLZW1, L"Dynamic LZW/1" }, 32 | { kNuThreadFormatLZW2, L"Dynamic LZW/2" }, 33 | { kNuThreadFormatLZC12, L"12-bit LZC" }, 34 | { kNuThreadFormatLZC16, L"16-bit LZC" }, 35 | { kNuThreadFormatDeflate, L"Deflate" }, 36 | { kNuThreadFormatBzip2, L"Bzip2" }, 37 | }; 38 | 39 | CComboBox* pCombo; 40 | int idx, comboIdx; 41 | int retIdx = 0; 42 | 43 | pCombo = (CComboBox*) GetDlgItem(IDC_RECOMP_COMP); 44 | ASSERT(pCombo != NULL); 45 | 46 | for (idx = comboIdx = 0; idx < NELEM(kComboStrings); idx++) { 47 | if (NufxArchive::IsCompressionSupported(kComboStrings[idx].format)) { 48 | pCombo->AddString(kComboStrings[idx].name); 49 | pCombo->SetItemData(comboIdx, kComboStrings[idx].format); 50 | 51 | if (kComboStrings[idx].format == fmt) 52 | retIdx = comboIdx; 53 | 54 | comboIdx++; 55 | } 56 | } 57 | 58 | return retIdx; 59 | } 60 | 61 | void RecompressOptionsDialog::DoDataExchange(CDataExchange* pDX) 62 | { 63 | DDX_CBIndex(pDX, IDC_RECOMP_COMP, fCompressionIdx); 64 | 65 | if (pDX->m_bSaveAndValidate) { 66 | CComboBox* pCombo; 67 | pCombo = (CComboBox*) GetDlgItem(IDC_RECOMP_COMP); 68 | ASSERT(pCombo != NULL); 69 | 70 | fCompressionType = pCombo->GetItemData(fCompressionIdx); 71 | LOGI("DDX got type=%d from combo index %d", 72 | fCompressionType, fCompressionIdx); 73 | } 74 | 75 | UseSelectionDialog::DoDataExchange(pDX); 76 | } 77 | -------------------------------------------------------------------------------- /app/RecompressOptionsDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Options for recompressing files. This is derived from the "use selection" 8 | * dialog. 9 | */ 10 | #ifndef APP_RECOMPESSOPTIONSDIALOG_H 11 | #define APP_RECOMPESSOPTIONSDIALOG_H 12 | 13 | #include "UseSelectionDialog.h" 14 | #include "../nufxlib/NufxLib.h" 15 | #include "resource.h" 16 | 17 | /* 18 | * Straightforward confirmation plus a drop-list. 19 | */ 20 | class RecompressOptionsDialog : public UseSelectionDialog { 21 | public: 22 | RecompressOptionsDialog(int selCount, CWnd* pParentWnd = NULL) : 23 | UseSelectionDialog(selCount, pParentWnd, IDD_RECOMPRESS_OPTS) 24 | { 25 | fCompressionType = 0; 26 | } 27 | virtual ~RecompressOptionsDialog(void) {} 28 | 29 | // maps directly to NuThreadFormat enum 30 | int fCompressionType; 31 | 32 | private: 33 | virtual BOOL OnInitDialog(void) override; 34 | virtual void DoDataExchange(CDataExchange* pDX) override; 35 | 36 | /* 37 | * Load strings into the combo box. Only load formats supported by the 38 | * NufxLib DLL. 39 | * 40 | * Returns the combo box index for the format matching "fmt". 41 | */ 42 | int LoadComboBox(NuThreadFormat fmt); 43 | 44 | int fCompressionIdx; // drop list index 45 | 46 | //DECLARE_MESSAGE_MAP() 47 | }; 48 | 49 | #endif /*APP_RECOMPESSOPTIONSDIALOG_H*/ 50 | -------------------------------------------------------------------------------- /app/RenameEntryDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Rename an archive entry. 8 | */ 9 | #ifndef APP_RENAMEENTRYDIALOG_H 10 | #define APP_RENAMEENTRYDIALOG_H 11 | 12 | #include "GenericArchive.h" 13 | #include "resource.h" 14 | 15 | /* 16 | * Rename an entry in an archive (as opposed to renaming a file on the local 17 | * hard drive). 18 | * 19 | * We use the GenericArchive to verify that the name is valid before we 20 | * shut the dialog. 21 | * 22 | * We should probably dim the "Skip" button when there aren't any more entries 23 | * to rename. This requires that the caller tell us when we're on the last 24 | * one. 25 | */ 26 | class RenameEntryDialog : public CDialog { 27 | public: 28 | RenameEntryDialog(CWnd* pParentWnd = NULL) : 29 | CDialog(IDD_RENAME_ENTRY, pParentWnd) 30 | { 31 | fFssep = '='; 32 | //fNewNameLimit = 0; 33 | fpArchive = NULL; 34 | fpEntry = NULL; 35 | fCanRenameFullPath = false; 36 | fCanChangeFssep = false; 37 | } 38 | virtual ~RenameEntryDialog(void) {} 39 | 40 | void SetCanRenameFullPath(bool val) { fCanRenameFullPath = val; } 41 | void SetCanChangeFssep(bool val) { fCanChangeFssep = val; } 42 | 43 | CString fOldName; 44 | char fFssep; 45 | CString fNewName; 46 | //int fNewNameLimit; // max #of chars accepted, or 0 47 | const GenericArchive* fpArchive; 48 | const GenericEntry* fpEntry; 49 | 50 | protected: 51 | // overrides 52 | virtual BOOL OnInitDialog(void) override; 53 | virtual void DoDataExchange(CDataExchange* pDX) override; 54 | 55 | afx_msg void OnSkip(void); 56 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 57 | return MyApp::HandleHelpInfo(lpHelpInfo); 58 | } 59 | afx_msg void OnHelp(void) { 60 | MyApp::HandleHelp(this, HELP_TOPIC_RENAME_ENTRY); 61 | } 62 | 63 | private: 64 | //CString fOldPath; // pathname component, or empty if canRenFull 65 | CString fOldFile; // filename component, or full name if ^^^ 66 | CString fBasePath; 67 | CString fFssepStr; 68 | bool fCanRenameFullPath; 69 | bool fCanChangeFssep; 70 | 71 | DECLARE_MESSAGE_MAP() 72 | }; 73 | 74 | #endif /*APP_RENAMEENTRYDIALOG_H*/ 75 | -------------------------------------------------------------------------------- /app/RenameVolumeDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Declarations for "rename volume" dialog. 8 | * 9 | * Show a tree with possible volumes and sub-volumes, and ask the user to 10 | * enter the desired name (or volume number). 11 | * 12 | * We need to have the tree, rather than just clicking on an entry in the file 13 | * list, because we want to be able to change names and volume numbers on 14 | * disks with no files. 15 | */ 16 | #ifndef APP_RENAMEVOLUME_H 17 | #define APP_RENAMEVOLUME_H 18 | 19 | #include "DiskFSTree.h" 20 | #include "resource.h" 21 | 22 | class DiskArchive; 23 | 24 | /* 25 | * Get a pointer to the DiskFS that we're altering, and a valid string for 26 | * the new volume name. 27 | */ 28 | class RenameVolumeDialog : public CDialog { 29 | public: 30 | RenameVolumeDialog(CWnd* pParentWnd = NULL) : 31 | CDialog(IDD_RENAME_VOLUME, pParentWnd) 32 | { 33 | fpArchive = NULL; 34 | } 35 | virtual ~RenameVolumeDialog(void) {} 36 | 37 | const DiskArchive* fpArchive; 38 | CString fNewName; 39 | DiskImgLib::DiskFS* fpChosenDiskFS; 40 | 41 | protected: 42 | virtual BOOL OnInitDialog(void) override; 43 | virtual void DoDataExchange(CDataExchange* pDX) override; 44 | 45 | /* 46 | * Get a notification whenever the selection changes. Use it to stuff a 47 | * default value into the edit box. 48 | */ 49 | afx_msg void OnSelChanged(NMHDR* pnmh, LRESULT* pResult); 50 | 51 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 52 | return MyApp::HandleHelpInfo(lpHelpInfo); 53 | } 54 | afx_msg void OnHelp(void) { 55 | MyApp::HandleHelp(this, HELP_TOPIC_RENAME_VOLUME); 56 | } 57 | 58 | DiskFSTree fDiskFSTree; 59 | 60 | private: 61 | 62 | DECLARE_MESSAGE_MAP() 63 | }; 64 | 65 | #endif /*APP_RENAMEVOLUME_H*/ 66 | -------------------------------------------------------------------------------- /app/Squeeze.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Implementation of SQueeze compression. 8 | */ 9 | #ifndef APP_SQUEEZE_H 10 | #define APP_SQUEEZE_H 11 | 12 | /* 13 | * Expand "SQ" format. Archive file should already be seeked. 14 | * 15 | * If "outExp" is NULL, no output is produced (useful for "test" mode). 16 | */ 17 | NuError UnSqueeze(FILE* fp, unsigned long realEOF, ExpandBuffer* outExp, 18 | bool fullSqHeader, int blockSize); 19 | 20 | #endif /*APP_SQUEEZE_H*/ 21 | -------------------------------------------------------------------------------- /app/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.cpp : source file that includes just the standard includes 7 | // diskimg.pch will be the pre-compiled header 8 | // stdafx.obj will contain the pre-compiled type information 9 | 10 | #include "stdafx.h" 11 | 12 | // TODO: reference any additional headers you need in STDAFX.H 13 | // and not in this file 14 | -------------------------------------------------------------------------------- /app/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.h : include file for standard system include files, 7 | // or project specific include files that are used frequently, but 8 | // are changed infrequently 9 | // 10 | 11 | #if !defined(AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC57__INCLUDED_) 12 | #define AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC57__INCLUDED_ 13 | 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif // _MSC_VER > 1000 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | #define VC_EXTRALEAN 20 | 21 | // enable file association editing 22 | #define CAN_UPDATE_FILE_ASSOC 23 | 24 | #include "targetver.h" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include "../diskimg/DiskImg.h" 43 | #include "../util/UtilLib.h" 44 | #include "Main.h" 45 | 46 | // TODO: reference additional headers your program requires here 47 | 48 | //{{AFX_INSERT_LOCATION}} 49 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 50 | 51 | #endif // !defined(AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC57__INCLUDED_) 52 | -------------------------------------------------------------------------------- /app/SubVolumeDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Support for the sub-volume selection dialog. 8 | * 9 | * This just picks a sub-volume. Image format overrides and blocks vs. 10 | * sectors should be chosen elsewhere. 11 | */ 12 | #include "stdafx.h" 13 | #include "SubVolumeDialog.h" 14 | #include "resource.h" 15 | #include "../reformat/Charset.h" 16 | 17 | 18 | BEGIN_MESSAGE_MAP(SubVolumeDialog, CDialog) 19 | ON_LBN_DBLCLK(IDC_SUBV_LIST, OnItemDoubleClicked) 20 | END_MESSAGE_MAP() 21 | 22 | 23 | BOOL SubVolumeDialog::OnInitDialog(void) 24 | { 25 | ASSERT(fpDiskFS != NULL); 26 | 27 | CListBox* pListBox = (CListBox*) GetDlgItem(IDC_SUBV_LIST); 28 | ASSERT(pListBox != NULL); 29 | 30 | // if (pListBox->SetTabStops(12) != TRUE) { 31 | // ASSERT(false); 32 | // } 33 | 34 | DiskFS::SubVolume* pSubVol = fpDiskFS->GetNextSubVolume(NULL); 35 | ASSERT(pSubVol != NULL); // shouldn't be here otherwise 36 | while (pSubVol != NULL) { 37 | CString volumeId(Charset::ConvertMORToUNI(pSubVol->GetDiskFS()->GetVolumeID())); 38 | pListBox->AddString(volumeId); // makes a copy of the string 39 | 40 | pSubVol = fpDiskFS->GetNextSubVolume(pSubVol); 41 | } 42 | 43 | return CDialog::OnInitDialog(); 44 | } 45 | 46 | void SubVolumeDialog::DoDataExchange(CDataExchange* pDX) 47 | { 48 | DDX_LBIndex(pDX, IDC_SUBV_LIST, fListBoxIndex); 49 | } 50 | 51 | void SubVolumeDialog::OnItemDoubleClicked(void) 52 | { 53 | // Accept a double-click as an "OK". 54 | OnOK(); 55 | } 56 | -------------------------------------------------------------------------------- /app/SubVolumeDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Sub-volume selection dialog. 8 | */ 9 | #ifndef APP_SUBVOLUMEDIALOG_H 10 | #define APP_SUBVOLUMEDIALOG_H 11 | 12 | #include "resource.h" 13 | #include "../diskimg/DiskImg.h" 14 | using namespace DiskImgLib; 15 | 16 | /* 17 | * Display the sub-volume selection dialog, which is primarily a list box 18 | * with the sub-volumes listed in it. 19 | */ 20 | class SubVolumeDialog : public CDialog { 21 | public: 22 | SubVolumeDialog(CWnd* pParentWnd = NULL) : 23 | CDialog(IDD_SUBV, pParentWnd) 24 | { 25 | fListBoxIndex = 0; 26 | } 27 | virtual ~SubVolumeDialog(void) {} 28 | 29 | void Setup(DiskFS* pDiskFS) { fpDiskFS = pDiskFS; } 30 | 31 | /* so long as we don't sort the list, this number is enough */ 32 | int fListBoxIndex; 33 | 34 | protected: 35 | virtual BOOL OnInitDialog(void) override; 36 | virtual void DoDataExchange(CDataExchange* pDX) override; 37 | 38 | afx_msg void OnItemDoubleClicked(void); 39 | 40 | private: 41 | DiskFS* fpDiskFS; 42 | 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | 46 | #endif /*APP_SUBVOLUMEDIALOG_H*/ 47 | -------------------------------------------------------------------------------- /app/TwoImgPropsDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * TwoImg properties edit dialog. 8 | */ 9 | #ifndef APP_TWOIMGPROPSDIALOG_H 10 | #define APP_TWOIMGPROPSDIALOG_H 11 | 12 | #include "resource.h" 13 | #include "../diskimg/TwoImg.h" 14 | 15 | 16 | /* 17 | * Dialog with a bunch of controls that map to fields in the TwoImg file 18 | * header. We want to keep the "Save" button ("OK") dimmed until we have 19 | * something to write. 20 | */ 21 | class TwoImgPropsDialog : public CDialog { 22 | public: 23 | TwoImgPropsDialog(CWnd* pParentWnd = NULL) : 24 | CDialog(IDD_TWOIMG_PROPS, pParentWnd), 25 | fpHeader(NULL), fReadOnly(false) 26 | {} 27 | 28 | 29 | void Setup(TwoImgHeader* pHeader, bool readOnly) { 30 | fpHeader = pHeader; 31 | fReadOnly = readOnly; 32 | } 33 | 34 | protected: 35 | // overrides 36 | virtual BOOL OnInitDialog(void) override; 37 | virtual void DoDataExchange(CDataExchange* pDX) override; 38 | 39 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 40 | return MyApp::HandleHelpInfo(lpHelpInfo); 41 | } 42 | 43 | /* 44 | * If they changed anything, enable the "save" button. 45 | */ 46 | afx_msg void OnChange(void); 47 | 48 | TwoImgHeader* fpHeader; 49 | bool fReadOnly; 50 | //bool fModified; 51 | 52 | DECLARE_MESSAGE_MAP() 53 | }; 54 | 55 | #endif /*APP_TWOIMGPROPSDIALOG_H*/ 56 | -------------------------------------------------------------------------------- /app/UseSelectionDialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #include "stdafx.h" 7 | #include "UseSelectionDialog.h" 8 | 9 | BEGIN_MESSAGE_MAP(UseSelectionDialog, CDialog) 10 | ON_WM_HELPINFO() 11 | //ON_COMMAND(IDHELP, OnHelp) 12 | END_MESSAGE_MAP() 13 | 14 | 15 | BOOL UseSelectionDialog::OnInitDialog(void) 16 | { 17 | CString str; 18 | CString selStr; 19 | CWnd* pWnd; 20 | 21 | CDialog::OnInitDialog(); 22 | 23 | /* grab the radio button with the selection count */ 24 | pWnd = GetDlgItem(IDC_USE_SELECTED); 25 | ASSERT(pWnd != NULL); 26 | 27 | /* set the string using a string table entry */ 28 | if (fSelectedCount == 1) { 29 | CheckedLoadString(&str, fSelCountID); 30 | pWnd->SetWindowText(str); 31 | } else { 32 | CheckedLoadString(&str, fSelCountsID); 33 | selStr.Format((LPCWSTR) str, fSelectedCount); 34 | pWnd->SetWindowText(selStr); 35 | 36 | if (fSelectedCount == 0) 37 | pWnd->EnableWindow(FALSE); 38 | } 39 | 40 | /* set the other strings */ 41 | CheckedLoadString(&str, fTitleID); 42 | SetWindowText(str); 43 | 44 | pWnd = GetDlgItem(IDC_USE_ALL); 45 | ASSERT(pWnd != NULL); 46 | CheckedLoadString(&str, fAllID); 47 | pWnd->SetWindowText(str); 48 | 49 | pWnd = GetDlgItem(IDOK); 50 | ASSERT(pWnd != NULL); 51 | CheckedLoadString(&str, fOkLabelID); 52 | pWnd->SetWindowText(str); 53 | 54 | return TRUE; 55 | } 56 | 57 | void UseSelectionDialog::DoDataExchange(CDataExchange* pDX) 58 | { 59 | DDX_Radio(pDX, IDC_USE_SELECTED, fFilesToAction); 60 | } 61 | -------------------------------------------------------------------------------- /app/UseSelectionDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Acknowledge and clarify a request to do something, e.g. delete files. 8 | */ 9 | #ifndef APP_USESELECTIONDIALOG_H 10 | #define APP_USESELECTIONDIALOG_H 11 | 12 | #include "resource.h" 13 | 14 | /* 15 | * Straightforward confirmation. 16 | */ 17 | class UseSelectionDialog : public CDialog { 18 | public: 19 | UseSelectionDialog(int selCount, CWnd* pParentWnd = NULL, int rsrcID = IDD_USE_SELECTION) : 20 | CDialog(rsrcID, pParentWnd), 21 | fSelectedCount(selCount), 22 | fTitleID(-1), 23 | fOkLabelID(-1), 24 | fSelCountID(-1), 25 | fSelCountsID(-1), 26 | fAllID(-1) 27 | { 28 | // init values; these should be overridden before DoModal 29 | fFilesToAction = 0; 30 | } 31 | virtual ~UseSelectionDialog(void) {} 32 | 33 | // set up dialog parameters; must be called before DoModal 34 | void Setup(int titleID, int okLabelID, int countID, int countsID, 35 | int allID) 36 | { 37 | fTitleID = titleID; 38 | fOkLabelID = okLabelID; 39 | fSelCountID = countID; 40 | fSelCountsID = countsID; 41 | fAllID = allID; 42 | } 43 | 44 | enum { kActionSelection = 0, kActionAll = 1 }; 45 | int fFilesToAction; 46 | 47 | protected: 48 | virtual BOOL OnInitDialog(void) override; 49 | virtual void DoDataExchange(CDataExchange* pDX) override; 50 | 51 | afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo) { 52 | return MyApp::HandleHelpInfo(lpHelpInfo); 53 | } 54 | 55 | private: 56 | int fSelectedCount; 57 | 58 | /* dialog parameters */ 59 | int fTitleID; 60 | int fOkLabelID; 61 | int fSelCountID; 62 | int fSelCountsID; 63 | int fAllID; 64 | 65 | DECLARE_MESSAGE_MAP() 66 | }; 67 | 68 | #endif /*APP_USESELECTIONDIALOG_H*/ 69 | -------------------------------------------------------------------------------- /app/app.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /app/postbuild.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy %1\help\CiderPress.chm %2 3 | copy %1\..\dist\nlist.data.txt %2 4 | -------------------------------------------------------------------------------- /app/resource.hm: -------------------------------------------------------------------------------- 1 | // Microsoft Developer Studio generated Help ID include file. 2 | // Used by CiderPress.rc 3 | // 4 | #define HIDC_ABOUT_CREDITS 0x80690457 // IDD_ABOUTDLG 5 | #define HIDC_DISKEDIT_DONE 0x807f0435 // IDD_DISKEDIT 6 | #define HIDC_DISKEDIT_DOREAD 0x807f0427 // IDD_DISKEDIT 7 | #define HIDC_DISKEDIT_DOWRITE 0x807f0428 // IDD_DISKEDIT 8 | #define HIDC_DISKEDIT_EDIT 0x807f042e // IDD_DISKEDIT 9 | #define HIDC_DISKEDIT_HEX 0x807f0436 // IDD_DISKEDIT 10 | #define HIDC_DISKEDIT_NEXT 0x807f0430 // IDD_DISKEDIT 11 | #define HIDC_DISKEDIT_OPENFILE 0x807f042d // IDD_DISKEDIT 12 | #define HIDC_DISKEDIT_PREV 0x807f042f // IDD_DISKEDIT 13 | #define HIDC_DISKEDIT_SECTOR 0x807f042b // IDD_DISKEDIT 14 | #define HIDC_DISKEDIT_SUBVOLUME 0x807f0439 // IDD_DISKEDIT 15 | #define HIDC_DISKEDIT_TRACK 0x807f0429 // IDD_DISKEDIT 16 | #define HIDC_STATIC 0x8074ffff // IDD_PREF_COMPRESSION 17 | #define HIDC_STEXT_SECTOR 0x807f0431 // IDD_DISKEDIT 18 | #define HIDC_STEXT_TRACK 0x807f0432 // IDD_DISKEDIT 19 | #define HIDHELP 0x807f0009 // IDD_DISKEDIT 20 | -------------------------------------------------------------------------------- /app/targetver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | 7 | // Visual C++ 2013 yells if you don't define these values. By default 8 | // they're set to the highest version, but we want to support WinXP, so 9 | // we use that definition. 10 | // 11 | // The symbolic names for the constants are defined in SDKDDKVer.h, but 12 | // that also sets the default values, so the auto-generated "targetver.h" 13 | // recommends doing it this way. Web docs confirm that it should be done 14 | // numerically. 15 | #include 16 | #define WINVER 0x0501 17 | #define _WIN32_WINNT 0x0501 18 | #include 19 | -------------------------------------------------------------------------------- /diskimg/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DiskImg makefile for Linux. 3 | # 4 | SHELL = /bin/sh 5 | CC = gcc 6 | CXX = g++ 7 | AR = ar 8 | OPT = -g -D_DEBUG 9 | #-DEXCISE_GPL_CODE 10 | #OPT = -g -O2 11 | GCC_FLAGS = -Wall -Wwrite-strings -Wpointer-arith -Wshadow 12 | # -Wstrict-prototypes 13 | CXXFLAGS = $(OPT) $(GCC_FLAGS) -D_FILE_OFFSET_BITS=64 14 | 15 | SRCS = ASPI.cpp CFFA.cpp Container.cpp CPM.cpp DDD.cpp DiskFS.cpp \ 16 | DiskImg.cpp DIUtil.cpp DOS33.cpp DOSImage.cpp FAT.cpp FDI.cpp \ 17 | FocusDrive.cpp \GenericFD.cpp Global.cpp Gutenberg.cpp HFS.cpp \ 18 | ImageWrapper.cpp MacPart.cpp MicroDrive.cpp Nibble.cpp \ 19 | Nibble35.cpp OuterWrapper.cpp OzDOS.cpp Pascal.cpp ProDOS.cpp \ 20 | RDOS.cpp TwoImg.cpp UNIDOS.cpp VolumeUsage.cpp Win32BlockIO.cpp 21 | OBJS = ASPI.o CFFA.o Container.o CPM.o DDD.o DiskFS.o \ 22 | DiskImg.o DIUtil.o DOS33.o DOSImage.o FDI.o \ 23 | FocusDrive.o FAT.o GenericFD.o Global.o Gutenberg.o HFS.o \ 24 | ImageWrapper.o MacPart.o MicroDrive.o Nibble.o \ 25 | Nibble35.o OuterWrapper.o OzDOS.o Pascal.o ProDOS.o \ 26 | RDOS.o TwoImg.o UNIDOS.o VolumeUsage.o Win32BlockIO.o 27 | 28 | STATIC_PRODUCT = libdiskimg.a 29 | PRODUCT = $(STATIC_PRODUCT) 30 | 31 | all: $(PRODUCT) 32 | @true 33 | 34 | $(STATIC_PRODUCT): $(OBJS) 35 | -rm -f $(STATIC_PRODUCT) 36 | $(AR) rcv $@ $(OBJS) 37 | 38 | clean: 39 | -rm -f *.o core 40 | -rm -f $(STATIC_PRODUCT) 41 | -rm -f Makefile.bak 42 | 43 | tags:: 44 | @ctags -R --totals * 45 | 46 | depend: 47 | makedepend -- $(CFLAGS) -- $(SRCS) 48 | 49 | # DO NOT DELETE THIS LINE -- make depend depends on it. 50 | -------------------------------------------------------------------------------- /diskimg/SPTI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Declarations for the Win32 SCSI Pass-Through Interface. 8 | */ 9 | #ifndef DISKIMG_SPTI_H 10 | #define DISKIMG_SPTI_H 11 | 12 | #ifdef _WIN32 13 | 14 | namespace DiskImgLib { 15 | 16 | /* 17 | * This is currently implemented as a set of static functions. Do not 18 | * instantiate the class. 19 | */ 20 | class DISKIMG_API SPTI { 21 | public: 22 | // Read blocks from the device. 23 | static DIError ReadBlocks(HANDLE handle, long startBlock, short numBlocks, 24 | long blockSize, void* buf); 25 | 26 | // Get the capacity, expressed as the highest-available LBA and the device 27 | // block size. 28 | static DIError GetDeviceCapacity(HANDLE handle, uint32_t* pLastBlock, 29 | uint32_t* pBlockSize); 30 | 31 | private: 32 | SPTI(void) {} 33 | ~SPTI(void) {} 34 | }; 35 | 36 | } // namespace DiskImgLib 37 | 38 | #endif /*_WIN32*/ 39 | 40 | #endif /*DISKIMG_SPTI_H*/ 41 | -------------------------------------------------------------------------------- /diskimg/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.cpp : source file that includes just the standard includes 7 | // diskimg.pch will be the pre-compiled header 8 | // stdafx.obj will contain the pre-compiled type information 9 | 10 | #include "StdAfx.h" 11 | 12 | // TODO: reference any additional headers you need in STDAFX.H 13 | // and not in this file 14 | -------------------------------------------------------------------------------- /diskimg/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.h : include file for standard system include files, 7 | // or project specific include files that are used frequently, but 8 | // are changed infrequently 9 | // 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifndef _WIN32 17 | 18 | /* UNIX includes */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #define O_BINARY 0 27 | 28 | #define HAVE_VSNPRINTF 29 | #define HAVE_FSEEKO 30 | #define HAVE_FTRUNCATE 31 | 32 | // gcc wants special compile options; just ignore this for now 33 | #define override 34 | 35 | #else /*_WIN32*/ 36 | 37 | #if !defined(AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC58__INCLUDED_) 38 | #define AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC58__INCLUDED_ 39 | 40 | #if _MSC_VER > 1000 41 | #pragma once 42 | #endif // _MSC_VER > 1000 43 | 44 | #define HAVE_WINDOWS_CDROM // enable CD-ROM access under Windows 45 | #define HAVE_CHSIZE 46 | 47 | 48 | // Insert your headers here 49 | # define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 50 | 51 | #include "../app/targetver.h" 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | 58 | #ifdef HAVE_WINDOWS_CDROM 59 | # include 60 | #endif 61 | 62 | #ifndef _SSIZE_T_DEFINED 63 | typedef unsigned int ssize_t; 64 | #define _SSIZE_T_DEFINED 65 | #endif 66 | 67 | #define HAVE__VSNPRINTF 68 | #define strcasecmp stricmp 69 | #define snprintf _snprintf 70 | 71 | //{{AFX_INSERT_LOCATION}} 72 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 73 | 74 | #endif // !defined(AFX_STDAFX_H__1CB7B33E_42BF_4A98_B814_4198EA8ACC58__INCLUDED_) 75 | #endif /*_WIN32*/ 76 | -------------------------------------------------------------------------------- /diskimg/Win32Extra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Visual C++ 6.0 doesn't have this definition, because it wasn't added until 8 | * WinXP. 9 | * 10 | * (Do we want IOCTL_DISK_GET_DRIVE_LAYOUT_EX too?) 11 | */ 12 | #ifndef DISKIMG_WIN32EXTRA_H 13 | #define DISKIMG_WIN32EXTRA_H 14 | 15 | #include // base definitions 16 | 17 | #ifndef IOCTL_DISK_GET_DRIVE_GEOMETRY_EX 18 | 19 | /* 20 | BOOL DeviceIoControl( 21 | (HANDLE) hDevice, // handle to volume 22 | IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, // dwIoControlCode 23 | NULL, // lpInBuffer 24 | 0, // nInBufferSize 25 | (LPVOID) lpOutBuffer, // output buffer 26 | (DWORD) nOutBufferSize, // size of output buffer 27 | (LPDWORD) lpBytesReturned, // number of bytes returned 28 | (LPOVERLAPPED) lpOverlapped // OVERLAPPED structure 29 | ); 30 | */ 31 | 32 | #define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX \ 33 | CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS) 34 | 35 | typedef struct _DISK_GEOMETRY_EX { 36 | DISK_GEOMETRY Geometry; 37 | LARGE_INTEGER DiskSize; 38 | BYTE Data[1]; 39 | } DISK_GEOMETRY_EX, *PDISK_GEOMETRY_EX; 40 | 41 | #if 0 42 | typedef struct _DISK_DETECTION_INFO { 43 | DWORD SizeOfDetectInfo; 44 | DETECTION_TYPE DetectionType; 45 | union { 46 | struct { 47 | DISK_INT13_INFO Int13; 48 | DISK_EX_INT13_INFO ExInt13; 49 | }; 50 | }; 51 | } DISK_DETECTION_INFO, *PDISK_DETECTION_INFO; 52 | 53 | PDISK_DETECTION_INFO DiskGeometryGetDetect(PDISK_GEOMETRY_EX Geometry); 54 | PDISK_PARTITION_INFO DiskGeometryGetPartition(PDISK_GEOMETRY_EX Geometry); 55 | #endif 56 | 57 | 58 | #endif /*IOCTL_DISK_GET_DRIVE_GEOMETRY_EX*/ 59 | 60 | #endif /*DISKIMG_WIN32EXTRA_H*/ 61 | -------------------------------------------------------------------------------- /diskimg/diskimg.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /diskimg/libhfs/COPYRIGHT: -------------------------------------------------------------------------------- 1 | 2 | hfsutils - tools for reading and writing Macintosh HFS volumes 3 | Copyright (C) 1996-1998 Robert Leslie 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | If you would like to negotiate alternate licensing terms, you may do 20 | so by contacting the author: Robert Leslie 21 | 22 | -------------------------------------------------------------------------------- /diskimg/libhfs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DiskImg libhfs makefile for Linux. 3 | # 4 | SHELL = /bin/sh 5 | CC = gcc 6 | AR = ar 7 | OPT = -g -DHAVE_CONFIG_H 8 | #OPT = -g -O2 -DHAVE_CONFIG_H 9 | GCC_FLAGS = -Wall -Wwrite-strings -Wpointer-arith -Wshadow -Wstrict-prototypes 10 | CFLAGS = $(OPT) $(GCC_FLAGS) -D_FILE_OFFSET_BITS=64 11 | 12 | SRCS = os.c data.c block.c low.c medium.c file.c btree.c node.c \ 13 | record.c volume.c hfs.c version.c 14 | OBJS = os.o data.o block.o low.o medium.o file.o btree.o node.o \ 15 | record.o volume.o hfs.o version.o 16 | 17 | STATIC_PRODUCT = libhfs.a 18 | PRODUCT = $(STATIC_PRODUCT) 19 | 20 | all: $(PRODUCT) 21 | @true 22 | 23 | $(STATIC_PRODUCT): $(OBJS) 24 | -rm -f $(STATIC_PRODUCT) 25 | $(AR) rcv $@ $(OBJS) 26 | 27 | clean: 28 | -rm -f *.o core 29 | -rm -f $(STATIC_PRODUCT) 30 | -rm -f Makefile.bak 31 | 32 | tags:: 33 | @ctags -R --totals * 34 | 35 | depend: 36 | makedepend -- $(CFLAGS) -- $(SRCS) 37 | 38 | # DO NOT DELETE THIS LINE -- make depend depends on it. 39 | 40 | -------------------------------------------------------------------------------- /diskimg/libhfs/README: -------------------------------------------------------------------------------- 1 | HFS utility library, part of hfsutils v3.2.6 by Robert Leslie. 2 | 3 | Adapted for use with CiderPress by Andy McFadden. The os_* functions 4 | have been replaced with a callback mechanism, and code that uses global 5 | variables has been (mostly) removed. 6 | -------------------------------------------------------------------------------- /diskimg/libhfs/block.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | int b_init(hfsvol *); 23 | int b_flush(hfsvol *); 24 | int b_finish(hfsvol *); 25 | 26 | int b_readpb(hfsvol *, unsigned long, block *, unsigned int); 27 | int b_writepb(hfsvol *, unsigned long, const block *, unsigned int); 28 | 29 | int b_readlb(hfsvol *, unsigned long, block *); 30 | int b_writelb(hfsvol *, unsigned long, const block *); 31 | 32 | int b_readab(hfsvol *, unsigned int, unsigned int, block *); 33 | int b_writeab(hfsvol *, unsigned int, unsigned int, const block *); 34 | 35 | unsigned long b_size(hfsvol *); 36 | 37 | # ifdef DEBUG 38 | void b_showstats(const bcache *); 39 | void b_dumpcache(const bcache *); 40 | # endif 41 | -------------------------------------------------------------------------------- /diskimg/libhfs/btree.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | int bt_getnode(node *, btree *, unsigned long); 23 | int bt_putnode(node *); 24 | 25 | int bt_readhdr(btree *); 26 | int bt_writehdr(btree *); 27 | 28 | int bt_space(btree *, unsigned int); 29 | 30 | int bt_insert(btree *, const byte *, unsigned int); 31 | int bt_delete(btree *, const byte *); 32 | 33 | int bt_search(btree *, const byte *, node *); 34 | -------------------------------------------------------------------------------- /diskimg/libhfs/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated automatically by configure. */ 2 | /* config.h.in. Generated automatically from configure.in by autoheader. */ 3 | /* 4 | * libhfs - library for reading and writing Macintosh HFS volumes 5 | * Copyright (C) 1996-1998 Robert Leslie 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | * 21 | * $Id$ 22 | */ 23 | 24 | /***************************************************************************** 25 | * Definitions selected automatically by `configure' * 26 | *****************************************************************************/ 27 | 28 | /* Define to empty if the keyword does not work. */ 29 | /* #undef const */ 30 | 31 | /* Define to `unsigned' if doesn't define. */ 32 | /* #undef size_t */ 33 | 34 | /* Define if you have the ANSI C header files. */ 35 | #define STDC_HEADERS 1 36 | 37 | /* Define if your declares struct tm. */ 38 | /* #undef TM_IN_SYS_TIME */ 39 | 40 | /* Define if you want to enable diagnostic debugging support. */ 41 | /* #undef DEBUG */ 42 | 43 | /* Define if you have the mktime function. */ 44 | #define HAVE_MKTIME 1 45 | 46 | /* Define if you have the header file. */ 47 | #define HAVE_FCNTL_H 1 48 | 49 | /* Define if you have the header file. */ 50 | #ifndef _WIN32 51 | # define HAVE_UNISTD_H 1 52 | #endif 53 | 54 | /***************************************************************************** 55 | * End of automatically configured definitions * 56 | *****************************************************************************/ 57 | 58 | # ifdef DEBUG 59 | # include 60 | # endif 61 | -------------------------------------------------------------------------------- /diskimg/libhfs/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | enum { 23 | fkData = 0x00, 24 | fkRsrc = 0xff 25 | }; 26 | 27 | void f_init(hfsfile *, hfsvol *, long, const char *); 28 | void f_selectfork(hfsfile *, int); 29 | void f_getptrs(hfsfile *, ExtDataRec **, unsigned long **, unsigned long **); 30 | 31 | int f_doblock(hfsfile *, unsigned long, block *, 32 | int (*)(hfsvol *, unsigned int, unsigned int, block *)); 33 | 34 | # define f_getblock(file, num, bp) \ 35 | f_doblock((file), (num), (bp), b_readab) 36 | # define f_putblock(file, num, bp) \ 37 | f_doblock((file), (num), (bp), \ 38 | (int (*)(hfsvol *, unsigned int, unsigned int, block *)) \ 39 | b_writeab) 40 | 41 | int f_addextent(hfsfile *, ExtDescriptor *); 42 | long f_alloc(hfsfile *); 43 | 44 | int f_trunc(hfsfile *); 45 | int f_flush(hfsfile *); 46 | -------------------------------------------------------------------------------- /diskimg/libhfs/low.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | # define HFS_DDR_SIGWORD 0x4552 23 | 24 | # define HFS_PM_SIGWORD 0x504d 25 | # define HFS_PM_SIGWORD_OLD 0x5453 26 | 27 | # define HFS_BB_SIGWORD 0x4c4b 28 | 29 | # define HFS_BOOTCODE1LEN (HFS_BLOCKSZ - 148) 30 | # define HFS_BOOTCODE2LEN HFS_BLOCKSZ 31 | 32 | # define HFS_BOOTCODELEN (HFS_BOOTCODE1LEN + HFS_BOOTCODE2LEN) 33 | 34 | int l_getddr(hfsvol *, Block0 *); 35 | int l_putddr(hfsvol *, const Block0 *); 36 | 37 | int l_getpmentry(hfsvol *, Partition *, unsigned long); 38 | int l_putpmentry(hfsvol *, const Partition *, unsigned long); 39 | 40 | int l_getbb(hfsvol *, BootBlkHdr *, byte *); 41 | int l_putbb(hfsvol *, const BootBlkHdr *, const byte *); 42 | 43 | int l_getmdb(hfsvol *, MDB *, int); 44 | int l_putmdb(hfsvol *, const MDB *, int); 45 | -------------------------------------------------------------------------------- /diskimg/libhfs/medium.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | /* 23 | * Partition Types: 24 | * 25 | * "Apple_partition_map" partition map 26 | * "Apple_Driver" device driver 27 | * "Apple_Driver43" SCSI Manager 4.3 device driver 28 | * "Apple_MFS" Macintosh 64K ROM filesystem 29 | * "Apple_HFS" Macintosh hierarchical filesystem 30 | * "Apple_Unix_SVR2" Unix filesystem 31 | * "Apple_PRODOS" ProDOS filesystem 32 | * "Apple_Free" unused 33 | * "Apple_Scratch" empty 34 | */ 35 | 36 | int m_zeroddr(hfsvol *); 37 | 38 | int m_zeropm(hfsvol *, unsigned int); 39 | int m_findpmentry(hfsvol *, const char *, Partition *, unsigned long *); 40 | int m_mkpart(hfsvol *, const char *, const char *, unsigned long); 41 | 42 | int m_zerobb(hfsvol *); 43 | -------------------------------------------------------------------------------- /diskimg/libhfs/memcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | # ifdef HAVE_CONFIG_H 23 | # include "config.h" 24 | # endif 25 | 26 | # include 27 | 28 | /* 29 | * NAME: memcmp() 30 | * DESCRIPTION: compare memory areas 31 | */ 32 | int memcmp(const void *s1, const void *s2, size_t n) 33 | { 34 | register const unsigned char *c1, *c2; 35 | 36 | c1 = s1; 37 | c2 = s2; 38 | 39 | while (n--) 40 | { 41 | register int diff; 42 | 43 | diff = *c1++ - *c2++; 44 | 45 | if (diff) 46 | return diff; 47 | } 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /diskimg/libhfs/node.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | void n_init(node *, btree *, int, int); 23 | 24 | int n_new(node *); 25 | int n_free(node *); 26 | 27 | int n_search(node *, const byte *); 28 | 29 | void n_index(const node *, byte *, unsigned int *); 30 | 31 | void n_insertx(node *, const byte *, unsigned int); 32 | int n_insert(node *, byte *, unsigned int *); 33 | 34 | int n_delete(node *, byte *, int *); 35 | -------------------------------------------------------------------------------- /diskimg/libhfs/os.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | #ifdef CP_NOT_USED 23 | int os_open(void **, const char *, int); 24 | #endif 25 | int os_callback_open(void **priv, oscallback func, void* cookie); 26 | int os_close(void **); 27 | 28 | #ifdef CP_NOT_USED 29 | int os_same(void **, const char *); 30 | #endif 31 | 32 | unsigned long os_seek(void **, unsigned long); 33 | unsigned long os_read(void **, void *, unsigned long); 34 | unsigned long os_write(void **, const void *, unsigned long); 35 | -------------------------------------------------------------------------------- /diskimg/libhfs/record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | void r_packcatkey(const CatKeyRec *, byte *, unsigned int *); 23 | void r_unpackcatkey(const byte *, CatKeyRec *); 24 | 25 | void r_packextkey(const ExtKeyRec *, byte *, unsigned int *); 26 | void r_unpackextkey(const byte *, ExtKeyRec *); 27 | 28 | int r_comparecatkeys(const CatKeyRec *, const CatKeyRec *); 29 | int r_compareextkeys(const ExtKeyRec *, const ExtKeyRec *); 30 | 31 | void r_packcatdata(const CatDataRec *, byte *, unsigned int *); 32 | void r_unpackcatdata(const byte *, CatDataRec *); 33 | 34 | void r_packextdata(const ExtDataRec *, byte *, unsigned int *); 35 | void r_unpackextdata(const byte *, ExtDataRec *); 36 | 37 | void r_makecatkey(CatKeyRec *, unsigned long, const char *); 38 | void r_makeextkey(ExtKeyRec *, int, unsigned long, unsigned int); 39 | 40 | void r_packcatrec(const CatKeyRec *, const CatDataRec *, 41 | byte *, unsigned int *); 42 | void r_packextrec(const ExtKeyRec *, const ExtDataRec *, 43 | byte *, unsigned int *); 44 | 45 | void r_packdirent(CatDataRec *, const hfsdirent *); 46 | void r_unpackdirent(unsigned long, const char *, 47 | const CatDataRec *, hfsdirent *); 48 | -------------------------------------------------------------------------------- /diskimg/libhfs/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | # include "version.h" 23 | 24 | const char libhfs_rcsid[] = 25 | "$Id$"; 26 | 27 | const char libhfs_version[] = "libhfs version 3.2.6"; 28 | const char libhfs_copyright[] = "Copyright (C) 1996-1998 Robert Leslie"; 29 | const char libhfs_author[] = "Robert Leslie "; 30 | -------------------------------------------------------------------------------- /diskimg/libhfs/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | extern const char libhfs_rcsid[]; 23 | 24 | extern const char libhfs_version[]; 25 | extern const char libhfs_copyright[]; 26 | extern const char libhfs_author[]; 27 | -------------------------------------------------------------------------------- /diskimg/libhfs/volume.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libhfs - library for reading and writing Macintosh HFS volumes 3 | * Copyright (C) 1996-1998 Robert Leslie 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * 19 | * $Id$ 20 | */ 21 | 22 | void v_init(hfsvol *, int); 23 | 24 | #ifdef CP_NOT_USED 25 | int v_open(hfsvol *, const char *, int); 26 | #endif 27 | int v_callback_open(hfsvol *, oscallback, void*); 28 | int v_flush(hfsvol *); 29 | int v_close(hfsvol *); 30 | 31 | #ifdef CP_NOT_USED 32 | int v_same(hfsvol *, const char *); 33 | #endif 34 | int v_geometry(hfsvol *, int); 35 | 36 | int v_readmdb(hfsvol *); 37 | int v_writemdb(hfsvol *); 38 | 39 | int v_readvbm(hfsvol *); 40 | int v_writevbm(hfsvol *); 41 | 42 | int v_mount(hfsvol *); 43 | int v_dirty(hfsvol *); 44 | 45 | int v_catsearch(hfsvol *, unsigned long, const char *, 46 | CatDataRec *, char *, node *); 47 | int v_extsearch(hfsfile *, unsigned int, ExtDataRec *, node *); 48 | 49 | int v_getthread(hfsvol *, unsigned long, CatDataRec *, node *, int); 50 | 51 | # define v_getdthread(vol, id, thread, np) \ 52 | v_getthread(vol, id, thread, np, cdrThdRec) 53 | # define v_getfthread(vol, id, thread, np) \ 54 | v_getthread(vol, id, thread, np, cdrFThdRec) 55 | 56 | int v_putcatrec(const CatDataRec *, node *); 57 | int v_putextrec(const ExtDataRec *, node *); 58 | 59 | int v_allocblocks(hfsvol *, ExtDescriptor *); 60 | int v_freeblocks(hfsvol *, const ExtDescriptor *); 61 | 62 | int v_resolve(hfsvol **, const char *, CatDataRec *, long *, char *, node *); 63 | 64 | int v_adjvalence(hfsvol *, unsigned long, int, int); 65 | int v_mkdir(hfsvol *, unsigned long, const char *); 66 | 67 | int v_scavenge(hfsvol *); 68 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | getfile 2 | iconv 3 | makedisk 4 | mdc 5 | packddd 6 | sstasm 7 | -------------------------------------------------------------------------------- /linux/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # CiderPress 3 | # Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | # See the file LICENSE for distribution terms. 5 | # 6 | # DiskImg makefile for Linux. 7 | # 8 | SHELL = /bin/sh 9 | CC = gcc 10 | CXX = g++ 11 | #OPT = -g -D_DEBUG 12 | OPT = -g -O2 13 | GCC_FLAGS = -Wall -Wwrite-strings -Wpointer-arith -Wshadow 14 | CXXFLAGS = $(OPT) $(GCC_FLAGS) -D_FILE_OFFSET_BITS=64 15 | 16 | SRCS1 = MDC.cpp 17 | SRCS2 = Convert.cpp 18 | SRCS3 = SSTAsm.cpp 19 | SRCS4 = PackDDD.cpp 20 | SRCS5 = MakeDisk.cpp 21 | SRCS5 = GetFile.cpp 22 | 23 | OBJS1 = MDC.o 24 | OBJS2 = Convert.o 25 | OBJS3 = SSTAsm.o 26 | OBJS4 = PackDDD.o 27 | OBJS5 = MakeDisk.o 28 | OBJS6 = GetFile.o 29 | 30 | PRODUCT1 = mdc 31 | PRODUCT2 = iconv 32 | PRODUCT3 = sstasm 33 | PRODUCT4 = packddd 34 | PRODUCT5 = makedisk 35 | PRODUCT6 = getfile 36 | 37 | DISKIMGLIB = ../diskimg/libdiskimg.a ../diskimg/libhfs/libhfs.a 38 | NUFXLIB = ../nufxlib/libnufx.a 39 | 40 | all: $(PRODUCT1) $(PRODUCT2) $(PRODUCT3) $(PRODUCT4) $(PRODUCT5) $(PRODUCT6) 41 | @true 42 | 43 | $(PRODUCT1): $(OBJS1) $(DISKIMGLIB) 44 | $(CXX) -o $@ $(OBJS1) $(DISKIMGLIB) $(NUFXLIB) -lz 45 | 46 | $(PRODUCT2): $(OBJS2) $(DISKIMGLIB) 47 | $(CXX) -o $@ $(OBJS2) $(DISKIMGLIB) $(NUFXLIB) -lz 48 | 49 | $(PRODUCT3): $(OBJS3) $(DISKIMGLIB) 50 | $(CXX) -o $@ $(OBJS3) $(DISKIMGLIB) $(NUFXLIB) -lz 51 | 52 | $(PRODUCT4): $(OBJS4) $(DISKIMGLIB) 53 | $(CXX) -o $@ $(OBJS4) $(DISKIMGLIB) $(NUFXLIB) -lz 54 | 55 | $(PRODUCT5): $(OBJS5) $(DISKIMGLIB) 56 | $(CXX) -o $@ $(OBJS5) $(DISKIMGLIB) $(NUFXLIB) -lz 57 | 58 | $(PRODUCT6): $(OBJS6) $(DISKIMGLIB) 59 | $(CXX) -o $@ $(OBJS6) $(DISKIMGLIB) $(NUFXLIB) -lz 60 | 61 | ../diskimg/libdiskimg.a: 62 | (cd ../diskimg ; make) 63 | 64 | ../diskimg/libhfs/libhfs.a: 65 | (cd ../diskimg/libhfs ; make) 66 | 67 | clean: 68 | -rm -f *.o core 69 | -rm -f $(PRODUCT1) $(PRODUCT2) $(PRODUCT3) $(PRODUCT4) $(PRODUCT5) 70 | -rm -f $(PRODUCT6) 71 | -rm -f Makefile.bak tags 72 | -rm -f mdc-log.txt iconv-log.txt makedisk-log.txt 73 | 74 | tags:: 75 | @ctags -R --totals * 76 | 77 | depend: 78 | makedepend -- $(CFLAGS) -- $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) $(SRCS5) $(SRCS6) 79 | 80 | # DO NOT DELETE THIS LINE -- make depend depends on it. 81 | -------------------------------------------------------------------------------- /mdc/AboutDlg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // AboutDlg.cpp : implementation file 7 | // 8 | 9 | #include "stdafx.h" 10 | #include "mdc.h" 11 | #include "AboutDlg.h" 12 | 13 | #ifdef _DEBUG 14 | #define new DEBUG_NEW 15 | #undef THIS_FILE 16 | static char THIS_FILE[] = __FILE__; 17 | #endif 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | // AboutDlg dialog 21 | 22 | 23 | AboutDlg::AboutDlg(CWnd* pParent /*=NULL*/) 24 | : CDialog(AboutDlg::IDD, pParent) 25 | { 26 | //{{AFX_DATA_INIT(AboutDlg) 27 | // NOTE: the ClassWizard will add member initialization here 28 | //}}AFX_DATA_INIT 29 | } 30 | 31 | 32 | BEGIN_MESSAGE_MAP(AboutDlg, CDialog) 33 | //{{AFX_MSG_MAP(AboutDlg) 34 | //}}AFX_MSG_MAP 35 | END_MESSAGE_MAP() 36 | 37 | ///////////////////////////////////////////////////////////////////////////// 38 | // AboutDlg message handlers 39 | 40 | BOOL AboutDlg::OnInitDialog() 41 | { 42 | CDialog::OnInitDialog(); 43 | 44 | // TODO: Add extra initialization here 45 | CWnd* pWnd = GetDlgItem(IDC_ABOUT_VERS); 46 | ASSERT(pWnd != NULL); 47 | CString fmt, newText; 48 | 49 | pWnd->GetWindowText(fmt); 50 | newText.Format(fmt, kAppMajorVersion, kAppMinorVersion, kAppBugVersion); 51 | pWnd->SetWindowText(newText); 52 | LOGD("STR is '%ls'", (LPCWSTR) newText); 53 | 54 | return TRUE; // return TRUE unless you set the focus to a control 55 | // EXCEPTION: OCX Property Pages should return FALSE 56 | } 57 | -------------------------------------------------------------------------------- /mdc/AboutDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #if !defined(AFX_ABOUTDLG_H__340C7108_C3D5_4F24_98AF_C1C614460F6A__INCLUDED_) 7 | #define AFX_ABOUTDLG_H__340C7108_C3D5_4F24_98AF_C1C614460F6A__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | // AboutDlg.h : header file 13 | // 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // AboutDlg dialog 17 | 18 | class AboutDlg : public CDialog 19 | { 20 | // Construction 21 | public: 22 | AboutDlg(CWnd* pParent = NULL); // standard constructor 23 | 24 | // Dialog Data 25 | //{{AFX_DATA(AboutDlg) 26 | enum { IDD = IDD_ABOUTBOX }; 27 | // NOTE: the ClassWizard will add data members here 28 | //}}AFX_DATA 29 | 30 | 31 | // Overrides 32 | // ClassWizard generated virtual function overrides 33 | //{{AFX_VIRTUAL(AboutDlg) 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | protected: 38 | 39 | // Generated message map functions 40 | //{{AFX_MSG(AboutDlg) 41 | virtual BOOL OnInitDialog(); 42 | //}}AFX_MSG 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | 46 | //{{AFX_INSERT_LOCATION}} 47 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 48 | 49 | #endif // !defined(AFX_ABOUTDLG_H__340C7108_C3D5_4F24_98AF_C1C614460F6A__INCLUDED_) 50 | -------------------------------------------------------------------------------- /mdc/ProgressDlg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // ProgressDlg.cpp : implementation file 7 | // 8 | 9 | #include "stdafx.h" 10 | #include "mdc.h" 11 | #include "ProgressDlg.h" 12 | 13 | #ifdef _DEBUG 14 | #define new DEBUG_NEW 15 | #undef THIS_FILE 16 | static char THIS_FILE[] = __FILE__; 17 | #endif 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | // ProgressDlg dialog 21 | 22 | #if 0 23 | ProgressDlg::ProgressDlg(CWnd* pParent /*=NULL*/) 24 | : CDialog(ProgressDlg::IDD, pParent) 25 | { 26 | //{{AFX_DATA_INIT(ProgressDlg) 27 | // NOTE: the ClassWizard will add member initialization here 28 | //}}AFX_DATA_INIT 29 | 30 | fpCancelFlag = NULL; 31 | } 32 | #endif 33 | 34 | 35 | BEGIN_MESSAGE_MAP(ProgressDlg, CDialog) 36 | //{{AFX_MSG_MAP(ProgressDlg) 37 | //}}AFX_MSG_MAP 38 | END_MESSAGE_MAP() 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // ProgressDlg message handlers 42 | 43 | BOOL ProgressDlg::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 44 | { 45 | // TODO: Add your specialized code here and/or call the base class 46 | 47 | return CDialog::Create(IDD, pParentWnd); 48 | } 49 | 50 | void ProgressDlg::PostNcDestroy() 51 | { 52 | // TODO: Add your specialized code here and/or call the base class 53 | delete this; 54 | 55 | //CDialog::PostNcDestroy(); 56 | } 57 | 58 | /* 59 | * Update the progress display with the name of the file we're currently 60 | * working on. 61 | */ 62 | void 63 | ProgressDlg::SetCurrentFile(const WCHAR* fileName) 64 | { 65 | CWnd* pWnd = GetDlgItem(IDC_PROGRESS_FILENAME); 66 | ASSERT(pWnd != NULL); 67 | pWnd->SetWindowText(fileName); 68 | } 69 | 70 | void ProgressDlg::OnCancel() 71 | { 72 | // TODO: Add extra cleanup here 73 | LOGI("Cancel button pushed"); 74 | ASSERT(fpCancelFlag != NULL); 75 | *fpCancelFlag = true; 76 | 77 | //CDialog::OnCancel(); 78 | } 79 | -------------------------------------------------------------------------------- /mdc/ProgressDlg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #if !defined(AFX_PROGRESSDLG_H__94B5552B_1337_4FA4_A336_32FA9544ADAC__INCLUDED_) 7 | #define AFX_PROGRESSDLG_H__94B5552B_1337_4FA4_A336_32FA9544ADAC__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | // ProgressDlg.h : header file 13 | // 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // ProgressDlg dialog 17 | 18 | class ProgressDlg : public CDialog 19 | { 20 | // Construction 21 | public: 22 | /*ProgressDlg(CWnd* pParent = NULL); // standard constructor*/ 23 | 24 | // Dialog Data 25 | //{{AFX_DATA(ProgressDlg) 26 | enum { IDD = IDD_PROGRESS }; 27 | // NOTE: the ClassWizard will add data members here 28 | //}}AFX_DATA 29 | 30 | bool* fpCancelFlag; 31 | 32 | // Overrides 33 | // ClassWizard generated virtual function overrides 34 | //{{AFX_VIRTUAL(ProgressDlg) 35 | public: 36 | virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); 37 | protected: 38 | virtual void PostNcDestroy(); 39 | //}}AFX_VIRTUAL 40 | 41 | public: 42 | BOOL Create(CWnd* pParentWnd = NULL) { 43 | return CDialog::Create(IDD_PROGRESS, pParentWnd); 44 | } 45 | void SetCurrentFile(const WCHAR* fileName); 46 | 47 | // Implementation 48 | protected: 49 | // Generated message map functions 50 | //{{AFX_MSG(ProgressDlg) 51 | virtual void OnCancel(); 52 | //}}AFX_MSG 53 | DECLARE_MESSAGE_MAP() 54 | }; 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_PROGRESSDLG_H__94B5552B_1337_4FA4_A336_32FA9544ADAC__INCLUDED_) 60 | -------------------------------------------------------------------------------- /mdc/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.cpp : source file that includes just the standard includes 7 | // mdc.pch will be the pre-compiled header 8 | // stdafx.obj will contain the pre-compiled type information 9 | 10 | #include "stdafx.h" 11 | 12 | // TODO: reference any additional headers you need in STDAFX.H 13 | // and not in this file 14 | -------------------------------------------------------------------------------- /mdc/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.h : include file for standard system include files, 7 | // or project specific include files that are used frequently, but 8 | // are changed infrequently 9 | // 10 | 11 | #if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) 12 | #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ 13 | 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif // _MSC_VER > 1000 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | 20 | #include "../app/targetver.h" 21 | 22 | // Windows Header Files: 23 | //#include 24 | 25 | // C RunTime Header Files 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | //#include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include "..\util\UtilLib.h" 43 | 44 | // Local Header Files 45 | 46 | // TODO: reference additional headers your program requires here 47 | 48 | //{{AFX_INSERT_LOCATION}} 49 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 50 | 51 | #endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) 52 | -------------------------------------------------------------------------------- /mdc/mdc.ICO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/mdc/mdc.ICO -------------------------------------------------------------------------------- /mdc/mdc.clw: -------------------------------------------------------------------------------- 1 | ; CLW file contains information for the MFC ClassWizard 2 | 3 | [General Info] 4 | Version=1 5 | LastClass=AboutDlg 6 | LastTemplate=CDialog 7 | NewFileInclude1=#include "stdafx.h" 8 | NewFileInclude2=#include "mdc.h" 9 | LastPage=0 10 | 11 | ClassCount=2 12 | 13 | ResourceCount=4 14 | Resource1=IDD_ABOUTBOX 15 | Class1=AboutDlg 16 | Resource2="IDD_CHOOSE_FILES" 17 | Resource3=IDC_MDC 18 | Class2=ProgressDlg 19 | Resource4=IDD_PROGRESS 20 | 21 | [DLG:IDD_ABOUTBOX] 22 | Type=1 23 | Class=AboutDlg 24 | ControlCount=6 25 | Control1=IDC_MYICON,static,1342177283 26 | Control2=IDC_ABOUT_VERS,static,1342308480 27 | Control3=IDC_STATIC,static,1342308352 28 | Control4=IDOK,button,1342242817 29 | Control5=IDC_STATIC,static,1342308352 30 | Control6=IDC_STATIC,static,1342308352 31 | 32 | [MNU:IDC_MDC] 33 | Type=1 34 | Class=? 35 | Command1=IDM_FILE_SCAN 36 | Command2=IDM_FILE_EXIT 37 | Command3=IDM_HELP_WEBSITE 38 | Command4=IDM_HELP_ABOUT 39 | CommandCount=4 40 | 41 | [ACL:IDC_MDC] 42 | Type=1 43 | Class=? 44 | Command1=IDM_ABOUT 45 | Command2=IDM_ABOUT 46 | CommandCount=2 47 | 48 | [CLS:AboutDlg] 49 | Type=0 50 | HeaderFile=AboutDlg.h 51 | ImplementationFile=AboutDlg.cpp 52 | BaseClass=CDialog 53 | Filter=D 54 | VirtualFilter=dWC 55 | LastObject=AboutDlg 56 | 57 | [DLG:"IDD_CHOOSE_FILES"] 58 | Type=1 59 | Class=? 60 | ControlCount=4 61 | Control1=1119,static,1342177280 62 | Control2=IDC_SELECT_ACCEPT,button,1342242816 63 | Control3=IDCANCEL,button,1342242816 64 | Control4=IDC_CHOOSEFILES_STATIC1,static,1342308352 65 | 66 | [DLG:IDD_PROGRESS] 67 | Type=1 68 | Class=ProgressDlg 69 | ControlCount=3 70 | Control1=IDCANCEL,button,1342242816 71 | Control2=IDC_STATIC,static,1342308352 72 | Control3=IDC_PROGRESS_FILENAME,static,1342308352 73 | 74 | [CLS:ProgressDlg] 75 | Type=0 76 | HeaderFile=ProgressDlg.h 77 | ImplementationFile=ProgressDlg.cpp 78 | BaseClass=CDialog 79 | Filter=C 80 | LastObject=IDCANCEL 81 | VirtualFilter=dWC 82 | 83 | -------------------------------------------------------------------------------- /mdc/mdc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * The application object. 8 | */ 9 | #include "stdafx.h" 10 | #include "mdc.h" 11 | #include "Main.h" 12 | #include 13 | 14 | /* magic global that MFC finds (or that finds MFC) */ 15 | MyApp gMyApp; 16 | 17 | DebugLog* gDebugLog; 18 | 19 | /* 20 | * Constructor. This is the closest thing to "main" that we have, but we 21 | * should wait for InitInstance for most things. 22 | */ 23 | MyApp::MyApp(LPCTSTR lpszAppName) : CWinApp(lpszAppName) 24 | { 25 | // TODO: make the log file configurable 26 | gDebugLog = new DebugLog(L"C:\\src\\mdclog.txt"); 27 | 28 | time_t now = time(NULL); 29 | LOGI("MDC v%d.%d.%d started at %.24hs", 30 | kAppMajorVersion, kAppMinorVersion, kAppBugVersion, 31 | ctime(&now)); 32 | 33 | int tmpDbgFlag; 34 | // enable memory leak detection 35 | tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); 36 | tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF; 37 | _CrtSetDbgFlag(tmpDbgFlag); 38 | LOGI("Leak detection enabled"); 39 | } 40 | 41 | /* 42 | * This is the last point of control we have. 43 | */ 44 | MyApp::~MyApp(void) 45 | { 46 | LOGI("MDC shutting down"); 47 | delete gDebugLog; 48 | } 49 | 50 | 51 | /* 52 | * It all begins here. 53 | * 54 | * Create a main window. 55 | */ 56 | BOOL 57 | MyApp::InitInstance(void) 58 | { 59 | m_pMainWnd = new MainWindow; 60 | m_pMainWnd->ShowWindow(m_nCmdShow); 61 | m_pMainWnd->UpdateWindow(); 62 | 63 | return TRUE; 64 | } 65 | -------------------------------------------------------------------------------- /mdc/mdc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #if !defined(AFX_MDC_H__15BEB7EF_BB49_4E23_BDD1_7F7B0220F3DB__INCLUDED_) 7 | #define AFX_MDC_H__15BEB7EF_BB49_4E23_BDD1_7F7B0220F3DB__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #include "resource.h" 14 | 15 | /* MDC version numbers */ 16 | #define kAppMajorVersion 3 17 | #define kAppMinorVersion 0 18 | #define kAppBugVersion 0 19 | 20 | /* 21 | * Windows application object. 22 | */ 23 | class MyApp : public CWinApp { 24 | public: 25 | MyApp(LPCTSTR lpszAppName = NULL); 26 | virtual ~MyApp(void); 27 | 28 | // Overridden functions 29 | virtual BOOL InitInstance(void); 30 | //virtual BOOL OnIdle(LONG lCount); 31 | }; 32 | 33 | extern MyApp gMyApp; 34 | 35 | #endif // !defined(AFX_MDC_H__15BEB7EF_BB49_4E23_BDD1_7F7B0220F3DB__INCLUDED_) 36 | -------------------------------------------------------------------------------- /mdc/mdc.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/mdc/mdc.rc -------------------------------------------------------------------------------- /mdc/mdc.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {19d28053-27cc-4138-924c-e2bfc781aa40} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {493f9868-fdfc-4dc5-9c9a-b75808666a2a} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {39acd0ae-9058-474a-84b3-d4244d95c53c} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | 43 | 44 | Resource Files 45 | 46 | 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | -------------------------------------------------------------------------------- /mdc/mdc.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /mdc/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by mdc.rc 4 | // 5 | #define IDC_MYICON 2 6 | #define IDD_ABOUTBOX 103 7 | #define IDS_APP_TITLE 103 8 | #define IDM_ABOUT 104 9 | #define IDM_FILE_EXIT 105 10 | #define IDI_MDC 107 11 | #define IDC_MDC 109 12 | #define IDS_MUST_REGISTER 110 13 | #define IDS_FAILED 111 14 | #define IDD_PROGRESS 131 15 | #define IDC_CHOOSEFILES_STATIC1 1002 16 | #define IDC_PROGRESS_FILENAME 1003 17 | #define IDC_ABOUT_VERS 1004 18 | #define IDC_SELECT_ACCEPT 1175 19 | #define IDM_HELP_ABOUT 32771 20 | #define IDM_FILE_SCAN 32772 21 | #define IDM_HELP_WEBSITE 32773 22 | 23 | // Next default values for new objects 24 | // 25 | #ifdef APSTUDIO_INVOKED 26 | #ifndef APSTUDIO_READONLY_SYMBOLS 27 | #define _APS_NEXT_RESOURCE_VALUE 132 28 | #define _APS_NEXT_COMMAND_VALUE 32774 29 | #define _APS_NEXT_CONTROL_VALUE 1005 30 | #define _APS_NEXT_SYMED_VALUE 110 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /nufxlib/.gitignore: -------------------------------------------------------------------------------- 1 | # config-generated sources 2 | Makefile 3 | config.h 4 | config.log 5 | config.status 6 | 7 | # generated binaries 8 | libnufx.a 9 | samples/exerciser 10 | samples/imgconv 11 | samples/launder 12 | samples/test-basic 13 | samples/test-extract 14 | samples/test-names 15 | samples/test-simple 16 | samples/test-twirl 17 | -------------------------------------------------------------------------------- /nufxlib/COPYING-LIB: -------------------------------------------------------------------------------- 1 | Copyright (C) 2007, Andy McFadden. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holder nor the names of project 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 23 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 | THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | -------------------------------------------------------------------------------- /nufxlib/Version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * NuFX archive manipulation library 3 | * Copyright (C) 2000-2007 by Andy McFadden, All Rights Reserved. 4 | * This is free software; you can redistribute it and/or modify it under the 5 | * terms of the BSD License, see the file COPYING-LIB. 6 | */ 7 | #include "NufxLibPriv.h" 8 | 9 | /* executable was build on or after this date */ 10 | #ifdef __DATE__ 11 | static const char gNuBuildDate[] = __DATE__; 12 | #else 13 | static const char gNuBuildDate[] = "??? ?? ????"; 14 | #endif 15 | 16 | #ifdef OPTFLAGSTR 17 | static const char gNuBuildFlags[] = OPTFLAGSTR; 18 | #else 19 | static const char gNuBuildFlags[] = "-"; 20 | #endif 21 | 22 | 23 | /* 24 | * Return the version number, date built, and build flags. 25 | */ 26 | NuError Nu_GetVersion(int32_t* pMajorVersion, int32_t* pMinorVersion, 27 | int32_t* pBugVersion, const char** ppBuildDate, const char** ppBuildFlags) 28 | { 29 | if (pMajorVersion != NULL) 30 | *pMajorVersion = kNuVersionMajor; 31 | if (pMinorVersion != NULL) 32 | *pMinorVersion = kNuVersionMinor; 33 | if (pBugVersion != NULL) 34 | *pBugVersion = kNuVersionBug; 35 | if (ppBuildDate != NULL) 36 | *ppBuildDate = gNuBuildDate; 37 | if (ppBuildFlags != NULL) 38 | *ppBuildFlags = gNuBuildFlags; 39 | return kNuErrNone; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /nufxlib/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Last modified: 1995-03-05 6 | # Public domain 7 | 8 | errstatus=0 9 | 10 | for file in ${1+"$@"} ; do 11 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 12 | shift 13 | 14 | pathcomp= 15 | for d in ${1+"$@"} ; do 16 | pathcomp="$pathcomp$d" 17 | case "$pathcomp" in 18 | -* ) pathcomp=./$pathcomp ;; 19 | esac 20 | 21 | if test ! -d "$pathcomp"; then 22 | echo "mkdir $pathcomp" 1>&2 23 | mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? 24 | fi 25 | 26 | if test ! -d "$pathcomp"; then 27 | errstatus=$lasterr 28 | fi 29 | 30 | pathcomp="$pathcomp/" 31 | done 32 | done 33 | 34 | exit $errstatus 35 | -------------------------------------------------------------------------------- /nufxlib/nufxlib.def: -------------------------------------------------------------------------------- 1 | ; NufxLib library exported symbols 2 | ; 3 | ; This is redundant with the __declspec(dllexport) declarations enabled 4 | ; with the NUFXLIB_EXPORTS symbol. If we're just building a DLL, there's 5 | ; no need for this file. However, the objects we're building are used for 6 | ; both the static library and the dynamic library, and we don't want to 7 | ; have exports in the static library. If we do, the linker will create 8 | ; .lib and .exp files for every executable we link against it. This is 9 | ; mostly harmless, but a tad messy. I don't expect the interface to change, 10 | ; so there's not much of a maintenance burden here. 11 | ; 12 | EXPORTS 13 | NuAbort 14 | NuAddFile 15 | NuAddRecord 16 | NuAddThread 17 | NuClose 18 | NuContents 19 | NuConvertMORToUNI 20 | NuConvertUNIToMOR 21 | NuCreateDataSinkForBuffer 22 | NuCreateDataSinkForFP 23 | NuCreateDataSinkForFile 24 | NuCreateDataSourceForBuffer 25 | NuCreateDataSourceForFP 26 | NuCreateDataSourceForFile 27 | NuDataSinkGetOutCount 28 | NuDataSourceSetRawCrc 29 | NuDebugDumpArchive 30 | NuDelete 31 | NuDeleteRecord 32 | NuDeleteThread 33 | NuExtract 34 | NuExtractRecord 35 | NuExtractThread 36 | NuFlush 37 | NuFreeDataSink 38 | NuFreeDataSource 39 | NuGetAttr 40 | NuGetExtraData 41 | NuGetMasterHeader 42 | NuGetRecord 43 | NuGetRecordIdxByName 44 | NuGetRecordIdxByPosition 45 | NuGetValue 46 | NuGetVersion 47 | NuIsPresizedThreadID 48 | NuOpenRO 49 | NuOpenRW 50 | NuRecordCopyAttr 51 | NuRecordCopyThreads 52 | NuRecordGetNumThreads 53 | NuRename 54 | NuSetErrorHandler 55 | NuSetErrorMessageHandler 56 | NuSetExtraData 57 | NuSetGlobalErrorMessageHandler 58 | NuSetOutputPathnameFilter 59 | NuSetProgressUpdater 60 | NuSetRecordAttr 61 | NuSetSelectionFilter 62 | NuSetValue 63 | NuStrError 64 | NuStreamOpenRO 65 | NuTest 66 | NuTestFeature 67 | NuTestRecord 68 | NuThreadGetByIdx 69 | NuUpdatePresizedThread 70 | -------------------------------------------------------------------------------- /nufxlib/samples/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NuFX archive manipulation library 3 | * Copyright (C) 2000-2007 by Andy McFadden, All Rights Reserved. 4 | * This is free software; you can redistribute it and/or modify it under the 5 | * terms of the BSD License, see the file COPYING.LIB. 6 | * 7 | * Common functions for NuLib tests. 8 | */ 9 | #ifndef NUFXLIB_SAMPLES_COMMON_H 10 | #define NUFXLIB_SAMPLES_COMMON_H 11 | 12 | #include "SysDefs.h" /* might as well draft off the autoconf */ 13 | #include "NufxLib.h" 14 | 15 | #ifdef USE_DMALLOC 16 | # include "dmalloc.h" 17 | #endif 18 | 19 | #define NELEM(x) (sizeof(x) / sizeof((x)[0])) 20 | 21 | #ifndef __cplusplus 22 | #define false 0 23 | #define true (!false) 24 | #endif 25 | 26 | 27 | #ifdef FOPEN_WANTS_B 28 | # define kNuFileOpenReadOnly "rb" 29 | # define kNuFileOpenReadWrite "r+b" 30 | # define kNuFileOpenWriteTrunc "wb" 31 | # define kNuFileOpenReadWriteCreat "w+b" 32 | #else 33 | # define kNuFileOpenReadOnly "r" 34 | # define kNuFileOpenReadWrite "r+" 35 | # define kNuFileOpenWriteTrunc "w" 36 | # define kNuFileOpenReadWriteCreat "w+" 37 | #endif 38 | 39 | 40 | /* 41 | * Figure out what path separator to use. 42 | * 43 | * NOTE: recent versions of Win32 will also accept '/'. 44 | */ 45 | 46 | #ifdef MSDOS 47 | # define PATH_SEP '\\' 48 | #endif 49 | 50 | #ifdef WIN32 51 | # define PATH_SEP '\\' 52 | #endif 53 | 54 | #ifdef MACOS 55 | # define PATH_SEP ':' 56 | #endif 57 | 58 | #if defined(APW) || defined(__ORCAC__) 59 | # define PATH_SEP ':' 60 | #endif 61 | 62 | #ifndef PATH_SEP 63 | # define PATH_SEP '/' 64 | #endif 65 | 66 | #endif /*NUFXLIB_SAMPLES_COMMON_H*/ 67 | -------------------------------------------------------------------------------- /reformat/BASIC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007, 2008 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat BASIC programs. 8 | */ 9 | #ifndef REFORMAT_BASIC_H 10 | #define REFORMAT_BASIC_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat an Applesoft BASIC program into readable text. 16 | */ 17 | class ReformatApplesoft : public ReformatText { 18 | public: 19 | ReformatApplesoft(void) {} 20 | virtual ~ReformatApplesoft(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | /* share our token list with others */ 28 | // TODO: this is a hack; find a better way to do this 29 | enum { kTokenLen = 8, kTokenCount = 107 }; 30 | static const char* GetApplesoftTokens(void); 31 | }; 32 | 33 | /* 34 | * Reformat an Integer BASIC program into readable text. 35 | */ 36 | class ReformatInteger : public ReformatText { 37 | public: 38 | ReformatInteger(void) {} 39 | virtual ~ReformatInteger(void) {} 40 | 41 | virtual void Examine(ReformatHolder* pHolder) override; 42 | virtual int Process(const ReformatHolder* pHolder, 43 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 44 | ReformatOutput* pOutput) override; 45 | }; 46 | 47 | /* 48 | * Reformat an Apple /// Business BASIC program into readable text. 49 | */ 50 | class ReformatBusiness : public ReformatText { 51 | public: 52 | ReformatBusiness(void) {} 53 | virtual ~ReformatBusiness(void) {} 54 | 55 | virtual void Examine(ReformatHolder* pHolder) override; 56 | virtual int Process(const ReformatHolder* pHolder, 57 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 58 | ReformatOutput* pOutput) override; 59 | }; 60 | 61 | #endif /*REFORMAT_BASIC_H*/ 62 | -------------------------------------------------------------------------------- /reformat/CPMFiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat CP/M files. 8 | */ 9 | #ifndef REFORMAT_CPMFILES_H 10 | #define REFORMAT_CPMFILES_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat CP/M text. 16 | */ 17 | class ReformatCPMText : public ReformatText { 18 | public: 19 | ReformatCPMText(void) {} 20 | virtual ~ReformatCPMText(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | }; 27 | 28 | #endif /*REFORMAT_CPMFILES_H*/ 29 | -------------------------------------------------------------------------------- /reformat/Charset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2015 by faddenSoft. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | #ifndef REFORMAT_CHARSET_H 7 | #define REFORMAT_CHARSET_H 8 | 9 | /* 10 | * Character set conversions. 11 | */ 12 | class Charset { 13 | public: 14 | // Convert a Mac OS Roman character value (from a IIgs document) to 15 | // its UTF-16 Unicode equivalent. This also includes a conversion 16 | // for the control characters. The transformation is reversible. 17 | static uint16_t ConvertMacRomanToUTF16(uint8_t ch) { 18 | return kUTF16Conv[ch]; 19 | } 20 | 21 | // Convert a Mac OS Roman character value an 8-bit Windows CP1252 22 | // equivalent. The transformation is NOT reversible. 23 | static uint8_t ConvertMacRomanTo1252(uint8_t ch) { 24 | if (ch < 128) 25 | return ch; 26 | else 27 | return kCP1252Conv[ch-128]; 28 | } 29 | 30 | // Simple Mac OS Roman to Unicode string conversion. 31 | static CString ConvertMORToUNI(const char* strMOR) 32 | { 33 | // We know that all MOR characters are represented in Unicode with a 34 | // single BMP code point, so we know that strlen(MOR) == wcslen(UNI). 35 | const size_t len = strlen(strMOR); 36 | CString strUNI; 37 | WCHAR* uniBuf = strUNI.GetBuffer(len); 38 | for (size_t i = 0; i < len; i++) { 39 | uniBuf[i] = Charset::ConvertMacRomanToUTF16(strMOR[i]); 40 | } 41 | strUNI.ReleaseBuffer(len); 42 | return strUNI; 43 | } 44 | 45 | static void CheckGSCharConv(void); 46 | 47 | private: 48 | static const uint8_t kCP1252Conv[]; 49 | static const uint16_t kUTF16Conv[]; 50 | }; 51 | 52 | #endif /*REFORMAT_CHARSET_H*/ 53 | -------------------------------------------------------------------------------- /reformat/Directory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat subdirectories. 8 | */ 9 | #ifndef REFORMAT_DIRECTORY_H 10 | #define REFORMAT_DIRECTORY_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat a ProDOS directory. 16 | */ 17 | class ReformatDirectory : public ReformatText { 18 | public: 19 | ReformatDirectory(void) {} 20 | virtual ~ReformatDirectory(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | private: 28 | void PrintDirEntries(const uint8_t* srcBuf, 29 | long srcLen, bool showDeleted); 30 | }; 31 | 32 | #endif /*REFORMAT_DIRECTORY_H*/ 33 | -------------------------------------------------------------------------------- /reformat/DoubleHiRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat double-hi-res graphics. 8 | */ 9 | #ifndef REFORMAT_DOUBLEHIRES_H 10 | #define REFORMAT_DOUBLEHIRES_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat double-hi-res graphics into a bitmap. 16 | */ 17 | class ReformatDHR : public ReformatGraphics { 18 | public: 19 | ReformatDHR(void) {} 20 | virtual ~ReformatDHR(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | enum { 28 | kPixelsPerLine = 560, 29 | kNumLines = 192, 30 | 31 | kOutputWidth = 560, 32 | kOutputHeight = 384, 33 | kPageSize = 8192, 34 | kExpectedSize = kPageSize*2, 35 | kNumDHRColors = 16, 36 | }; 37 | 38 | /* this MUST match up with prefs ctrl indices (IDC_DHR_CONV_COMBO) */ 39 | typedef enum { 40 | kDHRBlackWhite = 0, 41 | kDHRLatched = 1, 42 | kDHRPlain140 = 2, 43 | kDHRWindow = 3, 44 | } Algorithms; 45 | 46 | void InitColorLookup(void); 47 | MyDIBitmap* DHRScreenToBitmap(const uint8_t* buf); 48 | 49 | Algorithms fAlgorithm; 50 | int fLineOffset[kNumLines]; 51 | unsigned int fColorLookup[4][kNumDHRColors]; 52 | }; 53 | 54 | #endif /*REFORMAT_DOUBLEHIRES_H*/ 55 | -------------------------------------------------------------------------------- /reformat/HiRes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat hi-res images. 8 | */ 9 | #ifndef REFORMAT_HIRES_H 10 | #define REFORMAT_HIRES_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat a HiRes graphic into a bitmap. 16 | */ 17 | class ReformatHiRes : public ReformatGraphics { 18 | public: 19 | ReformatHiRes(void) { fBlackWhite = false; } 20 | virtual ~ReformatHiRes(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | static void InitLineOffset(int* pOffsetBuf); 28 | 29 | private: 30 | enum { 31 | kPixelsPerLine = 280, 32 | kNumLines = 192, 33 | 34 | kOutputWidth = 560, 35 | kOutputHeight = 384, 36 | kExpectedSize = 8192, 37 | }; 38 | 39 | MyDIBitmap* HiResScreenToBitmap(const uint8_t* buf); 40 | 41 | static long ExpandLZ4FH(uint8_t* dstBuf, const uint8_t* srcBuf, 42 | long srcLen); 43 | 44 | int fLineOffset[kNumLines]; 45 | bool fBlackWhite; 46 | }; 47 | 48 | #endif /*REFORMAT_HIRES_H*/ 49 | -------------------------------------------------------------------------------- /reformat/MacPaint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Convert MacPaint files. 8 | */ 9 | #ifndef REFORMAT_MACPAINT_H 10 | #define REFORMAT_MACPAINT_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat a B&W MacPaint image. 16 | */ 17 | class ReformatMacPaint : public ReformatGraphics { 18 | public: 19 | ReformatMacPaint(void) {} 20 | virtual ~ReformatMacPaint(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | private: 28 | MyDIBitmap* ConvertMacPaint(const uint8_t* srcBuf, long length); 29 | 30 | enum { 31 | kLeadingJunkCount = 512, 32 | kOutputWidth = 576, 33 | kOutputHeight = 720, 34 | kNumColors = 2, 35 | kMinSize = kLeadingJunkCount + 2*kOutputHeight, 36 | // max size is 53072, not including MacBinary header 37 | kMaxSize = 128 + kLeadingJunkCount + kOutputHeight*((kOutputWidth/8)+1), 38 | }; 39 | }; 40 | 41 | #endif /*REFORMAT_MACPAINT_H*/ 42 | -------------------------------------------------------------------------------- /reformat/PrintShop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Convert Print Shop graphics. 8 | */ 9 | #ifndef REFORMAT_PRINTSHOP_H 10 | #define REFORMAT_PRINTSHOP_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Reformat Print Shop clip art. There are actually two kinds, "classic" 16 | * (88x52 B&W) and "GS" (88x52 3-bit color). This handles both. 17 | */ 18 | class ReformatPrintShop : public ReformatGraphics { 19 | public: 20 | ReformatPrintShop(void) {} 21 | virtual ~ReformatPrintShop(void) {} 22 | 23 | virtual void Examine(ReformatHolder* pHolder) override; 24 | virtual int Process(const ReformatHolder* pHolder, 25 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 26 | ReformatOutput* pOutput) override; 27 | 28 | private: 29 | enum { kWidth=88, kHeight=52 }; 30 | 31 | MyDIBitmap* ConvertBW(const uint8_t* srcBuf); 32 | MyDIBitmap* ConvertColor(const uint8_t* srcBuf); 33 | }; 34 | 35 | #endif /*REFORMAT_PRINTSHOP_H*/ 36 | -------------------------------------------------------------------------------- /reformat/ResourceFork.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Reformat a resource fork. 8 | */ 9 | #ifndef REFORMAT_RESOURCEFORK_H 10 | #define REFORMAT_RESOURCEFORK_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Currently pretty simple. 16 | */ 17 | class ReformatResourceFork : public ReformatText { 18 | public: 19 | ReformatResourceFork(void) {} 20 | virtual ~ReformatResourceFork(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | 27 | static bool GetResource(const uint8_t* srcBuf, long srcLen, 28 | uint16_t resourceType, uint32_t resourceID, 29 | const uint8_t** pResource, long* pResourceLen); 30 | 31 | private: 32 | enum { kRsrcMapEntryLen = 0x14 }; 33 | 34 | static bool ReadHeader(const uint8_t* srcBuf, long srcLen, 35 | long* pFileVersion, long* pFileToMap, long* pFileMapSize, 36 | bool* pLittleEndian); 37 | }; 38 | 39 | #endif /*REFORMAT_RESOURCEFORK_H*/ 40 | -------------------------------------------------------------------------------- /reformat/Simple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Simple reformatters that can apply to anything. 8 | */ 9 | #ifndef REFORMAT_SIMPLE_H 10 | #define REFORMAT_SIMPLE_H 11 | 12 | #include "ReformatBase.h" 13 | 14 | /* 15 | * Fix the EOL markers on a text file. 16 | */ 17 | class ReformatEOL_HA : public ReformatText { 18 | public: 19 | ReformatEOL_HA(void) {} 20 | virtual ~ReformatEOL_HA(void) {} 21 | 22 | virtual void Examine(ReformatHolder* pHolder) override; 23 | virtual int Process(const ReformatHolder* pHolder, 24 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 25 | ReformatOutput* pOutput) override; 26 | }; 27 | 28 | /* 29 | * Do nothing. 30 | */ 31 | class ReformatRaw : public Reformat { 32 | public: 33 | ReformatRaw(void) {} 34 | virtual ~ReformatRaw(void) {} 35 | 36 | virtual void Examine(ReformatHolder* pHolder) override; 37 | virtual int Process(const ReformatHolder* pHolder, 38 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 39 | ReformatOutput* pOutput) override; 40 | }; 41 | 42 | /* 43 | * Reformat a block of data into a hex dump. 44 | */ 45 | class ReformatHexDump : public ReformatText { 46 | public: 47 | ReformatHexDump(void) {} 48 | virtual ~ReformatHexDump(void) {} 49 | 50 | virtual void Examine(ReformatHolder* pHolder) override; 51 | virtual int Process(const ReformatHolder* pHolder, 52 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 53 | ReformatOutput* pOutput) override; 54 | }; 55 | 56 | #endif /*REFORMAT_SIMPLE_H*/ 57 | -------------------------------------------------------------------------------- /reformat/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.cpp : source file that includes just the standard includes 7 | // reformat.pch will be the pre-compiled header 8 | // stdafx.obj will contain the pre-compiled type information 9 | 10 | #include "stdafx.h" 11 | -------------------------------------------------------------------------------- /reformat/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.h : include file for standard system include files, 7 | // or project specific include files that are used frequently, but 8 | // are changed infrequently 9 | // 10 | 11 | #if !defined(AFX_STDAFX_H__58591A00_B642_4F26_9051_CE5BF55AC103__INCLUDED_) 12 | #define AFX_STDAFX_H__58591A00_B642_4F26_9051_CE5BF55AC103__INCLUDED_ 13 | 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif // _MSC_VER > 1000 17 | 18 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 19 | 20 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 21 | 22 | #include "../app/targetver.h" 23 | 24 | #include 25 | #include 26 | #include 27 | #include // for some stuff in util lib 28 | #include 29 | #include 30 | #include 31 | 32 | #include "../util/UtilLib.h" 33 | 34 | //{{AFX_INSERT_LOCATION}} 35 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 36 | 37 | #endif // !defined(AFX_STDAFX_H__58591A00_B642_4F26_9051_CE5BF55AC103__INCLUDED_) 38 | -------------------------------------------------------------------------------- /reformat/Text8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2009 by Ciderpress authors. All Rights Reserved. 4 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 5 | * See the file LICENSE for distribution terms. 6 | */ 7 | /* 8 | * Reformat 8-bit word processor files. 9 | */ 10 | #ifndef REFORMAT_TEXT8_H 11 | #define REFORMAT_TEXT8_H 12 | 13 | #include "ReformatBase.h" 14 | 15 | /* 16 | * Magic Window / Magic Window II 17 | */ 18 | class ReformatMagicWindow : public ReformatText { 19 | public: 20 | ReformatMagicWindow(void) {} 21 | virtual ~ReformatMagicWindow(void) {} 22 | 23 | virtual void Examine(ReformatHolder* pHolder) override; 24 | virtual int Process(const ReformatHolder* pHolder, 25 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 26 | ReformatOutput* pOutput) override; 27 | 28 | private: 29 | static bool IsFormatted(const ReformatHolder* pHolder); 30 | 31 | enum { kHeaderLen = 256 }; 32 | }; 33 | 34 | /* 35 | * Gutenberg Word Processor 36 | */ 37 | class ReformatGutenberg : public ReformatText { 38 | public: 39 | ReformatGutenberg(void) {} 40 | virtual ~ReformatGutenberg(void) {} 41 | 42 | virtual void Examine(ReformatHolder* pHolder) override; 43 | virtual int Process(const ReformatHolder* pHolder, 44 | ReformatHolder::ReformatID id, ReformatHolder::ReformatPart part, 45 | ReformatOutput* pOutput) override; 46 | 47 | }; 48 | 49 | #endif /*REFORMAT_TEXT8_H*/ 50 | -------------------------------------------------------------------------------- /util/CancelDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Display a modeless dialog with a "cancel" button. 8 | * 9 | * The user of this class must define a dialog with at least an IDCANCEL 10 | * button. 11 | */ 12 | #ifndef UTIL_CANCELDIALOG_H 13 | #define UTIL_CANCELDIALOG_H 14 | 15 | /* 16 | * This class must be allocated on the heap. 17 | * 18 | * Create with the dialog ID, parent window, and a pointer to a boolean that 19 | * will be set to "true" if the user hits "cancel". 20 | * 21 | * [This should probably derive from ExclusiveModelessDialog, now that we have 22 | * that available. Need to go through and clean up all CancelDialog clients.] 23 | */ 24 | class CancelDialog : public ModelessDialog { 25 | public: 26 | CancelDialog(void) : fpCancelFlag(NULL) {} 27 | virtual ~CancelDialog(void) {} 28 | 29 | BOOL Create(bool* pCancelFlag, int dialogID, CWnd* pParentWnd = NULL) { 30 | fpCancelFlag = pCancelFlag; 31 | *fpCancelFlag = false; 32 | return ModelessDialog::Create(dialogID, pParentWnd); 33 | } 34 | 35 | protected: 36 | bool* fpCancelFlag; 37 | 38 | private: 39 | DECLARE_COPY_AND_OPEQ(CancelDialog) 40 | 41 | /* override Cancel button to just raise the flag */ 42 | virtual void OnCancel(void) override { 43 | /* "cancel" button or escape hit */ 44 | *fpCancelFlag = true; 45 | } 46 | //void PostNcDestroy(void) override { delete this; } 47 | 48 | }; 49 | 50 | #endif /*UTIL_CANCELDIALOG_H*/ 51 | -------------------------------------------------------------------------------- /util/FaddenStd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Standard stuff. 8 | */ 9 | #ifndef UTIL_FADDENSTD_H 10 | #define UTIL_FADDENSTD_H 11 | 12 | #define NELEM(x) (sizeof(x) / sizeof(x[0])) 13 | 14 | /* 15 | * Declare copy construction and operator=. Put this in a private section 16 | * of a class declaration to prevent objects from being copied. 17 | */ 18 | #define DECLARE_COPY_AND_OPEQ(_TYPE) \ 19 | _TYPE(const _TYPE&); \ 20 | _TYPE& operator= (const _TYPE&); 21 | 22 | #endif /*UTIL_FADDENSTD_H*/ 23 | -------------------------------------------------------------------------------- /util/MyBitmapButton.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Code for my buttons with bitmaps. 8 | */ 9 | #include "stdafx.h" 10 | #include "MyBitmapButton.h" 11 | 12 | 13 | BEGIN_MESSAGE_MAP(MyBitmapButton, CButton) 14 | ON_WM_SYSCOLORCHANGE() 15 | END_MESSAGE_MAP() 16 | 17 | 18 | BOOL MyBitmapButton::ReplaceDlgCtrl(CDialog* pDialog, int buttonID) 19 | { 20 | CWnd* pWnd = pDialog->GetDlgItem(buttonID); 21 | if (pWnd == NULL) 22 | return FALSE; 23 | 24 | #if 0 25 | DWORD styles = pWnd->GetStyle(); 26 | //DWORD stylesEx = pWnd->GetExStyle(); 27 | CString caption; 28 | CRect rect; 29 | pWnd->GetWindowText(caption); 30 | pWnd->GetWindowRect(&rect); 31 | pDialog->ScreenToClient(&rect); 32 | 33 | // pWnd->DestroyWindow(); 34 | if (Create(caption, styles, rect, pDialog, buttonID) == FALSE) { 35 | LOGI("ERROR: unable to replace dialog ctrl (buttonID=%d)", 36 | buttonID); 37 | return FALSE; 38 | } 39 | #endif 40 | 41 | /* latch on to their window handle */ 42 | Attach(pWnd->m_hWnd); 43 | 44 | return TRUE; 45 | } 46 | 47 | BOOL MyBitmapButton::SetBitmapID(int id) 48 | { 49 | fBitmapID = id; 50 | UpdateBitmap(); 51 | return TRUE; 52 | } 53 | 54 | void MyBitmapButton::UpdateBitmap(void) 55 | { 56 | HBITMAP hNewBits; 57 | 58 | if (fBitmapID == -1) { 59 | LOGE("ERROR: UpdateBitmap called before bitmap set"); 60 | ASSERT(false); 61 | return; 62 | } 63 | 64 | hNewBits = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), 65 | MAKEINTRESOURCE(fBitmapID), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS); 66 | if (hNewBits == NULL) { 67 | LOGW("WARNING: LoadImage failed (bitID=%d)", fBitmapID); 68 | ASSERT(false); 69 | return; 70 | } 71 | 72 | ASSERT(GetBitmap() == fhBitmap); 73 | 74 | ::DeleteObject(SetBitmap(hNewBits)); 75 | fhBitmap = hNewBits; 76 | } 77 | 78 | void MyBitmapButton::OnSysColorChange(void) 79 | { 80 | LOGD("MyBitmapButton 0x%p tracking color change", this); 81 | UpdateBitmap(); 82 | } 83 | -------------------------------------------------------------------------------- /util/MyBitmapButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * My BitmapButton class. 8 | * 9 | * An extension of CBitmap that updates the button's bitmap automatically when 10 | * the system colors change. Also handles installing itself into a dialog. 11 | */ 12 | #ifndef UTIL_MYBITMAPBUTTON_H 13 | #define UTIL_MYBITMAPBUTTON_H 14 | 15 | class MyBitmapButton : public CButton { 16 | public: 17 | MyBitmapButton(void) { 18 | fhBitmap = NULL; 19 | fBitmapID = -1; 20 | } 21 | virtual ~MyBitmapButton(void) { 22 | //LOGI("~MyBitmapButton()"); 23 | Detach(); // it's not really our window 24 | ::DeleteObject(fhBitmap); 25 | } 26 | 27 | /* don't allow creation of a window */ 28 | int Create(LPCTSTR, LPCTSTR, DWORD, const RECT&, CWnd*, UINT, CCreateContext*) { 29 | ASSERT(false); 30 | return FALSE; 31 | } 32 | int Create(LPCTSTR, DWORD, const RECT&, CWnd*, UINT) { 33 | ASSERT(false); 34 | return FALSE; 35 | } 36 | 37 | /* 38 | * Replace a button control in a dialog with ourselves. 39 | * 40 | * Returns TRUE on success, FALSE on failure. 41 | */ 42 | virtual BOOL ReplaceDlgCtrl(CDialog* pDialog, int buttonID); 43 | 44 | /* 45 | * Set the bitmap ID, and update the button appropriately. 46 | */ 47 | virtual BOOL SetBitmapID(int id); 48 | 49 | protected: 50 | /* 51 | * If the system colors have changed, reload the bitmap. 52 | */ 53 | afx_msg void OnSysColorChange(void); 54 | 55 | /* 56 | * (Re-)load the bitmap and attach it to the button. 57 | */ 58 | virtual void UpdateBitmap(void); 59 | 60 | private: 61 | DECLARE_COPY_AND_OPEQ(MyBitmapButton) 62 | 63 | HBITMAP fhBitmap; 64 | int fBitmapID; 65 | 66 | DECLARE_MESSAGE_MAP() 67 | }; 68 | 69 | #endif /*UTIL_MYBITMAPBUTTON_H*/ 70 | -------------------------------------------------------------------------------- /util/MyEdit.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Support for MyEdit class. 8 | */ 9 | #include "StdAfx.h" 10 | #include "MyEdit.h" 11 | 12 | //BEGIN_MESSAGE_MAP(MyBitmapButton, CButton) 13 | // ON_WM_SYSCOLORCHANGE() 14 | //END_MESSAGE_MAP() 15 | 16 | /* 17 | * Replace an edit control in a dialog with ourselves. 18 | * 19 | * Returns TRUE on success, FALSE on failure. 20 | */ 21 | BOOL MyEdit::ReplaceDlgCtrl(CDialog* pDialog, int editID) 22 | { 23 | CWnd* pWnd = pDialog->GetDlgItem(editID); 24 | if (pWnd == NULL) 25 | return FALSE; 26 | 27 | /* latch on to their window handle */ 28 | Attach(pWnd->m_hWnd); 29 | 30 | return TRUE; 31 | } 32 | 33 | /* 34 | * Set the properties that make us special. 35 | */ 36 | void MyEdit::SetProperties(int props) 37 | { 38 | fCapsOnly = (props & kCapsOnly) != 0; 39 | fHexOnly = (props & kHexOnly) != 0; 40 | fNoWhiteSpace = (props & kNoWhiteSpace) != 0; 41 | } 42 | 43 | /* 44 | * Special keypress handling. 45 | */ 46 | BOOL MyEdit::PreTranslateMessage(MSG* pMsg) 47 | { 48 | if (pMsg->message == WM_CHAR) { 49 | if (fCapsOnly) 50 | pMsg->wParam = toupper(pMsg->wParam); 51 | if (fNoWhiteSpace) { 52 | if (pMsg->wParam == ' ' || pMsg->wParam == '\t') 53 | return TRUE; // we handled it 54 | } 55 | if (fHexOnly) { 56 | if ((pMsg->wParam >= '0' && pMsg->wParam <= '9') || 57 | (pMsg->wParam >= 'a' && pMsg->wParam <= 'f') || 58 | (pMsg->wParam >= 'A' && pMsg->wParam <= 'F')) 59 | { 60 | /* good, keep going */ 61 | } else if ((pMsg->wParam >= 0x20 && pMsg->wParam < 0x7f) || 62 | (pMsg->wParam >= 0xa0 && pMsg->wParam <= 0xff)) 63 | { 64 | /* ignore this character */ 65 | return TRUE; // we handled it 66 | } 67 | /* else it's a backspace or DEL or something */ 68 | } 69 | } 70 | 71 | return CEdit::PreTranslateMessage(pMsg); 72 | } 73 | -------------------------------------------------------------------------------- /util/MyEdit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * My edit class. 8 | */ 9 | #ifndef UTIL_MYEDIT_H 10 | #define UTIL_MYEDIT_H 11 | 12 | /* 13 | * Replace the edit box in a dialog with this code by calling MyEdit's 14 | * ReplaceDlgCtrl(this, ID) from the dialog's OnInitDialog. This class will 15 | * take over support for that control. 16 | */ 17 | class MyEdit : public CEdit { 18 | public: 19 | MyEdit(void) { 20 | fCapsOnly = fHexOnly = fNoWhiteSpace = false; 21 | } 22 | virtual ~MyEdit(void) { 23 | Detach(); // it's not really our window 24 | } 25 | 26 | /* don't allow creation of a window */ 27 | int Create(LPCTSTR, LPCTSTR, DWORD, const RECT&, CWnd*, UINT, CCreateContext*) { 28 | ASSERT(false); 29 | return FALSE; 30 | } 31 | int Create(LPCTSTR, DWORD, const RECT&, CWnd*, UINT) { 32 | ASSERT(false); 33 | return FALSE; 34 | } 35 | 36 | enum { 37 | kCapsOnly = 0x01, 38 | kHexOnly = 0x02, 39 | kNoWhiteSpace = 0x04, 40 | }; 41 | 42 | virtual void SetProperties(int props); 43 | virtual BOOL ReplaceDlgCtrl(CDialog* pDialog, int editID); 44 | 45 | private: 46 | DECLARE_COPY_AND_OPEQ(MyEdit) 47 | 48 | virtual BOOL PreTranslateMessage(MSG* pMsg) override; 49 | 50 | bool fCapsOnly; 51 | bool fHexOnly; 52 | bool fNoWhiteSpace; 53 | 54 | //DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | #endif /*UTIL_MYEDIT_H*/ 58 | -------------------------------------------------------------------------------- /util/MySpinCtrl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Replacement spin control with extended range. Requires auto-buddy. 8 | * 9 | * This is based on code originally written by Definitive Solutions, Inc. 10 | * It was rewritten because their code was miserable. 11 | */ 12 | #ifndef UTIL_MYSPINCTRL_H 13 | #define UTIL_MYSPINCTRL_H 14 | 15 | #include // for CSpinButtonCtrl 16 | 17 | 18 | // Declare depending on whether this file is in an EXE or a DLL. 19 | class 20 | #ifdef _WINDLL 21 | AFX_EXT_CLASS 22 | #endif 23 | MySpinCtrl : public CSpinButtonCtrl 24 | { 25 | public: 26 | MySpinCtrl(void) : fLow(0), fHigh(100) {} 27 | virtual ~MySpinCtrl(void) {} 28 | 29 | // replacements for superclass methods (AFXCMN.H) 30 | int SetPos(int nPos); 31 | int GetPos() const; 32 | void SetRange(int nLower, int nUpper) { SetRange32(nLower, nUpper); } 33 | void SetRange32(int nLower, int nUpper); 34 | DWORD GetRange() const; // don't use this 35 | void GetRange(int &lower, int& upper) const { GetRange32(lower, upper); } 36 | void GetRange32(int &lower, int& upper) const; 37 | 38 | protected: 39 | //virtual void PreSubclassWindow(); 40 | afx_msg void OnDeltaPos(NMHDR* pNMHDR, LRESULT* pResult); 41 | 42 | private: 43 | DECLARE_COPY_AND_OPEQ(MySpinCtrl) 44 | 45 | int fLow, fHigh; 46 | 47 | /* 48 | * Convert a decimal or hex string to a long. 49 | * 50 | * Returns "true" on success, "false" on error. 51 | */ 52 | bool ConvLong(const WCHAR* str, long* pVal) const; 53 | 54 | DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | #endif /*UTIL_MYSPINCTRL_H*/ 58 | -------------------------------------------------------------------------------- /util/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.cpp : source file that includes just the standard includes 7 | // util.pch will be the pre-compiled header 8 | // stdafx.obj will contain the pre-compiled type information 9 | 10 | #include "stdafx.h" 11 | -------------------------------------------------------------------------------- /util/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | // stdafx.h : include file for standard system include files, 7 | // or project specific include files that are used frequently, but 8 | // are changed infrequently 9 | // 10 | 11 | #if !defined(AFX_STDAFX_H__A6080BE3_62A5_473B_899F_7C5F4B780299__INCLUDED_) 12 | #define AFX_STDAFX_H__A6080BE3_62A5_473B_899F_7C5F4B780299__INCLUDED_ 13 | 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif // _MSC_VER > 1000 17 | 18 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 19 | 20 | #include "../app/targetver.h" 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | // TODO: reference additional headers your program requires here 34 | #include "FaddenStd.h" 35 | #include "MyDebug.h" 36 | 37 | //{{AFX_INSERT_LOCATION}} 38 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 39 | 40 | #endif // !defined(AFX_STDAFX_H__A6080BE3_62A5_473B_899F_7C5F4B780299__INCLUDED_) 41 | -------------------------------------------------------------------------------- /util/UtilLib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CiderPress 3 | * Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved. 4 | * See the file LICENSE for distribution terms. 5 | */ 6 | /* 7 | * Include this to get headers for all contents of utility library. 8 | */ 9 | #ifndef UTIL_LIB_H 10 | #define UTIL_LIB_H 11 | 12 | #include "FaddenStd.h" 13 | #include "MyDebug.h" 14 | 15 | #include "Util.h" 16 | #include "ImageDataObject.h" 17 | #include "MyBitmapButton.h" 18 | #include "MyDIBitmap.h" 19 | #include "MyEdit.h" 20 | #include "MySpinCtrl.h" 21 | #include "PathName.h" 22 | #include "Pidl.h" 23 | #include "SelectFilesDialog.h" 24 | #include "SoundFile.h" 25 | 26 | #include "Modeless.h" 27 | #include "CancelDialog.h" 28 | #include "ProgressCancelDialog.h" 29 | 30 | #endif /*UTIL_LIB_H*/ 31 | -------------------------------------------------------------------------------- /zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fadden/ciderpress/fc2fc1429df0a099692d9393d214bd6010062b1a/zlib/ChangeLog -------------------------------------------------------------------------------- /zlib/INDEX: -------------------------------------------------------------------------------- 1 | CMakeLists.txt cmake build file 2 | ChangeLog history of changes 3 | FAQ Frequently Asked Questions about zlib 4 | INDEX this file 5 | Makefile dummy Makefile that tells you to ./configure 6 | Makefile.in template for Unix Makefile 7 | README guess what 8 | configure configure script for Unix 9 | make_vms.com makefile for VMS 10 | test/example.c zlib usages examples for build testing 11 | test/minigzip.c minimal gzip-like functionality for build testing 12 | test/infcover.c inf*.c code coverage for build coverage testing 13 | treebuild.xml XML description of source file dependencies 14 | zconf.h.cmakein zconf.h template for cmake 15 | zconf.h.in zconf.h template for configure 16 | zlib.3 Man page for zlib 17 | zlib.3.pdf Man page in PDF format 18 | zlib.map Linux symbol information 19 | zlib.pc.in Template for pkg-config descriptor 20 | zlib.pc.cmakein zlib.pc template for cmake 21 | zlib2ansi perl script to convert source files for C++ compilation 22 | 23 | amiga/ makefiles for Amiga SAS C 24 | as400/ makefiles for AS/400 25 | doc/ documentation for formats and algorithms 26 | msdos/ makefiles for MSDOS 27 | nintendods/ makefile for Nintendo DS 28 | old/ makefiles for various architectures and zlib documentation 29 | files that have not yet been updated for zlib 1.2.x 30 | qnx/ makefiles for QNX 31 | watcom/ makefiles for OpenWatcom 32 | win32/ makefiles for Windows 33 | 34 | zlib public header files (required for library use): 35 | zconf.h 36 | zlib.h 37 | 38 | private source files used to build the zlib library: 39 | adler32.c 40 | compress.c 41 | crc32.c 42 | crc32.h 43 | deflate.c 44 | deflate.h 45 | gzclose.c 46 | gzguts.h 47 | gzlib.c 48 | gzread.c 49 | gzwrite.c 50 | infback.c 51 | inffast.c 52 | inffast.h 53 | inffixed.h 54 | inflate.c 55 | inflate.h 56 | inftrees.c 57 | inftrees.h 58 | trees.c 59 | trees.h 60 | uncompr.c 61 | zutil.c 62 | zutil.h 63 | 64 | source files for sample programs 65 | See examples/README.examples 66 | 67 | unsupported contributions by third parties 68 | See contrib/README.contrib 69 | -------------------------------------------------------------------------------- /zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (z_const Bytef *)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | --------------------------------------------------------------------------------