rsalz@uunet.uu.net (Rich Salz) (01/25/89)
Submitted-by: Stephen A. Uhler <sau@bellcore.com> Posting-number: Volume 17, Issue 24 Archive-name: mgr/part23 #! /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 23 (of 61)." # Contents: demo/misc/dmgr.c demo/misc/mgrmail.c demo/misc/omgrmail.c # font-16/Ugal13x20b font-16/Ugal13x20r font-32/Ugal13x20b # font-32/Ugal13x20r src/graph_subs.c # Wrapped by rsalz@papaya.bbn.com on Thu Nov 17 21:05:27 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'demo/misc/dmgr.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'demo/misc/dmgr.c'\" else echo shar: Extracting \"'demo/misc/dmgr.c'\" \(5769 characters\) sed "s/^X//" >'demo/misc/dmgr.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: dmgr.c,v 4.1 88/06/30 10:06:21 bianchi Exp $ X $Source: /tmp/mgrsrc/demo/misc/RCS/dmgr.c,v $ X*/ Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/demo/misc/RCS/dmgr.c,v $$Revision: 4.1 $"; X X/* Ditroff to MGR conversion filter (sample version) */ X X#include "term.h" X#include <signal.h> X#include <ctype.h> X X/* ditroff macros */ X X#define t_push() X#define t_pop() X#define hmot(N) (hpos+=(N)) X#define hgoto(N) (hpos = (N)) X#define vmot(N) (vpos+=(N)) X#define vgoto(N) (vpos=(N)) X#define put1s(c) put1('?') X#define put1a(N) printf("\\%3.3o",N); X#define t_text(S) printf("{%s}",S) X#define draw(S) printf("\nDRAW %s\n",S); X#define setfont(S) (font=(S)) X#define setsize(N) (size=(N)) X#define t_page() (page++>0?(getpass("\007"),m_clear()):0) X#define t_newline() m_flush() X#define t_init() X#define t_trailer() X#define t_reset(C) X#define loadfont(N, S1, S2) X#define error printf X#define done() getpass("\007") X X/* mgr defines */ X X#define GMAX 1000 /* maximum coordinate */ X X/* these should be calculated from the ditroff input file */ X X#define PAGE_WIDE 2300 /* page width (pixels) */ X#define PAGE_HIGH 3200 /* page height (pixels) */ X Xint hpos,vpos; Xint font; Xint size; Xint page=0; X Xmain() X { X X int clean(); X X /* setup MGR */ X X m_setup(M_DEBUG); X m_push(P_FLAGS|P_FONT); X signal(SIGTERM,clean); X signal(SIGINT,clean); X m_setmode(M_OVERSTRIKE); X m_func(14); X /* m_font(4); */ X m_clear(); X X /* display output */ X X conv(stdin); X X /* wait for ack. */ X X getpass("\007"); X clean(0); X } X X/* print a character */ X Xint Xput1(c) Xregister char c; /* the character to print */ X { X register int x = hpos * GMAX / PAGE_WIDE; X register int y = vpos * GMAX / PAGE_HIGH; X X m_movecursor(x,y); X putc(c,m_termout); X switch(font) { X case 2: /* italic */ X m_printstr("\010_"); X break; X case 3: /* bold */ X m_incr(2); X break; X } X } X X/* do ditroff conversion (standard template) */ X Xconv(fp) Xregister FILE *fp; X{ X register int c, k, sign; X int m, n, i, n1, m1; X char str[100], buf[300]; X X while ((c = getc(fp)) != EOF) { X switch (c) { X case '\n': /* when input is text */ X case ' ': X case 0: /* occasional noise creeps in */ X break; X case '{': /* push down current environment */ X t_push(); X break; X case '}': X t_pop(); X break; X case '0': case '1': case '2': case '3': case '4': X case '5': case '6': case '7': case '8': case '9': X /* two motion digits plus a character */ X hmot((c-'0')*10 + getc(fp)-'0'); X put1(getc(fp)); X break; X case 'c': /* single ascii character */ X put1(getc(fp)); X break; X case 'C': X fscanf(fp, "%s", str); X put1s(str); X break; X case 'N': /* absolute character number */ X fscanf(fp, "%d", &n); X put1a(n); X break; X case 't': /* straight text */ X fgets(buf, sizeof(buf), fp); X t_text(buf); X break; X case 'D': /* draw function */ X fgets(buf, sizeof(buf), fp); X draw(buf); X break; X case 's': X fscanf(fp, "%d", &n); /* ignore fractional sizes */ X setsize(n); X break; X case 'f': X fscanf(fp, "%d", &n); X setfont(n); X if (n==3) /* bold */ X m_func(1); X else if (n==1 || n==2) X m_func(14); X break; X case 'H': /* absolute horizontal motion */ X /* fscanf(fp, "%d", &n); */ X while ((c = getc(fp)) == ' ') X ; X k = 0; X do { X k = 10 * k + c - '0'; X } while (isdigit(c = getc(fp))); X ungetc(c, fp); X hgoto(k); X break; X case 'h': /* relative horizontal motion */ X /* fscanf(fp, "%d", &n); */ X while ((c = getc(fp)) == ' ') X ; X k = 0; X sign = 1; X if (c == '-') { X sign = -1; X c = getc(fp); X } X do { X k = 10 * k + c - '0'; X } while (isdigit(c = getc(fp))); X ungetc(c, fp); X hmot(sign * k); X break; X case 'w': /* word space */ X break; X case 'V': X fscanf(fp, "%d", &n); X vgoto(n); X break; X case 'v': X fscanf(fp, "%d", &n); X vmot(n); X break; X case 'p': /* new page */ X fscanf(fp, "%d", &n); X t_page(n); X break; X case 'n': /* end of line */ X while (getc(fp) != '\n') X ; X t_newline(); X break; X case '#': /* comment */ X while (getc(fp) != '\n') X ; X break; X case 'x': /* device control */ X devcntrl(fp); X break; X default: X error("unknown input character %o %c\n", c, c); X fprintf(stderr, "input context is:\n%c", c); X for (i = 0; i < 10; i++) { X if (fgets(buf, sizeof(buf), fp) == NULL) X break; X fprintf(stderr, "%s", buf); X } X done(); X } X } X } X Xdevcntrl(fp) /* interpret device control functions */ XFILE *fp; X{ X char str[20], str1[50], buf[50]; X int c, n; X X fscanf(fp, "%s", str); X switch (str[0]) { /* crude for now */ X case 'i': /* initialize */ X t_init(); X break; X case 'T': /* device name */ X fscanf(fp, "%s", buf); X break; X case 't': /* trailer */ X t_trailer(); X break; X case 'p': /* pause -- can restart */ X t_reset('p'); X break; X case 's': /* stop */ X t_reset('s'); X break; X case 'r': /* resolution assumed when prepared */ X fscanf(fp, "%d", &n); X break; X case 'f': /* font used */ X fscanf(fp, "%d %s", &n, str); X fgets(buf, sizeof buf, fp); /* in case there's a filename */ X ungetc('\n', fp); /* fgets goes too far */ X str1[0] = 0; /* in case there's nothing to come in */ X sscanf(buf, "%s", str1); X loadfont(n, str, str1); X break; X } X while ((c = getc(fp)) != '\n') /* skip rest of input line */ X if (c == EOF) X break; X} X Xint Xclean(n) Xint n; X { X m_pop(); X m_clear(); X } END_OF_FILE # end of 'demo/misc/dmgr.c' fi if test -f 'demo/misc/mgrmail.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'demo/misc/mgrmail.c'\" else echo shar: Extracting \"'demo/misc/mgrmail.c'\" \(5947 characters\) sed "s/^X//" >'demo/misc/mgrmail.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: mgrmail.c,v 4.2 88/06/22 14:37:50 bianchi Exp $ X $Source: /tmp/mgrsrc/demo/misc/RCS/mgrmail.c,v $ X*/ Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/demo/misc/RCS/mgrmail.c,v $$Revision: 4.2 $"; X X/* check for new mail (experimental version) */ X X#include <sys/types.h> X#include <sys/stat.h> X#include <signal.h> X#include <stdio.h> X#include "term.h" X X#define MSG_1 "\fLooking for new mail" X#define MSG_2 "\f\007You have new mail" X#define MSG_3 "\freading mail ...\r" X#define MSG_4 "\rChecking for new mail..." X#define MSG_5 "\fMail window is active" X#define MSG_6 "\rYou don't have mail " X X#define MAILF "/usr/spool/mail" /* spool file */ X#define MAIL "mail" /* name of mail command */ X#define POLL 60 /* polling interval */ X#define XPOS 240 /* x start of mail window */ X#define YPOS 190 /* y start of mail window */ X#define W_WIDE 650 /* width of mail window */ X#define W_HIGH 394 /* height of mail window */ X X#define PROCESSED 2 /* new mail already processed */ X X#define S(x) statb.x X#define Isflag(arg,flag) (!strncmp(arg,flag,strlen(flag))) X#define Max(x,y) ((x)>(y)?(x):(y)) X#define dprintf if(debug) fprintf X X#define MENU_COUNT (sizeof(menu)/sizeof(struct menu_entry)) X Xstruct menu_entry menu[] = { X "print","t\r", X "delete","dt\r", X "next","n\r", X "quit","q\r", X "help","?\r", X "headers","h *\r", X "abort","x\r", X}; X Xstruct stat statb; /* spool file status */ Xchar mail[255]; /* spool file path name */ Xlong omtime=0l; /* previous file mod. time */ Xint state = 0; /* mail & window state */ Xint poll = POLL; /* poll interval */ Xint debug=0; /* for mgrmail -d >& /dev/tty?? */ X Xmain(argc,argv) X char **argv; X{ X register int i; X int xpos = XPOS; /* screen position of mail subwindow */ X int ypos = YPOS; X int font = -1; /* font to use for mail subwindow */ X int shape = 1; /* initially reshape window */ X char *command = MAIL; /* name of readmail command */ X X char *getenv(); X char *user = getenv("USER"); X char line[80]; /* event input buffer */ X X int clean(), update(); X X ckmgrterm( *argv ); X X /* make sure environment is ok */ X if (user==NULL || *user=='\0') { X fprintf(stderr,"%s: Who are you?\n",argv[0]); X exit(2); X } X X /* process arguments */ X X for(i=1;i<argc;i++) { X if (Isflag(argv[i],"-s")) X shape = 0; X else if (Isflag(argv[i],"-d")) X debug = 1; X else if (Isflag(argv[i],"-x")) X xpos = atoi(argv[i]+2); X else if (Isflag(argv[i],"-y")) X ypos = atoi(argv[i]+2); X else if (Isflag(argv[i],"-f")) X font = atoi(argv[i]+2); X else if (Isflag(argv[i],"-p")) X poll = Max(atoi(argv[i]+2),10); X else if (Isflag(argv[i],"-M")) X command = argv[i]+2; X else X usage(argv[0],argv[i]); X } X sprintf(mail,"%s/%s",MAILF,user); X X /* set up window environment */ X X m_setup(M_FLUSH); X m_ttyset(); X m_push(P_MENU|P_EVENT|P_FLAGS); X dprintf(stderr,"pushing environment\n"); fflush(stderr); X m_setmode(M_NOWRAP); X X signal(SIGTERM,clean); X signal(SIGINT,clean); X signal(SIGALRM,update); X X m_setmode(M_ACTIVATE); X if (shape) { X m_size(strlen(MSG_1),1); X } X X m_setevent(ACTIVATE,"A\r"); X m_setevent(REDRAW,"R\r"); X X m_clearmode(M_ACTIVATE); X m_clear(); X m_printstr(MSG_1); X X dprintf(stderr,"Starting state 0x%x\n",state); fflush(stderr); X X update(); X X /* wait for an event */ X X while(1) { X m_gets(line); X dprintf(stderr,"state 0x%x line : %c\n",state,*line); fflush(stderr); X switch(*line) { X case 'A': /* window is activated */ X if (!stat(mail,&statb) && S(st_size)) X do_mail(command,font,xpos,ypos); X else { X m_printstr(MSG_6); X sleep(2); X m_clearmode(M_ACTIVATE); X } X state &= ~PROCESSED; X update(); X break; X case 'R': /* screen is redrawn */ X state &= ~PROCESSED; X update(); X break; X } X } X} X X/* run readmail in a subwindow */ X Xdo_mail(command,font,xpos,ypos) Xchar *command; Xint font,xpos,ypos; X { X int code; X int n; X X alarm(0); X dprintf(stderr,"doing mail\n"); fflush(stderr); X n=m_makewindow(xpos,ypos,W_WIDE,W_HIGH); X if (n==0) { /* can't make window */ X m_printstr("\007\fCan't open mail window, sorry"); X return(0); X } X m_clearevent(ACTIVATE); X m_printstr(MSG_5); X m_selectwin(n); X menu_load(1,MENU_COUNT,menu); X m_selectmenu(1); X m_printstr(MSG_3); X m_ttyreset(); X code = system(command); X m_printstr(MSG_4); X sleep(1); /* for "New mail arrived" message */ X dprintf(stderr,"Readmail completed code %d\n",code); fflush(stderr); X m_ttyset(); X m_destroywin(n); X m_setevent(ACTIVATE,"A\r"); X m_clearmode(M_ACTIVATE); X dprintf(stderr,"window deactivated\n"); fflush(stderr); X } X X/* check the spool file for new mail and update message */ X Xint Xupdate() X{ X alarm(0); X dprintf(stderr,"checking mail state 0x%x\n",state); fflush(stderr); X if (!stat(mail,&statb) && S(st_mtime)>S(st_atime) && S(st_size)) { X state &= ~PROCESSED; X if (S(st_mtime) != omtime) { X dprintf(stderr," First time New mail\n"); fflush(stderr); X m_printstr(MSG_2); X m_setmode(M_WOB); X omtime = S(st_mtime); X } X } X else if (!(state&PROCESSED)) { X dprintf(stderr," Clearing new mail\n"); fflush(stderr); X m_clearmode(M_WOB); X m_printstr(MSG_1); X state |= PROCESSED; X } X alarm(poll); X} X X/* Clean up and exit */ X Xclean() X{ X m_popall(); X m_ttyreset(); X exit(1); X} X Xusage(name,error) Xchar *name, *error; X{ X fprintf(stderr,"Invalid flag: %s\n",error); X fprintf(stderr, X "usage: %s -[s|x<pos>|y<pos>|f<font>|p<poll>|M<mail_program>]\n" X ,name); X exit(1); X} END_OF_FILE # end of 'demo/misc/mgrmail.c' fi if test -f 'demo/misc/omgrmail.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'demo/misc/omgrmail.c'\" else echo shar: Extracting \"'demo/misc/omgrmail.c'\" \(5590 characters\) sed "s/^X//" >'demo/misc/omgrmail.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: omgrmail.c,v 4.2 88/06/22 14:37:57 bianchi Exp $ X $Source: /tmp/mgrsrc/demo/misc/RCS/omgrmail.c,v $ X*/ Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/demo/misc/RCS/omgrmail.c,v $$Revision: 4.2 $"; X X/* check for new mail */ X X#include <sys/types.h> X#include <sys/stat.h> X#include <signal.h> X#include <stdio.h> X#include "term.h" X X#define MSG_1 "\fLooking for new mail" X#define MSG_2 "\f\007You have new mail" X#define MSG_3 "\freading mail ...\r" X#define MSG_4 "\rChecking for new mail..." X X#define MAILF "/usr/spool/mail" /* spool file */ X#define MAIL "mail" /* name of mail command */ X#define POLL 60 /* polling interval */ X#define XPOS 200 /* x start of mail window */ X#define YPOS 150 /* y start of mail window */ X X#define PROCESSED 2 /* new mail already processed */ X X#define S(x) statb.x X#define Isflag(arg,flag) (!strncmp(arg,flag,strlen(flag))) X#define Max(x,y) ((x)>(y)?(x):(y)) X#define dprintf if(debug) fprintf X X#define MENU_COUNT (sizeof(menu)/sizeof(struct menu_entry)) X Xstruct menu_entry menu[] = { X "print","t\r", X "delete","dt\r", X "next","n\r", X "quit","q\r", X "help","?\r", X "headers","h *\r", X "abort","x\r", X}; X Xstruct stat statb; /* spool file status */ Xchar mail[255]; /* spool file path name */ Xlong omtime=0l; /* previous file mod. time */ Xint state = 0; /* mail & window state */ Xint poll = POLL; /* poll interval */ Xint debug=0; /* for mgrmail -d >& /dev/tty?? */ X Xmain(argc,argv) X char **argv; X{ X register int i; X int xpos = XPOS; /* screen position of mail subwindow */ X int ypos = YPOS; X int font = -1; /* font to use for mail subwindow */ X int shape = 1; /* initially reshape window */ X char *command = MAIL; /* name of readmail command */ X X char *getenv(); X char *user = getenv("USER"); X char line[80]; /* event input buffer */ X X int clean(), update(); X X /* make sure environment is ok */ X X ckmgrterm( *argv ); X X if (user==NULL || *user=='\0') { X fprintf(stderr,"%s: Who are you?\n",argv[0]); X exit(2); X } X X /* process arguments */ X X for(i=1;i<argc;i++) { X if (Isflag(argv[i],"-s")) X shape = 0; X else if (Isflag(argv[i],"-d")) X debug = 1; X else if (Isflag(argv[i],"-x")) X xpos = atoi(argv[i]+2); X else if (Isflag(argv[i],"-y")) X ypos = atoi(argv[i]+2); X else if (Isflag(argv[i],"-f")) X font = atoi(argv[i]+2); X else if (Isflag(argv[i],"-p")) X poll = Max(atoi(argv[i]+2),10); X else if (Isflag(argv[i],"-M")) X command = argv[i]+2; X else X usage(argv[0],argv[i]); X } X sprintf(mail,"%s/%s",MAILF,user); X X /* set up window environment */ X X m_setup(M_FLUSH); X m_ttyset(); X m_push(P_MENU|P_EVENT|P_FLAGS); X dprintf(stderr,"pushing environment\n"); fflush(stderr); X m_setmode(M_NOWRAP); X X signal(SIGTERM,clean); X signal(SIGINT,clean); X signal(SIGALRM,update); X X m_setmode(M_ACTIVATE); X if (shape) { X m_size(strlen(MSG_1),1); X } X X menu_load(1,MENU_COUNT,menu); X m_selectmenu(1); X m_setevent(ACTIVATE,"A\r"); X m_setevent(REDRAW,"R\r"); X X m_clearmode(M_ACTIVATE); X m_clear(); X m_printstr(MSG_1); X X dprintf(stderr,"Starting state 0x%x\n",state); fflush(stderr); X X update(); X X /* wait for an event */ X X while(1) { X m_gets(line); X dprintf(stderr,"state 0x%x line : %c\n",state,*line); fflush(stderr); X switch(*line) { X case 'A': /* window is activated */ X if (!stat(mail,&statb) && S(st_size)) X do_mail(command,font,xpos,ypos); X state &= ~PROCESSED; X update(); X break; X case 'R': /* screen is redrawn */ X state &= ~PROCESSED; X update(); X break; X } X } X} X X/* run readmail in a subwindow */ X Xdo_mail(command,font,xpos,ypos) Xchar *command; Xint font,xpos,ypos; X { X int x,y,dummy; X int code; X X alarm(0); X m_push(P_POSITION|P_EVENT|P_FLAGS|P_FONT); X dprintf(stderr,"doing mail\n"); fflush(stderr); X if (font != -1) X m_font(font); X m_sizeall(xpos,ypos,80,24); X m_printstr(MSG_3); X m_ttyreset(); X code = system(command); X m_printstr(MSG_4); X sleep(2); /* for "New mail arrived" message */ X dprintf(stderr,"Readmail completed code %d\n",code); fflush(stderr); X m_ttyset(); X get_size(&x,&y,&dummy,&dummy); X m_pop(); X dprintf(stderr,"done with mail\n"); fflush(stderr); X if (x!=xpos || y!=ypos) { X m_movewindow(x,y); X xpos = x; X dprintf(stderr,"moving mail window\n"); fflush(stderr); X ypos = y; X } X m_clearmode(M_ACTIVATE); X dprintf(stderr,"window deactivated\n"); fflush(stderr); X } X X/* check the spool file for new mail and update message */ X Xint Xupdate() X{ X alarm(0); X dprintf(stderr,"checking mail state 0x%x\n",state); fflush(stderr); X if (!stat(mail,&statb) && S(st_mtime)>S(st_atime) && S(st_size)) { X state &= ~PROCESSED; X if (S(st_mtime) != omtime) { X dprintf(stderr," First time New mail\n"); fflush(stderr); X m_printstr(MSG_2); X m_setmode(M_WOB); X omtime = S(st_mtime); X } X } X else if (!(state&PROCESSED)) { X dprintf(stderr," Clearing new mail\n"); fflush(stderr); X m_clearmode(M_WOB); X m_printstr(MSG_1); X state |= PROCESSED; X } X alarm(poll); X} X X/* Clean up and exit */ X Xclean() X{ X m_popall(); X m_ttyreset(); X exit(1); X} X Xusage(name,error) Xchar *name, *error; X{ X fprintf(stderr,"Invalid flag: %s\n",error); X fprintf(stderr, X "usage: %s -[s|x<pos>|y<pos>|f<font>|p<poll>|M<mail_program>]\n" X ,name); X exit(1); X} END_OF_FILE # end of 'demo/misc/omgrmail.c' fi if test -f 'font-16/Ugal13x20b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-16/Ugal13x20b'\" else echo shar: Extracting \"'font-16/Ugal13x20b'\" \(5772 characters\) sed "s/^X//" >'font-16/Ugal13x20b' <<'END_OF_FILE' Xbegin 644 gal13x20b.fnt XM%@T4!8 XM . =P!W!P'C@> < X< .!X 8!^ ? XM@!P'\!X#_@^ ?@ ? XM _' #\ & 8 # < \ !@ XMX 'P #P' > XM #@' XM< =Q_#-P/P/@ <#@ ' _ . _P/\ \!_ X!_X9P,\ XM /X X/^ ?S_@_\?^!_/CX_@?Q\>? >#^!X?!_P'P_X#_G_WP_P]__^'_# XMS_P/QP _ #P . !P / ;@ X #@ .> < XM !P!P!P XM X!W '<_XS<'.#X / \ XM !P9P'@<>&'@/ P < X,..&'@ 'O .!PP,.<>'##A@PYP XM<#@!P..#@#AYP,,\..#/''!PYG,X&<&.YG S@8PX#@. !P!^ ' \ XM!P &X > X #C@ ' !@ < < < XM XM . =P#N=_,^!S@. #@' X&.#X&#C X'P, . XM##CC@X !AP/P'P<.&!G#APPX88&<' X <#G X \>>#&'#AQAQPX XMX&!P.!CC#N8X8<, . X#@ < YP !P ' < #@ #@ X !P XM 8 #@' . XM #@'<#_W=Q[@ XM<X#@!X!X ^ .#CA^ X .!\& #@ !PXXX. </^!\ XM'#A@!P<< . & '!P. ' [@. /'GPQ@XX<8.<..!@<#@8XP[F/,#F ' . < ' XM <. ? !P ' X X . < . XM X!P#@ XM X!W _]W !P#\!P < . ' #@ ' X XMX#@ . '@W!_AP 8',.#@X < < '#AP;!PXX <'' #@#@!P<#@!P/P# XM@#QY\,X..'.#G#CP ' X&.,/YAS Y@!P#@' !P 'P'X=\#^ _P? . /V XM/\#X /CCP'!_\-\!^/_ ?9[P/\?^/OOA___\_\??_ . < X XM XM . '</P <!\ X ' #@=W X !P.. X #@/P-P<\=\ & ^#QX? XM' > #P #AP<,X<<. '!QQ@XPX <' X <#X X ^^;C.#CCC@YPP? !P.!AV XM#_P/@'P X X X < X#G'_ASPY\<<#@'/CW@. XYP!P/_GW@SQYX,^/ XMN'' X!QQP,[F>&.!G#P' ' ' XM #@ !W!_ . _ , !P X XM'_P. X#C@. !P'\&< 'G_@#@' ?^'P#X >#_P? !P=[#.'_#@!P<? XMX/\. '_P. ' ^ . /OF<S@X_PX.?X#X <#@8=@=\!P X . . . ' XMQQX\8<,/.#A_#APXX#@ ..X <#NXXX8></&'CSAPP. <<.&.YCS!PQAX#P!P XM!X XM X [@'X' ?X < . =P#@ < XX#@ X 'A XMG YX\ P#X#[@X ^ ? _\!\ X'_PQAPXX <''&#C#@!P<#@!P/P#@#[YGLX. XM. .#GX /@' X&'8'_ < . ' #@!P!P !\<'. '!S@X. X<.. X #C\ XM ' [N...#G!S@XX > #@''#ACN8?@<, \ < < < >, XM . XM.X!W!P'/P ' #@ /_@ #_X ' .. X < XQP .<' ,!G X ' ? ' XMP<!^\?\<'. '!QP X X_<' X <#^ X W^8[.#C@#@Y_ \!P.!@X!_P/@#@! XMP X . < #W'!S@!P<_^#@.'#C@. X^ !P.[CCC@YP<X.. #X X!QP XM<P?\#P#F > #@' . /W XM #@ /_ =P[QQ\ !X!X!W#_X _ XM^ #@#C@. . ./_ #G!P' XX < 'P !\' ?O&''!S@!P<< . .#G!P XM. ' [P. -[F'S@XX X.=X '@<#@8/ ?X&< X X . #@' !QQP<X <' XM. X!S@XX#@ ./P <#NXXXX.<'.#C@ /@. <<','_ > Y@/ X!P#@#_@ XM XM #_QW</F<> . <!_\#@ X X XP#@' ,#G_S YP<!@ XM.. ' X ? _\!\ '?Q@QP<8 <'' #@!@YP<#@!P.>#@#>Y@\8,. '#'/# XMX' X&#P#N!G@. . #@ <!P <<<'. '!S@ . ?P.. X #C^ ' [N... XM#G!S@XX \#@'' ^!_P/P'P'@ . < X!WX XM =P?^'9G' XM #P/ =W X X ? < ', X#@S@P!PX.>& 8#C@#@? ' !X/_!\ !P P.< XM''!G!AP8X <.<' X <#CPX,S.8/'##@!XQQXP.!P/# 8 [@PX#@' X ' < XM '''ASPQX\< #@. #C@. X[P!P.[CCCPQP8\.. &' XQQP/@.X&>!\ XM#PP' ' ' 8\ XM #@ .X#_!V8_\ <#@ < . ? 'P' !^ XM.!_\?X <''#_ . <P#P'P#X '@ \ ' . ,#G#@XQQP<&. #CG!P. ' X>.# XM,SF!PY@X /X</.' <!_P& .X8' X!PP/P X_ ![Q\X<</?#C@X#_PX XMX#@ ..> <#NXXX>8>,'GC@!QP/8>\!P#N##P.!X<!P!P!P XM XM X #N ' X\'W #AP /@#@'P X#@ / ?\?_#\ ' _@?@# #X'P X ^ XM < < !P#_WA__P'X_P/_GP ?CX^/X!P?#W_WM_P.'P? !X/A[_@?P/X!@# XMN/#X? _\#\ ./P /^;\#^!]X?@? ?^??#^ #GSX?Q__??#\'^ _Y\ XM?X!\#[@< [CY^#@?_ / <!X XM XM < #@ /\ XM < _ XM &#@ PX !P . P ' XM XM ' XM X ' XM 9[ ?_P # 8 .. XM < #@ < !P XM XM #@ < XM !@ /@ XM '_\ P& #S ' X XM & < XM !P XM . XM#P XM /_ ?@ !P . /@ ' XM XM 8 XM # X XM !_@ #P X:^ 'P #P !P X Xend END_OF_FILE # end of 'font-16/Ugal13x20b' fi if test -f 'font-16/Ugal13x20r' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-16/Ugal13x20r'\" else echo shar: Extracting \"'font-16/Ugal13x20r'\" \(5772 characters\) sed "s/^X//" >'font-16/Ugal13x20r' <<'END_OF_FILE' Xbegin 644 gal13x20r.fnt XM%@T4!8 XM , 9@!F!@'# < 8 P8 ,!P 0!\ ? XM !@'X!P#_ \ ? > XM ^& #X $ 0 " 8 X ! XMP '@ #@& < XM # & XM8 9A^")@/@/ 8# & ^ , _@/X X!^ P!_P1@(X XM /P P/\ ?C_ _X?\!^/#P_ ?AX<> <#L!P>!_@'@_P#_'_G@[@Y_>\'># XMC_@/A@ ^ #@ , !@ . 3 P # ,< 8 XM !@!@!@ XM P!F &8_PB8&,#P . X XM !@1@' 8<$' . @ 8 P(,,$' '. ,!@@(,8<&"#! @Q@ XM8# !@,,# #!Q@((X,,".&&!@Q&(P$8$,Q& C 0@P# , !@!L & X XM!@ $P < P ## & ! 8 8 8 XM XM , 9@#,9N(L!C , # & P$,#P$#" P%@( , XM"### P !!@/@%@8,$!&#!@@P00$8& P 8#& P X<<"$&#!A!A@P XMP$!@,!#"#,0P08( , P# 8 Q@ !@ & 8 # # P !@ XM 0 # & , XM # &8#_F9AS XM8P# !P!P \ ,##!L P ,!8$ # !@PPP, 8/\!8 XM&#! !@88 , $ &!@, & S , .''@A PP80,8,,! 8# 0P@S$.(#$ & , 8 & XM 8, > !@ & P P , 8 , XM P!@# XM P!F _YF !@#X!@ 8 , & # & P XMP# , ' F!_!@ 0&(,# P 8 8 &#!@2!@PP 8&& # # !@8# !@-@# XM #AQ8(P,,&,#&##@ & P$,(.Q!B Q !@# & !@ '@'P9X#\ ]@> , /D XM-X#P /##@&!NX)X!\.^ >1S@/X?\///!W^[X]X>?^ , 8 P XM XM , &8/@ 8!X P & # 9F P !@,, P # /@)@8X9X $ T#AP> XM& < #@ #!@8(P88, &!AA P@P 8& P 8#P P LL3",#### Q@@> !@,!!D XM#N@- &@ P P P 8 P#&&_!C@QX88# &/#G , PQ@!@-W'G CAQP(\- XM,&& P!AA@(S$<$,!&#@& & & XM # !F!^ , ^ ( !@ P XM';@, P## , !@'X$8 '&_ # & ?L'@#P <#_@> !@9R",'^# !@8? XMP/X, '_@, & \ , ++$8C PW@P,?P#P 8# 09 9H!@ P , , , & XMAAPX08(.,#!^#!@PP# ,,P 8#,PPP0<8.$'#C!@@, 88,$,Q#B!@A!P#@!@ XM!P XM P S 'P& =P 8 , 9@# 8 PP# P '! XM& QPX @"P#S P \ > _X!X P&^@A!@PP 8&&$#"# !@8# !@/@# "RQ'(P, XM, ,#'P / & P$&0&Z 8 , & # !@!@ !X8&, &!C P, P8,, P ##X XM & S,,,,#&!C PP < # &&#!#,0= 8( X 8 8 8 <( XM , XM,P!F!@&-@ & # /_ #_P & ,, P 8 PA@ ,8& (!& P & > ' XM@8!LH?X8&, &!A@ P P^8& P 8#< P FL0R,## # QN X!@,! P!W@+ # ! XM@ P , 8 #F&!C !@8_\# ,&## , P\ !@,S### Q@8P,, #P P!A@ XM8@;H#@#$ < # & , /F XM # /^ 9@SAAX !P!P!F#_P _ XM\ # ## , , ,/^ #&!@& PP 8 '@ !X& ;*$&&!C !@88 , ,#&!@ XM, & S@, )S$&C PP P,9P ' 8# 0. =P$8 P P , # & !AA@8P 8& XM, P!C PP# ,/@ 8#,PPPP,8&,## / , 88&(': < Q . P!@# #; XM XM #_AF8-$8< , 8!VX# P P P@# & (#'_B Q@8! XM,, & P > _X!X &?A A@80 8&& # ! Q@8# !@,<# "<Q X0(, &"&." XMP& P$#@#,!' , , # 8!@ 888&, &!C , ?@,, P ##< & S,,,, XM#&!C PP X# && T!V@+@&@' , 8 P!GP XM 9@?\&1&& XM #@. 9F P P > 8 &( P# C @!@P,<$ 0## # > & !P/^!X !@ @,8 XM&&!&!!@0P 8,8& P 8##@P(B,0.&"# !PAAP@,!@." 0 S @P# & P & 8 XM &&'!C@APX8 # , ## , PS@!@,S###@A@0X,, $& PAA@- ,P$<!H XM#@@& & & 0X XM # ,P#^!D0_X 8# 8 , > '@& !\ XM,!_X?P 8&&#^ , 8@#@'@#P ' X & , (#&# PAA@8$, ##&!@, & P<," XM(C$!@Q P /P8.,& 8!_@$ ,P0& P!@@/@ P^ !SAXP88.6## P#_@P XMP# ,,< 8#,PPP<0<(''# !A@.0<X!@#,"#@,!P8!@!@!@ XM XM P #, & PX'F #!@ / # '@ P# . ?X?^#X & _ ? " #P'@ P \ XM 8 8 !@#_G![_@'P_@/_'@ ?#P\/P!@>#G_G)[@,'@> !P/!S_ ?@/P! # XM,.#P> _X#X ,/@ /<3X#\!YP? > ?\>>#\ #'CP?AWN>>#X'\ _QX XM?P!X#S 8 S#Q\# ?^ . 8!P XM XM 8 # /X XM 8 ^ XM $# @P !@ , @ & XM XM & XM P & XM 1R ?_@ " 0 ,, XM 8 # 8 !@ XM XM # 8 XM ! / XM '_X @$ #B & P XM $ 8 XM !@ XM , XM#@ XM /^ ? !@ , / & XM XM 0 XM " P XM !_ #@ X:\ '@ #@ !@ X Xend END_OF_FILE # end of 'font-16/Ugal13x20r' fi if test -f 'font-32/Ugal13x20b' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-32/Ugal13x20b'\" else echo shar: Extracting \"'font-32/Ugal13x20b'\" \(5772 characters\) sed "s/^X//" >'font-32/Ugal13x20b' <<'END_OF_FILE' Xbegin 644 gal13x20b.fnt XM& T4!8 XM . =P!W!P'C@> < X< .!X 8!^ ? XM@!P'\!X#_@^ ?@ ? XM _' #\ & 8 # < \ !@ XMX 'P #P' > XM #@' XM< =Q_#-P/P/@ <#@ ' _ . _P/\ \!_ X!_X9P,\ XM /X X/^ ?S_@_\?^!_/CX_@?Q\>? >#^!X?!_P'P_X#_G_WP_P]__^'_# XMS_P/QP _ #P . !P / ;@ X #@ .> < XM !P!P!P XM X!W '<_XS<'.#X / \ XM !P9P'@<>&'@/ P < X,..&'@ 'O .!PP,.<>'##A@PYP XM<#@!P..#@#AYP,,\..#/''!PYG,X&<&.YG S@8PX#@. !P!^ ' \ XM!P &X > X #C@ ' !@ < < < XM XM . =P#N=_,^!S@. #@' X&.#X&#C X'P, . XM##CC@X !AP/P'P<.&!G#APPX88&<' X <#G X \>>#&'#AQAQPX XMX&!P.!CC#N8X8<, . X#@ < YP !P ' < #@ #@ X !P XM 8 #@' . XM #@'<#_W=Q[@ XM<X#@!X!X ^ .#CA^ X .!\& #@ !PXXX. </^!\ XM'#A@!P<< . & '!P. ' [@. /'GPQ@XX<8.<..!@<#@8XP[F/,#F ' . < ' XM <. ? !P ' X X . < . XM X!P#@ XM X!W _]W !P#\!P < . ' #@ ' X XMX#@ . '@W!_AP 8',.#@X < < '#AP;!PXX <'' #@#@!P<#@!P/P# XM@#QY\,X..'.#G#CP ' X&.,/YAS Y@!P#@' !P 'P'X=\#^ _P? . /V XM/\#X /CCP'!_\-\!^/_ ?9[P/\?^/OOA___\_\??_ . < X XM XM . '</P <!\ X ' #@=W X !P.. X #@/P-P<\=\ & ^#QX? XM' > #P #AP<,X<<. '!QQ@XPX <' X <#X X ^^;C.#CCC@YPP? !P.!AV XM#_P/@'P X X X < X#G'_ASPY\<<#@'/CW@. XYP!P/_GW@SQYX,^/ XMN'' X!QQP,[F>&.!G#P' ' ' XM #@ !W!_ . _ , !P X XM'_P. X#C@. !P'\&< 'G_@#@' ?^'P#X >#_P? !P=[#.'_#@!P<? XMX/\. '_P. ' ^ . /OF<S@X_PX.?X#X <#@8=@=\!P X . . . ' XMQQX\8<,/.#A_#APXX#@ ..X <#NXXX8></&'CSAPP. <<.&.YCS!PQAX#P!P XM!X XM X [@'X' ?X < . =P#@ < XX#@ X 'A XMG YX\ P#X#[@X ^ ? _\!\ X'_PQAPXX <''&#C#@!P<#@!P/P#@#[YGLX. XM. .#GX /@' X&'8'_ < . ' #@!P!P !\<'. '!S@X. X<.. X #C\ XM ' [N...#G!S@XX > #@''#ACN8?@<, \ < < < >, XM . XM.X!W!P'/P ' #@ /_@ #_X ' .. X < XQP .<' ,!G X ' ? ' XMP<!^\?\<'. '!QP X X_<' X <#^ X W^8[.#C@#@Y_ \!P.!@X!_P/@#@! XMP X . < #W'!S@!P<_^#@.'#C@. X^ !P.[CCC@YP<X.. #X X!QP XM<P?\#P#F > #@' . /W XM #@ /_ =P[QQ\ !X!X!W#_X _ XM^ #@#C@. . ./_ #G!P' XX < 'P !\' ?O&''!S@!P<< . .#G!P XM. ' [P. -[F'S@XX X.=X '@<#@8/ ?X&< X X . #@' !QQP<X <' XM. X!S@XX#@ ./P <#NXXXX.<'.#C@ /@. <<','_ > Y@/ X!P#@#_@ XM XM #_QW</F<> . <!_\#@ X X XP#@' ,#G_S YP<!@ XM.. ' X ? _\!\ '?Q@QP<8 <'' #@!@YP<#@!P.>#@#>Y@\8,. '#'/# XMX' X&#P#N!G@. . #@ <!P <<<'. '!S@ . ?P.. X #C^ ' [N... XM#G!S@XX \#@'' ^!_P/P'P'@ . < X!WX XM =P?^'9G' XM #P/ =W X X ? < ', X#@S@P!PX.>& 8#C@#@? ' !X/_!\ !P P.< XM''!G!AP8X <.<' X <#CPX,S.8/'##@!XQQXP.!P/# 8 [@PX#@' X ' < XM '''ASPQX\< #@. #C@. X[P!P.[CCCPQP8\.. &' XQQP/@.X&>!\ XM#PP' ' ' 8\ XM #@ .X#_!V8_\ <#@ < . ? 'P' !^ XM.!_\?X <''#_ . <P#P'P#X '@ \ ' . ,#G#@XQQP<&. #CG!P. ' X>.# XM,SF!PY@X /X</.' <!_P& .X8' X!PP/P X_ ![Q\X<</?#C@X#_PX XMX#@ ..> <#NXXX>8>,'GC@!QP/8>\!P#N##P.!X<!P!P!P XM XM X #N ' X\'W #AP /@#@'P X#@ / ?\?_#\ ' _@?@# #X'P X ^ XM < < !P#_WA__P'X_P/_GP ?CX^/X!P?#W_WM_P.'P? !X/A[_@?P/X!@# XMN/#X? _\#\ ./P /^;\#^!]X?@? ?^??#^ #GSX?Q__??#\'^ _Y\ XM?X!\#[@< [CY^#@?_ / <!X XM XM < #@ /\ XM < _ XM &#@ PX !P . P ' XM XM ' XM X ' XM 9[ ?_P # 8 .. XM < #@ < !P XM XM #@ < XM !@ /@ XM '_\ P& #S ' X XM & < XM !P XM . XM#P XM /_ ?@ !P . /@ ' XM XM 8 XM # X XM !_@ #P X:^ 'P #P !P X Xend END_OF_FILE # end of 'font-32/Ugal13x20b' fi if test -f 'font-32/Ugal13x20r' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font-32/Ugal13x20r'\" else echo shar: Extracting \"'font-32/Ugal13x20r'\" \(5772 characters\) sed "s/^X//" >'font-32/Ugal13x20r' <<'END_OF_FILE' Xbegin 644 gal13x20r.fnt XM& T4!8 XM , 9@!F!@'# < 8 P8 ,!P 0!\ ? XM !@'X!P#_ \ ? > XM ^& #X $ 0 " 8 X ! XMP '@ #@& < XM # & XM8 9A^")@/@/ 8# & ^ , _@/X X!^ P!_P1@(X XM /P P/\ ?C_ _X?\!^/#P_ ?AX<> <#L!P>!_@'@_P#_'_G@[@Y_>\'># XMC_@/A@ ^ #@ , !@ . 3 P # ,< 8 XM !@!@!@ XM P!F &8_PB8&,#P . X XM !@1@' 8<$' . @ 8 P(,,$' '. ,!@@(,8<&"#! @Q@ XM8# !@,,# #!Q@((X,,".&&!@Q&(P$8$,Q& C 0@P# , !@!L & X XM!@ $P < P ## & ! 8 8 8 XM XM , 9@#,9N(L!C , # & P$,#P$#" P%@( , XM"### P !!@/@%@8,$!&#!@@P00$8& P 8#& P X<<"$&#!A!A@P XMP$!@,!#"#,0P08( , P# 8 Q@ !@ & 8 # # P !@ XM 0 # & , XM # &8#_F9AS XM8P# !P!P \ ,##!L P ,!8$ # !@PPP, 8/\!8 XM&#! !@88 , $ &!@, & S , .''@A PP80,8,,! 8# 0P@S$.(#$ & , 8 & XM 8, > !@ & P P , 8 , XM P!@# XM P!F _YF !@#X!@ 8 , & # & P XMP# , ' F!_!@ 0&(,# P 8 8 &#!@2!@PP 8&& # # !@8# !@-@# XM #AQ8(P,,&,#&##@ & P$,(.Q!B Q !@# & !@ '@'P9X#\ ]@> , /D XM-X#P /##@&!NX)X!\.^ >1S@/X?\///!W^[X]X>?^ , 8 P XM XM , &8/@ 8!X P & # 9F P !@,, P # /@)@8X9X $ T#AP> XM& < #@ #!@8(P88, &!AA P@P 8& P 8#P P LL3",#### Q@@> !@,!!D XM#N@- &@ P P P 8 P#&&_!C@QX88# &/#G , PQ@!@-W'G CAQP(\- XM,&& P!AA@(S$<$,!&#@& & & XM # !F!^ , ^ ( !@ P XM';@, P## , !@'X$8 '&_ # & ?L'@#P <#_@> !@9R",'^# !@8? XMP/X, '_@, & \ , ++$8C PW@P,?P#P 8# 09 9H!@ P , , , & XMAAPX08(.,#!^#!@PP# ,,P 8#,PPP0<8.$'#C!@@, 88,$,Q#B!@A!P#@!@ XM!P XM P S 'P& =P 8 , 9@# 8 PP# P '! XM& QPX @"P#S P \ > _X!X P&^@A!@PP 8&&$#"# !@8# !@/@# "RQ'(P, XM, ,#'P / & P$&0&Z 8 , & # !@!@ !X8&, &!C P, P8,, P ##X XM & S,,,,#&!C PP < # &&#!#,0= 8( X 8 8 8 <( XM , XM,P!F!@&-@ & # /_ #_P & ,, P 8 PA@ ,8& (!& P & > ' XM@8!LH?X8&, &!A@ P P^8& P 8#< P FL0R,## # QN X!@,! P!W@+ # ! XM@ P , 8 #F&!C !@8_\# ,&## , P\ !@,S### Q@8P,, #P P!A@ XM8@;H#@#$ < # & , /F XM # /^ 9@SAAX !P!P!F#_P _ XM\ # ## , , ,/^ #&!@& PP 8 '@ !X& ;*$&&!C !@88 , ,#&!@ XM, & S@, )S$&C PP P,9P ' 8# 0. =P$8 P P , # & !AA@8P 8& XM, P!C PP# ,/@ 8#,PPPP,8&,## / , 88&(': < Q . P!@# #; XM XM #_AF8-$8< , 8!VX# P P P@# & (#'_B Q@8! XM,, & P > _X!X &?A A@80 8&& # ! Q@8# !@,<# "<Q X0(, &"&." XMP& P$#@#,!' , , # 8!@ 888&, &!C , ?@,, P ##< & S,,,, XM#&!C PP X# && T!V@+@&@' , 8 P!GP XM 9@?\&1&& XM #@. 9F P P > 8 &( P# C @!@P,<$ 0## # > & !P/^!X !@ @,8 XM&&!&!!@0P 8,8& P 8##@P(B,0.&"# !PAAP@,!@." 0 S @P# & P & 8 XM &&'!C@APX8 # , ## , PS@!@,S###@A@0X,, $& PAA@- ,P$<!H XM#@@& & & 0X XM # ,P#^!D0_X 8# 8 , > '@& !\ XM,!_X?P 8&&#^ , 8@#@'@#P ' X & , (#&# PAA@8$, ##&!@, & P<," XM(C$!@Q P /P8.,& 8!_@$ ,P0& P!@@/@ P^ !SAXP88.6## P#_@P XMP# ,,< 8#,PPP<0<(''# !A@.0<X!@#,"#@,!P8!@!@!@ XM XM P #, & PX'F #!@ / # '@ P# . ?X?^#X & _ ? " #P'@ P \ XM 8 8 !@#_G![_@'P_@/_'@ ?#P\/P!@>#G_G)[@,'@> !P/!S_ ?@/P! # XM,.#P> _X#X ,/@ /<3X#\!YP? > ?\>>#\ #'CP?AWN>>#X'\ _QX XM?P!X#S 8 S#Q\# ?^ . 8!P XM XM 8 # /X XM 8 ^ XM $# @P !@ , @ & XM XM & XM P & XM 1R ?_@ " 0 ,, XM 8 # 8 !@ XM XM # 8 XM ! / XM '_X @$ #B & P XM $ 8 XM !@ XM , XM#@ XM /^ ? !@ , / & XM XM 0 XM " P XM !_ #@ X:\ '@ #@ !@ X Xend END_OF_FILE # end of 'font-32/Ugal13x20r' fi if test -f 'src/graph_subs.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'src/graph_subs.c'\" else echo shar: Extracting \"'src/graph_subs.c'\" \(5999 characters\) sed "s/^X//" >'src/graph_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: graph_subs.c,v 4.1 88/06/21 13:33:53 bianchi Exp $ X $Source: /tmp/mgrsrc/src/RCS/graph_subs.c,v $ X*/ Xstatic char RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/graph_subs.c,v $$Revision: 4.1 $"; X X/* graphics subs - mostly from the BLIT */ X X#include "bitmap.h" X X/* circle of radius r centered at x1,y1 */ X Xcircle(b,x1,y1,r,f) XBITMAP *b; Xint x1; Xregister int y1; Xint r, f; X{ X register err = 0; /* x^2 + y^2 - r^2 */ X register dxsq = 1; /* (x+dx)^2-x^2*/ X register dysq = 1 - 2*r; X register exy; X int x0 = x1; X register y0 = y1 - r; X X y1 += r; X while(y1 > y0) { X bit_point(b,x0,y0,f); X bit_point(b,x0,y1,f); X bit_point(b,x1,y0,f); X bit_point(b,x1,y1,f); X exy = err + dxsq + dysq; X if(-exy <= err+dxsq) { X y1--; X y0++; X err += dysq; X dysq += 2; X } X if(exy <= -err) { X x1++; X x0--; X err += dxsq; X dxsq += 2; X } X } X bit_point(b,x0,y0,f); X bit_point(b,x1,y0,f); X } X X X#define labs(x,y) if((x=y)<0) x= -x X#define BIG 0x7fff X#define HUGE 0x3fffffffL X Xint bit_point(); X X/* draw an ellipse centered at x0,y0 with half-axes a,b */ X Xellipse(screen, x, y, a, b, f) XBITMAP *screen; Xint x, y; Xint a, b; Xint f; X { X if(a==0 || b==0) X bit_line(screen, x-a, y-b, x+a, y+b, f); X else X ellip1(screen, x, y, a, b, bit_point, 0, b, 0, b, f); X } X X/* calculate b*b*x*x + a*a*y*y - a*a*b*b avoiding ovfl */ X Xstatic long Xresid(a,b,x,y) Xregister a,b; X { X long result = 0; X long u = b*((long)a*a - (long)x*x); X long v = (long)a*y*y; X register q = u>BIG? HUGE/u: BIG; X register r = v>BIG? HUGE/v: BIG; X while(a || b) { X if(result>=0 && b) { X if(q>b) q = b; X result -= q*u; X b -= q; X } X else { X if(r>a) r = a; X result += r*v; X a -= r; X } X } X return(result); X } X X/* X * clockwise ellipse centered at x0,y0 with half-axes a,b. X * from x1,y1 to x2,y2 X * do "action" at each point X */ X Xellip1(screen, x0,y0, a, b, action, x1,y1, x2,y2, f) Xint x0,y0, x1,y1, x2, y2; Xregister void (*action)(); XBITMAP *screen; Xint f; X { X int z; X int dx = y1>0? 1: y1<0? -1: x1>0? -1: 1; X int dy = x1>0? -1: x1<0? 1: y1>0? -1: 1; X long a2 = (long)a*a; X long b2 = (long)b*b; X register long dex = b2*(2*dx*x1+1); X register long e; X register long dey = a2*(2*dy*y1+1); X register long ex, ey, exy; X X e = resid(a, b, x1, y1); X a2 *= 2; X b2 *= 2; X do { X labs(ex, e+dex); X labs(ey, e+dey); X labs(exy, e+dex+dey); X if(exy<=ex || ey<ex) { X y1 += dy; X e += dey; X dey += a2; X } X if(exy<=ey || ex<ey) { X x1 += dx; X e += dex; X dex += b2; X } X (*action)(screen, x0+x1, y0+y1, f); X if(x1 == 0) { X dy = -dy; X dey = -dey + a2; X } X else if(y1 == 0) { X for(z=x1; abs(z+=dx)<=a; ) X (*action)(screen, x0+z, y0+y1, f); X dx = -dx; X dex = -dex + b2; X } X } while(x1!=x2 || y1!=y2); X } X X/*----------------------------------------------------------------------*/ X X#define sq(x) ((long)(x)*(x)) X#define sgn(x) ((x)<0? -1 : (x)==0? 0 : 1) X Xstatic long XLabs(x) Xlong x; X { X return(x<0? -x : x); X } X X/* Draw an approximate arc centered at x0,y0 of an X * integer grid and running anti-clockwise from X * x1,y1 to the vicinity of x2,y2. X * If the endpoints coincide, draw a complete circle. X * X * The "arc" is a sequence of vertically, horizontally, X * or diagonally adjacent points that minimize X * abs(x^2+y^2-r^2). X * X * The circle is guaranteed to be symmetric about X * the horizontal, vertical, and diagonal axes X */ X Xarc(bp, x0,y0, x2,y2, x1,y1, f) Xregister BITMAP *bp; Xint x0,y0,x1,y1,x2,y2; X { X register dx, dy; X register eps; /* x^2 + y^2 - r^2 */ X int dxsq, dysq; /* (x+dx)^2-x^2, ...*/ X int ex, ey, exy; X X x1=x1-x0; X y1=y1-y0; X x2=x2-x0; X y2=y2-y0; X X nearby(x1,y1,x2,y2, &x2, &y2); X X dx = -sgn(y1); X dy = sgn(x1); X dxsq = (2*x1 + dx)*dx; X dysq = (2*y1 + dy)*dy; X eps = 0; X do { X if(x1 == 0) { X dy = -sgn(y1); X dysq = (2*y1 + dy)*dy; X } X else if(y1 == 0) { X dx = -sgn(x1); X dxsq = (2*x1 + dx)*dx; X } X ex = abs(eps + dxsq); X ey = abs(eps + dysq); X exy = abs(eps + dxsq + dysq); X if(ex<ey || exy<=ey) { X x1 += dx; X eps += dxsq; X dxsq += 2; X } X if(ey<ex || exy<=ex) { X y1 += dy; X eps += dysq; X dysq += 2; X } X bit_point(bp,x0+x1, y0+y1,f); X /* bit_blit(bp,x0+x1-1,y0+y1-1,2,2,f,NULL_DATA,0,0); */ X } X while(!(x1==x2 && y1==y2)); /* Note1 */ X } X X/* Note1: the equality end test is justified X * because it is impossible that X * abs(x^2+y^2-r^2)==abs((x+\010+-1)^2+y^2-r^2) or X * abs(x^2+y^2-r^2)==abs(x^2+(y+\010+-1)-r^2), X * and no values of x or y are skipped. X * X */ X Xnearby(x1,y1, x2,y2, rx, ry) Xregister int x1, y1, x2, y2; Xint *rx, *ry; X { X long eps, exy, Labs(); /*integers but many bits*/ X int d, dy; X register dx; X eps = sq(x2) + sq(y2) - sq(x1) - sq(y1); X d = eps>0? -1: 1; X for( ; ; eps=exy, x2+=dx, y2+=dy) { X if(abs(y2) > abs(x2)) { X dy = d*sgn(y2); X dx = 0; X } X else { X dy = 0; X dx = d*sgn(x2); X if(dx==0) X dx = 1; X } X exy = eps + (2*x2+dx)*dx + (2*y2+dy)*dy; X if(Labs(eps) <= Labs(exy)) X break; X } X *rx = x2; X *ry = y2; X return(0); X } END_OF_FILE # end of 'src/graph_subs.c' fi echo shar: End of archive 23 \(of 61\). cp /dev/null ark23isdone 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@uunet.uu.net.