/*
 * 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1986
 * LICENSED MATERIALS - PROPERTY OF IBM
 * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
 */
/* $Header:vlook.c 12.0$ */
/* $ACIS:vlook.c 12.0$ */
/* $Source: /ibm/acis/usr/src/ibm/aedtest/RCS/vlook.c,v $ */

#ifndef lint
static char *rcsid = "$Header:vlook.c 12.0$";
#endif

/* vlook.c */

#include "vikst.h"

#ifdef BSD
	extern int v_control;
	extern FILE *spool;
#endif

look(w1,w2,w3)
UINT16 *w1, *w2, *w3;
{
  UINT16 a;
  starttime();
  while( elapsedtime() < 20 )  /* 20 seconds is considered time-out */
     { 
	vread(&a,1,SR);
/* 	fprintf(spool,"debug vlook: a=%x\n",a); */
       if (a == (UINT16) vikdone)
	  {
/* 	PRINTF("debug vlook: a==vikdone\n"); */
 	  vread(w1,1,SR+2); 
	    vread(w2,1,SR+4);
	    vread(w3,1,SR+6);
/* 	PRINTF("debug vlook:*w1=%0x *w2=%0x *w3=%0x\n",*w1,*w2,*w3);  */
	    return(ok);
	  }
     }
   vread(w1,1,SR+2); 
   vread(w2,1,SR+4);
   vread(w3,1,SR+6);
/* 	PRINTF("debug vlook:*w1=%0x *w2=%0x *w3=%0x\n",*w1,*w2,*w3);  */
  return(bad);
}
