Path: utzoo!attcan!uunet!bbn.com!rsalz From: rsalz@uunet.uu.net (Rich Salz) Newsgroups: comp.sources.unix Subject: v17i024: MGR, Bellcore window manager, Part23/61 Message-ID: <1379@papaya.bbn.com> Date: 24 Jan 89 19:27:42 GMT Lines: 1496 Approved: rsalz@uunet.UU.NET Submitted-by: Stephen A. Uhler 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 '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 X#include 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 X#include X#include X#include 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;iS(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|y|f|p|M]\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 X#include X#include X#include 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;iS(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|y|f|p|M]\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 #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 #@''#ACN8?@<, \ < < < >, XM . XM.X!W!P'/P ' #@ /_@ #_X ' .. X < XQP .<' ,!G X ' ? ' XMP #@' . /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 Y@/ X!P#@#_@ XM XM #_QW . #@#>Y@\8,. '#'/# XMX' X&#P#N!G@. . #@ & 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 <''#_ . .# XM,SF!PY@X /X <#NXXX>8>,'GC@!QP/8>\!P#N##P.!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# !@,<# " 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$ '@& !\ 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#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 #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 #@''#ACN8?@<, \ < < < >, XM . XM.X!W!P'/P ' #@ /_@ #_X ' .. X < XQP .<' ,!G X ' ? ' XMP #@' . /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 Y@/ X!P#@#_@ XM XM #_QW . #@#>Y@\8,. '#'/# XMX' X&#P#N!G@. . #@ & 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 <''#_ . .# XM,SF!PY@X /X <#NXXX>8>,'GC@!QP/8>\!P#N##P.!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# !@,<# " 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$ '@& !\ 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#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 || ey0? -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.