v17i040: MGR, Bellcore window manager, Part39/61
Rich Salz
rsalz at uunet.uu.net
Thu Jan 26 07:39:15 AEST 1989
Submitted-by: Stephen A. Uhler <sau at bellcore.com>
Posting-number: Volume 17, Issue 40
Archive-name: mgr/part39
#! /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 archive 39 (of 61)."
# Contents: lib/sfont.c src/subs.c
# Wrapped by rsalz at papaya.bbn.com on Thu Nov 17 21:05:48 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'lib/sfont.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'lib/sfont.c'\"
else
echo shar: Extracting \"'lib/sfont.c'\" \(18800 characters\)
sed "s/^X//" >'lib/sfont.c' <<'END_OF_FILE'
X/* Copyright (c) 1987 Bellcore
X * All Rights Reserved
X * Permission is granted to copy or use this program, EXCEPT that it
X * may not be sold for profit, the copyright notice must be reproduced
X * on copies, and credit should be given to Bellcore where it is due.
X * BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
X */
X/* $Header: sfont.c,v 4.2 88/06/22 09:12:40 sau Exp $
X $Source: /tmp/mgrsrc/lib/RCS/sfont.c,v $
X*/
Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/lib/RCS/sfont.c,v $$Revision: 4.2 $";
X
X/* These characters were adapted from the Hershey font collection.
X *
X * The Hershey Fonts were originally created by Dr. A. V. Hershey
X * while working at the U. S. National Bureau of Standards.
X */
X
X/*---------------------------------------*/
Xsfont( font, ch, min, max, npts, pts)
X int font, *npts;
X char ch;
X short *min, *max, *pts;
X# define char_per_font 96
X{
X int i; char *c;
Xstatic char error_char[127] = { 62, -11, 11,
X -2,4,0,4,0,5,-1,6,-2,5,-2,4,-2,2,-3,0,-2,-2,-3,-4,
X -3,-7,-2,-9,0,-10,2,-9,3,-7,3,-4,2,-2,3,0,2,2,2,4,
X 2,5,1,6,0,5,0,4,2,4,31,31,-4,10,-5,5,-2,2,-3,1,-7,3,
X -12,0,31,31,-10,-5,-7,0,-3,0,-3,-1,-6,-3,-5,-10,31,31,
X 4,10,5,5,2,2,3,1,7,3,12,0,31,31,10,-5,7,0,3,0,3,-1,
X 6,-3,5,-10,31,31,-2,-7,1,-7,2,-6,1,-5,-1,-5,-2,-4,
X -1,-3,2,-3 };
X
X/*-- Stick Figure Font --*/
X
Xstatic char c1[] = { /* SP */
X 0, -8, 8};
Xstatic char c2[] = {
X 8, -4, 4,
X 0, 10, 0, -2,
X 31, 31, 0, -7, -1, -8, 0, -9, 1, -8,
X 0, -7};
Xstatic char c3[] = {
X 5, -7, 7,
X -2, 12, -4, 5,
X 31, 31, 4, 12, 2, 5};
Xstatic char c4[] = {
X 11, -10, 11,
X 1, 12, -6, -16, 31, 31,
X 7, 12, 0, -16, 31, 31, -6, 1, 8, 1,
X 31, 31, -7, -5, 7, -5};
Xstatic char c5[] = {
X 26, -10, 10,
X -2, 16, -2, -13, 31, 31,
X 2, 16, 2, -13, 31, 31,
X 7, 9, 5, 11, 2, 12,
X -2, 12, -5, 11, -7, 9, -7, 7, -6, 5,
X -5, 4, -3, 3, 3, 1, 5, 0, 6, -1,
X 7, -3, 7, -6, 5, -8, 2, -9, -2, -9,
X -5, -8, -7, -6};
Xstatic char c6[] = {
X 31, -12, 12,
X 9, 12, -9, -9, 31, 31,
X -4, 12, -2, 10, -2, 8, -3, 6, -5, 5,
X -7, 5, -9, 7, -9, 9, -8, 11, -6, 12,
X -4, 12, -2, 11, 1, 10, 4, 10, 7, 11,
X 9, 12, 31, 31, 5, -2, 3, -3, 2, -5,
X 2, -7, 4, -9, 6, -9, 8, -8, 9, -6,
X 9, -4, 7, -2, 5, -2};
X
Xstatic char c7[] = {
X 30, -12, 13,
X 10, 4, 9, 5, 8, 5, 7, 4,
X 6, 2, 4, -4, 3, -6, 1, -8, -1, -9,
X -5, -9, -8, -8, -9, -6, -9, -3, -8, -1,
X -2, 3, 0, 5, 1, 7, 1, 9, 0, 11,
X -2, 12, -4, 11, -5, 9, -5, 7, -4, 4,
X -2, 1, 3, -6, 5, -8, 8, -9, 9, -9,
X 10, -8};
X
Xstatic char c8[] = {
X 2, -4, 4,
X 1, 12, -1, 5};
X
Xstatic char c9[] = {
X 10, -7, 7,
X 4, 16, 2, 14, 0, 11,
X -2, 7, -3, 2, -3, -2, -2, -7, 0, -11,
X 2, -14, 4, -16};
X
Xstatic char c10[] = {
X 10, -7, 7,
X -4, 16, -2, 14, 0, 11,
X 2, 7, 3, 2, 3, -2, 2, -7, 0, -11,
X -2, -14, -4, -16};
X
Xstatic char c11[] = {
X 8, -8, 8,
X 0, 12, 0, 0, 31, 31,
X -5, 9, 5, 3, 31, 31, 5, 9, -5, 3};
X
Xstatic char c12[] = {
X 5, -12, 12,
X 0, 9, 0, -9, 31, 31,
X -9, 0, 9, 0};
X
Xstatic char c13[] = {
X 7, -4, 4,
X 0, -9, -1, -8, 0, -7,
X 1, -8, 1, -10, 0, -12, -1, -13};
X
Xstatic char c14[] = {
X 2, -12, 12,
X -9, 0, 9, 0};
X
Xstatic char c15[] = {
X 5, -4, 4,
X 0, -7, -1, -8, 0, -9,
X 1, -8, 0, -7};
X
Xstatic char c16[] = {
X 2, -11, 11,
X 9, 16, -9, -16};
X
Xstatic char c17[] = {
X 17, -10, 10,
X -1, 12, -4, 11, -6, 8,
X -7, 3, -7, 0, -6, -5, -4, -8, -1, -9,
X 1, -9, 4, -8, 6, -5, 7, 0, 7, 3,
X 6, 8, 4, 11, 1, 12, -1, 12};
X
Xstatic char c18[] = {
X 4, -10, 10,
X -4, 8, -2, 9, 1, 12,
X 1, -9};
X
Xstatic char c19[] = {
X 14, -10, 10,
X -6, 7, -6, 8, -5, 10,
X -4, 11, -2, 12, 2, 12, 4, 11, 5, 10,
X 6, 8, 6, 6, 5, 4, 3, 1, -7, -9,
X 7, -9};
X
Xstatic char c20[] = {
X 15, -10, 10,
X -5, 12, 6, 12, 0, 4,
X 3, 4, 5, 3, 6, 2, 7, -1, 7, -3,
X 6, -6, 4, -8, 1, -9, -2, -9, -5, -8,
X -6, -7, -7, -5};
X
Xstatic char c21[] = {
X 6, -10, 10,
X 3, 12, -7, -2, 8, -2,
X 31, 31, 3, 12, 3, -9};
X
Xstatic char c22[] = {
X 17, -10, 10,
X 5, 12, -5, 12, -6, 3,
X -5, 4, -2, 5, 1, 5, 4, 4, 6, 2,
X 7, -1, 7, -3, 6, -6, 4, -8, 1, -9,
X -2, -9, -5, -8, -6, -7, -7, -5};
X
Xstatic char c23[] = {
X 23, -10, 10,
X 6, 9, 5, 11, 2, 12,
X 0, 12, -3, 11, -5, 8, -6, 3, -6, -2,
X -5, -6, -3, -8, 0, -9, 1, -9, 4, -8,
X 6, -6, 7, -3, 7, -2, 6, 1, 4, 3,
X 1, 4, 0, 4, -3, 3, -5, 1, -6, -2};
X
Xstatic char c24[] = {
X 5, -10, 10,
X 7, 12, -3, -9, 31, 31,
X -7, 12, 7, 12};
X
Xstatic char c25[] = {
X 29, -10, 10,
X -2, 12, -5, 11, -6, 9,
X -6, 7, -5, 5, -2, 4, 3, 3, 5, 2,
X 6, 1, 7, -1, 7, -4, 6, -6, 4, -8,
X 1, -9, -1, -9, -4, -8, -6, -6, -7, -4,
X -7, -1, -6, 1, -5, 2, -3, 3, 2, 4,
X 5, 5, 6, 7, 6, 9, 5, 11, 2, 12,
X -2, 12};
X
Xstatic char c26[] = {
X 23, -10, 10,
X 6, 5, 5, 2, 3, 0,
X 0, -1, -1, -1, -4, 0, -6, 2, -7, 5,
X -7, 6, -6, 9, -4, 11, -1, 12, 0, 12,
X 3, 11, 5, 9, 6, 5, 6, 0, 5, -5,
X 3, -8, 0, -9, -2, -9, -5, -8, -6, -6};
X
Xstatic char c27[] = {
X 11, -4, 6,
X 0, 5, -1, 4, 0, 3, 1, 4, 0, 5, 31, 31, 0, -7, -1, -8,
X 0, -9, 1, -8, 0, -7};
X
Xstatic char c28[] = {
X 13, -4, 4,
X 0, 5, -1, 4, 0, 3,
X 1, 4, 0, 5, 31, 31, 0, -9, -1, -8,
X 0, -7, 1, -8, 1, -10, 0, -12, -1, -13};
X
Xstatic char c29[] = {
X 3, -11, 11,
X 8, 9, -8, 0, 8, -9};
X
Xstatic char c30[] = {
X 5, -12, 12,
X -9, 3, 9, 3, 31, 31,
X -9, -3, 9, -3};
X
Xstatic char c31[] = {
X 3, -11, 11,
X -8, 9, 8, 0, -8, -9};
X
Xstatic char c32[] = {
X 23, -9, 9,
X -5, 8, -4, 7, -5, 6,
X -6, 7, -6, 8, -5, 10, -4, 11, -2, 12,
X 1, 12, 4, 11, 5, 10, 6, 8, 6, 6,
X 5, 4, 4, 3, 0, 1, 0, -2, 31, 31,
X 0, -7, -1, -8,
X 0, -9, 1, -8, 0, -7};
X
Xstatic char c33[] = {
X 44, -13, 14,
X 5, 4, 4, 6, 2, 7,
X -1, 7, -3, 6, -4, 5, -5, 2, -5, -1,
X -4, -3, -2, -4, 1, -4, 3, -3, 4, -1,
X 31, 31,
X 6, 7, 5, 4, 4, -1,
X 4, -3, 6, -4, 8, -4, 10, -2, 11, 1,
X 11, 3, 10, 6, 9, 8, 7, 10, 5, 11,
X 2, 12, -1, 12, -4, 11, -6, 10, -8, 8,
X -9, 6, -10, 3, -10, 0, -9, -3, -8, -5,
X -6, -7, -4, -8, -1, -9, 2, -9, 5, -8,
X 7, -7, 8, -6};
X
Xstatic char c34[] = {
X 8, -9, 9,
X 0, 12, -8, -9, 31, 31,
X 0, 12, 8, -9, 31, 31, -6, -4, 6, -4};
X
Xstatic char c35[] = {
X 23, -11, 10,
X -7, 12, -7, -9, 31, 31,
X -7, 12, 2, 12, 5, 11, 6, 10, 7, 8,
X 7, 6, 6, 4, 5, 3, 2, 2, 31, 31,
X -7, 2, 2, 2, 5, 1, 6, 0, 7, -2,
X 7, -5, 6, -7, 5, -8, 2, -9, -7, -9};
X
Xstatic char c36[] = {
X 18, -10, 11,
X 8, 7, 7, 9, 5, 11,
X 3, 12, -1, 12, -3, 11, -5, 9, -6, 7,
X -7, 4, -7, -1, -6, -4, -5, -6, -3, -8,
X -1, -9, 3, -9, 5, -8, 7, -6, 8, -4};
X
Xstatic char c37[] = {
X 15, -11, 10,
X -7, 12, -7, -9, 31, 31,
X -7, 12, 0, 12, 3, 11, 5, 9, 6, 7,
X 7, 4, 7, -1, 6, -4, 5, -6, 3, -8,
X 0, -9, -7, -9};
X
Xstatic char c38[] = {
X 11, -10, 9,
X -6, 12, -6, -9, 31, 31,
X -6, 12, 7, 12, 31, 31, -6, 2, 2, 2,
X 31, 31, -6, -9, 7, -9};
X
Xstatic char c39[] = {
X 8, -10, 8,
X -6, 12, -6, -9, 31, 31,
X -6, 12, 7, 12, 31, 31, -6, 2, 2, 2};
X
Xstatic char c40[] = {
X 22, -10, 11,
X 8, 7, 7, 9, 5, 11,
X 3, 12, -1, 12, -3, 11, -5, 9, -6, 7,
X -7, 4, -7, -1, -6, -4, -5, -6, -3, -8,
X -1, -9, 3, -9, 5, -8, 7, -6, 8, -4,
X 8, -1, 31, 31, 3, -1, 8, -1};
X
Xstatic char c41[] = {
X 8, -11, 11,
X -7, 12, -7, -9, 31, 31,
X 7, 12, 7, -9, 31, 31, -7, 2, 7, 2};
X
Xstatic char c42[] = {
X 8, -6, 6,
X 0, 12, 0, -9, 31, 31,
X -3, 12, 3, 12, 31, 31, -3, -9, 3, -9};
X
Xstatic char c43[] = {
X 10, -9, 8,
X 4, 12, 4, -4, 3, -7,
X 2, -8, 0, -9, -2, -9, -4, -8, -5, -7,
X -6, -4, -6, -2};
X
Xstatic char c44[] = {
X 8, -11, 9,
X -7, 12, -7, -9, 31, 31,
X 7, 12, -7, -2, 31, 31, -2, 3, 7, -9};
X
Xstatic char c45[] = {
X 5, -10, 7,
X -6, 12, -6, -9, 31, 31,
X -6, -9, 6, -9};
X
Xstatic char c46[] = {
X 11, -12, 12,
X -8, 12, -8, -9, 31, 31,
X -8, 12, 0, -9, 31, 31, 8, 12, 0, -9,
X 31, 31, 8, 12, 8, -9};
X
Xstatic char c47[] = {
X 8, -11, 11,
X -7, 12, -7, -9, 31, 31,
X -7, 12, 7, -9, 31, 31, 7, 12, 7, -9};
X
Xstatic char c48[] = {
X 21, -11, 11,
X -2, 12, -4, 11, -6, 9,
X -7, 7, -8, 4, -8, -1, -7, -4, -6, -6,
X -4, -8, -2, -9, 2, -9, 4, -8, 6, -6,
X 7, -4, 8, -1, 8, 4, 7, 7, 6, 9,
X 4, 11, 2, 12, -2, 12};
X
Xstatic char c49[] = {
X 13, -11, 10,
X -7, 12, -7, -9, 31, 31,
X -7, 12, 2, 12, 5, 11, 6, 10, 7, 8,
X 7, 5, 6, 3, 5, 2, 2, 1, -7, 1};
X
Xstatic char c50[] = {
X 24, -11, 11,
X -2, 12, -4, 11, -6, 9,
X -7, 7, -8, 4, -8, -1, -7, -4, -6, -6,
X -4, -8, -2, -9, 2, -9, 4, -8, 6, -6,
X 7, -4, 8, -1, 8, 4, 7, 7, 6, 9,
X 4, 11, 2, 12, -2, 12, 31, 31, 1, -5,
X 7, -11};
X
Xstatic char c51[] = {
X 16, -11, 10,
X -7, 12, -7, -9, 31, 31,
X -7, 12, 2, 12, 5, 11, 6, 10, 7, 8,
X 7, 6, 6, 4, 5, 3, 2, 2, -7, 2,
X 31, 31, 0, 2, 7, -9};
X
Xstatic char c52[] = {
X 20, -10, 10,
X 7, 9, 5, 11, 2, 12,
X -2, 12, -5, 11, -7, 9, -7, 7, -6, 5,
X -5, 4, -3, 3, 3, 1, 5, 0, 6, -1,
X 7, -3, 7, -6, 5, -8, 2, -9, -2, -9,
X -5, -8, -7, -6};
X
Xstatic char c53[] = {
X 5, -8, 8,
X 0, 12, 0, -9, 31, 31,
X -7, 12, 7, 12};
X
Xstatic char c54[] = {
X 10, -11, 11,
X -7, 12, -7, -3, -6, -6,
X -4, -8, -1, -9, 1, -9, 4, -8, 6, -6,
X 7, -3, 7, 12};
X
Xstatic char c55[] = {
X 5, -9, 9,
X -8, 12, 0, -9, 31, 31,
X 8, 12, 0, -9};
X
Xstatic char c56[] = {
X 11, -12, 12,
X 1 -10, 12, -5, -9, 31, 31,
X 0, 12, -5, -9, 31, 31, 0, 12, 5, -9,
X 31, 31, 10, 12, 5, -9};
X
Xstatic char c57[] = {
X 5, -10, 10,
X -7, 12, 7, -9, 31, 31,
X 7, 12, -7, -9};
X
Xstatic char c58[] = {
X 6, -9, 9,
X -8, 12, 0, 2, 0, -9,
X 31, 31, 8, 12, 0, 2};
X
Xstatic char c59[] = {
X 8, -10, 10,
X 7, 12, -7, -9, 31, 31,
X -7, 12, 7, 12, 31, 31, -7, -9, 7, -9};
X
Xstatic char c60[] = {
X 8, -7, 7,
X -3, 16, -3, -16, 31, 31,
X -3, 16, 4, 16,
X 31, 31, -3, -16, 4, -16};
X
Xstatic char c61[] = {
X 2, -11, 11,
X -9, 16, 9, -16};
X
Xstatic char c62[] = {
X 8, -7, 7,
X 3, 16, 3, -16, 31, 31, -4, 16, 3, 16,
X 31, 31, -4, -16, 3, -16};
X
Xstatic char c63[] = {
X 3, -11, 11,
X 1 -8, -2, 0, 3, 8, -2};
X
Xstatic char c64[] = {
X 2, -12, 12,
X 1 -9, -12, 9, -12};
X
Xstatic char c65[] = {
X 2, -6, 6,
X 1 -2, 12, 3, 6};
X
Xstatic char c66[] = {
X 17, -9, 10,
X 6, 5, 6, -9, 31, 31,
X 6, 2, 4, 4, 2, 5, -1, 5, -3, 4,
X -5, 2, -6, -1, -6, -3, -5, -6, -3, -8,
X -1, -9, 2, -9, 4, -8, 6, -6};
X
Xstatic char c67[] = {
X 17, -10, 9,
X -6, 12, -6, -9, 31, 31,
X -6, 2, -4, 4, -2, 5, 1, 5, 3, 4,
X 5, 2, 6, -1, 6, -3, 5, -6, 3, -8,
X 1, -9, -2, -9, -4, -8, -6, -6};
X
Xstatic char c68[] = {
X 14, -9, 9,
X 6, 2, 4, 4, 2, 5,
X -1, 5, -3, 4, -5, 2, -6, -1, -6, -3,
X -5, -6, -3, -8, -1, -9, 2, -9, 4, -8,
X 6, -6};
X
Xstatic char c69[] = {
X 17, -9, 10,
X 6, 12, 6, -9, 31, 31,
X 6, 2, 4, 4, 2, 5, -1, 5, -3, 4,
X -5, 2, -6, -1, -6, -3, -5, -6, -3, -8,
X -1, -9, 2, -9, 4, -8, 6, -6};
X
Xstatic char c70[] = {
X 17, -9, 9,
X -6, -1, 6, -1, 6, 1,
X 5, 3, 4, 4, 2, 5, -1, 5, -3, 4,
X -5, 2, -6, -1, -6, -3, -5, -6, -3, -8,
X -1, -9, 2, -9, 4, -8, 6, -6};
X
Xstatic char c71[] = {
X 8, -5, 7,
X 5, 12, 3, 12, 1, 11,
X 0, 8, 0, -9, 31, 31, -4, 5, 4, 5};
X
Xstatic char c72[] = {
X 22, -9, 10,
X 6, 5, 6, -11, 5, -14,
X 4, -15, 2, -16, -1, -16, -3, -15, 31, 31,
X 6, 2, 4, 4, 2, 5, -1, 5, -3, 4,
X -5, 2, -6, -1, -6, -3, -5, -6, -3, -8,
X -1, -9, 2, -9, 4, -8, 6, -6};
X
Xstatic char c73[] = {
X 10, -9, 10,
X -5, 12, -5, -9, 31, 31,
X -5, 1, -2, 4, 0, 5, 3, 5, 5, 4,
X 6, 1, 6, -9};
X
Xstatic char c74[] = {
X 8, -4, 4,
X -1, 12, 0, 11, 1, 12,
X 0, 13, -1, 12, 31, 31, 0, 5, 0, -9};
X
Xstatic char c75[] = {
X 11, -5, 5,
X 0, 12, 1, 11, 2, 12,
X 1, 13, 0, 12, 31, 31, 1, 5, 1, -12,
X 0, -15, -2, -16, -4, -16};
X
Xstatic char c76[] = {
X 8, -9, 8,
X -5, 12, -5, -9, 31, 31,
X 5, 5, -5, -5, 31, 31, -1, -1, 6, -9};
X
Xstatic char c77[] = {
X 2, -4, 4,
X 0, 12, 0, -9};
X
Xstatic char c78[] = {
X 18, -15, 15,
X -11, 5, -11, -9, 31, 31,
X -11, 1, -8, 4, -6, 5, -3, 5, -1, 4,
X 0, 1, 0, -9, 31, 31, 0, 1, 3, 4,
X 5, 5, 8, 5, 10, 4, 11, 1, 11, -9};
X
Xstatic char c79[] = {
X 10, -9, 10,
X -5, 5, -5, -9, 31, 31,
X -5, 1, -2, 4, 0, 5, 3, 5, 5, 4,
X 6, 1, 6, -9};
X
Xstatic char c80[] = {
X 17, -9, 10,
X -1, 5, -3, 4, -5, 2,
X -6, -1, -6, -3, -5, -6, -3, -8, -1, -9,
X 2, -9, 4, -8, 6, -6, 7, -3, 7, -1,
X 6, 2, 4, 4, 2, 5, -1, 5};
X
Xstatic char c81[] = {
X 17, -10, 9,
X -6, 5, -6, -16, 31, 31,
X -6, 2, -4, 4, -2, 5, 1, 5, 3, 4,
X 5, 2, 6, -1, 6, -3, 5, -6, 3, -8,
X 1, -9, -2, -9, -4, -8, -6, -6,};
X
Xstatic char c82[] = {
X 17, -9, 10,
X 6, 5, 6, -16, 31, 31,
X 6, 2, 4, 4, 2, 5, -1, 5, -3, 4,
X -5, 2, -6, -1, -6, -3, -5, -6, -3, -8,
X -1, -9, 2, -9, 4, -8, 6, -6};
X
Xstatic char c83[] = {
X 8, -7, 7,
X -3, 5, -3, -9, 31, 31,
X -3, -1, -2, 2, 0, 4, 2, 5, 5, 5};
X
Xstatic char c84[] = {
X 17, -8, 9,
X 6, 2, 5, 4, 2, 5,
X -1, 5, -4, 4, -5, 2, -4, 0, -2, -1,
X 3, -2, 5, -3, 6, -5, 6, -6, 5, -8,
X 2, -9, -1, -9, -4, -8, -5, -6};
X
Xstatic char c85[] = {
X 8, -5, 7,
X 0, 12, 0, -5, 1, -8,
X 3, -9, 5, -9, 31, 31, -4, 5, 4, 5};
X
Xstatic char c86[] = {
X 10, -9, 10,
X -5, 5, -5, -5, -4, -8,
X -2, -9, 1, -9, 3, -8, 6, -5, 31, 31,
X 6, 5, 6, -9};
X
Xstatic char c87[] = {
X 5, -8, 8,
X -6, 5, 0, -9, 31, 31,
X 6, 5, 0, -9};
X
Xstatic char c88[] = {
X 11, -11, 11,
X -8, 5, -4, -9, 31, 31,
X 0, 5, -4, -9, 31, 31, 0, 5, 4, -9,
X 31, 31, 8, 5, 4, -9};
X
Xstatic char c89[] = {
X 5, -9, 9,
X -6, 5, 6, -9, 31, 31,
X 6, 5, -6, -9};
X
Xstatic char c90[] = {
X 9, -8, 8,
X -6, 5, 0, -9, 31, 31,
X 6, 5, 0, -9, -2, -13, -4, -15, -6, -16,
X -7, -16};
X
Xstatic char c91[] = {
X 8, -9, 9,
X 6, 5, -6, -9, 31, 31,
X -6, 5, 6, 5, 31, 31, -6, -9, 6, -9};
X
Xstatic char c92[] = {
X 17, -7, 9,
X 2, 16, -1, 13, -2, 10, -2, 8, -1, 5, 2, 2, 31, 31,
X 2, 2, -1, 0, 2, -2, 31, 31,
X 2, -2, -1, -5, -2, -8, -2, -10, -1, -13, 2, -16};
X
Xstatic char c93[] = {
X 2, -4, 4,
X 0, 16, 0, -16};
X
Xstatic char c94[] = {
X 17, -7, 9,
X -2, 16, 1, 13, 2, 10, 2, 8, 1, 5, -2, 2, 31, 31,
X -2, 2, 1, 0, -2, -2, 31, 31,
X -2, -2, 1, -5, 2, -8, 2, -10, 1, -13, -2, -16};
X
Xstatic char c95[] = {
X 11, -12, 14,
X -9, -3, -9, -1, -8, 2, -6, 3, -4, 3, -2, 2, 2, -1, 4, -2,
X 6, -2, 8, -1, 9, 1};
X
Xstatic char c96[] = {
X 4, -10, 10,
X -8, -9, 0, 12, 8, -9, -8, -9};
X
Xstatic char c97[] = { /* ground */
X 8, 0, 4,
X 0,-5,0,5,31,31,2,-3,2,3,31,31,4,-1,4,1};
X
Xstatic char c98[] = { /* vertical bar */
X 2, 0, 3,
X 0,-5,0,5 };
X
Xstatic char c99[] = { /* chip */
X 9, 0, 8,
X 0,-8,0,8,3,8,3,6,5,6,5,8,8,8,8,-8,0,-8 };
X
Xstatic char c100[] = { /* big circle */
X 13, 0, 16,
X 0,0,1,4,4,7,8,8,12,7,15,4,16,0,
X 15,-4,12,-7,8,-8,4,-7,1,-4,0,0 };
X
Xstatic char c101[] = { /* arrowtail > */
X 3, 0, 5,
X 0,-4,5,0,0,4 };
X
Xstatic char c102[] = { /* - - */
X 5, 0, 15,
X 0,0,5,0,31,31,10,0,15,0 };
X
Xstatic char c103[] = { /* large curve ) */
X 6, -1, 3,
X -1,8,0,6,1,2,1,-2,0,-6,-1,-8 };
X
Xstatic char c104[] = { /* centerline --- - */
X 5, 0, 20,
X 0,0,13,0,31,31,16,0,20,0 };
X
Xstatic char c105[] = { /* inverter */
X 4, 0, 7,
X 0,-5,7,0,0,5,0,-5 };
X
Xstatic char c106[] = { /* resistor */
X 9, 0, 20,
X 0,0,2,0,4,3,7,-3,10,3,13,-3,16,3,18,0,20,0 };
X
Xstatic char c107[] = { /* transistor */
X 9, 0, 6,
X 0,-4,0,4,31,31,6,-8,6,-6,2,-6,2,6,6,6,6,8 };
X
Xstatic char c108[] = { /* arrowhead */
X 6, 0, 5,
X 0,0,5,0,31,31,0,-4,5,0,0,4 };
X
Xstatic char c109[] = { /* or gate */
X 14, -1, 16,
X -1,-8,7,-7,11,-5,14,-3,16,0,14,3,11,5,7,7,-1,8,0,6,1,2,1,-2,
X 0,-6,-1,-8 };
X
Xstatic char c110[] = { /* and gate */
X 10, 0, 15,
X 0,-8,8,-8,11,-7,14,-4,15,0,14,4,11,7,8,8,0,8,0,-8 };
X
Xstatic char c111[] = { /* not symbol o */
X 9, 0, 4,
X 0,-1,1,-2,3,-2,4,-1,4,1,3,2,1,2,0,1,0,-1 };
X
Xstatic char c112[] = { /* wire connect dot */
X 5, 0, 0,
X -1,-1,1,-1,1,1,-1,1,-1,-1 };
X
Xstatic char *p[] = {
X c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
X c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24,
X c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36,
X c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48,
X c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c59, c60,
X c61, c62, c63, c64, c65, c66, c67, c68, c69, c70, c71, c72,
X c73, c74, c75, c76, c77, c78, c79, c80, c81, c82, c83, c84,
X c85, c86, c87, c88, c89, c90, c91, c92, c93, c94, c95, c96,
X c97, c98, c99, c100,c101,c102,c103,c104,c105,c106,c107,c108,
X c109,c110,c111,c112};
X/*--------------------------------*/
X i = ch-32;
X c = error_char;
X if (i >= 0 && i <113) c = p[i];
X *npts = ( *c++) << 1; /* convert pt count to coord count*/
X *min = *c++; /* extent of char, in char coords*/
X *max = *c++;
X for (i=0; i<*npts; i++) *pts++ = *c++;
X}
END_OF_FILE
# end of 'lib/sfont.c'
fi
if test -f 'src/subs.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'src/subs.c'\"
else
echo shar: Extracting \"'src/subs.c'\" \(16545 characters\)
sed "s/^X//" >'src/subs.c' <<'END_OF_FILE'
X/* Copyright (c) 1987 Bellcore
X * All Rights Reserved
X * Permission is granted to copy or use this program, EXCEPT that it
X * may not be sold for profit, the copyright notice must be reproduced
X * on copies, and credit should be given to Bellcore where it is due.
X * BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
X */
X/* $Header: subs.c,v 4.6 88/08/12 07:41:12 sau Exp $
X $Source: /tmp/mgrsrc/src/RCS/subs.c,v $
X*/
Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/subs.c,v $$Revision: 4.6 $";
X
X/* misc window and screen mangement routines */
X
X#include "bitmap.h"
X#include <stdio.h>
X#include <sys/ioctl.h>
X#include <sys/signal.h>
X#include "font.h"
X#include "defs.h"
X#include "event.h"
X#include "window.h"
X
X/*****************************************************************************
X * deactivate all windows covered by win (used for new window creation)
X */
X
Xset_covered(check)
Xregister WINDOW *check; /* window to check covering against */
X {
X register WINDOW *win;
X
X for(win=active;win != (WINDOW *) 0;win=win->next)
X if (win!=check && intersect(win,check) && W(flags)&W_ACTIVE) {
X save_win(win);
X do_event(EVENT_COVERED,win,E_MAIN);
X W(flags) &= ~W_ACTIVE;
X if (!(W(flags)&W_LOOK))
X mask &= ~(1<<W(to_fd));
X#ifdef DEBUG
X dprintf(o)(stderr,"\t%s covers %s\r\n",check->tty,W(tty));
X#endif
X }
X }
X
X/*****************************************************************************
X * find and activate all windows previously covered by win
X */
X
Xun_covered()
X {
X register WINDOW *win,*check;
X register int cover;
X
X for(win=active;win != (WINDOW *) 0;win=W(next)) {
X#ifdef DEBUG
X dprintf(U)(stderr," invalidate cliplist: %s)\r\n",W(tty));
X dprintf(o)(stderr," un_cover: %s)\n",W(tty));
X#endif
X for(cover=0,check=active;check!=win && cover==0;check=check->next)
X if (intersect(win,check)) cover=1;
X
X if (cover && W(flags)&W_ACTIVE) {
X do_event(EVENT_COVERED,win,E_MAIN);
X W(flags) &= ~W_ACTIVE;
X if (!(W(flags)&W_LOOK))
X mask &= ~(1<<W(to_fd));
X#ifdef DEBUG
X dprintf(o)(stderr,"becoming inactive (covered by %s)\r\n",check->tty);
X#endif
X }
X else if (!cover && !(W(flags)&W_ACTIVE)) {
X do_event(EVENT_UNCOVERED,win,E_MAIN);
X W(flags) |= W_ACTIVE;
X if (!(W(flags)&W_DIED))
X mask |= (1<<W(to_fd));
X#ifdef DEBUG
X dprintf(o)(stderr,"becoming active\r\n");
X#endif
X }
X else if (cover && !(W(flags)&W_ACTIVE)) {
X#ifdef DEBUG
X dprintf(o)(stderr,"remains inactive (covered by %s)\r\n",check->tty);
X#endif
X ;
X }
X else if (!cover && W(flags)&W_ACTIVE) {
X#ifdef DEBUG
X dprintf(o)(stderr,"remains active\r\n");
X#endif
X ;
X }
X else
X if( debug )
X fprintf(stderr,"%s: unknown covering state\r\n",W(tty));
X }
X }
X
X/*****************************************************************************
X * bring a window to the top
X */
X
Xexpose(win)
Xregister WINDOW *win; /* window to expose */
X {
X#ifdef DEBUG
X dprintf(o)(stderr,"exposing %s\r\n",W(tty));
X#endif
X
X /* reorder windows */
X
X if (win == active)
X return(0);
X
X W(prev)->next = W(next);
X if (W(next))
X W(next)->prev = W(prev);
X else
X ACTIVE(prev) = W(prev);
X
X W(prev) = ACTIVE(prev);
X W(next) = active;
X
X ACTIVE(prev) = win;
X active = win;
X
X if (!(W(flags)&W_ACTIVE)) {
X for(win=active->next;win!=(WINDOW *) 0;win=W(next))
X if (W(flags)&W_ACTIVE && intersect(active,win))
X save_win(win);
X
X restore_win(active);
X
X clip_bad(active); /* invalidate clip lists */
X un_covered();
X }
X#ifdef DEBUG
X else
X dprintf(o)(stderr,"expose: %s already active (0%o)\r\n",
X ACTIVE(tty),ACTIVE(flags));
X#endif
X }
X
X
X/*****************************************************************************
X * move a window at the bottom of window list
X */
X
Xint
Xbury(win)
Xregister WINDOW *win; /* window to bury */
X {
X#ifdef DEBUG
X dprintf(o)(stderr,"burying %s\r\n",W(tty));
X#endif
X if (!win || !W(next))
X return(0);
X
X if (win == active)
X active = W(next);
X
X W(prev)->next = W(next);
X W(next)->prev = W(prev);
X
X W(prev) = ACTIVE(prev);
X ACTIVE(prev)->next = win;
X
X ACTIVE(prev) = win;
X W(next) = (WINDOW *) 0;
X return(1);
X }
X
X/*****************************************************************************
X * bury a window at the bottom of the screen
X */
X
Xhide(win)
Xregister WINDOW *win; /* window to hide */
X {
X#ifdef DEBUG
X dprintf(o)(stderr,"hiding %s\r\n",W(tty));
X#endif
X if (bury(win)==0)
X return(0);
X save_win(win);
X repair(win);
X clip_bad(active); /* invalidate clip lists */
X }
X
X/*****************************************************************************
X * repair effects of buried window
X */
X
Xint
Xrepair(clip)
Xregister WINDOW *clip; /* window causing repairs */
X {
X register WINDOW *win;
X#ifdef NOCLIP
X for(win=ACTIVE(prev)->prev;win!=active;win=W(prev))
X if (!alone(win)) restore_win(win);
X restore_win(win);
X#else
X for(win=clip->prev;win!=active;win=W(prev))
X if (intersect(clip,win))
X clip_win(win,clip);
X if (clip!= active && intersect(clip,active))
X clip_win(active,clip);
X#endif
X un_covered();
X }
X
X/*****************************************************************************
X * save a pixel image of the window
X */
X
Xsave_win(win)
Xregister WINDOW *win; /* window to save */
X {
X#ifdef DEBUG
X dprintf(o)(stderr,"\t\t saving %s\r\n",W(tty));
X#endif
X if (W(save) == (BITMAP *) 0) {
X W(save) = bit_alloc(BIT_WIDE(W(border)),BIT_HIGH(W(border)),
X NULL_DATA,DEPTH);
X }
X else if (BIT_WIDE(W(save)) != BIT_WIDE(W(border)) ||
X BIT_HIGH(W(save)) != BIT_HIGH(W(border))) {
X#ifdef DEBUG
X dprintf(o)(stderr,"Saved window %s mismatch\r\n",W(tty));
X#endif
X bit_destroy(W(save));
X W(save) = bit_alloc(BIT_WIDE(W(border)),BIT_HIGH(W(border)),
X NULL_DATA,DEPTH);
X }
X
X bit_blit(W(save),0,0,BIT_WIDE(W(border)),BIT_HIGH(W(border)),
X BIT_SRC,W(border),0,0);
X }
X
X/*****************************************************************************
X * partially restore a previously saved pixel image of the window
X */
X
X#define C(x) (clip->x)
X#ifndef Max
X#define Max(x,y) ((x)>(y)?(x):(y))
X#endif
X#ifndef Min
X#define Min(x,y) ((x)>(y)?(y):(x))
X#endif
X
Xclip_win(win,clip)
Xregister WINDOW *win; /* window to restore to screen */
Xregister WINDOW *clip; /* clip window */
X {
X int x0 = Max(W(x0),C(x0)) - W(x0);
X int y0 = Max(W(y0),C(y0)) - W(y0);
X int x1 = Min(W(x0)+BIT_WIDE(W(border)),C(x0)+BIT_WIDE(C(border))) - W(x0);
X int y1 = Min(W(y0)+BIT_HIGH(W(border)),C(y0)+BIT_HIGH(C(border))) - W(y0);
X
X if (W(save) != (BITMAP *) 0) {
X
X/* ******* look at clipping region **********
X bit_blit(W(border),x0,y0,x1-x0,y1-y0 ,
X BIT_NOT(BIT_DST),W(save),x0,y0);
X getchar();
Xend of debug */
X
X bit_blit(W(border),x0,y0,x1-x0,y1-y0,
X BIT_SRC,W(save),x0,y0);
X }
X else
X if( debug )
X fprintf(stderr,"clip: can't restore %s\r\n",W(tty));
X#ifdef DEBUG
X dprintf(o)(stderr,"\t\t restore %s (clip to %s)\r\n",W(tty),C(tty));
X#endif
X }
X
X/*****************************************************************************
X * restore a previously saved pixel image of the window
X */
X
Xrestore_win(win)
Xregister WINDOW *win; /* window to restore to screen */
X {
X if (W(save) != (BITMAP *) 0)
X bit_blit(W(border),0,0,BIT_WIDE(W(border)),BIT_HIGH(W(border)),
X BIT_SRC,W(save),0,0);
X#ifdef DEBUG
X dprintf(o)(stderr,"\t\t restoring %s\r\n",W(tty));
X#endif
X }
X
X/*****************************************************************************
X * move the mouse, keep exclusive control
X * "how" specifies how we recognize completion:
X * how == 0: all buttons were up at start of action,
X * any button pushed down completes the action.
X * how != 0: some button was down at start of action,
X * all buttons released completes the action.
X */
X
Xint
Xmove_mouse(screen,mouse,x,y,how)
XBITMAP *screen;
Xint mouse, *x, *y;
Xint how;
X {
X register int mx = *x, my = *y;
X register int button = 0;
X int dx,dy;
X MOUSE_ON(mx,my);
X do {
X button=mouse_get(mouse,&dx,&dy);
X MOUSE_OFF(mx,my);
X mx += dx;
X my -= dy;
X mx = BETWEEN(0,mx,BIT_WIDE(screen));
X my = BETWEEN(0,my,BIT_HIGH(screen));
X MOUSE_ON(mx,my);
X }
X while (how ? button!= 0 : button==0);
X if( how )
X do_button( 0 );
X MOUSE_OFF(mx,my);
X *x = mx;
X *y = my;
X return(button);
X }
X
X/*****************************************************************************
X * parse a line into fields
X */
X
X#ifdef SYSV
X#define index strchr
X#endif
X
X#define iswhite(x) (index(" \t",x))
X
Xint
Xparse(line,fields)
Xregister char *line;
Xregister char **fields;
X {
X char *index();
X int inword = 0;
X int count = 0;
X char *start;
X register char c;
X
X for(start = line;(c = *line) && c != '\n';line++)
X if (inword && iswhite(c)) {
X inword = 0;
X *line = '\0';
X *fields++ = start;
X count++;
X }
X else if (!inword && !iswhite(c)) {
X start = line;
X inword = 1;
X }
X
X if (inword) {
X *fields++ = start;
X count++;
X if (c == '\n')
X *line = '\0';
X }
X *fields = (char *) 0;
X return(count);
X }
X
X/*****************************************************************************
X * parse a string to interpret \'s
X */
X
Xchar *
Xtrans(s)
Xchar *s;
X {
X char *result = s;
X register int i=0;
X register char c;
X register int got_slash=0;
X
X while(c = *s++&0x7f) {
X if (got_slash){
X switch(c) {
X case 'e':
X case 'E': result[i++] = '\033'; break;
X case 'n': result[i++] = '\n'; break;
X case 'r': result[i++] = '\r'; break;
X case 'b': result[i++] = '\b'; break;
X case 'f': result[i++] = '\f'; break;
X case 'g': result[i++] = '\007'; break;
X case 's': result[i++] = ' '; break;
X case '\\': result[i++] = '\\'; break;
X case 'M': result[i++] = *s++|0x80; break;
X default: result[i++] = c; break;
X }
X got_slash = 0;
X }
X else if (c=='\\')
X got_slash++;
X else
X result[i++] = c;
X }
X result[i] = '\0';
X return(result);
X }
X
X/* suspend MGR */
X
Xint suspend()
X {
X#ifdef SIGSTOP
X register WINDOW *win;
X
X MOUSE_OFF(mousex,mousey);
X sleep(1); /* give the key time to go up */
X set_kbd(0); /* fix up keyboard modes */
X
X for(win=active;win!=(WINDOW *) 0;win=win->next) {
X killpg(W(pid),SIGSTOP);
X if (W(flags)&W_ACTIVE)
X save_win(win);
X }
X
X reset_tty(0);
X kbd_reset();
X close(mouse);
X reset_tty(0);
X fprintf(stderr,"\fmgr suspended ...\n");
X#ifdef WHO
X restore_utmp(0,"");
X#endif
X
X do_cmd( 's' ); /* do the suspention command */
X
X /* courtesy DVW */
X signal(SIGTSTP, SIG_DFL);
X kill(0,SIGTSTP); /* send stop signal to self */
X sleep(1); /* wait for CONT signal */
X signal(SIGTSTP, catch);
X
X do_cmd( 'r' ); /* do the resumption command */
X
X if (set_kbd(1) != 0) { /* reopen kbd (as 0) */
X _quit();
X fprintf(stderr,"Sorry, Can't reopen kbd\n");
X exit(1);
X }
X mouse = mouse_reopen();
X set_tty(0);
X bell_on(); /* this resets the keyboard! */
X
X#ifdef WHO
X save_utmp(ttyname(0));
X#endif
X erase_win(screen,0,0);
X if (active) {
X for(win=ACTIVE(prev);win!=active;win=W(prev)) {
X restore_win(win);
X killpg(W(pid),SIGCONT);
X }
X restore_win(active);
X killpg(ACTIVE(pid),SIGCONT);
X }
X#endif
X MOUSE_ON(mousex,mousey);
X }
X
X/* Get a font from font numbers.
X Font numbers run 0 through MAXFONT;
X Font 0 is the default font. */
X
Xstruct font *
XGet_font(fnt)
Xint fnt; /* font number */
X {
X struct font *new, *get_font();
X char buff[MAX_PATH];
X char *name;
X
X if (fnt<=0 || fnt>MAXFONT || fontlist[fnt-1] == (char *) 0)
X return(font);
X
X if (*fontlist[fnt-1] == '/')
X name = fontlist[fnt-1];
X else {
X sprintf(buff, "%s/%s", font_dir, fontlist[fnt-1]);
X name = buff;
X }
X if ((new = get_font(name))==(struct font *)0)
X new = font;
X else
X new->ident = fnt;
X return(new);
X }
X
X#ifdef ALIGN
X
X/* align a window so a byte boundary occurs somewhere insode the border */
X
Xint
Xalignwin(screen,x,dx,slop)
Xregister BITMAP *screen;
Xregister int *x, *dx;
Xint slop;
X {
X register int adjust = (BIT_X(screen)+ *x) & 7;
X
X if (adjust>0 && adjust<(8-slop)) {
X *x -= adjust;
X#ifdef DEBUG
X dprintf(A)(stderr,"Adjusting x by %d",adjust);
X#endif
X }
X#ifdef DEBUG
X dprintf(A)(stderr," at [%d/%d]\r\n",*x,(*x)&7);
X#endif
X
X adjust = (adjust + *dx) &7;
X
X if (adjust>slop) {
X *dx += 8-adjust;
X#ifdef DEBUG
X dprintf(A)(stderr,"Adjusting dx by %d\r\n",8-adjust);
X#endif
X }
X#ifdef DEBUG
X dprintf(A)(stderr," at [%d/%d]\r\n",*x + *dx,(*x + *dx)&7);
X#endif
X }
X#endif ALIGN
X
X/* look for and remove all references to a particular font */
X
Xint
Xfont_purge(gone)
Xregister struct font *gone; /* invalid font pointer */
X {
X register WINDOW *win, *win2;
X register int count=0;
X
X /* re-reference current window font */
X
X for(win=active;win != (WINDOW *) 0;win=win->next) {
X if (W(font) == gone) {
X W(font) = font;
X count++;
X }
X
X /* now re-reference any stacked fonts */
X
X for(win2=W(stack);win2 != (WINDOW *) 0;win2=win2->stack)
X if (win2->font == gone) {
X win2->font = font;
X count++;
X }
X }
X return(count);
X }
X
X/*********************************************************************/
X
X/* make sure icon is valid */
X
Xint
Xcursor_ok(map,x,y)
XBITMAP *map; /* cursor icon */
Xint x,y; /* starting coord */
X {
X if (map==BIT_NULL || BIT_WIDE(map) < 16+x || BIT_HIGH(map) < 32+y)
X return(0);
X else /* we'll check more later */
X return(1);
X }
X
X
Xstatic int cursoron = 0;
X
Xcursor_on()
X{
X if( !active ) {
X cursoron = 0;
X return;
X }
X if( cursoron )
X return;
X do_cursor(active);
X cursoron = 1;
X}
X
Xcursor_off()
X{
X if( !active ) {
X cursoron = 0;
X return;
X }
X if( !cursoron )
X return;
X cursoron = 0;
X do_cursor(active);
X}
X
Xstatic int
Xdo_cursor(win)
XWINDOW *win;
X {
X switch(W(curs_type)) {
X case CS_BLOCK:
X bit_blit(W(window), W(x)+W(text.x),
X W(y)+W(text.y)-W(font->head.high),
X W(font->head.wide), W(font->head.high),
X BIT_NOT(BIT_DST), 0, 0, 0);
X break;
X case CS_BOX:
X bit_blit(W(window), W(x)+W(text.x),
X W(y)+W(text.y)-W(font->head.high)+1,
X W(font->head.wide), W(font->head.high)-2,
X BIT_NOT(BIT_DST), 0, 0, 0);
X bit_blit(W(window), W(x)+W(text.x)-2,
X W(y)+W(text.y)-W(font->head.high)-1,
X W(font->head.wide)+4, W(font->head.high)+2,
X BIT_NOT(BIT_DST), 0, 0, 0);
X break;
X case CS_LEFT:
X bit_blit(W(window), W(x)+W(text.x) - 1,
X W(y)+W(text.y)-W(font->head.high),
X 2, W(font->head.high),
X BIT_NOT(BIT_DST), 0, 0, 0);
X break;
X case CS_RIGHT:
X bit_blit(W(window), W(x)+W(text.x)+W(font->head.wide)-1,
X W(y)+W(text.y)-W(font->head.high),
X 2, W(font->head.high),
X BIT_NOT(BIT_DST), 0, 0, 0);
X break;
X case CS_UNDER:
X bit_blit(W(window), W(x)+W(text.x),
X W(y)+W(text.y)-1,
X W(font->head.wide), 2,
X BIT_NOT(BIT_DST), 0, 0, 0);
X break;
X }
X }
X
X/* system command - turn off root privaleges */
X
Xsystem(command)
Xchar *command;
X{
X int status, pid, w;
X register int (*istat)(), (*qstat)();
X
X if (!command || *command == '\0')
X return(0);
X if ((pid = vfork()) == 0) { /* does vfork work? */
X
X /* make sure commands doesn't run as root */
X
X int uid = getuid();
X int gid = getgid();
X setreuid(uid,uid);
X setregid(gid,gid);
X
X close(0);
X open("/dev/null",0);
X
X execl("/bin/sh", "sh", "-c", command, 0);
X _exit(127);
X }
X istat = signal(SIGINT, SIG_IGN);
X qstat = signal(SIGQUIT, SIG_IGN);
X while ((w = wait(&status)) != pid && w != -1)
X ;
X if (w == -1)
X status = -1;
X signal(SIGINT, istat);
X signal(SIGQUIT, qstat);
X return(status);
X}
END_OF_FILE
# end of 'src/subs.c'
fi
echo shar: End of archive 39 \(of 61\).
cp /dev/null ark39isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 \
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 \
55 56 57 58 59 60 61 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 61 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
More information about the Comp.sources.unix
mailing list