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

Function output_row

src/interfaces/libpq/fe-print.c:547–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545
546
547static void
548output_row(FILE *fout, const PQprintOpt *po, const int nFields, char **fields,
549 unsigned char *fieldNotNum, int *fieldMax, char *border,
550 const int row_index)
551{
552 int field_index; /* for loop index */
553
554 if (po->html3)
555 fputs("<tr>", fout);
556 else if (po->standard)
557 fputs(po->fieldSep, fout);
558 for (field_index = 0; field_index < nFields; field_index++)
559 {
560 char *p = fields[row_index * nFields + field_index];
561
562 if (po->html3)
563 fprintf(fout, "<td align=\"%s\">%s</td>",
564 fieldNotNum[field_index] ? "left" : "right", p ? p : "");
565 else
566 {
567 fprintf(fout,
568 fieldNotNum[field_index] ?
569 (po->standard ? " %-*s " : "%-*s") :
570 (po->standard ? " %*s " : "%*s"),
571 fieldMax[field_index],
572 p ? p : "");
573 if (po->standard || field_index + 1 < nFields)
574 fputs(po->fieldSep, fout);
575 }
576 }
577 if (po->html3)
578 fputs("</tr>", fout);
579 else if (po->standard)
580 fprintf(fout, "\n%s", border);
581 fputc('\n', fout);
582}
583
584
585

Callers 1

PQprintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected