FreeCalypso > hg > fc-sim-tools
view libcommon/globalopts.c @ 10:ddd767f6e15b
fc-simtool ported over
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Sun, 14 Mar 2021 07:11:25 +0000 | 
| parents | c9ef9e91dd8e | 
| children | 9eb5460f51a6 | 
line wrap: on
 line source
/* * This module implements parsing of global command line options. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> unsigned calypso_fd, pcsc_reader_num; parse_global_options(argc, argv) char **argv; { extern char *optarg; int c; while ((c = getopt(argc, argv, "+C:p:")) != EOF) { switch (c) { case 'C': calypso_fd = atoi(optarg); continue; case 'p': pcsc_reader_num = atoi(optarg); continue; case '?': default: /* error msg already printed */ exit(1); } } return(0); }
