|
|
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 d
Length: 707 (0x2c3)
Types: TextFile
Names: »devread.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/X/Xwanderer/devread.c«
#include "wand_head.h"
int rscreen(name,row_ptr,maxmoves)
int *maxmoves;
char *name;
char (*row_ptr)[ROWLEN+1];
{
int y;
FILE *fp;
char fnbuf[1024];
fp = fopen(name,"r");
if (fp == NULL) {
sprintf(fnbuf,"%s/%s",SCREENPATH,name);
if ((fp = fopen(fnbuf,"r")) == NULL) {
printf("Screen %s not found in ./%s or %s/%s.\n\n",
name,name,SCREENPATH,name);
exit(1);
}
}
{
for(y = 0;y<NOOFROWS;y++)
{
fgets((*row_ptr++),ROWLEN + 1,fp);
fgetc(fp); /* remove newline char*/
};
if(fscanf(fp,"%*s\n%d",maxmoves) != 1) {
printf("no maxmoves specified: assuming infinite movement.\n");
*maxmoves= (-1);
}
};
fclose(fp);
return (fp == NULL);
}