* IsPagerNeeded * * Setup pager if required */
| 3279 | * Setup pager if required |
| 3280 | */ |
| 3281 | static void |
| 3282 | IsPagerNeeded(const printTableContent *cont, int extra_lines, bool expanded, |
| 3283 | FILE **fout, bool *is_pager) |
| 3284 | { |
| 3285 | if (*fout == stdout) |
| 3286 | { |
| 3287 | int lines; |
| 3288 | |
| 3289 | if (expanded) |
| 3290 | lines = (cont->ncolumns + 1) * cont->nrows; |
| 3291 | else |
| 3292 | lines = cont->nrows + 1; |
| 3293 | |
| 3294 | if (!cont->opt->tuples_only) |
| 3295 | { |
| 3296 | printTableFooter *f; |
| 3297 | |
| 3298 | /* |
| 3299 | * FIXME -- this is slightly bogus: it counts the number of |
| 3300 | * footers, not the number of lines in them. |
| 3301 | */ |
| 3302 | for (f = cont->footers; f; f = f->next) |
| 3303 | lines++; |
| 3304 | } |
| 3305 | |
| 3306 | *fout = PageOutput(lines + extra_lines, cont->opt); |
| 3307 | *is_pager = (*fout != stdout); |
| 3308 | } |
| 3309 | else |
| 3310 | *is_pager = false; |
| 3311 | } |
| 3312 | |
| 3313 | /* |
| 3314 | * Use this to print any table in the supported formats. |
no test coverage detected