| 349 | |
| 350 | |
| 351 | static void |
| 352 | print_unaligned_text(const printTableContent *cont, FILE *fout) |
| 353 | { |
| 354 | bool opt_tuples_only = cont->opt->tuples_only; |
| 355 | unsigned int i; |
| 356 | const char *const *ptr; |
| 357 | bool need_recordsep = false; |
| 358 | |
| 359 | if (cancel_pressed) |
| 360 | return; |
| 361 | |
| 362 | if (cont->opt->start_table) |
| 363 | { |
| 364 | /* print title */ |
| 365 | if (!opt_tuples_only && cont->title) |
| 366 | { |
| 367 | fputs(cont->title, fout); |
| 368 | print_separator(cont->opt->recordSep, fout); |
| 369 | } |
| 370 | |
| 371 | /* print headers */ |
| 372 | if (!opt_tuples_only) |
| 373 | { |
| 374 | for (ptr = cont->headers; *ptr; ptr++) |
| 375 | { |
| 376 | if (ptr != cont->headers) |
| 377 | print_separator(cont->opt->fieldSep, fout); |
| 378 | fputs(*ptr, fout); |
| 379 | } |
| 380 | need_recordsep = true; |
| 381 | } |
| 382 | } |
| 383 | else |
| 384 | /* assume continuing printout */ |
| 385 | need_recordsep = true; |
| 386 | |
| 387 | /* print cells */ |
| 388 | for (i = 0, ptr = cont->cells; *ptr; i++, ptr++) |
| 389 | { |
| 390 | if (need_recordsep) |
| 391 | { |
| 392 | print_separator(cont->opt->recordSep, fout); |
| 393 | need_recordsep = false; |
| 394 | if (cancel_pressed) |
| 395 | break; |
| 396 | } |
| 397 | fputs(*ptr, fout); |
| 398 | |
| 399 | if ((i + 1) % cont->ncolumns) |
| 400 | print_separator(cont->opt->fieldSep, fout); |
| 401 | else |
| 402 | need_recordsep = true; |
| 403 | } |
| 404 | |
| 405 | /* print footers */ |
| 406 | if (cont->opt->stop_table) |
| 407 | { |
| 408 | printTableFooter *footers = footers_with_default(cont); |
no test coverage detected