MCPcopy Create free account
hub / github.com/apache/cloudberry / print_unaligned_text

Function print_unaligned_text

src/fe_utils/print.c:351–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350
351static void
352print_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);

Callers 1

printTableFunction · 0.85

Calls 2

print_separatorFunction · 0.85
footers_with_defaultFunction · 0.85

Tested by

no test coverage detected