Specifications
Chapter 18 321
PSA Programming Examples
Using C Over Socket LAN (UNIX)
PSA Programming Examples
  if ( *charBuf == ’#’ || *charBuf == ’!’ )
  continue ;
  strcat(charBuf, "\n");
  if (!quiet)
  {
  if (number)
  {
  char num[10];
  sprintf(num,"%d: ",number);
  fwrite(num, strlen(num), 1, stdout);
  }
  fwrite(charBuf, strlen(charBuf), 1, stdout) ;
  fflush(stdout);
  }
  if ( isQuery(charBuf) )
  {
  long bufBytes;
  /* Put the query response into the same buffer as the
  * command string appended after the null terminator.
  */
  bufBytes = queryInstrument(instSock, charBuf,
    charBuf + strlen(charBuf) + 1,
    INPUT_BUF_SIZE -strlen(charBuf) );
  if (!quiet)
  {
  fwrite(" ", 2, 1, stdout) ;
  fwrite(charBuf + strlen(charBuf)+1, bufBytes, 1, stdout);
  fwrite("\n", 1, 1, stdout) ;
  fflush(stdout);
  }
  }
  else










