1 C standard defines `stdin` as a macro so we can’t use it as an
3 https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20130506/173524.html
9 /* Structure to hold the command-line options. */
11 - bool stdin; /* True if data should be read from stdin. */
12 + bool usestdin; /* True if data should be read from stdin. */
13 bool noxar; /* The input data is not a XAR archive but the pbzx Payload. */
14 bool help; /* Print usage with details and exit. */
15 bool version; /* Print version and exit. */
17 /* Skip arguments that are not flags. */
18 if (argv[i][0] != '-') continue;
19 /* Match available arguments. */
20 - if (strcmp(argv[i], "-") == 0) opts->stdin = true;
21 + if (strcmp(argv[i], "-") == 0) opts->usestdin = true;
22 else if (strcmp(argv[i], "-n") == 0) opts->noxar = true;
23 else if (strcmp(argv[i], "-h") == 0) opts->help = true;
24 else if (strcmp(argv[i], "-v") == 0) opts->version = true;
26 parse_args(&argc, argv, &opts);
27 if (opts.version) version();
28 if (opts.help) usage(NULL);
29 - if (!opts.stdin && argc < 2)
30 + if (!opts.usestdin && argc < 2)
31 usage("missing filename argument");
32 - else if ((!opts.stdin && argc > 2) || (opts.stdin && argc > 1))
33 + else if ((!opts.usestdin && argc > 2) || (opts.usestdin && argc > 1))
34 usage("unhandled positional argument(s)");
36 char const* filename = NULL;
42 + if (opts.usestdin) {
43 stream.type = STREAM_FP;
50 - if (!opts.stdin) stream_close(&stream);
51 + if (!opts.usestdin) stream_close(&stream);