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

Function print_aligned_vertical

src/fe_utils/print.c:1211–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1209}
1210
1211static void
1212print_aligned_vertical(const printTableContent *cont,
1213 FILE *fout, bool is_pager)
1214{
1215 bool opt_tuples_only = cont->opt->tuples_only;
1216 unsigned short opt_border = cont->opt->border;
1217 const printTextFormat *format = get_line_style(cont->opt);
1218 const printTextLineFormat *dformat = &format->lrule[PRINT_RULE_DATA];
1219 int encoding = cont->opt->encoding;
1220 unsigned long record = cont->opt->prior_records + 1;
1221 const char *const *ptr;
1222 unsigned int i,
1223 hwidth = 0,
1224 dwidth = 0,
1225 hheight = 1,
1226 dheight = 1,
1227 hformatsize = 0,
1228 dformatsize = 0;
1229 struct lineptr *hlineptr,
1230 *dlineptr;
1231 bool is_local_pager = false,
1232 hmultiline = false,
1233 dmultiline = false;
1234 int output_columns = 0; /* Width of interactive console */
1235
1236 if (cancel_pressed)
1237 return;
1238
1239 if (opt_border > 2)
1240 opt_border = 2;
1241
1242 if (cont->cells[0] == NULL && cont->opt->start_table &&
1243 cont->opt->stop_table)
1244 {
1245 printTableFooter *footers = footers_with_default(cont);
1246
1247 if (!opt_tuples_only && !cancel_pressed && footers)
1248 {
1249 printTableFooter *f;
1250
1251 for (f = footers; f; f = f->next)
1252 fprintf(fout, "%s\n", f->data);
1253 }
1254
1255 fputc('\n', fout);
1256
1257 return;
1258 }
1259
1260 /*
1261 * Deal with the pager here instead of in printTable(), because we could
1262 * get here via print_aligned_text() in expanded auto mode, and so we have
1263 * to recalculate the pager requirement based on vertical output.
1264 */
1265 if (!is_pager)
1266 {
1267 IsPagerNeeded(cont, 0, true, &fout, &is_pager);
1268 is_local_pager = is_pager;

Callers 2

print_aligned_textFunction · 0.85
printTableFunction · 0.85

Calls 9

get_line_styleFunction · 0.85
footers_with_defaultFunction · 0.85
IsPagerNeededFunction · 0.85
pg_wcssizeFunction · 0.85
pg_mallocFunction · 0.85
pg_wcsformatFunction · 0.85
strlen_max_widthFunction · 0.85
ClosePagerFunction · 0.85

Tested by

no test coverage detected