MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / main

Function main

lib/getopt.c:717–790  ·  view source on GitHub ↗
(argc, argv)

Source from the content-addressed store, hash-verified

715 the above definition of `getopt'. */
716
717int
718main(argc, argv)
719int argc;
720char **argv;
721{
722 while (1)
723 {
724 int c;
725 int digit_optind = 0;
726
727 int this_option_optind = optind ? optind : 1;
728
729 c = getopt(argc, argv, "abc:d:0123456789");
730
731 if (c == EOF)
732 {
733 break;
734 }
735
736 switch (c)
737 {
738 case '0':
739 case '1':
740 case '2':
741 case '3':
742 case '4':
743 case '5':
744 case '6':
745 case '7':
746 case '8':
747 case '9':
748 if (digit_optind != 0 && digit_optind != this_option_optind)
749 {
750 printf("digits occur in two different argv-elements.\n");
751 }
752
753 digit_optind = this_option_optind;
754 printf("option %c\n", c);
755 break;
756
757 case 'a':
758 printf("option a\n");
759 break;
760
761 case 'b':
762 printf("option b\n");
763 break;
764
765 case 'c':
766 printf("option c with value `%s'\n", optarg);
767 break;
768
769 case '?':
770 break;
771
772 default:
773 printf("?? getopt returned character code 0%o ??\n", c);
774 }

Callers

nothing calls this directly

Calls 1

getoptFunction · 0.85

Tested by

no test coverage detected