Lines Matching refs:argv
19 ap_optiserr(int argc, char * const *argv, int oint, const char *optstr, in ap_optiserr() argument
31 fprintf(stderr, "option not found %c\n", argv[oint][optchr]); in ap_optiserr()
34 fprintf(stderr, "no argument for option %c\n", argv[oint][optchr]); in ap_optiserr()
41 ap_optopt = argv[oint][optchr]; in ap_optiserr()
45 int ap_getopt(int argc, char* const *argv, const char *optstr) in ap_getopt() argument
54 if (!dash && (argv[ap_optind][0] != '-')) in ap_getopt()
56 if (!dash && (argv[ap_optind][0] == '-') && !argv[ap_optind][1]) in ap_getopt()
64 if ((argv[ap_optind][0] == '-') && (argv[ap_optind][1] == '-')) in ap_getopt()
72 assert((argv[ap_optind][0] == '-') && argv[ap_optind][1]); in ap_getopt()
79 if (argv[ap_optind][optchr] == ':') in ap_getopt()
83 return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRCOLON)); in ap_getopt()
85 if (!(cp = strchr(optstr, argv[ap_optind][optchr]))) in ap_getopt()
90 if (!argv[ap_optind][optchr+1]) in ap_getopt()
97 return(ap_optiserr(argc, argv, errind, optstr, errchr, OPTERRNF)); in ap_getopt()
104 if(!argv[ap_optind][2]) { in ap_getopt()
107 return(ap_optiserr(argc, argv, ap_optind-1, optstr, optchr, OPTERRARG)); in ap_getopt()
108 ap_optarg = argv[ap_optind++]; in ap_getopt()
112 ap_optarg = &argv[ap_optind][2]; in ap_getopt()
119 if (!argv[ap_optind][optchr+1]) in ap_getopt()
134 main (int argc, char **argv) in main() argument
144 while ((c = ap_getopt(argc, argv, "abo:")) != EOF) in main()
171 (void)printf("%s\n", argv[ap_optind]); in main()