EasyManua.ls Logo

Agilent Technologies E8257C - Page 106

Agilent Technologies E8257C
198 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
100 Chapter 2
Programming Examples
LAN Programming Examples
argument), getopt returns EOF. The special option -- can be used to
delimit the end of the options; EOF is returned, and -- is skipped.
***************************************************************************/
#include <stdio.h> /* For NULL, EOF */
#include <string.h> /* For strchr() */
char *optarg; /* Global argument pointer. */
int optind = 0; /* Global argv index. */
static char *scan = NULL; /* Private scan pointer. */
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);
}

Table of Contents

Other manuals for Agilent Technologies E8257C

Related product manuals