#!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # # 7_2a.c 7_2b.c 7_2c.c 7_2d.c makefile nscreen.c tst.cmp # # 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:10:17 EDT 1990 # echo x - 7_2a.c sed 's/^X//' > 7_2a.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* exercise 7.2 */ /* implement the screen routine */ /* using the curses library */ #include /* inline */ void screen_init() { initscr(); } !EOF! ls -l 7_2a.c echo x - 7_2b.c sed 's/^X//' > 7_2b.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* inline */ void put_point(int x, int y) { (void) mvaddch(LINES - 1 - y, x, black); } !EOF! ls -l 7_2b.c echo x - 7_2c.c sed 's/^X//' > 7_2c.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* inline */ void screen_clear() { erase(); } /* inline */ void screen_refresh() { refresh(); } !EOF! ls -l 7_2c.c echo x - 7_2d.c sed 's/^X//' > 7_2d.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ /* inline */ void screen_end() { endwin(); } !EOF! ls -l 7_2d.c echo x - makefile sed 's/^X//' > makefile << '!EOF!' CC= CC -I. -I../shape -I../../CC SHP= ../shape all: tst OBJ= nscreen.o $(SHP)/shape.o $(SHP)/myshape.o $(SHP)/slist.o $(SHP)/put_line.o $(SHP)/main.o tst: $(OBJ) $(CC) $(OBJ) -o tst -lcurses nscreen.o: nscreen.c $(SHP)/screen.h 7_2a.c 7_2b.c 7_2c.c 7_2d.c $(CC) $(CFLAGS) -c nscreen.c CMP= tst.cmp OUT= tst.out tst.out: tst ; TERM=ansi LINES=24 COLUMNS=80 tst > tst.out test: all $(CMP) $(OUT) cmp tst.out tst.cmp @echo test done !EOF! ls -l makefile echo x - nscreen.c sed 's/^X//' > nscreen.c << '!EOF!' /* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */ /* The C++ Answer Book */ /* Tony Hansen */ /* All rights reserved. */ #include "screen.h" #include "7_2a.c" #include "7_2b.c" #include "7_2c.c" #include "7_2d.c" !EOF! ls -l nscreen.c echo x - tst.cmp sed 's/^X//' > tst.cmp << '!EOF!' ************* * * * ** ** * ***************** * ** * * * * ********* * * * *********** ************* * * * * * * * * * * * * * * * * * * ********************** * * * * * *  * * *  * *  * *  * * * *  ******* * ***************** ************* [5@ * * *** * [5@ * [5@ * * [5@ * * ********* * [5@ * [7@ ****** !EOF! ls -l tst.cmp # The following exit is to ensure that extra garbage # after the end of the shar file will be ignored. exit 0