FreeCalypso > hg > fc-rfcal-tools
annotate autocal/sockopts.c @ 60:81e8f7e99d89
fc-rfcal-rxband: upload of GMagic to DUT implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 27 May 2017 23:35:06 +0000 |
parents | a3f48378658d |
children |
rev | line source |
---|---|
21
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the common code for handling |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * -s and -t command line options. |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdio.h> |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdlib.h> |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <unistd.h> |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <rvinterf/exitcodes.h> |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 extern char *rvif_socket_pathname, *tsid_socket_pathname; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 socket_pathname_options(argc, argv) |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 char **argv; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 { |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 extern char *optarg; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 int c; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 while ((c = getopt(argc, argv, "s:t:")) != EOF) { |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 switch (c) { |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 case 's': |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 rvif_socket_pathname = optarg; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 continue; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 case 't': |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 tsid_socket_pathname = optarg; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 continue; |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 case '?': |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 default: |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /* error msg already printed */ |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 exit(ERROR_USAGE); |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 } |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 } |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 return(0); |
a3f48378658d
autocal: beginning of fc-rfcal-vcxo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 } |