Agilent Technologies E8663B Portable Generator User Manual


 
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 127
Programming Examples
LAN Programming Interface Examples
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); /* DDP */
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++;
}
}
return(c);
}