Agilent Technologies PSG Manual de Instruções Página 88

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 362
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 87
Programming Examples
LAN Programming Examples
Chapter 274
# include <unistd.h> /* for getopt(3C) */
#endif
#define COMMAND_ERROR (1)
#define NO_CMD_ERROR (0)
#define SCPI_PORT 7777
#define INPUT_BUF_SIZE (64*1024)
/**************************************************************************
* Display usage
**************************************************************************/
static void usage(char *basename)
{
fprintf(stderr,"Usage: %s [-nqu] <hostname> [<command>]\n", basename);
fprintf(stderr," %s [-nqu] <hostname> < stdin\n", basename);
fprintf(stderr," -n, number output lines\n");
fprintf(stderr," -q, quiet; do NOT echo lines\n");
fprintf(stderr," -e, show messages in error queue when done\n");
}
#ifdef WINSOCK
int init_winsock(void)
{
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD(1, 1);
wVersionRequested = MAKEWORD(2, 0);
err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
/* Tell the user that we couldn’t find a useable */
/* winsock.dll. */
fprintf(stderr, "Cannot initialize Winsock 1.1.\n");
return -1;
}
return 0;
}
int close_winsock(void)
{
WSACleanup();
return 0;
}
#endif /* WINSOCK */
Vista de página 87
1 2 ... 83 84 85 86 87 88 89 90 91 92 93 ... 361 362

Comentários a estes Manuais

Sem comentários