* Return the list of explicitly-requested footers or, when applicable, the * default "(xx rows)" footer. Always omit the default footer when given * non-default footers, "\pset footer off", or a specific instruction to that * effect from a calling backslash command. Vertical formats number each row, * making the default footer redundant; they do not call this function. * * The return value
| 325 | * The return value may point to static storage; do not keep it across calls. |
| 326 | */ |
| 327 | static printTableFooter * |
| 328 | footers_with_default(const printTableContent *cont) |
| 329 | { |
| 330 | if (cont->footers == NULL && cont->opt->default_footer) |
| 331 | { |
| 332 | unsigned long total_records; |
| 333 | |
| 334 | total_records = cont->opt->prior_records + cont->nrows; |
| 335 | snprintf(default_footer, sizeof(default_footer), |
| 336 | ngettext("(%lu row)", "(%lu rows)", total_records), |
| 337 | total_records); |
| 338 | |
| 339 | return &default_footer_cell; |
| 340 | } |
| 341 | else |
| 342 | return cont->footers; |
| 343 | } |
| 344 | |
| 345 | |
| 346 | /*************************/ |
no outgoing calls
no test coverage detected