|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 802 (0x322)
Types: TextFile
Names: »rsw.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Spacewar/rsw.c«
/*
* Spacewar - program that reads a user's terminal and passes
* it back to the spacewar game through a pipe in
* order to present spacewar with only one file to
* read for user input eliminating polling
*
* Copyright 1984 obo Systems, Inc.
* Copyright 1984 Dan Rosenblatt
*/
#include "spacewar.h"
#include "universe.h"
#include "login.h"
#include "uio.h"
main(argc,argv)
int argc;
char *argv[];
{
struct uio ttyuio;
register int i;
/* get, save, and clear player's login pointer */
if (argc != 2) exit(1);
ttyuio.uio_lgn = (struct login *) atoi(argv[1]);
argv[1] = (char *) 0;
/* read tty and forward it on */
for(;;) {
if ((i=read(0,ttyuio.uio_chrs,sizeof(ttyuio.uio_chrs)-1)) > 0) {
ttyuio.uio_chrs[i] = '\0';
write(1,&ttyuio,sizeof(ttyuio));
}
}
}