Agilent Technologies E4406A VSA Satellite Radio User Manual


 
Chapter 3 151
Programming Examples
Using C Programming Over Socket LAN
#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 <unistd.h> /* 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] <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)
{