# NuLib Home Page

Shortcuts
go to the downloads area
read the NuLib2 manual
see the NufxLib library API documentation
report a bug in NufxLib or NuLib2
check the library for old programs and misc docs

This is the home page for NuLib, NuLib2, NufxLib, and various items related to ShrinkIt and NuFX archives.

## What is NuLib?

NuLib is a disk and file archive program, similar in principle to PKZIP. Instead of ZIP archives, it manipulates NuFX archives, which are usually identified with ".SHK", ".SDK", or ".BXY".

The ".SHK" file extension is derived from ShrinkIt, the de facto archiving standard for Apple II computers. Both NuFX and ShrinkIt were developed by Andy Nicholas, and were initially released in January of 1989.

In mid-1989, while a sophomore in college, I started playing around with the file format. My goal was to write a simple program that could list the contents of a NuFX file. I had recently finished my first class on C programming, and wanted a small project to play around with. I never intended to go any further with it than just being able to list files.

Three name changes (NuView to NuARC to CShrink to NuLib) and more than three years later, NuLib was a full-featured archiver, and the code had finally settled down to where it could be left alone. Except for a major overhaul by Devin Reade in late 1996, NuLib hasn't changed much since.

## What is NuLib2?

NuLib was functional, but had a number of flaws. It couldn't handle resource forks, it was clumsy to use with BXY (ShrinkIt wrapped in Binary II) archives, it used more memory than it needed to, and some features -- notably the archive integrity test -- were entirely broken. Due to generally poor architecture, it was difficult to fix problems and add features.

NuLib2 is a replacement for NuLib. It does pretty much everything the original NuLib did, and adds a number of new features. NuLib2 is distributed as source code, under the terms of the BSD License.

The NuLib2 manual has a quick comparison of the two programs.

One additional "feature" of NuLib2: it was built on top of NufxLib.

## What is NufxLib?

NufxLib is a NuFX file archive manipulation library. Unlike most other compression library products, NufxLib goes beyond extracting and listing files. Full support for additions, deletions, and renaming of archived files is supported, with a transaction-oriented interface for maximum efficiency and reliability.

A thorough description of the library's features and interface is available here. NufxLib is distributed as source code under the terms of the BSD License.

Possible uses for NufxLib:

- Command-line applications like NuLib2.
- GUI applications like CiderPress, which can isolate ShrinkIt code in a DLL.
- Automatic handling of .SHK archives in Apple II emulators and 2IMG converters.
- Possible inclusion of NuFX support in mainstream applications like WinZip.
- Embedded applications, such as a filesystem driver that transparently unpacks NuFX archives (a la "zipfolders").

## Why did I do this?

In late 1997, I cranked up my Apple IIgs for the first time in a long while. It failed to boot. The old 100MB hard drive had seized up from "stiction". A friend of mine and I managed to resurrect that drive and a second 80MB hard drive that had also seized up, but it was clear the drives' days were numbered.

I replaced the old ones with a new 2GB drive, which was the smallest I could find in retail stores at the time. It occurred to me then that it would be useful, as well as prudent, to have a complete file archive of the contents of my hard drive. GS/ShrinkIt was capable of constructing such a thing, but couldn't extract from it because the archive was too large. YankIt and NuLib could do the extraction, but were too clumsy to be useful.

I resolved to write a program that could handle these archives. I thought it would be best to write it as a Win32 GUI application. However, I also wanted a better version of NuLib for UNIX. The NuLib sources are a pile of dung, so adding the features I wanted would be most easily accomplished by rewriting the whole thing from scratch.

Around the middle of 1998, I started fleshing out the API for something I called "NufxLib". The library would do all the hard work for both command line and GUI applications, and perhaps would be embedded into Apple II emulators as well, allowing seamless access to ShrinkIt-compressed disk images.

For the next 1.5 years, I would occasionally pick up the project and then leave it alone for weeks at a time. This continued until I left a big company for a small startup, and knew that my free time was about to evaporate entirely. I decided to finish up what I could and make it available. Version 1.0 was released in May of 2000.

In December of 2002, I decided it was time to learn how to write Windows software. Learning a new system is easier when you're working with something you know, so I decided to use NufxLib as the foundation of a Win32 application. The result, CiderPress, is available from github.

## Visible Changes in v1.1

New stuff in NufxLib v1.1:

- Support for SQueeze and LZC compression. NufxLib now fully supports all compression formats described in the NuFX specification.
- Support for zlib "deflate" compression and libbz2 BWT compression as extensions to the NuFX standard.
- Compression code may be disabled to reduce the size of the library. A new "feature test" interface allows applications to determine which methods are supported.
- The "launder" program has been updated to allow selection of the compression format to convert to. ("Launder" converts all files and disks in an archive from one compression format to another.)

New stuff in NuLib2 v1.1:

- Support for listing, testing, and extracting files from Binary II archives.
- New "-z" flag to use "deflate" or "bzip2".
- Extended help output with "-h" command.

## Visible Changes in v2.0

Version 2.0 is actually a rather small release. Some changes in NufxLib broke binary compatibility, so it was necessary to increment the major version.

New stuff in NufxLib v2.0:

- Can be built as a Windows DLL.
- NufxLib no longer tries to free memory allocated by the application (a callback is used instead).
- A high-ASCII text stripper is now available (useful for DOS text files and Merlin 8 source code).

New stuff in NuLib2 v2.0:

- Filename comparisons are now case-insensitive.
- Can be built with NufxLib in a DLL.
- Changed handling of reserved names like "AUX" so that the original names are better preserved. This creates filenames with "%00" in them, which could confuse older versions of NuLib2 (e.g. "nulib2 -ae %00aux" will not work well in v1.x).
- Files are now added with ':' as the pathname separator, regardless of OS. Win32 handling now recognizes both '/' and '\' as path separators.
- Disk images extracted with "-ee" now have ".PO" add to their filenames. This should make it easier to load them in an Apple II emulator.

## Visible Changes in v3.0

Version 3.0 was primarily a code refresh, updating the code for about 8 years of progress in compilers and operating systems. The Windows and Mac OS X builds were fixed, and proper handling of Mac OS Roman filenames was added to Linux and Mac OS X. The version was bumped because of possibly incompatible API changes.

A new test, "test-names", was added to check Unicode filename handling.

## Future Directions

The code appears to be stable, so I'm going to leave it alone for a while. If you're interested in developing applications with NufxLib, send a message to fadden -at- fadden.com.

NuLib, NuLib2, and NufxLib were written by Andy McFadden. Please see the documentation for each product to see a list of contributors.