Keysight E4428C ESG RF Programming Manual page 151

Signal generators
Table of Contents

Advertisement

static char
*scan = NULL;
int getopt( int argc, char * const argv[], const char* optstring)
{
char c;
char *posn;
optarg = NULL;
if (scan == NULL || *scan == '\0') {
if (optind == 0)
optind++;
if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
return(EOF);
if (strcmp(argv[optind], "--")==0) {
optind++;
return(EOF);
}
scan = argv[optind]+1;
optind++;
}
c = *scan++;
posn = strchr(optstring, c);
if (posn == NULL || c == ':') {
fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
return('?');
}
posn++;
if (*posn == ':') {
if (*scan != '\0') {
optarg = scan;
scan = NULL;
} else {
optarg = argv[optind];
optind++;
}
}
Keysight Signal Generators Programming Guide
/* Private scan pointer. */
/* DDP */
Programming Examples
LAN Programming Interface Examples
143

Advertisement

Table of Contents
loading

Table of Contents