Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/long-options.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | - | |||||||||||||
6 | static struct option const long_options[] = | - | ||||||||||||
7 | { | - | ||||||||||||
8 | {"help", | - | ||||||||||||
9 | 0 | - | ||||||||||||
10 | , | - | ||||||||||||
11 | ((void *)0) | - | ||||||||||||
12 | , 'h'}, | - | ||||||||||||
13 | {"version", | - | ||||||||||||
14 | 0 | - | ||||||||||||
15 | , | - | ||||||||||||
16 | ((void *)0) | - | ||||||||||||
17 | , 'v'}, | - | ||||||||||||
18 | { | - | ||||||||||||
19 | ((void *)0) | - | ||||||||||||
20 | , 0, | - | ||||||||||||
21 | ((void *)0) | - | ||||||||||||
22 | , 0} | - | ||||||||||||
23 | }; | - | ||||||||||||
24 | - | |||||||||||||
25 | - | |||||||||||||
26 | - | |||||||||||||
27 | - | |||||||||||||
28 | void | - | ||||||||||||
29 | parse_long_options (int argc, | - | ||||||||||||
30 | char **argv, | - | ||||||||||||
31 | const char *command_name, | - | ||||||||||||
32 | const char *package, | - | ||||||||||||
33 | const char *version, | - | ||||||||||||
34 | void (*usage_func) (int), | - | ||||||||||||
35 | ...) | - | ||||||||||||
36 | { | - | ||||||||||||
37 | int c; | - | ||||||||||||
38 | int saved_opterr; | - | ||||||||||||
39 | - | |||||||||||||
40 | saved_opterr = opterr; | - | ||||||||||||
41 | - | |||||||||||||
42 | - | |||||||||||||
43 | opterr = 0; | - | ||||||||||||
44 | - | |||||||||||||
45 | if (argc == 2
| 399-5542 | ||||||||||||
46 | && (
| 155-244 | ||||||||||||
47 | ((void *)0)
| 155-244 | ||||||||||||
48 | )) != -1
| 155-244 | ||||||||||||
49 | { | - | ||||||||||||
50 | switch (c) | - | ||||||||||||
51 | { | - | ||||||||||||
52 | case executed 42 times by 14 tests: 'h':case 'h': Executed by:
executed 42 times by 14 tests: case 'h': Executed by:
| 42 | ||||||||||||
53 | (*usage_func) ( | - | ||||||||||||
54 | 0 | - | ||||||||||||
55 | ); | - | ||||||||||||
56 | break; never executed: break; | 0 | ||||||||||||
57 | - | |||||||||||||
58 | case executed 72 times by 14 tests: 'v':case 'v': Executed by:
executed 72 times by 14 tests: case 'v': Executed by:
| 72 | ||||||||||||
59 | { | - | ||||||||||||
60 | va_list authors; | - | ||||||||||||
61 | - | |||||||||||||
62 | __builtin_va_start( | - | ||||||||||||
63 | authors | - | ||||||||||||
64 | , | - | ||||||||||||
65 | usage_func | - | ||||||||||||
66 | ) | - | ||||||||||||
67 | ; | - | ||||||||||||
68 | version_etc_va ( | - | ||||||||||||
69 | stdout | - | ||||||||||||
70 | , command_name, package, version, authors); | - | ||||||||||||
71 | exit (0); executed 72 times by 14 tests: exit (0); Executed by:
| 72 | ||||||||||||
72 | } | - | ||||||||||||
73 | - | |||||||||||||
74 | default executed 41 times by 14 tests: default: Executed by:
code before this statement never executed: default: executed 41 times by 14 tests: :default: Executed by:
code before this statement never executed: default: executed 41 times by 14 tests: default: Executed by:
| 0-41 | ||||||||||||
75 | - | |||||||||||||
76 | break; executed 41 times by 14 tests: break; Executed by:
| 41 | ||||||||||||
77 | } | - | ||||||||||||
78 | } | - | ||||||||||||
79 | - | |||||||||||||
80 | - | |||||||||||||
81 | opterr = saved_opterr; | - | ||||||||||||
82 | - | |||||||||||||
83 | - | |||||||||||||
84 | - | |||||||||||||
85 | optind = 0; | - | ||||||||||||
86 | } executed 5827 times by 15 tests: end of block Executed by:
| 5827 | ||||||||||||
Switch to Source code | Preprocessed file |