beautypg.com

Agilent Technologies N5183A MXG User Manual

Page 120

background image

110

Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide

Programming Examples
LAN Programming Interface Examples

#else /* UNIX with BSD sockets */

# include /* for connect and socket*/

# include /* for sockaddr_in */

# include /* for gethostbyname */

# define SOCKET_ERROR (-1)

# define INVALID_SOCKET (-1)

typedef int SOCKET;

#endif /* WINSOCK */

#ifdef WINSOCK

/* Declared in getopt.c. See example programs disk. */

extern char *optarg;

extern int optind;

extern int getopt(int argc, char * const argv[], const char* optstring);

#else

# include /* for getopt(3C) */

#endif

#define COMMAND_ERROR (1)

#define NO_CMD_ERROR (0)

#define SCPI_PORT 5025

#define INPUT_BUF_SIZE (64*1024)

/**************************************************************************

* Display usage

**************************************************************************/

static void usage(char *basename)

{

fprintf(stderr,"Usage: %s [-nqu] []\n", basename);

fprintf(stderr," %s [-nqu] < 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");

}

This manual is related to the following products: