allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (07/09/89)
Posting-number: Volume 7, Issue 64 Submitted-by: jbayer@ispi.UUCP (Jonathan Bayer) Archive-name: banner/patch01 [One of these days I'll get Patch-To: implemented.... ++bsa] I inadvertently left out a file in the Big Banner program I recently posted. If you tried to compile it and discovered that the file "save.c" was missing, it was. The file is only used if you did NOT use the "RESIDENT" option, and is used to save the datafiles to disk. I have enclosed a slightly revised Makefile and the file save.c below. JB #! /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 <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: Makefile save.c # Wrapped by cdbms@ispi on Tue Jun 27 10:37:26 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(1549 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' X#/************************************************************************ X# * * X# * written by Jonathan B. Bayer * X# * 500 Oakwood Ave. * X# * Roselle Park, NJ 07204 * X# * * X# * * X# * Copyright, 1989 * X# * * X# * Released June, 1989 as shareware * X# * * X# * A payment of $ 15 is requested if you find this * X# * program useful. This will register your copy and * X# * ensure that you will be notified of any new versions. * X# * It will also entitle you to receive the font editor * X# * when it is released. * X# * * X# ************************************************************************/ X# X# X# uncomment the following line if you want all the character tables stored X# with the program instead of in data files. XOPTIONS = -DRESIDENT X XCFLAGS = $(OPTIONS) -Mm2 XLFLAGS = -lcurses -ltermcap XSRCS = banner.c egetopt.c data.c XSHAR_SRCS = banner.c egetopt.c data.c save.c XOBJS = banner.o egetopt.o data.o XMAKES = Makefile banner.mak XHEADERS = banner.h XCC = cc X Xall: big.banner save X Xbig.banner: $(OBJS) X $(CC) $(CFLAGS) $(OBJS) $(LFLAGS) -o big.banner X Xbanner.o: banner.c banner.h X Xegetopt.o: egetopt.c X Xdata.o: data.c banner.h X Xsave.o: save.c banner.h X Xsave: save.o X $(CC) $(CFLAGS) -DRESIDENT data.c -c X $(CC) $(CFLAGS) save.o data.o $(LFLAGS) -o save X rm -f data.o X Xshar: ; X split -750 data.c data. X makekit -o MANIFEST $(SHAR_SRCS) $(MAKES) $(HEADERS) README X rm -f data.a* X Xdata.c: ; X cat data.a* > data.c X Xclean: X rm -f *.o X Xclobber: X rm -f *.o big.banner save X END_OF_FILE if test 1549 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi # end of 'Makefile' fi if test -f 'save.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'save.c'\" else echo shar: Extracting \"'save.c'\" \(1949 characters\) sed "s/^X//" >'save.c' <<'END_OF_FILE' X/************************************************************************ X * * X * written by Jonathan B. Bayer * X * 500 Oakwood Ave. * X * Roselle Park, NJ 07204 * X * * X * * X * Copyright, 1989 * X * * X * Released June, 1989 as shareware * X * * X * A payment of $ 15 is requested if you find this * X * program useful. This will register your copy and * X * ensure that you will be notified of any new versions. * X * It will also entitle you to receive the font editor * X * when it is released. * X * * X ************************************************************************/ X X X#include <stdio.h> X#include <string.h> X#include <malloc.h> X X#include "banner.h" X Xlpat_type *lpat; Xpsub_type *psub; X Xstdstr char_set; X Xextern psub_ar computer_p; Xextern lpat_ar computer_l; Xextern psub_ar roman_p; Xextern lpat_ar roman_l; Xextern psub_ar gothic_p; Xextern lpat_ar gothic_l; X X Xvoid f_error(st1,st2) Xchar *st1, *st2; X{ X fprintf(stderr,"file error %s in file %s",st2, st1); X exit(1); X} /* f_error */ X X X X Xmain() X{ XFILE *f_lpat; XFILE *f_psub; Xint font; X X for (font = 1; font <= 3; font++) { X strcpy(char_set, LIB_DIR); X switch (font) { X case 1: X strcat(char_set,"gothic"); X lpat = gothic_l; X psub = gothic_p; X break; X case 2: X strcat(char_set,"roman"); X lpat = roman_l; X psub = roman_p; X break; X case 3: X strcat(char_set,"computer"); X lpat = computer_l; X psub = computer_p; X break; X } X X strcat(char_set,".l"); X if ( (f_lpat = fopen(char_set,write_flag)) == NULL) f_error(char_set,"opening"); X if (fwrite(lpat,1,MAX_LPAT_AR,f_lpat) != MAX_LPAT_AR) f_error(char_set,"writing"); X fclose(f_lpat); X X char_set[strlen(char_set) - 1] = 'p'; X X if ((f_psub = fopen(char_set,write_flag)) == NULL) f_error(char_set,"opening"); X if (fwrite(psub, 2, MAX_PSUB_AR,f_psub) != MAX_PSUB_AR) f_error(char_set,"writing"); X fclose(f_psub); X } X} /* save_DATA */ X X X X X X END_OF_FILE if test 1949 -ne `wc -c <'save.c'`; then echo shar: \"'save.c'\" unpacked with wrong size! fi # end of 'save.c' fi echo shar: End of shell archive. exit 0 -- Jonathan Bayer Beware: The light at the end of the Intelligent Software Products, Inc. tunnel may be an oncoming dragon 500 Oakwood Ave. ...uunet!ispi!root Roselle Park, NJ 07204 (201) 245-5922 jbayer@ispi.UUCP