From news.iastate.edu!destroyer!gatech!concert!rutgers!igor.rutgers.edu!yoko.rutgers.edu!jac Sun Feb 7 10:44:35 CST 1993 Article: 98 of comp.sources.apple2 Path: news.iastate.edu!destroyer!gatech!concert!rutgers!igor.rutgers.edu!yoko.rutgers.edu!jac From: jac@yoko.rutgers.edu (Jonathan A. Chandross) Newsgroups: comp.sources.apple2 Subject: v001SRC075: BinSCII for Unix (New Version) Message-ID: Date: 7 Feb 93 02:56:12 GMT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 1615 Approved: jac@paul.rutgers.edu Submitted-by: Neil Parker (parker@corona.uoregon.edu) Posting-number: Volume 1, Source:75 Archive-name: archive/unix/binscii/bsc_v1.2 Architecture: UNIX Version-number: 1.2 This is version 1.2 of BSC, the UNIX and VMS BinSCII encoder. This version began as a "maintainance release" when I found out that the previous version wouldn't compile on Ultrix. Apparently a badly-chosen variable name was conflicting with a routine in the Ultrix C library. I renamed the variable, and the problem seems to have gone away. I've also added a new command-line option (-o) which makes it possible to save the output files under a different name than the input file. The major change in this version is the documentation--I turned the old docs.unix file into a genuine UNIX man page. There is also a man page for the BinSCII format, in case anybody's interested in how bsc works. Enjoy. =src/Makefile -# Makefile for bsc -# By Neil Parker -# Dec 18, 1992 -# -# Depending on your system, you may need to add some of the following options -# to the CFLAGS definition below: -# -# -DSTRING if your system uses and strrchr() instead of -# and rindex() -# -DMEMCPY if you have memcpy()/memset() instead of bcopy()/bzero() -# -DMEMORY_H if you need to #include to get memcpy()/memset() -# (this option will be ignored unless you also specified -# -DMEMCPY) -# -DFOPEN_NEEDS_B if you need to use fopen(...,"rb") to open a binary file -# (probably totally unnecessary for UNIX, but may come in -# handy for porting to other systems) -# -# The following seems to be appropriate for most BSD-like systems: -CFLAGS= -O -# A System V machine may require something like this: -#CFLAGS= -O -DSTRING -DMEMCPY -DMEMORY_H - -# -# If you need any special libraries, put them here -# -LIBS= - -# -# You shouldn't need to change these: -# -OBJS= bsc.o -SRCS= bsc.c -ALLFILES= README.1ST docs.unix bsc.1 binscii.5 docs.vms bsc.c pftypes.h \ - crc.h Makefile vmsmake.com vmsopt.opt - -all: bsc - -bsc: $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - -bsc.o: crc.h pftypes.h - -clean: - rm $(OBJS) - -cleaner: - rm $(OBJS) bsc - -catman: - nroff -man bsc.1 > bsc.1.txt - nroff -man binscii.5 > binscii.5.txt - -bsc.shar: $(ALLFILES) - shar bsc.shar $(ALLFILES) - -bsc.aaf: $(ALLFILES) - ../aaf bsc.aaf $(ALLFILES) =src/Manifest -Makefile -README.1ST -binscii.5 -bsc.1 -bsc.c -crc.h -docs.unix -docs.vms -pftypes.h -vmsmake.com -vmsopt.opt =src/README.1ST -================= -BSC v1.2 -by Neil Parker -December 17, 1992 -================= - -Package contents: - README.1ST this file - docs.unix how to compile on UNIX - bsc.1 UNIX man page for bsc - binscii.5 UNIX man page for BinSCII format - docs.vms how to compile and run on VMS - bsc.c main source code - pftypes.h ProDOS file types (for the -t option) - crc.h CRC calculation routines - Makefile makefile for UNIX - vmsmake.com script to make BSC on VMS - vmsopt.opt linker options for VMS - -If you're on UNIX, read the file "docs.unix" to find out how to compile bsc. -If you're on VMS, read the file "docs.vms" to find out how to compile and run. - -About This Version -================== -This is version 1.2 of BSC, the UNIX and VMS BinSCII encoder. - -This version began as a "maintainance release" when I found out that the -previous version wouldn't compile on Ultrix. Apparently a badly-chosen -variable name was conflicting with a routine in the Ultrix C library. I -renamed the variable, and the problem seems to have gone away. - -I've also added a new command-line option (-o) which makes it possible to -save the output files under a different name than the input file. - -The major change in this version is the documentation--I turned the old -docs.unix file into a genuine UNIX man page. There is also a man page for -the BinSCII format, in case anybody's interested in how bsc works (I found -my notes on the BinSCII format sitting on top a stack of printouts...obviously -Fate was trying to tell me it was time to write up the information in a -readable form). =src/binscii.5 -.\" binscii.5 - by Neil Parker -.\" Dec. 18, 1992 -.TH BINSCII 5 "Dec. 18, 1992" -.SH NAME -bsc \- format of a -.I BinSCII -file -.SH CAVEAT -The information below is based almost entirely on my own analysis of Marcel -J. E. Mol's -.I sciibin -source code. I can make no guarantees about its accuracy. Use at your own -risk. -.SH DESCRIPTION -Files encoded in the -.I BinSCII -format are broken into 12K (12288-byte) segments, and each segment is encoded -separately. All segments except the last are 12K long; the final segment -may be shorter than 12K if the length of the original file was not an exact -multiple of 12K. -.PP -Each segment of a -.IR BinSCII -encoded -file contains 3 parts: the header, the body, and the checksum. -.PP -The header consists of three lines. The first line is a "sentinal" line used -to locate the start of the segment. It consists of the following text: -.PP -.IP -.B FiLeStArTfIlEsTaRt -.PP -The second line is the alphabet used in the encoding. In all current -incarnations of -.IR BinSCII , -it looks like this: -.PP -.nf -.ft B -ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789() -.ft -.fi -.PP -The third line contains the file name and characteristics, and information -that tells the decoder which piece of the file this segment represents. -The first 16 characters are the ProDOS filename \- the first character -indicates the length of the filename (A=1, B=2, C=3, etc.), and the -remaining 15 characters are the actual filename, padded on the right with -blanks. The -final 36 chracters of the third line are an encoded representation of the -following data structure: -.PP -.RS -.nf -struct binscii_header { - byte filesize[3]; /* Total size of original file */ - byte segstart[3]; /* Offset into original file of start of this seg */ - byte acmode; /* ProDOS file access mode */ - byte filetype; /* ProDOS file type */ - byte auxtype[2]; /* ProDOS auxiliary file type */ - byte storetype; /* ProDOS file storage type */ - byte blksize[2]; /* Number of 512-byte blocks in original file */ - byte credate[2]; /* File creation date, in ProDOS 8 format */ - byte cretime[2]; /* File creation time, in ProDOS 8 format */ - byte moddate[2]; /* File modification date */ - byte modtime[2]; /* File modification time */ - byte seglen[3]; /* Length in bytes of this segment */ - byte crc[2]; /* CRC checksum of preceding fields */ - byte filler; /* Unused filler byte */ -}; -.fi -.RE -.PP -All multibyte fields of this structure are stored in Apple II byte order -(low-order byte first). This structure is encoded in the same manner as -the data lines, as described below. -.PP -Immediately following the header lines come the data lines. Each data line -is exactly 64 characters long, representing 48 characters of the original -file (if the file length is not an exact multiple of 48 bytes, the last -line is padded with enough binary zeroes to fill out the line). -.PP -Immediately following the last data line of the segment comes the checksum. -The checksum is a 2-byte CRC of the data in the current segment. It is -encoded by attaching a binary zero to the end to increase the length of the -field to three bytes, which are then encoded in the same fashion as the -data lines. -.PP -The encoding scheme used by -.I BinSCII -takes data three bytes at a time, and converts them to four 6-bit bytes, -each of which is translated into an ASCII character. If the bits of the -three input bytes are as follows, -.IP -.BR "abcdefgh ijklmnop qrstuvwx" , -.PP -then the four output bytes will be as follows: -.IP -.BR "00stuvwx 00mnopqr 00ghijkl 00abcdef" . -.PP -Each of these bytes is translated into an ASCII character by indexing into -the encoding alphabet (from the second line of the header of the -.I BinSCII -segment). -.PP -The CRC checksums in -.I BinSCII -are calculated using the CRC polynomial X^16 + X^12 + X^5 + 1. -.SH "SEE ALSO" -.IR bsc (1), -.IR uuencode (1), -.IR uuencode (5) =src/bsc.1 -.\" bsc.1 by Neil Parker -- 17 Dec 1992 -.\" bsc version 1.2 -.TH BSC 1 "Dec. 17, 1992" -.SH NAME -bsc \- Encode a file in the BinSCII format for transmittion to an Apple II -.SH SYNOPSIS -.B bsc -.RB [ \-t -.IR type ] -.RB [ \-a -.IR auxtype ] -.RB [ "\-m dnbiwr" ] -.RB [ \-n -.IR name ] -.RB [ \-s -.IR num ] -.RB [ \-o -.IR outfile ] -.RB [ \-h ] -.I filename -.SH DESCRIPTION -.I Bsc -encodes a file in the -.I BinSCII -format, which is an ASCII-only format similar to -.IR uuencode (1), -and which is suitable for transmittion through text-only communication -channels such as electronic mail and brain-dead terminal servers. The -.I BinSCII -format originated on the Apple II family of microcomputers (hence the -references to the Apple II ProDOS operating system below), and can be -decoded by the -.I BINSCII -program on an Apple II (there is also a -.I BinSCII -decoder for UNIX called -.IR sciibin ). -.SS Options -.TP -.BI \-t " type" -Sets the ProDOS filetype stored in the -.I BinSCII -header to -.IR type . -The type may be specified as a standard 3-letter ProDOS file type -abbreviation (in lowercase), or as a decimal, octal, or hexadecimal number -in one of the following formats: -.RS -.TP "\w'0xdd\ \ 'u" -.I ddd -A decimal number -.RI ( d -is a decimal digit, in the range 0-9). -.PD 0 -.TP -.BI $ dd -A hexadecimal number -.RI ( d -is a digit in the range 0-9 or a-f). Note that you will have to quote or -escape the $ to protect it from the shell. -.TP -.BI 0x dd -A hexadecimal number -.RI ( d -is a hexedecimal digit as in the previous case). -.TP -.BI 0 dd -An octal number -.RI ( d -is a digit in the range 0-7). -.PD -.RE -.IP -If no -.B \-t -option is present, the ProDOS file type will default to 6 (BIN). -.TP -.BI \-a " auxtype" -Sets the ProDOS auxiliary filetype in the -.I BinSCII -header to -.IR auxtype . -The auxiliary type may be specified in decimal, hexadecimal, or octal, -using the same syntax as the -.B \-t -option above. If no -.B \-a -option is present, the auxiliary type will default to 0. -.TP -.B "\-m dnbiwr" -Sets the ProDOS file access mode. The mode may consists of one or more of -the following letters: -.RS -.TP "\w'd\ \ 'u" -.B d -File can be destroyed. -.PD 0 -.TP -.B n -File can be renamed. -.TP -.B b -File needs backup. -.TP -.B i -File is invisible. -.TP -.B w -File can be opened for writing. -.TP -.B r -File can be opened for reading. -.PD -.RE -.IP -If no -.B \-m -option is specified, the access mode defaults to -.IR dnwr , -which corresponds to an "unlocked" ProDOS file. To create a "locked" -ProDOS file, specify a mode of -.IR r . -.TP -.BI \-n " name" -Sets the ProDOS filename stored in the -.I BinSCII -header. If this option is omitted, the ProDOS filename will be the same as -the UNIX filename. -.TP -.BI \-s " num" -Sets the number of -.I BinSCII -segments per output file to -.IR num . -As with the -.B \-t -and -.B \-a -options, the number may be specified in decimal, hexadecimal, or octal. If -no -.B \-s -option is present, or if -.I num -is 0, then all -.I BinSCII -segments will be written to a single output file. To cause each segment to -go into its own output file (like the Apple II -.I BINSCII -program), set -.I num -equal to 1. See below for an explanation of output files. -.TP -.BI \-o " outfile" -Normally, the output of -.I bsc -is stored in files whose names are derived from the name of the input file. -This option makes -.I bsc -derive its output file names from the name -.I outfile -instead. -.TP -.B \-h -Print a short summary of -.IR bsc 's -output options on the standard output. -.PP -These options, if present, may appear in any order, provided that they -appear before the filename. Spaces may appear between an option letter -and its value, but are not necessary. -.PP -The -.I filename -is the name of the UNIX file to be BinSCII'd. The stored -ProDOS filename will be taken from the UNIX name, or from the -.B \-n -option if -one was supplied, with lowercase letters converted to uppercase. -Additionally, characters that are not valid in ProDOS filenames will be -translated into periods (unless the invalid character is the first -character in the name, in which case it gets translated into an "X"). The -ProDOS name will be truncated to 15 characters if necessary. -.PP -The stored ProDOS creation and modification times will be taken from the -UNIX input file. -.PP -The output of bsc is a set of one or more files, each containing one or -more BinSCII segments. By default, all BinSCII segments are written to -a single output file, which has the same name as the input file with a -".0" appended to the end. If the -.B \-s -option is given on the command -line with a value greater than zero, then the number of segments per -output file will be limited to the specified value, and if more than one -output file is needed, the second file will have ".1" appended to the -name, the third will have ".2" appended, and so forth. For example, if -"foo" is a large UNIX file, the command "bsc -s3 foo" will create files -"foo.0", "foo.1", "foo.2", etc., each containing 3 BinSCII segments. -.PP -If the -.B \-o -option is given on the command line, then the -.B \-o -name will be used for the output files instead of the input filename. The -output files will still have ".0", ".1", ".2", etc., appended to their -names. -.PP -.I Bsc -will refuse to -.I BinSCII -a file larger than 16777216 bytes (16 meg), -since that is the maximum size of a ProDOS file. -.SH EXAMPLE -Suppose a UNIX file called "picture" contains a standard -Apple IIGS super-hires screen image. The command -.IP -bsc \-tpic picture -.PP -will create the file "picture.0" in a format suitable for downloading to -an Apple II and -.RI un- BinSCII ing, -or for posting to comp.binaries.apple2. -When -.RI un- BinSCII 'd -on an Apple II, it will automatically be converted to -a PIC ($C1) file. -.SH "SEE ALSO" -.IR uuencode (1), -.IR binscii (5) -.SH BUGS -If a file with the same name as a -.I bsc -output file already exists, then the pre-existing file will be silently -overwritten by the -.I bsc -output file. Before typing "bsc foo", it's a good idea to make sure you -don't already have an important data file called "foo.0". -.PP -If you find any bugs is -.BR bsc , -send e-mail to one of the addresses -below. I welcome bug reports, comments, complaints, and suggestions for -improvement. -.RI ( Please -send me your bug reports \- don't just sit on it and hope it will magically -get better. I can't fix it if I don't know it's broken!) -.SH AUTHOR -Neil Parker -.br -(nparker@cie.uoregon.edu, parker@corona.uoregon.edu) -.PP -Thanks to Marcel J. E. Mol, whose -.I sciibin -program was a valuable source -of technical information on -.IR BinSCII . =src/bsc.c -/* - * Program: bsc.c - * Version: 1.2 - * Author: Neil Parker - * Files: bsc.c (source code) - * crc.h (CRC generation routine) - * pftypes.h (ProDOS file types) - * Purpose: Create BinSCII files on UNIX or VMS - * - * This program is freeware. It comes with no warranty whatsoever; use - * at your own risk. - * - * Version 1.2: 17 Dec 1992 - * Added -o (output filename) flag. - * Changed variable name ("access" -> "acmode") to fix conflict with - * Ultrix libraries. - * Incorporated System 6 file type abbreviations. - * - * Version 1.1: 21 Feb 1992 - * Added -n (name), -d (debug), and -b (binary) flags. - * Added support for VMS (it's still icky, but it works after a fashion). - * Increased ugliness coefficient of source code :-). - * - * Version 1.0: 14 Mar 1991 - * Original release--UNIX only. - */ -#include - -#if defined(STRING)||defined(vms) -#include -#define rindex strrchr -#else -#include -#endif - -#if defined(MEMCPY)||defined(vms) -#ifdef MEMORY_H -#include -#endif -#define bcopy(from,to,length) memcpy((to),(from),(length)) -#define bzero(buf,length) memset((buf),0,(length)) -#endif - -#include -#include -#include -#include -#include "crc.h" -#include "pftypes.h" - -unsigned int getnumber(),getftype(); -char *malloc(); - -unsigned char inbuf[49], /* buffer for reading from input */ - header[28]; /* buffer for BinSCII header */ - -char outbuf[65], /* buffer for coded output lines */ - binsciifile[256], /* buffer for ProDOS filename in header */ - *infile, /* name of input file */ - *outfile, /* name of current output file */ - *outarg, /* output file argument from cmd line */ - pname[16], /* ProDOS file name for BinSCII header */ -#ifndef vms - *progname, /* program name, for error messages */ -#endif - *filestart="FiLeStArTfIlEsTaRt", /* BinSCII intro marker */ - *alphabet= /* code alphabet */ - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789()"; - -unsigned int crc, /* running CRC counter */ - processed, /* number of bytes already processed */ - remaining, /* number of bytes yet to be processed */ - auxtype=0, /* ProDOS aux type (default=0) */ - acmode=0xc3, /* ProDOS access mode (default=dnwr) */ - filetype=6, /* ProDOS file type (default=bin) */ - storagetype, /* ProDOS file storage type */ - blocks, /* number of blocks in ProDOS file */ - seqno, /* output file sequence number */ - segsplit=0, /* output segment split count (default=0) */ - segno, /* output segment number */ -#if defined(FOPEN_NEEDS_B)||defined(vms) - bflag=0, /* set to 1 if -b flag found */ -#endif - nflag=0, /* set to 1 if -n flag found */ - dflag=0, /* set to 1 if -d flag found */ - oflag=0; /* set to 1 of -o flag found */ - -long filesize, /* input file size */ - segmentlen; /* count of bytes remaining in current segment */ - -FILE *fi, /* input file pointer */ - *fo; /* current output file pointer */ - -main(argc,argv) -int argc; -char **argv; -{ - char *c; - unsigned char *uc; - unsigned int numread; - long lastbyte; - struct stat statbuf; - struct tm *timebuf; - -#ifndef vms - -/* get program so we can print it in usage() and help() */ - - if((progname=rindex(*argv,'/'))==NULL) - progname= *argv; - else - progname++; - -#endif - -/* get and interpret command-line arguments */ - - if(argc<2) - usage(); - - while(argc-- >1) { - argv++; - if(**argv=='-') { - switch(argv[0][1]) { - - case 'h': /* help */ - help(); /* doesn't return */ - - case 't': /* type */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - filetype=getftype(c); - break; - - case 'a': /* auxtype */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - auxtype=getnumber(c); - break; - - case 's': /* segments/file */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - segsplit=getnumber(c); - segsplit=segsplit==0?32767:segsplit; - break; - - case 'n': /* ProDOS file name */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - strncpy(pname,c,15); - pname[15]='\0'; /* just to be sure */ - nflag++; - break; - -#if defined(FOPEN_NEEDS_B)||defined(vms) - case 'b': /* treat input as binary */ - bflag++; - break; -#endif - - case 'm': /* access mode */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - acmode=0; - while(*c!='\0') { - switch(*c) { - case 'd': - acmode|=0x80; - break; - case 'n': - acmode|=0x40; - break; - case 'b': - acmode|=0x20; - break; - case 'i': - acmode|=0x04; - break; - case 'w': - acmode|=0x02; - break; - case 'r': - acmode|=0x01; - break; - default: - usage(); - } - c++; - } - break; - - case 'o': /* output file name */ - c= *argv+2; - if(*c=='\0') { - argv++; - argc--; - if(argc<1) - usage(); - c= *argv; - } - outarg=c; - oflag++; - break; - - case 'd': /* debugging */ - dflag++; - break; - - default: - usage(); - - } /* END switch(argv[0][1]) */ - - if(argc<2) /* filename must follow options */ - usage(); - - } else { /* **argv!='-' */ - - infile= *argv; - if(argc>1) /* filename must be last arg */ - usage(); - - } /* END if(**argv=='-') */ - - } /* END while(argc-->1) */ - - if(!nflag) { /* If no -n flag, take ProDOS name from input file */ - -#ifdef vms - -/* Extract file name portion from VMS file spec */ - - if((uc=rindex(infile,':'))==NULL) /* delete NODE::DEV: */ - uc=infile; - else - uc++; - - if((c=rindex(uc,']'))==NULL) /* delete [dir] */ - c=uc; - else - c++; - -#else /* not VMS */ - -/* Extract tail from UNIX file name */ - - if((c=rindex(infile,'/'))==NULL) /* delete dirs */ - c=infile; - else - c++; - -#endif /* VMS */ - - strncpy(pname,c,15); - pname[15]='\0'; /* just to be sure */ - } /* if (!nflag) */ - - if(!oflag) - outarg=infile; /* if no -o, make output name from input name */ - outfile=malloc(strlen(outarg)+10); /* enough space for name + number */ - - if(outfile==NULL) { - fprintf(stderr,"out of memory\n"); - exit(1); - } - - if(dflag) - printf("*** Using ProDOS filename %s\n",pname); - - strcpy(&binsciifile[1],pname); - c=binsciifile+1; - - if(!isalpha(*c)) /* initial invalid char -> 'X' */ - *c='X'; - for(;*c!='\0';c++) - if(isalnum(*c)||*c=='.') { - if(islower(*c)) /* upshift lowercase */ - *c=toupper(*c); - } else /* invalid char -> '.' */ - *c='.'; - - c=binsciifile+1; - if(*c=='\0') { - fprintf(stderr,"empty ProDOS file name\n"); - exit(1); - } - c[15]='\0'; /* truncate name at 15 chars */ - binsciifile[0]=alphabet[strlen(c)-1]; /* encode name length */ - strcat(c," "); /* 16 spaces */ - c[15]='\0'; /* pad with spaces, and truncate to 15 again */ - -/* Make sure input file exists, and get its size and dates */ - -#ifdef vms - vms_stat(infile,&statbuf); -#else - if(stat(infile,&statbuf)<0) { - perror("getting input file status"); - exit(1); - } -#endif - - if(dflag) - printf("*** File=%s, Size=%d\n",infile,statbuf.st_size); - - filesize=statbuf.st_size; - lastbyte=filesize-1; - if(filesize>16777216L) { /* ProDOS can't handle files >16Mb */ - fprintf(stderr,"Input file too big for ProDOS\n"); - exit(1); - } - - if(filesize>131072L) { - storagetype=3; /* tree */ - blocks=3+lastbyte/131072+lastbyte/512; - } else if(filesize>512L) { - storagetype=2; /* sapling */ - blocks=2+lastbyte/512; - } else { - storagetype=1; /* seedling */ - blocks=1; - } - -/* Get file times into BinSCII header */ - - timebuf=localtime(&statbuf.st_ctime); - timebuf->tm_mon+=1; /* UNIX month is 0-11, ProDOS is 1-12 */ - header[13]=timebuf->tm_mday|(timebuf->tm_mon<<5); /* create date */ - header[14]=(timebuf->tm_mon>>3)|(timebuf->tm_year<<1); - header[15]=timebuf->tm_min; /* create time */ - header[16]=timebuf->tm_hour; - - timebuf=localtime(&statbuf.st_mtime); - timebuf->tm_mon+=1; - header[17]=timebuf->tm_mday|(timebuf->tm_mon<<5); /* mod date */ - header[18]=(timebuf->tm_mon>>3)|(timebuf->tm_year<<1); - header[19]=timebuf->tm_min; /* mod time */ - header[20]=timebuf->tm_hour; - -/* Fill out remaining constant portion of header */ - - header[0]=filesize&0xff; - header[1]=(filesize>>8)&0xff; - header[2]=(filesize>>16)&0xff; - - header[6]=acmode; - - header[7]=filetype; - - header[8]=auxtype&0xff; - header[9]=(auxtype>>8)&0xff; - - header[10]=storagetype; - - header[11]=blocks&0xff; - header[12]=(blocks>>8)&0xff; - - header[26]=0; - -/* open input file; initialize counters */ - -#if defined(FOPEN_NEEDS_B)||defined(vms) - if((fi=fopen(infile,bflag?"rb":"r"))==NULL) { -#else - if((fi=fopen(infile,"r"))==NULL) { -#endif - perror("opening input file"); - exit(1); - } - -#ifdef vms - if((c=rindex(infile,';'))!=NULL) /* Delete version num */ - *c='\0'; -#endif - - processed=0; - remaining=filesize; - segno=0; - seqno=0; - - while(remaining>0) { /* loop until nothing left to process */ - - segmentlen=remaining>0x3000?0x3000:remaining; - /* max segment size is 0x3000 */ - - if(dflag) - printf("*** Seg=%d, Len=%d, Rem=%d\n",seqno, - segmentlen,remaining); - -/* see if new output file should be created--if so, form name and create - it */ - - if(segno==0) { -#ifdef vms - sprintf(outfile,"%s-%d",outarg,seqno++); -#else - sprintf(outfile,"%s.%d",outarg,seqno++); -#endif - if((fo=fopen(outfile,"w"))==NULL) { - sprintf(outbuf, - "opening output file %s",outfile); - perror(outbuf); - exit(1); - } - if(dflag) - printf("*** Outfile=%s\n",outfile); - } - -/* write headers to new file */ - - fprintf(fo,"%s\n",filestart); - fprintf(fo,"%s\n",alphabet); - fprintf(fo,"%s",binsciifile); - -/* set up variable part of header */ - - header[3]=processed&0xff; /* start addr of this seg */ - header[4]=(processed>>8)&0xff; - header[5]=(processed>>16)&0xff; - - header[21]=segmentlen&0xff; /* length of this seg */ - header[22]=(segmentlen>>8)&0xff; - header[23]=(segmentlen>>16)&0xff; - -/* compute header CRC */ - - crc=0; - for(uc=header;uc!=header+24;uc++) - crc=updcrc(*uc,crc); - - header[24]=crc&0xff; - header[25]=(crc>>8)&0xff; - -/* code header and send it on its way */ - - encode(header,outbuf,27); - fprintf(fo,"%s\n",outbuf); - -/* start working on segment data */ - - crc=0; - while(segmentlen>0) { /* loop until end of seg */ - - bzero(inbuf,48); /* zero buffer in case there's - not enough data to fill it */ - -/* get 48 bytes (or less if at end) from file */ - - if((fread(inbuf,1,48,fi))<0) { - perror("reading input file"); - exit(0); - } - -/* update number of bytes read */ -/* (I tried to do this using the return value from fread(), but VMS choked - on it.) */ - - numread=filesize-processed; - if(numread>48) - numread=48; - -/* update CRC for this line */ - - for(uc=inbuf;uc!=inbuf+48;uc++) - crc=updcrc(*uc,crc); - -/* code the line and send it on its way */ - - encode(inbuf,outbuf,48); - fprintf(fo,"%s\n",outbuf); - - segmentlen-=numread; - remaining-=numread; - processed+=numread; - } /* END while(segmentlen>0) */ - -/* end of segment--code and write the CRC */ - - inbuf[0]=crc&0xff; - inbuf[1]=(crc>>8)&0xff; - inbuf[2]=0; - - encode(inbuf,outbuf,3); - fprintf(fo,"%s\n",outbuf); - -/* if end of output file, close it and prepare for next output file */ - - if(++segno==segsplit) { - segno=0; - fclose(fo); - } - - } /* END while(remaining>0) */ - -/* all done--close and exit */ - - if(segno!=0) - fclose(fo); - fclose(fi); - exit(0); -} - -/* subroutine to encode a line of data */ - -encode(input,output,length) -unsigned char *input; -char *output; -int length; -{ - int i; - char *o; - - o=output; - for(i=0;i>6)|(input[i+1]<<2))&0x3f]; - *o++ =alphabet[((input[i+1]>>4)|(input[i]<<4))&0x3f]; - *o++ =alphabet[input[i]>>2]; - } - *o='\0'; -} - -/* subroutine to get a file type from the command line */ - -unsigned int getftype(c) -char *c; -{ - int i; - unsigned int retcode; - - for(i=0;i hex */ - sscanf(c+1,"%x",&i); - return i; - } - if(!isdigit(*c)) - usage(); - if(*c=='0') - if(c[1]=='x'||c[1]=='X') - sscanf(c+2,"%x",&i); /* 0xnn or 0Xnn -> hex */ - else - sscanf(c,"%o",&i); /* 0nn -> octal */ - else - sscanf(c,"%d",&i); /* nn -> decimal */ - return i; -} - -usage() -{ -#ifdef vms - fprintf(stderr,"Bad arguments--type BSC -H for help\n"); -#else - fprintf(stderr,"%s: bad arguments--type \"%s -h\" for help\n", - progname,progname); -#endif - exit(1); -} - -help() -{ - printf("BSC Version 1.2 by Neil Parker -- 17 Dec 1992\n"); -#ifdef vms - printf("Usage: BSC [] \n"); -#else - printf("Usage: %s [] \n",progname); -#endif - printf("args: -t = set ProDOS file type to \n"); - printf(" -a = set ProDOS aux type to \n"); - printf(" -m = set ProDOS access mode-- may be any\n"); - printf(" combination of d, n, b, i, w, or r\n"); - printf(" -n = set ProDOS file name to \n"); - printf(" -s = set number of segs/output file to \n"); - printf(" -o = set output file name to \n"); -#if defined(FOPEN_NEEDS_B)||defined(vms) - printf(" -b = treat input file as binary file\n"); -#endif - printf(" -h = print this help message\n"); - exit(0); -} - -#ifdef vms -#include - -/* The following piece of stupidity is intended to correct for the fact that - the VAX C RTL's idea of file length doesn't always match the number of - bytes that can actually be read from the file with fgets() or fread(). - If we don't make this correction, we may get extra garbage at the end of - the output file. */ - -/* Unfortunately, I know of no way to do this except by brute force (and even - that doesn't always work). Why, why, WHY does VMS have to make life so - difficult? */ - -vms_stat(filename,statbuf) -char *filename; -struct stat *statbuf; -{ - FILE *fp; - char buf[512]; - unsigned long size=0; - -/* get file stats */ - - if(stat(filename,statbuf)<0) { - perror("getting input file info"); - exit(1); - } - -/* if records are stream_CR or stream_LF, size is OK - if -b flag was given, size is probably not OK, but we can't fix it */ - - if(bflag||statbuf->st_fab_rfm==FAB$C_STMCR - ||statbuf->st_fab_rfm==FAB$C_STMLF) - return; - -/* open and read file, totalling up number of chars */ - - if((fp=fopen(filename,"r"))==(FILE *)NULL) { - perror("opening infile for size calc"); - exit(1); - } - - while(fgets(buf,512,fp)!=(char *)NULL) - size+=strlen(buf); - - fclose(fp); - -/* fix size in status buffer */ - - statbuf->st_size=size; -} - -#endif =src/crc.h -/* - * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. - * NOTE: First srgument must be in range 0 to 255. - * Second argument is referenced twice. - * - * Programmers may incorporate any or all code into their programs, - * giving proper credit within the source. Publication of the - * source routines is permitted so long as proper credit is given - * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, - * Omen Technology. - */ - - /* #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp) */ -#define updcrc(cp, crc) ( (crctab[((crc >> 8) & 0xFF) ^ cp] ^ (crc << 8)) & 0xFFFF) - - -/* crctab calculated by Mark G. Mendel, Network Systems Corporation */ -static unsigned short crctab[256] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, - 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, - 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, - 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, - 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, - 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, - 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, - 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, - 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, - 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, - 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, - 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, - 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, - 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, - 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, - 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, - 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, - 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, - 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, - 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, - 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, - 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, - 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 -}; - =src/docs.unix - -Bsc is a program which creates BinSCII files on UNIX systems. - - -COMPILING ---------- - -First, examine the makefile. For some systems, you may need to add some of -the -Dxxx flags to CFLAGS. These flags are briefly described in the -comments in the makefile. - -Once you have CFLAGS set up to match your system, type "make". This should -build the bsc executable. If it doesn't, you might want to write to the -author (at the one of the addresses listed at the end of this file) and -tell him he goofed. You get extra credit if you can describe the reasons -for the failure in sufficient detail for me to correct the problem. - -Once you have bsc successfully compiled, move it to your favorite -directory. It doesn't really matter where you put it, as long as you can -find it when you need it. - -The documentation on running bsc is in the file bsc.1, in UNIX man page -format. The file bsc.1 should be installed somewhere where your man -command can find it. (If you can't write to the /usr/man directory, and -you have a brain-dead man command that can't find man pages in non-standard -places, then you can type "make catman" to turn the man page into an -ordinary text file ("bsc.1.txt").) - -INFORMATION ------------ - -This program is freeware. It comes with no warranty of any kind--in -particular, I cannot guarantee that it is free of bugs. Use it at your -own risk. - -When the inevitable bugs DO appear, send e-mail to one of the addresses -below. I welcome bug reports, comments, complaints, and suggestions for -improvement. - -Thanks to Marcel J. E. Mol, whose sciibin program was a valuable source -of technical information on BinSCII. - - - Neil Parker - parker@corona.uoregon.edu - nparker@cie.uoregon.edu - -Version 1.2 =src/docs.vms - -BSC is a program which creates BinSCII files on VMS systems. - - -COMPILING & INSTALLING ----------------------- - -After unpacking the BSC source files, type "@VMSMAKE". Then sit back and wait -for the compile to finish. - -When BSC is finished compiling, move the file BSC.EXE to the location where -you finally want it to run from. (This can be done with the RENAME -command.) - -Finally, execute a command of the following form: - - BSC :== $device:[directory]BSC - -where "device:[directory]" is the location where you stored BSC.EXE. (The -above command should be put into your LOGIN.COM if you want to have access -to BSC whenever you log on.) - -NOTE: I tested BSC on VMS 5.2. I have no idea whether it will work on -earlier versions of VMS. - -EXECUTING ---------- - -To run BSC, use: - - BSC [] - -The following options are available: - - -t type Sets the ProDOS filetype stored in the BinSCII - header to "type". The type may be specified in - any of several ways: - Type Meaning - ---- ----------- - LLL 3-letter abbreviation - dd decimal - 0xdd hexadecimal - $dd hexadecimal - 0dd octal - The 3-letter abbreviations recognized are the - standard ones described in "About File Type Notes" - from Apple Computer, Inc. For the complete list of - abbreviations recognized by the current version of - BSC, see the file PFTYPES.H. If no "-t" option is - present, the filetype will default to 6 (BIN). - - -a auxtype Sets the stored ProDOS auxiliary filetype to - "auxtype". The auxiliary type may specified in - any of the following forms: - Syntax Base - ------ ----------- - dd decimal - $dd hexadecimal - 0xdd hexadecimal - 0dd octal - If no "-a" options is present, the auxiliary - filetype will default to 0. - - -m mode Sets the stored ProDOS access mode to "mode" The - mode may be one or more of the following: - Mode Meaning - ---- --------- - d destroy - n rename - b backup-needed - i invisible - w write - r read - If no "-m" option is present, the access mode - defaults to "dnwr", which corresponds to an - "unlocked" ProDOS file. To create a "locked" - file, use "-m r". - - -n name Sets the ProDOS filename stored in the BinSCII - header. If the "-n" option is omitted, the ProDOS - filename will be the same as the VMS filename. - - -s num Sets the number of BinSCII segments per output file - to "num". As above, the number may be specified in - decimal, hex, or octal. If no "-s" option is present, - or if "num" is 0, then all BinSCII segments will be - written to a single output file. To cause each - segment to go into its own output file (like the - Apple II BINSCII program), use "-s 1". See below - for an explanation of output files. - - -o file Sent the output to files whose names are derived - from the name "file", instead of from the name of - the input file. - - -b Normally, BSC treats its input file as an ASCII - file. If the "-b" flag is specified, the input - file will be treated as binary instead. This flag - is essential for getting a sensible conversion of a - non-ASCII file. See below for more information on - VMS files and the "-b" option. - - -h Print a short summary of bsc's options on the - standard output. - -These options, if present, may appear in any order, provided that they -appear before the filename. Spaces may appear between an option letter -and its value, but are not necessary. - -The filename is the name of the VMS file to be BinSCII'd. The stored -ProDOS filename will be taken from the VMS name, or from the -n option if -one was supplied, with lowercase letters converted to uppercase. -Additionally, characters that are not valid in ProDOS filenames will be -translated into periods (unless the invalid character is the first -character in the name, in which case it gets translated into an "X"). The -ProDOS name will be truncated to 15 characters if necessary. - -The stored ProDOS creation and modification times will be taken from the -VMS input file. - -The output of bsc is a set of one or more files, each containing one or -more BinSCII segments. By default, all BinSCII segments are written to -a single output file, which has the same name as the input file with a -"-0" appended to the end. If the "-s" option is given on the command -line with a value greater than zero, then the number of segments per -output file will be limited to the specified value, and if more than one -output file is needed, the second file will have "-1" appended to the -name, the third will have "-2" appended, and so forth. For example, if -"FOO.DAT" is a large VMS file, the command "bsc -s3 foo.dat" will create -files "FOO.DAT-0", "FOO.DAT-1", "FOO.DAT-2", etc., each containing 3 -BinSCII segments. - -Unfortunately, certain features of the VMS file system seem to be -specifically designed to make life as difficult as possible for programs -like BSC. Files on VMS may be sequential, relative, or indexed, and of the -three, only sequential files can be handled by BSC in a sensible manner. -Additionally, all files are divided into records, which may be any one of -several types, and may have any one of several carriage-return-handling -conventions. The VAX C I/O functions do their best to make sense of this -chaos by making everything look like a UNIX (i.e. structureless) file. -This works great for text files, but it turns non-ASCII files into garbage -(since there's no completely reliable way to tell whether a given newline -character was really part of the file or was inserted by VAX C to mark the -end of a record). - -The (partial) solution to this problem is BSC's "-b" flag. This causes BSC -to open the file in binary mode, which turns off the special end-of-record -character insertion. - -Alas, this isn't the end of the story. If the records of a binary file are -of any type other than FIXED, then the file-length counter includes -record-separator information that isn't part of the actual data (and -therefore isn't seen by BSC, which then thinks the file is longer than it -actually is). And if the records ARE of type FIXED, then the last record -will be padded with enough extra bytes to raise the file length to a -multiple of of the record length. Either way, the result may be a file -with extra garbage at the end. - - * If you have an ASCII file, omit the -b option. - * If you have a non-ASCII file, use the -b option, and pray - that the application that finally has to deal with the file - isn't bothered by extra garbage at the end. - * For some weird cases, you may need to use CONVERT/FDL first. - -Mercifully, Shrinkit seems to be able to handle extra garbage at the end -of an archive without problems. - -BSC will refuse to BinSCII a file larger than 16777216 bytes (16 meg), -since that is the maximum size of a ProDOS file. - -An example: Suppose a VMS file called "PIC.DAT" contains a standard -Apple IIGS super-hires screen image. The command - - bsc -b -tpic pic.dat - -will create the file "PIC.DAT-0" in a format suitable for downloading to -an Apple II and un-BinSCIIing, or for posting to comp.binaries.apple2. -When un-BinSCII'd on an Apple II, it will automatically be converted to -a PIC ($C1) file. - -INFORMATION ------------ - -This program is freeware. It comes with no warranty of any kind--in -particular, I cannot guarantee that it is free of bugs. Use it at your -own risk. - -When the inevitable bugs DO appear, send e-mail to one of the addresses -below. I welcome bug reports, comments, complaints, and suggestions for -improvement. - -Thanks to Marcel J. E. Mol, whose sciibin program was a valuable source -of technical information on BinSCII. - - - Neil Parker - parker@corona.uoregon.edu - nparker@cie.uoregon.edu - -Version 1.2 =src/pftypes.h - -/* - * Apple II ProDOS file types as of June, 1992 - * - * See "About Apple II File Type Notes" by Apple Developer Technical - * Support for more information. - * - * This list is taken directly from the above named document, with the - * exception of the file types $B6 and $F9, for which the abbreviations - * "str" and "p16" are often found alongside the official abbreviations - * ("pif" and "os" respectively). - */ - -struct ftypes { - unsigned char code; - char name[4]; -} filetypes[] = { - 0x00, "non", /* Unknown */ - 0x01, "bad", /* Bad blocks */ - 0x02, "pcd", /* Pascal code */ - 0x03, "ptx", /* Pascal text */ - 0x04, "txt", /* ASCII text */ - 0x05, "pda", /* Pascal data */ - 0x06, "bin", /* Binary */ - 0x07, "fnt", /* Apple /// Font */ - 0x08, "fot", /* Apple II or /// Graphics */ - 0x09, "ba3", /* Apple /// BASIC program */ - 0x0a, "da3", /* Apple /// BASIC data */ - 0x0b, "wpf", /* Apple II or /// Word Processor */ - 0x0c, "sos", /* Apple /// SOS System */ - 0x0f, "dir", /* Folder */ - 0x10, "rpd", /* Apple /// RPS data */ - 0x11, "rpi", /* Apple /// RPS index */ - 0x12, "afd", /* Apple /// AppleFile discard */ - 0x13, "afm", /* Apple /// AppleFile model */ - 0x14, "afr", /* Apple /// AppleFile report format */ - 0x15, "scl", /* Apple /// screen library */ - 0x16, "pfs", /* PFS document */ - 0x19, "adb", /* AppleWorks Data Base */ - 0x1a, "awp", /* AppleWorks Word Processor */ - 0x1b, "asp", /* AppleWorks Spreadsheet */ - 0x20, "tdm", /* Desktop Manager document */ - 0x2a, "8sc", /* Apple II Source Code */ - 0x2b, "8ob", /* Apple II Object Code */ - 0x2c, "8ic", /* Apple II Interpreted Code */ - 0x2d, "8ld", /* Apple II Language Data */ - 0x2e, "p8c", /* ProDOS 8 code module */ - 0x40, "dic", /* Dictionary file */ - 0x42, "ftd", /* File Type Names */ - 0x50, "gwp", /* Apple IIgs Word Processor */ - 0x51, "gss", /* Apple IIgs Spreadsheet */ - 0x52, "gdb", /* Apple IIgs Data Base */ - 0x53, "drw", /* Drawing */ - 0x54, "gdp", /* Desktop Publishing */ - 0x55, "hmd", /* Hypermedia */ - 0x56, "edu", /* Educational Data */ - 0x57, "stn", /* Stationery */ - 0x58, "hlp", /* Help File */ - 0x59, "com", /* Communications File */ - 0x5a, "cfg", /* Configuration file */ - 0x5b, "anm", /* Animation file */ - 0x5c, "mum", /* Multimedia document */ - 0x5d, "ent", /* Game/Entertainment document */ - 0x5e, "dvu", /* Development utility document */ - 0x5f, "fin", /* Financial document */ - 0x6b, "bio", /* PC Transporter BIOS */ - 0x6d, "tdr", /* PC Transporter driver */ - 0x6e, "pre", /* PC Transporter pre-boot */ - 0x6f, "hdv", /* PC Transporter volume */ - 0xa0, "wp", /* WordPerfect document */ - 0xab, "gsb", /* Apple IIgs BASIC program */ - 0xac, "tdf", /* Apple IIgs BASIC TDF */ - 0xad, "bdf", /* Apple IIgs BASIC data */ - 0xb0, "src", /* Apple IIgs source code */ - 0xb1, "obj", /* Apple IIgs object code */ - 0xb2, "lib", /* Apple IIgs Library file */ - 0xb3, "s16", /* GS/OS application */ - 0xb4, "rtl", /* GS/OS Run-Time Library */ - 0xb5, "exe", /* GS/OS Shell application */ - 0xb6, "pif", /* Permanent initialization file */ - 0xb6, "str", /* Permanent initialization file (alternate) */ - 0xb7, "tif", /* Temporary initialization file */ - 0xb8, "nda", /* New desk accessory */ - 0xb9, "cda", /* Classic desk accessory */ - 0xba, "tol", /* Tool */ - 0xbb, "dvr", /* Apple IIgs Device Driver file */ - 0xbc, "ldf", /* Load file (generic) */ - 0xbd, "fst", /* GS/OS File System Translator */ - 0xbf, "doc", /* GS/OS document */ - 0xc0, "pnt", /* Packed Super Hi-Res picture */ - 0xc1, "pic", /* Super Hi-Res picture */ - 0xc2, "ani", /* Paintworks animation */ - 0xc3, "pal", /* Paintworks palette */ - 0xc5, "oog", /* Object-oriented graphics */ - 0xc6, "scr", /* Script */ - 0xc7, "cdv", /* Control Panel document */ - 0xc8, "fon", /* Font */ - 0xc9, "fnd", /* Finder data */ - 0xca, "icn", /* Icons */ - 0xd5, "mus", /* Music sequence */ - 0xd6, "ins", /* Instrument */ - 0xd7, "mdi", /* MIDI data */ - 0xd8, "snd", /* Sampled sound */ - 0xdb, "dbm", /* DB Master document */ - 0xe0, "lbr", /* Archival library */ - 0xe2, "atk", /* AppleTalk data */ - 0xee, "r16", /* EDASM 816 relocatable file */ - 0xef, "pas", /* Pascal area */ - 0xf0, "cmd", /* BASIC command */ - 0xf9, "os", /* GS/OS System file */ - 0xf9, "p16", /* GS/OS System file (alternate) */ - 0xfa, "int", /* Integer BASIC program */ - 0xfb, "ivr", /* Integer BASIC variables */ - 0xfc, "bas", /* AppleSoft BASIC program */ - 0xfd, "var", /* AppleSoft BASIC variables */ - 0xfe, "rel", /* Relocatable code */ - 0xff, "sys" /* ProDOS 8 application */ -}; - -#define FTYPESIZE sizeof(filetypes)/sizeof(struct ftypes) =src/vmsmake.com -$! VMS script to make BSC -$! By Neil Parker -$! Feb. 22, 1992 -$! -$ DEFINE SYS SYS$SHARE: ! so that #include will work properly -$ CC BSC ! compile -$ LINK BSC,VMSOPT/OPTIONS ! link with sharable VAXCRTL =src/vmsopt.opt -SYS$SHARE:VAXCRTL.EXE/SHARE + END OF ARCHIVE