possibly called to show usage info during command line processing when an interface hasn't yet been chosen and set up */
| 1536 | /* possibly called to show usage info during command line processing when |
| 1537 | an interface hasn't yet been chosen and set up */ |
| 1538 | void |
| 1539 | genl_display_file(const char *fname, boolean complain) |
| 1540 | { |
| 1541 | char buf[BUFSZ]; |
| 1542 | dlb *f = dlb_fopen(fname, "r"); |
| 1543 | |
| 1544 | if (!f) { |
| 1545 | if (complain) /* send complaint to stdout rather than to stderr */ |
| 1546 | fprintf(stdout, "\nCannot open \"%s\".\n", fname); |
| 1547 | } else { |
| 1548 | /* straight copy to stdout, no pagination or other interaction */ |
| 1549 | while (dlb_fgets(buf, BUFSZ, f)) { |
| 1550 | if (fputs(buf, stdout) < 0) |
| 1551 | break; |
| 1552 | } |
| 1553 | (void) dlb_fclose(f); |
| 1554 | } |
| 1555 | } |
| 1556 | |
| 1557 | /* |
| 1558 | * Window port helper function for menu invert routines to move the decision |
no test coverage detected