send_rdp (char *template, va_alist) va_dcl #endif
send_rdp (char *template,...)
send_rdp (char *template, va_alist)     va_dcl#endif{  char buf[200];  char *dst = buf;  va_list alist;#ifdef ANSI_PROTOTYPES  va_start (alist, template);#else  va_start (alist);#endif  while (*template)    {      unsigned int val;      int *pi;      int *pstat;      char *pc;      int i;      switch (*template++)	{	case 'b':	  val = va_arg (alist, int);	  *dst++ = val;	  break;	case 'w':	  val = va_arg (alist, int);	  *dst++ = val;	  *dst++ = val >> 8;	  *dst++ = val >> 16;	  *dst++ = val >> 24;	  break;	case 'S':	  val = get_byte ();	  if (val != RDP_RES_VALUE)	    {	      printf_unfiltered ("got bad res value of %d, %x\n", val, val);	    }	  break;	case 'V':	  pstat = va_arg (alist, int *);	  pi = va_arg (alist, int *);	  *pstat = get_byte ();	  /* Check the result was zero, if not read the syndrome */	  if (*pstat)	    {	      *pi = get_word ();	    }	  break;	case 'Z':	  /* Check the result code, error if not zero */	  if (get_byte ())	    error ("Command garbled");	  break;	case 'W':	  /* Read a word from the target */	  pi = va_arg (alist, int *);	  *pi = get_word ();	  break;	case 'P':	  /* Read in some bytes from the target. */	  pc = va_arg (alist, char *);	  val = va_arg (alist, int);	  for (i = 0; i < val; i++)	    {	      pc[i] = get_byte ();	    }	  break;	case 'p':	  /* send what's being pointed at */	  pc = va_arg (alist, char *);	  val = va_arg (alist, int);	  dst = buf;	  SERIAL_WRITE (io, pc, val);	  break;	case '-':	  /* Send whats in the queue */	  if (dst != buf)	    {	      SERIAL_WRITE (io, buf, dst - buf);	      dst = buf;	    }	  break;	case 'B':	  pi = va_arg (alist, int *);	  *pi = get_byte ();	  break;	default:	  abort ();	}    }  va_end (args);  if (dst != buf)    abort ();}