Path: utzoo!utgpu!watserv1!watmath!att!linac!uwm.edu!cs.utexas.edu!usc!orion.oac.uci.edu!ucivax!dhw68k!macintosh From: np@doc.imperial.ac.uk (Nigel Perry) Newsgroups: comp.sources.mac Subject: AufsTools (part 1 of 4) Message-ID: Date: 20 Feb 91 18:07:23 GMT Organization: Department of Computing, Imperial College, London Lines: 2111 Approved: bytebug@dhw68k.cts.com (Roger L. Long) [AufsTools - part 1 of 4] This package contains programs for use by users of the CAP aufs system. Programs are provided to convert downloads direct into aufs files, handle StuffIt archives and manage aufs files. Most programs are modified versions of exisiting public domain utilites. To build just run make: Enjoy. -- Nigel Perry Department of Computing Imperial College Janet: np@uk.ac.ic.doc London ARPA: np%uk.ac.ic.doc@ucl-cs SW7 Uucp: np@icdoc.UUCP, ukc!icdoc!np England --- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'MANIFEST' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X MANIFEST 1 This shipping list X Makefile 1 X ReadMe 1 X aufslib 1 X binhex 1 X binhex/8to6.c 1 X binhex/Makefile 1 X binhex/aufs.h 1 X binhex/binhex.1 1 X binhex/binhex.c 1 X binhex/crc.c 1 X binhex/gethead.c 1 X binhex/run.c 1 X capit 1 X capit/Makefile 1 X capit/capit.1 1 X capit/capit.c 2 X formatted 1 X formatted/makeman 1 X man 1 X man/cleanup.1 1 X man/drag.1 1 X man/dup.1 1 X man/m2u.1 1 X man/macp.1 1 X man/newfolder.1 1 X man/toaufs.1 1 X man/trash.1 1 X mcvert 1 X mcvert/Makefile 1 X mcvert/hqxify.c 3 X mcvert/mactypes.h 2 X mcvert/mcvert.1 2 X mcvert/mcvert.c 3 X mcvert/unpack.c 2 X shell 1 X shell/cleanup 1 X shell/drag 1 X shell/dup 1 X shell/m2u 1 X shell/macp 1 X shell/newfolder 1 X shell/toaufs 1 X shell/trash 1 X shell/u2m 1 X stuffit 1 X stuffit/Makefile 1 X stuffit/sit.1 1 X stuffit/sit.c 3 X stuffit/sit.h 1 X stuffit/updcrc.c 2 X unstuffit 1 X unstuffit/Makefile 1 X unstuffit/getopt.c 1 X unstuffit/stuffit.h 1 X unstuffit/unsit.1 1 X unstuffit/unsit.c 4 X unstuffit/unstuffit.1 1 X unstuffit/updcrc.c 2 END_OF_FILE if test 1943 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(746 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' XBIN = aufslib X Xbin: X (cd stuffit; make) X (cd unstuffit; make) X (cd binhex; make) X (cd mcvert; make) X (cd capit; make) X Xinstall: bin X mv stuffit/stuffit $(BIN); strip $(BIN)/stuffit X mv stuffit/sit $(BIN); strip $(BIN)/sit X mv unstuffit/unstuffit $(BIN); strip $(BIN)/unstuffit X mv unstuffit/unsit $(BIN); strip $(BIN)/unsit X mv mcvert/mcvert $(BIN); strip $(BIN)/mcvert X mv capit/capit $(BIN); strip $(BIN)/capit X mv binhex/binhex $(BIN); strip $(BIN)/binhex X mv binhex/unxbin $(BIN); strip $(BIN)/unxbin X cp shell/* $(BIN) X Xclean: X (cd stuffit; make clean) X (cd unstuffit; make clean) X (cd binhex; make clean) X (cd mcvert; make clean) X (cd capit; make clean) X Xreallyclean: clean X rm -f formatted/*.1 aufslib/* X Xformat: X (cd formatted; makeman) END_OF_FILE if test 746 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi # end of 'Makefile' fi if test -f 'ReadMe' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'ReadMe'\" else echo shar: Extracting \"'ReadMe'\" \(734 characters\) sed "s/^X//" >'ReadMe' <<'END_OF_FILE' XPublic Domain Aufs Tools Package X================================ X XNigel Perry, Dec 90. X XThis package contains programs for use by users of the CAP aufs system. XPrograms are provided to convert downloads direct into aufs files, handle XStuffIt archives and manage aufs files. Most programs are modified versions Xof exisiting public domain utilites. To build just run make: X X make X builds binaries in their own directories X make install X builds binaries & moves them to $(BIN), default X ./aufslib. Also copies shell scripts to $(BIN). X make format X builds formatted versions of all the manual pages X in the directory formatted. X make clean X cleans up .o files etc. X make reallyclean X as clean + wipes aufslib & formatted X XEnjoy. END_OF_FILE if test 734 -ne `wc -c <'ReadMe'`; then echo shar: \"'ReadMe'\" unpacked with wrong size! fi # end of 'ReadMe' fi if test ! -d 'aufslib' ; then echo shar: Creating directory \"'aufslib'\" mkdir 'aufslib' fi if test ! -d 'binhex' ; then echo shar: Creating directory \"'binhex'\" mkdir 'binhex' fi if test -f 'binhex/8to6.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/8to6.c'\" else echo shar: Extracting \"'binhex/8to6.c'\" \(1248 characters\) sed "s/^X//" >'binhex/8to6.c' <<'END_OF_FILE' X/* X * convert 8 bit data stream into 6 bit data stream X * X * David Gentzel, Lexeme Corporation X */ X X#include X X#define MAXLINELEN 62 X Xstatic Xchar tr[]="!\"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr"; X X/* X * Output a character to the current output file converting from 8 bit to 6 bit X * representation. When called with EOF, flush all pending output. X */ Xvoid putchar_6(c) Xint c; X{ X static unsigned char buf[3]; X static unsigned int num_bytes = 0; X static count = 1; /* # of characters on current line */ X /* start at 1 to include colon */ X X if (c == EOF) /* flush buffer on EOF */ X { X while (num_bytes != 0) X putchar_6(0); X count = 1; /* for next file */ X return; X } X X buf[num_bytes++] = c; X if (num_bytes == 3) X { X X num_bytes = 0; X putchar(tr[buf[0] >> 2]); X if (count++ > MAXLINELEN) X { X count = 0; X putchar('\n'); X } X putchar(tr[((buf[0] & 0x03) << 4) | (buf[1] >> 4)]); X if (count++ > MAXLINELEN) X { X count = 0; X putchar('\n'); X } X putchar(tr[((buf[1] & 0x0F) << 2) | (buf[2] >> 6)]); X if (count++ > MAXLINELEN) X { X count = 0; X putchar('\n'); X } X putchar(tr[buf[2] & 0x3F]); X if (count++ > MAXLINELEN) X { X count = 0; X putchar('\n'); X } X } X} END_OF_FILE if test 1248 -ne `wc -c <'binhex/8to6.c'`; then echo shar: \"'binhex/8to6.c'\" unpacked with wrong size! fi # end of 'binhex/8to6.c' fi if test -f 'binhex/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/Makefile'\" else echo shar: Extracting \"'binhex/Makefile'\" \(368 characters\) sed "s/^X//" >'binhex/Makefile' <<'END_OF_FILE' XCFLAGS= -O -Dstrrchr=rindex XLFLAGS= XCFILES= binhex.c gethead.c crc.c run.c 8to6.c XOFILES= binhex.o gethead.o crc.o run.o 8to6.o X Xunxbin : binhex X rm -f unxbin X ln binhex unxbin X Xbinhex: $(OFILES) X cc -o binhex $(OFILES) X Xbinhex.o: Makefile Xgethead.o: Makefile X Xdebug: X cc -o binhexd -g $(CFILES) X Xlint: X lint $(LFLAGS) $(CFILES) X Xclean: X rm -f binhex unxbin $(OFILES) END_OF_FILE if test 368 -ne `wc -c <'binhex/Makefile'`; then echo shar: \"'binhex/Makefile'\" unpacked with wrong size! fi # end of 'binhex/Makefile' fi if test -f 'binhex/aufs.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/aufs.h'\" else echo shar: Extracting \"'binhex/aufs.h'\" \(4134 characters\) sed "s/^X//" >'binhex/aufs.h' <<'END_OF_FILE' X/********************************************************************************/ X/* added for aufs, nicked from various places... */ X X/* following from mcvert program */ X X/* Useful, though not particularly Mac related, values */ Xtypedef unsigned char byte; /* one byte, obviously */ Xtypedef unsigned short word; /* must be 2 bytes */ Xtypedef unsigned long ulong; /* 4 bytes */ X X#define NAMELEN 63 /* maximum legal Mac file name length */ X X/* Format of a bin file: XA bin file is composed of 128 byte blocks. The first block is the Xinfo_header (see below). Then comes the data fork, null padded to fill the Xlast block. Then comes the resource fork, padded to fill the last block. A Xproposal to follow with the text of the Get Info box has not been implemented, Xto the best of my knowledge. Version, zero1 and zero2 are what the receiving Xprogram looks at to determine if a MacBinary transfer is being initiated. X*/ Xtypedef struct { /* info file header (128 bytes). Unfortunately, these X longs don't align to word boundaries */ X byte version; /* there is only a version 0 at this time */ X byte nlen; /* Length of filename. */ X byte name[NAMELEN]; /* Filename (only 1st nlen are significant)*/ X byte type[4]; /* File type. */ X byte auth[4]; /* File creator. */ X byte flags; /* file flags: LkIvBnSyBzByChIt */ X byte zero1; /* Locked, Invisible,Bundle, System */ X /* Bozo, Busy, Changed, Init */ X byte icon_vert[2]; /* Vertical icon position within window */ X byte icon_horiz[2]; /* Horizontal icon postion in window */ X byte window_id[2]; /* Window or folder ID. */ X byte protect; /* = 1 for protected file, 0 otherwise */ X byte zero2; X byte dflen[4]; /* Data Fork length (bytes) - most sig. */ X byte rflen[4]; /* Resource Fork length byte first */ X byte cdate[4]; /* File's creation date. */ X byte mdate[4]; /* File's "last modified" date. */ X byte ilen[2]; /* GetInfo message length */ X byte flags2; /* Finder flags, bits 0-7 */ X byte unused[14]; X byte packlen[4]; /* length of total files when unpacked */ X byte headlen[2]; /* length of secondary header */ X byte uploadvers; /* Version of MacBinary II that the uploading program is written for */ X byte readvers; /* Minimum MacBinary II version needed to read this file */ X byte crc[2]; /* CRC of the previous 124 bytes */ X byte padding[2]; /* two trailing unused bytes */ X } info_header; X X/* end of mcvert stuff */ X/* from CAP aufs documentation */ X X#define FINFOLEN 32 X#define MAXCLEN 199 Xtypedef struct X{ /* byte fi_fndr[FINFOLEN]; */ /* finder info */ X /* what I think the above is... */ X ulong fndr_type, fndr_creator; X word fndr_flags; X ulong fndr_loc; X word fndr_fldr; X word fndr_icon; X byte fndr_unused[8]; X word fndr_comment; X ulong fndr_putaway; X /* end of fi_fndr */ X X word fi_attr; /* attributes */ X#define FI_MAGIC1 255 X byte fi_magic1; /* was: length of comment */ X#define FI_VERSION 0x10 /* version major 1, minor 0 */ X /* if more than 8 versions then */ X /* something wrong anyway */ X byte fi_version; /* version number */ X#define FI_MAGIC 0xda X byte fi_magic; /* magic word check */ X byte fi_bitmap; /* bitmap of included info */ X#define FI_BM_SHORTFILENAME 0x1 /* is this included? */ X#define FI_BM_MACINTOSHFILENAME 0x2 /* is this included? */ X byte fi_shortfilename[12+1]; /* possible short file name */ X byte fi_macfilename[32+1]; /* possible macintosh file name */ X byte fi_comln; /* comment length */ X byte fi_comnt[MAXCLEN+1]; /* comment string */ X} FinderInfo; X X/* end aufs */ X/********************************************************************************/ END_OF_FILE if test 4134 -ne `wc -c <'binhex/aufs.h'`; then echo shar: \"'binhex/aufs.h'\" unpacked with wrong size! fi # end of 'binhex/aufs.h' fi if test -f 'binhex/binhex.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/binhex.1'\" else echo shar: Extracting \"'binhex/binhex.1'\" \(524 characters\) sed "s/^X//" >'binhex/binhex.1' <<'END_OF_FILE' X.TH BINHEX L "December 1990" X.UC X.SH NAME Xbinhex \- convert CAP aufs file(s) to Binhex 4.0 Unix file(s) Xunxbin \- ditto but for *.{rsrc,data,info} format files X.SH SYNOPSIS X.B binhex Xfile(s) X.br X.B unxbin Xfile(s) X.br X.SH DESCRIPTION X.I Binhex Xconverts CAP aufs file(s) to BinHex 4.0 format and stores them Xas Unix text (i.e. using Unix LF not Mac CR). X.I Unxbin Xdoes the same but for *.{rsrc,data,info} format files. X.SH AUTHORS Xbinhex: Nigel Perry (np@doc.ic.ac.uk), based on X.br Xunxbin: David Gentzel, Lexeme Corporation X END_OF_FILE if test 524 -ne `wc -c <'binhex/binhex.1'`; then echo shar: \"'binhex/binhex.1'\" unpacked with wrong size! fi # end of 'binhex/binhex.1' fi if test -f 'binhex/binhex.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/binhex.c'\" else echo shar: Extracting \"'binhex/binhex.c'\" \(4441 characters\) sed "s/^X//" >'binhex/binhex.c' <<'END_OF_FILE' X/* X * binhex -- binhex aufs files X * X * if called binhex handles aufs files, if called unxbin handles *.{rsrc,data,info} files X * will process multiple files X * X * Nigel Perry, Aug 90, np@doc.ic.ac.uk X * X * This is a hacked version of... X * X * unxbin -- convert files generated by xbin or macget into BinHex 4.0 format. X * X * David Gentzel, Lexeme Corporation X * X * (c) 1985 David Gentzel X * may be used but not sold without permission X * X * This is based on a Unix(tm) program with the same name and function written X * by ????. Original was a series of small programs (8to6, crc, etc.) piped X * together and run by a shell script. I completely rewrote the system as a X * C program (speeding it up considerably, needless to say), added run-length X * compression, and bullet-proofed (at least partly) the thing. Unfortunately, X * I have lost the name of the original poster (to net.sources.mac) without X * whom this would never have appeared. X * X * created dbg 09/10/85 -- Version 1.0 X */ X X#include X#include "aufs.h" X X#ifdef VMS X# define PROGRAMNAME "unxbin" X# define EXIT_ERROR ((1 << 28) | 2) X# ifndef MAXNAMLEN X# define MAXNAMLEN 127 X# define MAXBASENAME 63 X# endif X#else X# include X# include X# define PROGRAMNAME (argv[0]) X# define AUFSNAME "binhex" X# define EXIT_ERROR 1 X# ifndef MAXNAMLEN X# ifdef DIRSIZ X# define MAXNAMLEN DIRSIZ X# else X# define MAXNAMLEN 14 X# endif X# endif X# define MAXBASENAME (MAXNAMLEN - 2) X#endif X Xextern char *sprintf(), *strrchr(); Xextern void aufs_gethead(), gethead(), fakehead(), make_buffer_crc(), make_file_crc(), X putchar_run(); X Xmain(argc, argv) Xint argc; Xregister char *argv[]; X{ X register FILE *rsrc, *data, *info; X char fbuf[256], infobuf[128]; X register char *file; X int aufs; X int i; X FinderInfo fndr_info; X X aufs = strcmp(PROGRAMNAME, AUFSNAME) == 0; X X if (argc < 2) X { X fprintf(stderr, "Usage: %s file(s)\n", PROGRAMNAME); X exit(EXIT_ERROR); X } X X for(i = 1; i < argc; i++) X { X#ifdef VMS X if ((file = strrchr(argv[i], ']')) == NULL) X file = strrchr(argv[i], ':'); X#else X file = strrchr(argv[i], '/'); X#endif X if (file) X file++; X else X file = argv[i]; X if (strlen(file) > MAXBASENAME) X file[MAXBASENAME] = '\0'; X file = argv[i]; X (void) sprintf(fbuf, aufs ? ".resource/%s" : "%s.rsrc", file); X fbuf[MAXNAMLEN] = '\0'; X rsrc = fopen(fbuf, "r"); X (void) sprintf(fbuf, aufs ? "%s" : "%s.data", file); X fbuf[MAXNAMLEN] = '\0'; X data = fopen(fbuf, "r"); X if (rsrc == NULL && data == NULL) X { X fprintf(stderr, "No resource or data forks for %s\n", argv[i]); X exit(EXIT_ERROR); X } X if (rsrc == NULL) X fprintf(stderr, "Warning: no resource file %s\n", fbuf); X if (data == NULL) X fprintf(stderr, "Warning: no data file %s\n", fbuf); X (void) sprintf(fbuf, aufs ? ".finderinfo/%s" : "%s.info", file); X fbuf[MAXNAMLEN] = '\0'; X info = fopen(fbuf, "r"); X if (info == NULL) X fprintf(stderr, "Warning: no info file %s\n", fbuf); X X if(aufs) X { /* make the .finderinfo file */ X FILE *oinfo; X X sprintf(fbuf, ".finderinfo/%s.Hqx", file); X if((oinfo = fopen(fbuf, "w")) == NULL) X { perror(fbuf); X exit(1); X } X bzero(&fndr_info, sizeof(FinderInfo)); X bcopy("TEXT", &fndr_info.fndr_type, 4); X bcopy("BnHq", &fndr_info.fndr_creator, 4); X fndr_info.fi_magic1 = FI_MAGIC1; X fndr_info.fi_version = FI_VERSION; X fndr_info.fi_magic = FI_MAGIC; X fndr_info.fi_bitmap = FI_BM_MACINTOSHFILENAME; X strcpy(fndr_info.fi_macfilename, file); X fwrite(&fndr_info, sizeof(FinderInfo), 1, oinfo); X fclose(oinfo); X } X X (void) sprintf(fbuf, "%s.Hqx", file); X fbuf[MAXNAMLEN] = '\0'; X if (freopen(fbuf, "w", stdout) == NULL) X { X fputs("Couldn't open output file.\n", stderr); X exit(EXIT_ERROR); X } X fputs("(This file must be converted with BinHex 4.0)\n:", stdout); X if (info != NULL) X { if(aufs) X { (void) fread(&fndr_info, sizeof(FinderInfo), 1, info); X (void) fclose(info); X aufs_gethead(&fndr_info, data, rsrc, infobuf); X } X else X { (void) fread(fbuf, 128, 1, info); X (void) fclose(info); X gethead(fbuf, infobuf); X } X } X else X fakehead(file, rsrc, data, infobuf); X make_buffer_crc(infobuf, 20 + infobuf[0]); X make_file_crc(data); X if (data != NULL) X (void) fclose(data); X make_file_crc(rsrc); X if (rsrc != NULL) X (void) fclose(rsrc); X putchar_run(EOF); X puts(":"); X } X (void) fclose(stdout); X} END_OF_FILE if test 4441 -ne `wc -c <'binhex/binhex.c'`; then echo shar: \"'binhex/binhex.c'\" unpacked with wrong size! fi # end of 'binhex/binhex.c' fi if test -f 'binhex/crc.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/crc.c'\" else echo shar: Extracting \"'binhex/crc.c'\" \(1488 characters\) sed "s/^X//" >'binhex/crc.c' <<'END_OF_FILE' X/* X * compute the crc used in .hqx files for unxbin X * X * David Gentzel, Lexeme Corporation X * X * Based on crc code in xbin.c by Darin Adler of TMQ Software. X */ X X#include X X#define BYTEMASK 0xFF X#define WORDMASK 0xFFFF X#define WORDBIT 0x10000 X X#define CRCCONSTANT 0x1021 X Xstatic unsigned int crc; X Xextern void putchar_run(); X X/* X * Update the crc. X */ Xstatic void docrc(c) Xregister unsigned int c; X{ X register int i; X register unsigned long temp = crc; X X for (i = 0; i < 8; i++) X { X c <<= 1; X if ((temp <<= 1) & WORDBIT) X temp = (temp & WORDMASK) ^ CRCCONSTANT; X temp ^= (c >> 8); X c &= BYTEMASK; X } X crc = temp; X} X X/* X * Copy all characters from file in to the current output file computing a crc X * as we go. Append 2 byte crc to the output. in may be NULL (empty file). X */ Xvoid make_file_crc(in) Xregister FILE *in; X{ X register int c; X X crc = 0; X if (in != NULL) X while ((c = getc(in)) != EOF) X { X putchar_run(c); X docrc(c); X } X docrc(0); X docrc(0); X putchar_run((crc >> 8) & BYTEMASK); X putchar_run(crc & BYTEMASK); X} X X/* X * Copy count characters from buffer in to the current output file computing a X * crc as we go. Append 2 byte crc to the output. X */ Xvoid make_buffer_crc(in, count) Xregister unsigned char *in; Xregister int count; X{ X crc = 0; X while (count--) X { X putchar_run(*in); X docrc(*in++); X } X docrc(0); X docrc(0); X putchar_run((crc >> 8) & BYTEMASK); X putchar_run(crc & BYTEMASK); X} END_OF_FILE if test 1488 -ne `wc -c <'binhex/crc.c'`; then echo shar: \"'binhex/crc.c'\" unpacked with wrong size! fi # end of 'binhex/crc.c' fi if test -f 'binhex/gethead.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/gethead.c'\" else echo shar: Extracting \"'binhex/gethead.c'\" \(4043 characters\) sed "s/^X//" >'binhex/gethead.c' <<'END_OF_FILE' X/* X * Change a .info file into a proper header for a .hqx file X * X * David Gentzel, Lexeme Corporation X * X * Based on code written by ????. X */ X X#include X#ifdef VMS X# include X# include X#else X# include X# include X#endif X X#include "aufs.h" X X#define NAMEBYTES 63 X#define H_NLENOFF 1 X#define H_NAMEOFF 2 X X/* 65 <-> 80 is the FInfo structure */ X#define H_TYPEOFF 65 X#define H_AUTHOFF 69 X#define H_FLAGOFF 73 X X#define H_LOCKOFF 81 X#define H_DLENOFF 83 X#define H_RLENOFF 87 X#define H_CTIMOFF 91 X#define H_MTIMOFF 95 X X/* Append cnt bytes to the output buffer starting at head[offset]. */ X#define put(cnt, offset) \ X{ \ X register char *a = &head[(int) offset]; \ X register int b = (int) (cnt); \ X \ X while (b--) \ X *out++ = *a++; \ X} X X/* Append cnt bytes to the output buffer starting at string. */ X#define put2(cnt, string) \ X{ \ X register int b = (int) (cnt); \ X register char *a = (char *) (string); \ X \ X while (b--) \ X *out++ = *a++; \ X} X X/* Append cnt bytes to the output buffer starting at string + (cnt - 1) and X working backwards. */ X#define put2rev(cnt, string) \ X{ \ X register int b = (int) (cnt); \ X register char *a = (char *) (string) + b; \ X \ X while (b--) \ X *out++ = *--a; \ X} X X/* Build a usable header out of the .info information. head is the text from X the .info file, out is an output buffer. */ Xvoid gethead(head, out) Xregister char *head, *out; X{ X put(1, H_NLENOFF); /* Name length */ X put(head[1], H_NAMEOFF); /* Name */ X put(1, 0); /* NULL */ X put(4, H_TYPEOFF); /* Type */ X put(4, H_AUTHOFF); /* Author */ X put(2, H_FLAGOFF); /* Flags */ X put(4, H_DLENOFF); /* Data length */ X put(4, H_RLENOFF); /* Resource length */ X} X X/* Build a usable header out of the .finderinfo information. X out is an output buffer. */ Xvoid aufs_gethead(info, data, rsrc, out) Xregister char *out; Xregister FinderInfo *info; XFILE *data, *rsrc; X{ register int len; X long rlen, dlen; X struct stat st; X X if(info->fi_bitmap & FI_BM_MACINTOSHFILENAME) X { len = strlen(info->fi_macfilename); X *out++ = (char)len; X put2(len+1, info->fi_macfilename); X } X else X { len = strlen(info->fi_shortfilename); X *out++ = (char)len; X put2(len+1, info->fi_shortfilename); X } X put2(4, &info->fndr_type); /* Type */ X put2(4, &info->fndr_creator); /* Author */ X put2(2, &info->fndr_flags); /* Flags */ X X if (rsrc != NULL) X { X (void) fstat(fileno(rsrc), &st); X rlen = (long) st.st_size; X } X else X rlen = 0L; X if (data != NULL) X { X (void) fstat(fileno(data), &st); X dlen = (long) st.st_size; X } X else X dlen = 0L; X put2(4, &dlen); /* Data length */ X put2(4, &rlen); /* Resource length */ X} X X/* Fake a usable header (there was no .info file). */ X/* VMS NOTE: X It is possible that the use of fstat to figure the sizes of the X .data and .rsrc files will not work correctly if they are not X Stream_LF files. Not easy to get around, but not very common either X (will only cause problem if .info file is missing and either .data X or .rsrc is not Stream_LF, and xbin creates Stream_LF files). X*/ Xvoid fakehead(file, rsrc, data, out) Xchar *file; XFILE *rsrc, *data; Xregister char *out; X{ X unsigned char flen; X long rlen, dlen; X char flags[2]; X struct stat st; X X flen = (unsigned char) strlen(file); X if (rsrc != NULL) X { X (void) fstat(fileno(rsrc), &st); X rlen = (long) st.st_size; X } X else X rlen = 0L; X if (data != NULL) X { X (void) fstat(fileno(data), &st); X dlen = (long) st.st_size; X } X else X dlen = 0L; X flags[0] = '\0'; X flags[1] = '\0'; X X put2(1, &flen); /* Name length */ X put2(flen, file); /* Name */ X put2(1, ""); /* NULL */ X put2(4, "TEXT"); /* Type */ X put2(4, "????"); /* Author */ X put2(2, flags); /* Flags */ X#ifdef DONTSWAPINT X put2(4, dlen); /* Data length */ X put2(4, rlen); /* Resource length */ X#else X put2rev(4, dlen); /* Data length */ X put2rev(4, rlen); /* Resource length */ X#endif X} END_OF_FILE if test 4043 -ne `wc -c <'binhex/gethead.c'`; then echo shar: \"'binhex/gethead.c'\" unpacked with wrong size! fi # end of 'binhex/gethead.c' fi if test -f 'binhex/run.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'binhex/run.c'\" else echo shar: Extracting \"'binhex/run.c'\" \(1175 characters\) sed "s/^X//" >'binhex/run.c' <<'END_OF_FILE' X/* X * do run length compression for unxbin X * X * David Gentzel, Lexeme Corporation X */ X X#include X X#define RUNCHAR 0x90 X#define MAXREP 255 X Xextern void putchar_6(); X X/* X * Output a character to the current output file generating run length X * compression on the fly. All output goes through putchar_6 to do conversion X * from 8 bit to 6 bit format. When c == EOF, call putchar_6 with EOF to flush X * pending output. X */ Xvoid putchar_run(c) Xregister int c; X{ X static unsigned int rep = 1; /* # of repititions of lastc seen */ X static int lastc = EOF; /* last character passed to us */ X X if (c == lastc) /* increment rep */ X { X /* repetition count limited to MAXREP */ X if (++rep == MAXREP) X { X putchar_6(RUNCHAR); X putchar_6(MAXREP); X rep = 1; X lastc = EOF; X } X } X else X { X switch (rep) X { X case 2: /* not worth running for only 2 reps... */ X putchar_6(lastc); X if (lastc == RUNCHAR) X putchar_6(0); X break; X case 1: X break; X default: X putchar_6(RUNCHAR); X putchar_6(rep); X break; X } X putchar_6(c); /* output character (EOF flushes) */ X rep = 1; X if (c == RUNCHAR) X putchar_6(0); X lastc = c; X } X} END_OF_FILE if test 1175 -ne `wc -c <'binhex/run.c'`; then echo shar: \"'binhex/run.c'\" unpacked with wrong size! fi # end of 'binhex/run.c' fi if test ! -d 'capit' ; then echo shar: Creating directory \"'capit'\" mkdir 'capit' fi if test -f 'capit/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'capit/Makefile'\" else echo shar: Extracting \"'capit/Makefile'\" \(54 characters\) sed "s/^X//" >'capit/Makefile' <<'END_OF_FILE' Xcapit: capit.c X cc -o capit -O capit.c Xclean: X # nowt END_OF_FILE if test 54 -ne `wc -c <'capit/Makefile'`; then echo shar: \"'capit/Makefile'\" unpacked with wrong size! fi # end of 'capit/Makefile' fi if test -f 'capit/capit.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'capit/capit.1'\" else echo shar: Extracting \"'capit/capit.1'\" \(498 characters\) sed "s/^X//" >'capit/capit.1' <<'END_OF_FILE' X.TH CAPIT L "Decemeber 1990" X.UC X.SH NAME Xcapit \- convert a MacBinary file into a CAP aufs one. X.SH SYNOPSIS X.B capit X[ X.B \-v X] file(s) X.br X.SH DESCRIPTION X.I Capit Xconverts files from MacBinary to CAP aufs format and writes them to the current directory, Xwhich should be a CAP aufs folder. X.SH OPTION X.TP X.B \-v XVerbose option. Causes X.I capit Xto list name of each file converted. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) based on macbin by John M. Sellens (jmsellens@watdragon.uwaterloo.ca). END_OF_FILE if test 498 -ne `wc -c <'capit/capit.1'`; then echo shar: \"'capit/capit.1'\" unpacked with wrong size! fi # end of 'capit/capit.1' fi if test ! -d 'formatted' ; then echo shar: Creating directory \"'formatted'\" mkdir 'formatted' fi if test -f 'formatted/makeman' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'formatted/makeman'\" else echo shar: Extracting \"'formatted/makeman'\" \(100 characters\) sed "s/^X//" >'formatted/makeman' <<'END_OF_FILE' X#!/bin/csh Xforeach i (../{stuffit,unstuffit,binhex,capit,mcvert,man}/*.1) X nroff -man <$i >$i:t Xend END_OF_FILE if test 100 -ne `wc -c <'formatted/makeman'`; then echo shar: \"'formatted/makeman'\" unpacked with wrong size! fi # end of 'formatted/makeman' fi if test ! -d 'man' ; then echo shar: Creating directory \"'man'\" mkdir 'man' fi if test -f 'man/cleanup.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/cleanup.1'\" else echo shar: Extracting \"'man/cleanup.1'\" \(335 characters\) sed "s/^X//" >'man/cleanup.1' <<'END_OF_FILE' X.TH CLEANUP L "December 1990" X.UC X.SH NAME Xcleanup \- cleanup the current CAP aufs folder X.SH SYNOPSIS X.B cleanup X.SH DESCRIPTION X.I Cleanup Xremoves orphaned files stored in the hidden directories of a CAP aufs folder. XThese occur when Unix commands such as mv & rm are used on CAp aufs files. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 335 -ne `wc -c <'man/cleanup.1'`; then echo shar: \"'man/cleanup.1'\" unpacked with wrong size! fi # end of 'man/cleanup.1' fi if test -f 'man/drag.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/drag.1'\" else echo shar: Extracting \"'man/drag.1'\" \(398 characters\) sed "s/^X//" >'man/drag.1' <<'END_OF_FILE' X.TH DRAG L "December 1990" X.UC X.SH NAME Xdrag \- rename/move CAP aufs file(s) X.SH SYNOPSIS X.B drag Xfile file X.br X.B drag Xfile(s) folder X.SH DESCRIPTION X.I Drag Xrenames a CAP aufs file, or if there are multiple arguments moves CAP aufs files from one folder to another. XDo not use X.I mv Xto rename/move files as this does not handle the hidden CAP aufs files. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 398 -ne `wc -c <'man/drag.1'`; then echo shar: \"'man/drag.1'\" unpacked with wrong size! fi # end of 'man/drag.1' fi if test -f 'man/dup.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/dup.1'\" else echo shar: Extracting \"'man/dup.1'\" \(399 characters\) sed "s/^X//" >'man/dup.1' <<'END_OF_FILE' X.TH DUP L "December 1990" X.UC X.SH NAME Xdup \- copy CAP aufs file(s) X.SH SYNOPSIS X.B dup Xfile file X.br X.B dup Xfile(s) folder X.br X.SH DESCRIPTION X.I Dup Xduplicates a CAP aufs file, if given multiple arguments the last must be Xa folder and each file will be copied into it. XDo not use X.I cp Xto duplicate files as this does not handle the hidden CAP aufs files. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 399 -ne `wc -c <'man/dup.1'`; then echo shar: \"'man/dup.1'\" unpacked with wrong size! fi # end of 'man/dup.1' fi if test -f 'man/m2u.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/m2u.1'\" else echo shar: Extracting \"'man/m2u.1'\" \(338 characters\) sed "s/^X//" >'man/m2u.1' <<'END_OF_FILE' X.TH M2U L "December 1990" X.UC X.SH NAME Xm2u \- convert file from Mac to Unix text X.br Xu2m \- convert file from Unix to Mac text X.SH SYNOPSIS X.B m2u Xfile(s) X.br X.B u2m Xfile(s) X.SH DESCRIPTION XThese commands convert files between Mac & Unix text formats i.e. Xthe convert CR's to LF's and vice versa. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 338 -ne `wc -c <'man/m2u.1'`; then echo shar: \"'man/m2u.1'\" unpacked with wrong size! fi # end of 'man/m2u.1' fi if test -f 'man/macp.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/macp.1'\" else echo shar: Extracting \"'man/macp.1'\" \(361 characters\) sed "s/^X//" >'man/macp.1' <<'END_OF_FILE' X.TH MACP L "December 1990" X.UC X.SH NAME Xmacp \- list an CAP aufs file X.SH SYNOPSIS X.B macp Xfile(s) X.SH DESCRIPTION X.I Macp Xlists the given files using your standard pager, obtained from $PAGER, which is usually X.I more Xor X.I less . XDo not use the Unix pagers directly as CAP aufs files use CR and not LF as end of line. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 361 -ne `wc -c <'man/macp.1'`; then echo shar: \"'man/macp.1'\" unpacked with wrong size! fi # end of 'man/macp.1' fi if test -f 'man/newfolder.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/newfolder.1'\" else echo shar: Extracting \"'man/newfolder.1'\" \(296 characters\) sed "s/^X//" >'man/newfolder.1' <<'END_OF_FILE' X.TH NEWFOLDER L "December 1990" X.UC X.SH NAME Xnewfolder \- create CAP aufs folder(s) X.SH SYNOPSIS X.B newfolder Xfolder(s) X.SH DESCRIPTION X.I Newfolder Xcreates CAP aufs folders. XDo not use X.I mkdir Xto do this as it does not handle the hidden CAP aufs files. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 296 -ne `wc -c <'man/newfolder.1'`; then echo shar: \"'man/newfolder.1'\" unpacked with wrong size! fi # end of 'man/newfolder.1' fi if test -f 'man/toaufs.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/toaufs.1'\" else echo shar: Extracting \"'man/toaufs.1'\" \(656 characters\) sed "s/^X//" >'man/toaufs.1' <<'END_OF_FILE' X.TH TOAUFS L "December 1990" X.UC X.SH NAME Xtoaufs \- decode Binhex 4.0 files to CAP aufs format X.SH SYNOPSIS X.B toaufs Xfile(s) X.SH DESCRIPTION X.I Toaufs Xtakes a collection of files, joins them as appropriate, discards gumph Xsuch as news headers at top & bottom, unbinhexes them and stores them Xas CAP aufs files in the current directory, which should be a CAP aufs folder. XTo use X.I toaufs Xto convert files sent as news articles save each part in a file using Xan ascending alphanumeric sequence of names e.g. file.1, file.2 etc., Xand then pass them all to X.I toaufs , Xe.g. toaufs file.*. X.SH SEE ALSO Xmcvert, capit X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 656 -ne `wc -c <'man/toaufs.1'`; then echo shar: \"'man/toaufs.1'\" unpacked with wrong size! fi # end of 'man/toaufs.1' fi if test -f 'man/trash.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'man/trash.1'\" else echo shar: Extracting \"'man/trash.1'\" \(347 characters\) sed "s/^X//" >'man/trash.1' <<'END_OF_FILE' X.TH TRASH L "December 1990" X.UC X.SH NAME Xtrash \- delete a CAP aufs file X.SH SYNOPSIS X.B trash Xfile(s) X.SH DESCRIPTION X.I Trash Xsimply deletes the given CAP aufs files. Don't use X.I rm Xto delete CAP aufs files as it will not handle the multiple forks Xcorrectly, leaving hidden unwanted files on your disc. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) END_OF_FILE if test 347 -ne `wc -c <'man/trash.1'`; then echo shar: \"'man/trash.1'\" unpacked with wrong size! fi # end of 'man/trash.1' fi if test ! -d 'mcvert' ; then echo shar: Creating directory \"'mcvert'\" mkdir 'mcvert' fi if test -f 'mcvert/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mcvert/Makefile'\" else echo shar: Extracting \"'mcvert/Makefile'\" \(362 characters\) sed "s/^X//" >'mcvert/Makefile' <<'END_OF_FILE' XCSOURCES = mcvert.c hqxify.c unpack.c XSOURCES = mcvert.c hqxify.c unpack.c mactypes.h Makefile XOBJECTS = mcvert.o hqxify.o unpack.o XBIN = . XCFLAGS = -O -DBSD X Xmcvert: $(OBJECTS) X cc $(CFLAGS) $(OBJECTS) -s -o $(BIN)/mcvert X X$(OBJECTS): mactypes.h X Xprint: X lpr -p -Pvmslp $(SOURCES) X Xshar: X shar $(SOURCES) mcvert.1 >mcvert.shar X Xclean: X rm -f mcvert $(OBJECTS) END_OF_FILE if test 362 -ne `wc -c <'mcvert/Makefile'`; then echo shar: \"'mcvert/Makefile'\" unpacked with wrong size! fi # end of 'mcvert/Makefile' fi if test ! -d 'shell' ; then echo shar: Creating directory \"'shell'\" mkdir 'shell' fi if test -f 'shell/cleanup' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/cleanup'\" else echo shar: Extracting \"'shell/cleanup'\" \(120 characters\) sed "s/^X//" >'shell/cleanup' <<'END_OF_FILE' X# clean up an Aufs folder Xforeach i ({.resource,.finderinfo}/*) X if(! -e "$i:t") then X ls -l "$i" X rm "$i" X endif Xend END_OF_FILE if test 120 -ne `wc -c <'shell/cleanup'`; then echo shar: \"'shell/cleanup'\" unpacked with wrong size! fi chmod +x 'shell/cleanup' # end of 'shell/cleanup' fi if test -f 'shell/drag' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/drag'\" else echo shar: Extracting \"'shell/drag'\" \(513 characters\) sed "s/^X//" >'shell/drag' <<'END_OF_FILE' X# Xset echo Xset argc = $#argv Xif( $argc > 2 ) then X set dest = $argv[argc] X foreach i ( $argv[-(argc-1)] ) X set h1 = $i:h X if( $h1 == $i ) set h1 = "." X mv $i $dest X mv h1/.finderinfo/$i:t $dest/.finderinfo X mv h1/.resource/$i:t $dest/.resource X end Xelse X set h1 = $argv[1]:h X if( $h1 == $argv[1] ) set h1 = "." X set h2 = $argv[2]:h X if( $h2 == $argv[2] ) set h2 = "." X mv $argv[1] $argv[2] X mv $h1/.finderinfo/$argv[1]:t $h2/.finderinfo/$argv[2]:t X mv $h1/.resource/$argv[1]:t $h2/.resource/$argv[2]:t Xendif END_OF_FILE if test 513 -ne `wc -c <'shell/drag'`; then echo shar: \"'shell/drag'\" unpacked with wrong size! fi chmod +x 'shell/drag' # end of 'shell/drag' fi if test -f 'shell/dup' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/dup'\" else echo shar: Extracting \"'shell/dup'\" \(513 characters\) sed "s/^X//" >'shell/dup' <<'END_OF_FILE' X# Xset echo Xset argc = $#argv Xif( $argc > 2 ) then X set dest = $argv[argc] X foreach i ( $argv[-(argc-1)] ) X set h1 = $i:h X if( $h1 == $i ) set h1 = "." X cp $i $dest X cp h1/.finderinfo/$i:t $dest/.finderinfo X cp h1/.resource/$i:t $dest/.resource X end Xelse X set h1 = $argv[1]:h X if( $h1 == $argv[1] ) set h1 = "." X set h2 = $argv[2]:h X if( $h2 == $argv[2] ) set h2 = "." X cp $argv[1] $argv[2] X cp $h1/.finderinfo/$argv[1]:t $h2/.finderinfo/$argv[2]:t X cp $h1/.resource/$argv[1]:t $h2/.resource/$argv[2]:t Xendif END_OF_FILE if test 513 -ne `wc -c <'shell/dup'`; then echo shar: \"'shell/dup'\" unpacked with wrong size! fi chmod +x 'shell/dup' # end of 'shell/dup' fi if test -f 'shell/m2u' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/m2u'\" else echo shar: Extracting \"'shell/m2u'\" \(83 characters\) sed "s/^X//" >'shell/m2u' <<'END_OF_FILE' X# Xset f = _tmp_$$ Xforeach i ($argv) X mv $i $f X tr '\015' '\012' <$f >$i X rm $f Xend END_OF_FILE if test 83 -ne `wc -c <'shell/m2u'`; then echo shar: \"'shell/m2u'\" unpacked with wrong size! fi chmod +x 'shell/m2u' # end of 'shell/m2u' fi if test -f 'shell/macp' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/macp'\" else echo shar: Extracting \"'shell/macp'\" \(55 characters\) sed "s/^X//" >'shell/macp' <<'END_OF_FILE' X# Xforeach i ($argv) X tr '\015' '\012' <$i | $PAGER Xend END_OF_FILE if test 55 -ne `wc -c <'shell/macp'`; then echo shar: \"'shell/macp'\" unpacked with wrong size! fi chmod +x 'shell/macp' # end of 'shell/macp' fi if test -f 'shell/newfolder' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/newfolder'\" else echo shar: Extracting \"'shell/newfolder'\" \(99 characters\) sed "s/^X//" >'shell/newfolder' <<'END_OF_FILE' X# Xset u = `umask` Xumask 007 Xforeach i ($argv) X mkdir $i $i/.finderinfo $i/.resource Xend Xumask $u END_OF_FILE if test 99 -ne `wc -c <'shell/newfolder'`; then echo shar: \"'shell/newfolder'\" unpacked with wrong size! fi chmod +x 'shell/newfolder' # end of 'shell/newfolder' fi if test -f 'shell/toaufs' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/toaufs'\" else echo shar: Extracting \"'shell/toaufs'\" \(71 characters\) sed "s/^X//" >'shell/toaufs' <<'END_OF_FILE' X# Xsetenv MAC_EXT .$$conv Xmcvert -v $argv Xcapit *$MAC_EXT Xrm *$MAC_EXT X END_OF_FILE if test 71 -ne `wc -c <'shell/toaufs'`; then echo shar: \"'shell/toaufs'\" unpacked with wrong size! fi chmod +x 'shell/toaufs' # end of 'shell/toaufs' fi if test -f 'shell/trash' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/trash'\" else echo shar: Extracting \"'shell/trash'\" \(64 characters\) sed "s/^X//" >'shell/trash' <<'END_OF_FILE' X# Xforeach i ($argv) X rm -f $i .finderinfo/$i .resource/$i Xend END_OF_FILE if test 64 -ne `wc -c <'shell/trash'`; then echo shar: \"'shell/trash'\" unpacked with wrong size! fi chmod +x 'shell/trash' # end of 'shell/trash' fi if test -f 'shell/u2m' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'shell/u2m'\" else echo shar: Extracting \"'shell/u2m'\" \(83 characters\) sed "s/^X//" >'shell/u2m' <<'END_OF_FILE' X# Xset f = _tmp_$$ Xforeach i ($argv) X mv $i $f X tr '\012' '\015' <$f >$i X rm $f Xend END_OF_FILE if test 83 -ne `wc -c <'shell/u2m'`; then echo shar: \"'shell/u2m'\" unpacked with wrong size! fi chmod +x 'shell/u2m' # end of 'shell/u2m' fi if test ! -d 'stuffit' ; then echo shar: Creating directory \"'stuffit'\" mkdir 'stuffit' fi if test -f 'stuffit/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'stuffit/Makefile'\" else echo shar: Extracting \"'stuffit/Makefile'\" \(122 characters\) sed "s/^X//" >'stuffit/Makefile' <<'END_OF_FILE' Xstuffit: sit X rm -f stuffit X ln sit stuffit X Xsit: sit.o updcrc.o X cc -o sit sit.o updcrc.o X Xclean: X rm -f stuffit sit *.o END_OF_FILE if test 122 -ne `wc -c <'stuffit/Makefile'`; then echo shar: \"'stuffit/Makefile'\" unpacked with wrong size! fi # end of 'stuffit/Makefile' fi if test -f 'stuffit/sit.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'stuffit/sit.1'\" else echo shar: Extracting \"'stuffit/sit.1'\" \(1006 characters\) sed "s/^X//" >'stuffit/sit.1' <<'END_OF_FILE' X.TH SIT L "December 1990" X.UC X.SH NAME Xstuffit \- create a Stuffit archive from Unix text or CAP aufs files X.br Xsit \- create a Stuffit archive from Unix text or *.{rsrc,data,info} files X.SH SYNOPSIS X.B stuffit X[ X.B \-ru X] [ X.B \-o X.I output X] [ X.B \-C X.I creator X] [ X.B \-T X.I type X] file X.br X.B sit X[ X.B \-ru X] [ X.B \-o X.I output X] [ X.B \-C X.I creator X] [ X.B \-T X.I type X] file X.br X.SH DESCRIPTION XCreate a Stuffit archive from CAP aufs (stuffit), *.{rsrc,data,info} (sit) or XUnix text (both) files. X.SH OPTIONS X.TP X.B \-r XRemove input files when done. X.TP X.B \-o output XSpecify name of output file. Defaults to X.I archive.sit . X.TP X.B \-u XInput files are Unix text not CAP aufs (stuffit) or *.{rsrc,data,info} (sit). X.TP X.B \-C creator XSet files creator when input is Unix text, defaults to KAHL. X.TP X.B \-T type XSet files type wehn input is Unix text, defaults to TEXT. X.SH AUTHORS Xstuffit: Nigel Perry (np@doc.ic.ac.uk), based on X.br Xsit: Tom Bereiter ..!{rutgers,ames}!cs.utexas.edu!halley!rolex!twb END_OF_FILE if test 1006 -ne `wc -c <'stuffit/sit.1'`; then echo shar: \"'stuffit/sit.1'\" unpacked with wrong size! fi # end of 'stuffit/sit.1' fi if test -f 'stuffit/sit.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'stuffit/sit.h'\" else echo shar: Extracting \"'stuffit/sit.h'\" \(1834 characters\) sed "s/^X//" >'stuffit/sit.h' <<'END_OF_FILE' X X/* sit.h: contains declarations for SIT headers */ X Xtypedef struct sitHdr { /* 22 bytes */ X u_char sig1[4]; /* = 'SIT!' -- for verification */ X u_char numFiles[2]; /* number of files in archive */ X u_char arcLen[4]; /* length of entire archive incl. */ X u_char sig2[4]; /* = 'rLau' -- for verification */ X u_char version; /* version number */ X char reserved[7]; X}; X Xtypedef struct fileHdr { /* 112 bytes */ X u_char compRMethod; /* rsrc fork compression method */ X u_char compDMethod; /* data fork compression method */ X u_char fName[64]; /* a STR63 */ X char fType[4]; /* file type */ X char fCreator[4]; /* creator... */ X char FndrFlags[2]; /* copy of Finder flags */ X char cDate[4]; /* creation date */ X char mDate[4]; /* !restored-compat w/backup prgms */ X u_char rLen[4]; /* decom rsrc length */ X u_char dLen[4]; /* decomp data length */ X u_char cRLen[4]; /* compressed lengths */ X u_char cDLen[4]; X u_char rsrcCRC[2]; /* crc of rsrc fork */ X u_char dataCRC[2]; /* crc of data fork */ X char reserved[6]; X u_char hdrCRC[2]; /* crc of file header */ X}; X X/* file format is: X sitArchiveHdr X file1Hdr X file1RsrcFork X file1DataFork X file2Hdr X file2RsrcFork X file2DataFork X . X . X . X fileNHdr X fileNRsrcFork X fileNDataFork X*/ X X X X/* compression methods */ X#define noComp 0 /* just read each byte and write it to archive */ X#define repComp 1 /* RLE compression */ X#define lpzComp 2 /* LZW compression */ X#define hufComp 3 /* Huffman compression */ X X/* all other numbers are reserved */ X X/* X * the format of a *.info file made by xbin X */ Xstruct infohdr { X char res0; X char name[64]; /* 2 (a str 63) */ X char type[4]; /* 65 */ X char creator[4]; /* 69 */ X char flag[2]; /* 73 */ X char res1[8]; X char dlen[4]; /* 83 */ X char rlen[4]; /* 87 */ X char ctime[4]; /* 91 */ X char mtime[4]; /* 95 */ X}; END_OF_FILE if test 1834 -ne `wc -c <'stuffit/sit.h'`; then echo shar: \"'stuffit/sit.h'\" unpacked with wrong size! fi # end of 'stuffit/sit.h' fi if test ! -d 'unstuffit' ; then echo shar: Creating directory \"'unstuffit'\" mkdir 'unstuffit' fi if test -f 'unstuffit/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unstuffit/Makefile'\" else echo shar: Extracting \"'unstuffit/Makefile'\" \(245 characters\) sed "s/^X//" >'unstuffit/Makefile' <<'END_OF_FILE' XGETOPT = X#GETOPT = getopt.o X Xunstuffit: unsit X rm -f unstuffit X ln unsit unstuffit X Xunsit : unsit.o updcrc.o $(GETOPT) X cc -o unsit unsit.o updcrc.o $(GETOPT) X Xunsit.o : unsit.c stuffit.h Xgetopt.o : getopt.c X X Xclean: X rm -f unstuffit unsit *.o END_OF_FILE if test 245 -ne `wc -c <'unstuffit/Makefile'`; then echo shar: \"'unstuffit/Makefile'\" unpacked with wrong size! fi # end of 'unstuffit/Makefile' fi if test -f 'unstuffit/getopt.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unstuffit/getopt.c'\" else echo shar: Extracting \"'unstuffit/getopt.c'\" \(1074 characters\) sed "s/^X//" >'unstuffit/getopt.c' <<'END_OF_FILE' X/* X * getopt - get option letter from argv X */ X X#include X Xchar *optarg; /* Global argument pointer. */ Xint optind = 0; /* Global argv index. */ X Xstatic char *scan = NULL; /* Private scan pointer. */ X Xextern char *index(); X Xint Xgetopt(argc, argv, optstring) Xint argc; Xchar *argv[]; Xchar *optstring; X{ X register char c; X register char *place; X X optarg = NULL; X X if (scan == NULL || *scan == '\0') { X if (optind == 0) X optind++; X X if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') X return(EOF); X if (strcmp(argv[optind], "--")==0) { X optind++; X return(EOF); X } X X scan = argv[optind]+1; X optind++; X } X X c = *scan++; X place = index(optstring, c); X X if (place == NULL || c == ':') { X fprintf(stderr, "%s: unknown option -%c\n", argv[0], c); X return('?'); X } X X place++; X if (*place == ':') { X if (*scan != '\0') { X optarg = scan; X scan = NULL; X } else if (optind < argc) { X optarg = argv[optind]; X optind++; X } else { X fprintf(stderr, "%s: -%c argument missing\n", argv[0], c); X return('?'); X } X } X X return(c); X} X END_OF_FILE if test 1074 -ne `wc -c <'unstuffit/getopt.c'`; then echo shar: \"'unstuffit/getopt.c'\" unpacked with wrong size! fi # end of 'unstuffit/getopt.c' fi if test -f 'unstuffit/stuffit.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unstuffit/stuffit.h'\" else echo shar: Extracting \"'unstuffit/stuffit.h'\" \(1871 characters\) sed "s/^X//" >'unstuffit/stuffit.h' <<'END_OF_FILE' X/* StuffIt.h: contains declarations for SIT headers */ X Xtypedef struct sitHdr { /* 22 bytes */ X OSType signature; /* = 'SIT!' -- for verification */ X unsigned short numFiles; /* number of files in archive */ X unsigned long arcLength; /* length of entire archive incl. X hdr. -- for verification */ X OSType signature2; /* = 'rLau' -- for verification */ X unsigned char version; /* version number */ X char reserved[7]; X}; X Xtypedef struct fileHdr { /* 112 bytes */ X unsigned char compRMethod; /* rsrc fork compression method */ X unsigned char compDMethod; /* data fork compression method */ X unsigned char fName[64]; /* a STR63 */ X OSType fType; /* file type */ X OSType fCreator; /* er... */ X short FndrFlags; /* copy of Finder flags. For our X purposes, we can clear: X busy,onDesk */ X unsigned long creationDate; X unsigned long modDate; /* !restored-compat w/backup prgms */ X unsigned long rsrcLength; /* decompressed lengths */ X unsigned long dataLength; X unsigned long compRLength; /* compressed lengths */ X unsigned long compDLength; X unsigned short rsrcCRC; /* crc of rsrc fork */ X unsigned short dataCRC; /* crc of data fork */ X char reserved[6]; X unsigned short hdrCRC; /* crc of file header */ X}; X X X/* file format is: X sitArchiveHdr X file1Hdr X file1RsrcFork X file1DataFork X file2Hdr X file2RsrcFork X file2DataFork X . X . X . X fileNHdr X fileNRsrcFork X fileNDataFork X*/ X X X X/* compression methods */ X#define noComp 0 /* just read each byte and write it to archive */ X#define rleComp 1 /* RLE compression */ X#define lzwComp 2 /* LZW compression */ X#define hufComp 3 /* Huffman compression */ X X#define encrypted 16 /* bit set if encrypted. ex: encrypted+lpzComp */ X X#define startFolder 32 /* marks start of a new folder */ X#define endFolder 33 /* marks end of the last folder "started" */ X X/* all other numbers are reserved */ END_OF_FILE if test 1871 -ne `wc -c <'unstuffit/stuffit.h'`; then echo shar: \"'unstuffit/stuffit.h'\" unpacked with wrong size! fi # end of 'unstuffit/stuffit.h' fi if test -f 'unstuffit/unsit.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unstuffit/unsit.1'\" else echo shar: Extracting \"'unstuffit/unsit.1'\" \(4233 characters\) sed "s/^X//" >'unstuffit/unsit.1' <<'END_OF_FILE' X.TH UNSIT L "Septermber 28, 1988" X.UC X.SH NAME Xunsit \- extract/list files in a Macintosh Stuffit archive file X.SH SYNOPSIS X.B unsit X[ X.B \-rdulM X] [ X-vqfm X] file X.br X.SH DESCRIPTION XFor the Stuffit archive file listed, X.I unsit Xextracts the files in the archive into separate files. XThis makes it possible, for example, to separate a large StuffIt file Xinto component files for selective downloading, rather than Xdownloading the larger archive file just to extract a single, small Xfile. It also allows the use of StuffIt to compress a group of files Xinto a single, smaller archive that can be uploaded to a Unix system Xfor storage, printing, etc. X.PP XIn the normal mode, both the data and the resource forks of the Xcomponent Macintosh files in the archive are extracted and stored in XUnix files with the extension X.I .data Xand X.I .rsrc Xappended to the end of the Macintosh file name. XIn addition, a X.I .info Xfile will be created with the Finder information. XThese three file are compatible with the X.I macput Xprogram for downloading to a Mac running MacTerminal. The output files can Xalso be generated in the MacBinary format which is easier to use if they are to Xbe sent to the Mac over a network connection using an FTP program. The XMacBinary format file will have the same name as the file would have on the XMac. If only the data or resource fork is extracted, no addition extension is Xappended to the Mac file name. Characters in the Mac file name that are Xillegal (or unwieldy, like spaces) are changed to underscores in the Unix file Xname. The true Mac file name is retained internally in the MacBinary file or Xin the X.I .info Xfile and is restored when the file is downloaded. X.PP XStuffIt version 1.5 has the ability to archive a group of files and folders Xin such a way that the hierarchical relationship of the files and folders Xis maintained. X.I Unsit Xversion 1.5 can unpack files archived in this manner and place them in Xcorresponding subdirectories so as to maintain the hierarchy. As an option, Xthe hierarcy can be flattened out and all the files stored in the current Xdirectory. X.PP XThe options are similar to those for X.I macput Xand X.I unpit. X.TP X.B \-M XGenerate output files in MacBinary format instead of the .data, .rsrc, Xand .info format. X.TP X.B \-f XFor StuffIt files containing a "Hierarchy Maintained Folder" entry, extract the Xfiles into a "flat" organization (all in the current directory) rather than Xmaintaining the hierarchy by creating new directories, etc. XDefault is to maintain the hierarchical folder organization. X.TP X.B \-l XList the files in the archive but do not extract them. The name, size, Xtype, and creator of each file is listed. X.TP X.B \-m XAssumes the input file in MacBinary format rather than macput/macget Xformat and skips over the MacBinary header. X.TP X.B \-r XExtract resources forks only. X.TP X.B \-d XExtract data forks only. X.TP X.B \-u XExtract data fork and change into a Unix text file. XThis only works if the file is really a text file. X.TP X.B \-q XQuery user before extracting files and folders. If a "n" answer is given for Xa folder, none of the files or folders in that folder will be extracted. X.TP X.B \-v XVerbose option. Causes X.I unsit Xto list name, size, type, and creator of each file extracted. X.SH BUGS XFiles that were compressed by StuffIt with the Lempel-Ziv method and are Xextracted with the X.B \-u Xswitch (text files) are not checked for a correct CRC value when X.I unsit Xuncompresses them. This is because X.I unsit Xpipes the data through X.I compress Xand X.I tr Xto extract the file and never has a chance to do the CRC check. X.PP XThe X.I compress Xprogram has been observed to go into strange states when uncompressing a Xdamaged file. Often it will get stuck writing out bogus data until the Xdisk fills up. Since X.I unsit Xsends data through X.I compress, Xthe same problem could occur when extracting files from a damaged Stuffit Xarchive. X.SH FILES XFor archives that have been compressed with the Lempel-Ziv method, the X.I compress Xprogram must be present on the system and in the search path since X.I unsit Xuses it for the uncompressing. X.I Compress Xis available from the comp.sources.unix archives. X.SH AUTHOR XAllan G. Weber (weber@sipi.usc.edu) END_OF_FILE if test 4233 -ne `wc -c <'unstuffit/unsit.1'`; then echo shar: \"'unstuffit/unsit.1'\" unpacked with wrong size! fi # end of 'unstuffit/unsit.1' fi if test -f 'unstuffit/unstuffit.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'unstuffit/unstuffit.1'\" else echo shar: Extracting \"'unstuffit/unstuffit.1'\" \(2941 characters\) sed "s/^X//" >'unstuffit/unstuffit.1' <<'END_OF_FILE' X.TH UNSTUFFIT L "December 1990" X.UC X.SH NAME Xunstuffit \- unpack a Stuffit archive file to CAP aufs files X.SH SYNOPSIS X.B unstuffit X[ X.B \-rdulM X] [ X-vqfm X] file(s) X.br X.SH DESCRIPTION XFor the Stuffit archive(s) file listed, X.I unstuffit Xextracts the files in the archive into separate files. XThis makes it possible, for example, to separate a large StuffIt file Xinto component files for selective downloading, rather than Xdownloading the larger archive file just to extract a single, small Xfile. It also allows the use of StuffIt to compress a group of files Xinto a single, smaller archive that can be uploaded to a Unix system Xfor storage, printing, etc. X.PP X.I Unstuffit Xstores extracted files in CAP aufs format in the current directory, which Xmust be a CAP aufs folder. XCharacters in the Mac file name that are Xillegal (or unwieldy, like spaces) are changed to underscores in the Unix file Xname. X.PP XStuffIt version 1.5 has the ability to archive a group of files and folders Xin such a way that the hierarchical relationship of the files and folders Xis maintained. X.I Unstuffit Xversion 1.5 can unpack files archived in this manner and place them in Xcorresponding subdirectories, which it will create in CAP aufs folder format, so as to maintain the hierarchy. As an option, Xthe hierarcy can be flattened out and all the files stored in the current Xdirectory. X.PP X.TP X.B \-f XFor StuffIt files containing a "Hierarchy Maintained Folder" entry, extract the Xfiles into a "flat" organization (all in the current directory) rather than Xmaintaining the hierarchy by creating new directories, etc. XDefault is to maintain the hierarchical folder organization. X.TP X.B \-l XList the files in the archive but do not extract them. The name, size, Xtype, and creator of each file is listed. X.TP X.B \-m XAssumes the input file in MacBinary format rather than aufs Xformat and skips over the MacBinary header. X.TP X.B \-r XExtract resources forks only. X.TP X.B \-d XExtract data forks only. X.TP X.B \-q XQuery user before extracting files and folders. If a "n" answer is given for Xa folder, none of the files or folders in that folder will be extracted. X.TP X.B \-v XVerbose option. Causes X.I unstuffit Xto list name, size, type, and creator of each file extracted. X.SH BUGS XThe X.I compress Xprogram has been observed to go into strange states when uncompressing a Xdamaged file. Often it will get stuck writing out bogus data until the Xdisk fills up. Since X.I unstuffit Xsends data through X.I compress, Xthe same problem could occur when extracting files from a damaged Stuffit Xarchive. X.SH FILES XFor archives that have been compressed with the Lempel-Ziv method, the X.I compress Xprogram must be present on the system and in the search path since X.I unstuffit Xuses it for the uncompressing. X.I Compress Xis available from the comp.sources.unix archives. X.SH AUTHOR XNigel Perry (np@doc.ic.ac.uk) based upon unsit by XAllan G. Weber (weber@sipi.usc.edu). END_OF_FILE if test 2941 -ne `wc -c <'unstuffit/unstuffit.1'`; then echo shar: \"'unstuffit/unstuffit.1'\" unpacked with wrong size! fi # end of 'unstuffit/unstuffit.1' fi echo shar: End of archive 1 \(of 4\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 4 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0 --- end of part 1 ---