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

Function printTableAddHeader

src/fe_utils/print.c:3097–3123  ·  view source on GitHub ↗

* Add a header to the table. * * Headers are not duplicated; you must ensure that the header string is * available for the lifetime of the printTableContent struct. * * If translate is true, the function will pass the header through gettext. * Otherwise, the header will not be translated. * * align is either 'l' or 'r', and specifies the alignment for cells in this * column. */

Source from the content-addressed store, hash-verified

3095 * column.
3096 */
3097void
3098printTableAddHeader(printTableContent *const content, char *header,
3099 const bool translate, const char align)
3100{
3101#ifndef ENABLE_NLS
3102 (void) translate; /* unused parameter */
3103#endif
3104
3105 if (content->header >= content->headers + content->ncolumns)
3106 {
3107 fprintf(stderr, _("Cannot add header to table content: "
3108 "column count of %d exceeded.\n"),
3109 content->ncolumns);
3110 exit(EXIT_FAILURE);
3111 }
3112
3113 *content->header = (char *) mbvalidate((unsigned char *) header,
3114 content->opt->encoding);
3115#ifdef ENABLE_NLS
3116 if (translate)
3117 *content->header = _(*content->header);
3118#endif
3119 content->header++;
3120
3121 *content->align = align;
3122 content->align++;
3123}
3124
3125/*
3126 * Add a cell to the table.

Callers 5

printQueryFunction · 0.85
printCrosstabFunction · 0.85
describeOneTableDetailsFunction · 0.85
describeRolesFunction · 0.85
describePublicationsFunction · 0.85

Calls 1

mbvalidateFunction · 0.85

Tested by

no test coverage detected