1 /* $Id: dl.c,v 1.5 1994/06/24 13:55:44 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
29 char hex[] = "0123456789ABCDEF";
31 main(argc,argv) char **argv; {
32 register nd,pc,sg,osg,first;
38 fatal("usage: %s [object [tty]]\n",argv[0]);
42 if (freopen(s,"r",stdin) == NULL)
43 fatal("can't open %s",s);
47 if ((ttyfd = open(s,2)) < 0)
48 if ((ttyfd = creat(s,0666)) < 0)
49 fatal("can't open %s",s);
50 if (gtty(ttyfd,&tty) == 0) {
53 tty.sg_ispeed = tty.sg_ospeed = B2400;
57 freopen(s,"w",stdout);
77 while (nd > MAXBYTE) {
84 assert(feof(stdin) == 0);
112 newline(nd,pc,DATTYPE);
121 newline(0,0,EOFTYPE);
130 put('\n'); /* added instruction */
140 assert(bytecount == 0);
154 put(hex[(b>>4) & 017]);
172 i = read(ttyfd,&c,1);
181 return((getc(f) << 8) | c);
186 fprintf(stderr,"%s: ",progname);
188 fprintf(stderr,"\n");