#!/bin/sh
# This is a shar archive.
# The rest of this file is a shell script which will extract:
#
# 8_7_init.c makefile tst.c tst.cmp tst.in
#
# To extract the files from this shell archive file simply
# create a directory for this file, move the archive file
# to it and enter the command
#
#	sh filename
# 
# The files will be extracted automatically.
# Note: Do not use csh.
#
# Archive created: Mon Jul 30 23:13:43 EDT 1990
#
echo x - 8_7_init.c
sed 's/^X//' > 8_7_init.c << '!EOF!'
/* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
/* The C++ Answer Book */
/* Tony Hansen */
/* All rights reserved. */
// declare a suitable amount of buffer space
static char cout_buf[1], cerr_buf[1], cin_buf[1];

// Make filebuf's to manage that space.
// Bind it to the UNIX FILE pointers
static filebuf cout_file
    (stdout, cout_buf, sizeof(cout_buf));
static filebuf cerr_file
    (stderr, cerr_buf, sizeof(cerr_buf));
static filebuf cin_file
    (stdin, cin_buf, sizeof(cin_buf));

// make the streams providing the user interface
ostream cout(&cout_file);
ostream cerr(&cerr_file);
istream cin(&cin_file);
!EOF!
ls -l 8_7_init.c
echo x - makefile
sed 's/^X//' > makefile << '!EOF!'
CC= CC -I. -I../8.6dir -I../../CC
CFLAGS=

all: tst

DIR= ../8.6dir

tst: tst.o $(DIR)/in.o $(DIR)/out.o $(DIR)/main.o
	$(CC) tst.o $(DIR)/in.o $(DIR)/out.o $(DIR)/main.o -o tst

tst.o: tst.c 8_7_init.c
	$(CC) $(CFLAGS) -c tst.c

CMP= tst.cmp
OUT= tst.out

tst.out: tst tst.in ; tst < tst.in > tst.out

test: $(CMP) $(OUT)
	cmp tst.out tst.cmp
	@echo test done
!EOF!
ls -l makefile
echo x - tst.c
sed 's/^X//' > tst.c << '!EOF!'
/* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
/* The C++ Answer Book */
/* Tony Hansen */
/* All rights reserved. */
#include <stream.h>
#include "8_6_alloc.c"
#include "8_6_c1.c"
#include "8_6_c2.c"
#include "8_6_dest.c"
#include "8_6_doalloc.c"
#include "8_6_fbclose.c"
#include "8_6_fbopen.c"
#include "8_6_fbover.c"
#include "8_6_fbunder.c"
#include "8_7_init.c"
#include "8_6_over.c"
#include "8_6_setbuf.c"
#include "8_6_sgetc.c"
#include "8_6_snextc.c"
#include "8_6_spback.c"
#include "8_6_sputc.c"
#include "8_6_stossc.c"
#include "8_6_under.c"
!EOF!
ls -l tst.c
echo x - tst.cmp
sed 's/^X//' > tst.cmp << '!EOF!'
a = 2341
d = 3251.23
!EOF!
ls -l tst.cmp
echo x - tst.in
sed 's/^X//' > tst.in << '!EOF!'
2341
3251.2341
!EOF!
ls -l tst.in
# The following exit is to ensure that extra garbage 
# after the end of the shar file will be ignored.
exit 0
