|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <limits.h>#include <math.h>#include <unistd.h>#include <sys/ioctl.h>#include "catalog/pg_type_d.h"#include "fe_utils/mbprint.h"#include "fe_utils/print.h"
Go to the source code of this file.
Data Structures | |
| struct | unicodeStyleRowFormat |
| struct | unicodeStyleColumnFormat |
| struct | unicodeStyleBorderFormat |
| struct | unicodeStyleFormat |
Macros | |
| #define | LONGTABLE_WHITESPACE " \t\n" |
| #define LONGTABLE_WHITESPACE " \t\n" |
|
static |
Definition at line 609 of file print.c.
References fb(), format, fout, fprintf, i, and j.
Referenced by print_aligned_text().
Definition at line 305 of file print.c.
References decimal_point, fb(), groupdigits, integer_digits(), len, and thousands_sep.
Referenced by format_numeric_locale().
Definition at line 2154 of file print.c.
Referenced by print_asciidoc_text(), and print_asciidoc_vertical().
Definition at line 3161 of file print.c.
References _, cancel_pressed, fb(), fprintf, and restore_sigpipe_trap().
Referenced by exec_command_sf_sv(), ExecQueryAndProcessResults(), helpSQL(), helpVariables(), print_aligned_text(), print_aligned_vertical(), printHistory(), printTable(), slashUsage(), and usage().
Definition at line 3812 of file print.c.
References fb().
Referenced by printCrosstab(), and printQuery().
Definition at line 1841 of file print.c.
References csv_escaped_print(), fb(), fout, and str.
Referenced by print_csv_text(), and print_csv_vertical().
Definition at line 3025 of file print.c.
References PG_SIG_IGN, pqsignal, and SIGPIPE.
Referenced by do_copy(), do_watch(), exec_command_write(), PageOutputInternal(), and SetupGOutput().
|
static |
Definition at line 414 of file print.c.
References default_footer, default_footer_cell, fb(), ngettext, and snprintf.
Referenced by print_aligned_text(), print_aligned_vertical(), print_asciidoc_text(), print_html_text(), print_latex_text(), print_troff_ms_text(), and print_unaligned_text().
Definition at line 330 of file print.c.
References additional_numeric_locale_len(), Assert, decimal_point, fb(), groupdigits, i, integer_digits(), pg_malloc_array, pg_strdup(), and thousands_sep.
Referenced by printQuery().
| const printTextFormat * get_line_style | ( | const printTableOpt * | opt | ) |
Definition at line 3876 of file print.c.
References fb(), printTableOpt::line_style, and pg_asciiformat.
Referenced by print_aligned_text(), print_aligned_vertical(), print_aligned_vertical_line(), printPsetInfo(), and pset_value_string().
Definition at line 1938 of file print.c.
Referenced by print_html_text(), print_html_vertical(), and PrintQueryStatus().
Definition at line 294 of file print.c.
References fb().
Referenced by additional_numeric_locale_len(), and format_numeric_locale().
|
static |
Definition at line 3431 of file print.c.
References fb(), fout, and PageOutputInternal().
Referenced by print_aligned_text(), print_aligned_vertical(), and printTable().
Definition at line 2378 of file print.c.
Referenced by print_latex_longtable_text(), print_latex_text(), and print_latex_vertical().
| FILE * PageOutput | ( | int | lines, |
| const printTableOpt * | topt | ||
| ) |
Definition at line 3079 of file print.c.
References fb(), and PageOutputInternal().
Referenced by exec_command_sf_sv(), ExecQueryAndProcessResults(), helpSQL(), helpVariables(), print_aligned_text(), printHistory(), slashUsage(), and usage().
|
static |
Definition at line 3091 of file print.c.
References DEFAULT_PAGER, disable_sigpipe_trap(), fb(), Max, printTableOpt::pager, printTableOpt::pager_min_lines, restore_sigpipe_trap(), and result.
Referenced by IsPagerNeeded(), and PageOutput().
|
static |
Definition at line 651 of file print.c.
References _print_horizontal_line(), cancel_pressed, cleanup(), ClosePager(), printTableFooter::data, encoding, fb(), footers_with_default(), format, fout, fprintf, free, get_line_style(), i, IsPagerNeeded(), j, printTableFooter::next, PageOutput(), pg_malloc0_array, pg_malloc_array, pg_wcsformat(), pg_wcssize(), print_aligned_vertical(), PRINT_LINE_WRAP_NEWLINE, PRINT_LINE_WRAP_NONE, PRINT_LINE_WRAP_WRAP, PRINT_RULE_BOTTOM, PRINT_RULE_DATA, PRINT_RULE_MIDDLE, PRINT_RULE_TOP, PRINT_WRAPPED, lineptr::ptr, strlen_max_width(), and lineptr::width.
Referenced by printTable().
|
static |
Definition at line 1304 of file print.c.
References cancel_pressed, ClosePager(), printTableFooter::data, encoding, fb(), footers_with_default(), format, fout, fprintf, free, get_line_style(), i, IsPagerNeeded(), printTableFooter::next, pg_asciiformat_old, pg_malloc(), pg_malloc_array, pg_wcsformat(), pg_wcssize(), PRINT_ALIGNED, print_aligned_vertical_line(), PRINT_RULE_BOTTOM, PRINT_RULE_DATA, PRINT_RULE_MIDDLE, PRINT_RULE_TOP, PRINT_WRAPPED, lineptr::ptr, strlen_max_width(), and lineptr::width.
Referenced by print_aligned_text(), and printTable().
|
static |
Definition at line 1205 of file print.c.
References printTableOpt::border, printTableOpt::expanded_header_exact_width, printTableOpt::expanded_header_width_type, fb(), fout, fprintf, get_line_style(), i, printTextFormat::lrule, Max, Min, PRINT_XHEADER_COLUMN, PRINT_XHEADER_EXACT_WIDTH, and PRINT_XHEADER_PAGE.
Referenced by print_aligned_vertical().
|
static |
Definition at line 2172 of file print.c.
References asciidoc_escaped_print(), cancel_pressed, printTableFooter::data, fb(), footers_with_default(), fout, fprintf, i, and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 2282 of file print.c.
References asciidoc_escaped_print(), cancel_pressed, printTableFooter::data, fb(), fout, fprintf, i, and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 1866 of file print.c.
References cancel_pressed, csv_print_field(), fb(), fout, and i.
Referenced by printTable().
|
static |
Definition at line 1906 of file print.c.
References cancel_pressed, csv_print_field(), fb(), fout, and i.
Referenced by printTable().
|
static |
Definition at line 1979 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), footers_with_default(), fout, fprintf, html_escaped_print(), i, and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 2068 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), fout, fprintf, html_escaped_print(), i, and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 2547 of file print.c.
References cancel_pressed, fb(), fout, i, latex_escaped_print(), and LONGTABLE_WHITESPACE.
Referenced by printTable().
|
static |
Definition at line 2440 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), footers_with_default(), fout, i, latex_escaped_print(), and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 2703 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), fout, fprintf, i, latex_escaped_print(), and printTableFooter::next.
Referenced by printTable().
|
static |
Definition at line 2813 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), footers_with_default(), fout, i, printTableFooter::next, and troff_ms_escaped_print().
Referenced by printTable().
|
static |
Definition at line 2905 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), fout, fprintf, i, printTableFooter::next, and troff_ms_escaped_print().
Referenced by printTable().
|
static |
Definition at line 438 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), footers_with_default(), fout, i, printTableFooter::next, and print_separator().
Referenced by printTable().
|
static |
Definition at line 529 of file print.c.
References cancel_pressed, printTableFooter::data, fb(), fout, i, printTableFooter::next, and print_separator().
Referenced by printTable().
| void printQuery | ( | const PGresult * | result, |
| const printQueryOpt * | opt, | ||
| FILE * | fout, | ||
| bool | is_pager, | ||
| FILE * | flog | ||
| ) |
Definition at line 3743 of file print.c.
References Assert, cancel_pressed, column_type_alignment(), printQueryOpt::falsePrint, fb(), printQueryOpt::footers, format_numeric_locale(), fout, i, printQueryOpt::n_translate_columns, printQueryOpt::nullPrint, printTableOpt::numericLocale, PQfname, PQftype(), PQgetisnull, PQgetvalue, PQnfields, PQntuples, printTable(), printTableAddCell(), printTableAddFooter(), printTableAddHeader(), printTableCleanup(), printTableInit(), result, printQueryOpt::title, printQueryOpt::topt, translate(), printQueryOpt::translate_columns, printQueryOpt::translate_header, and printQueryOpt::truePrint.
Referenced by describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describeFunctions(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describeRoleGrants(), describeSubscriptions(), describeTablespaces(), describeTypes(), ExecQueryAndProcessResults(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOneExtensionContents(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSDictionaries(), listTSParsers(), listTSTemplates(), listUserMappings(), objectDescription(), permissionsList(), and PrintQueryTuples().
Definition at line 3637 of file print.c.
References _, cancel_pressed, ClosePager(), EXIT_FAILURE, fb(), fout, fprintf, IsPagerNeeded(), PRINT_ALIGNED, print_aligned_text(), print_aligned_vertical(), PRINT_ASCIIDOC, print_asciidoc_text(), print_asciidoc_vertical(), PRINT_CSV, print_csv_text(), print_csv_vertical(), PRINT_HTML, print_html_text(), print_html_vertical(), PRINT_LATEX, PRINT_LATEX_LONGTABLE, print_latex_longtable_text(), print_latex_text(), print_latex_vertical(), PRINT_NOTHING, PRINT_TROFF_MS, print_troff_ms_text(), print_troff_ms_vertical(), PRINT_UNALIGNED, print_unaligned_text(), print_unaligned_vertical(), and PRINT_WRAPPED.
Referenced by describeOneTableDetails(), describePublications(), describeRoles(), exec_command_conninfo(), printCrosstab(), and printQuery().
| void printTableAddCell | ( | printTableContent *const | content, |
| char * | cell, | ||
| const bool | translate, | ||
| const bool | mustfree | ||
| ) |
Definition at line 3280 of file print.c.
References _, printTableContent::cell, printTableContent::cellmustfree, printTableContent::cellsadded, printTableOpt::encoding, EXIT_FAILURE, fb(), fprintf, mbvalidate(), printTableContent::ncolumns, printTableContent::nrows, printTableContent::opt, pg_malloc0_array, and translate().
Referenced by describeOneTableDetails(), describePublications(), describeRoles(), exec_command_conninfo(), and printQuery().
| void printTableAddFooter | ( | printTableContent *const | content, |
| const char * | footer | ||
| ) |
Definition at line 3330 of file print.c.
References printTableFooter::data, fb(), printTableContent::footer, printTableContent::footers, printTableFooter::next, pg_malloc0_object, and pg_strdup().
Referenced by add_tablespace_footer(), addFooterToPublicationDesc(), describeOneTableDetails(), printQuery(), and printTableSetFooter().
| void printTableAddHeader | ( | printTableContent *const | content, |
| char * | header, | ||
| const bool | translate, | ||
| const char | align | ||
| ) |
Definition at line 3240 of file print.c.
References _, printTableContent::align, printTableOpt::encoding, EXIT_FAILURE, fb(), fprintf, printTableContent::header, printTableContent::headers, mbvalidate(), printTableContent::ncolumns, printTableContent::opt, and translate().
Referenced by describeOneTableDetails(), describePublications(), describeRoles(), exec_command_conninfo(), printCrosstab(), and printQuery().
| void printTableCleanup | ( | printTableContent *const | content | ) |
Definition at line 3373 of file print.c.
References printTableContent::align, printTableContent::aligns, printTableContent::cell, printTableContent::cellmustfree, printTableContent::cells, printTableFooter::data, fb(), printTableContent::footer, printTableContent::footers, free, printTableContent::header, printTableContent::headers, i, printTableContent::ncolumns, printTableFooter::next, printTableContent::nrows, printTableContent::opt, printTableContent::title, and unconstify.
Referenced by describeOneTableDetails(), describePublications(), describeRoles(), exec_command_conninfo(), printCrosstab(), and printQuery().
| void printTableInit | ( | printTableContent *const | content, |
| const printTableOpt * | opt, | ||
| const char * | title, | ||
| const int | ncolumns, | ||
| const int | nrows | ||
| ) |
Definition at line 3192 of file print.c.
References _, printTableContent::align, printTableContent::aligns, printTableContent::cell, printTableContent::cellmustfree, printTableContent::cells, printTableContent::cellsadded, EXIT_FAILURE, fb(), printTableContent::footer, printTableContent::footers, fprintf, printTableContent::header, printTableContent::headers, printTableContent::ncolumns, printTableContent::nrows, printTableContent::opt, pg_malloc0_array, and printTableContent::title.
Referenced by describeOneTableDetails(), describePublications(), describeRoles(), exec_command_conninfo(), printCrosstab(), and printQuery().
| void printTableSetFooter | ( | printTableContent *const | content, |
| const char * | footer | ||
| ) |
Definition at line 3355 of file print.c.
References printTableFooter::data, fb(), printTableContent::footer, printTableContent::footers, free, pg_strdup(), and printTableAddFooter().
Referenced by add_tablespace_footer().
| void refresh_utf8format | ( | const printTableOpt * | opt | ) |
Definition at line 3890 of file print.c.
References unicodeStyleFormat::border_style, unicodeStyleFormat::column_style, unicodeStyleBorderFormat::down_and_left, unicodeStyleBorderFormat::down_and_right, fb(), unicodeStyleFormat::header_nl_left, printTextFormat::header_nl_left, unicodeStyleFormat::header_nl_right, printTextFormat::header_nl_right, unicodeStyleRowFormat::horizontal, unicodeStyleBorderFormat::horizontal, printTextLineFormat::hrule, unicodeStyleBorderFormat::left_and_right, printTextLineFormat::leftvrule, printTextFormat::lrule, printTextLineFormat::midvrule, printTextFormat::midvrule_blank, printTextFormat::midvrule_nl, printTextFormat::midvrule_wrap, printTextFormat::name, unicodeStyleFormat::nl_left, printTextFormat::nl_left, unicodeStyleFormat::nl_right, printTextFormat::nl_right, pg_utf8format, PRINT_RULE_BOTTOM, PRINT_RULE_DATA, PRINT_RULE_MIDDLE, PRINT_RULE_TOP, printTextLineFormat::rightvrule, unicodeStyleFormat::row_style, printTableOpt::unicode_border_linestyle, printTableOpt::unicode_column_linestyle, printTableOpt::unicode_header_linestyle, unicode_style, unicodeStyleBorderFormat::up_and_right, unicodeStyleBorderFormat::vertical, unicodeStyleRowFormat::vertical_and_left, unicodeStyleRowFormat::vertical_and_right, unicodeStyleFormat::wrap_left, printTextFormat::wrap_left, unicodeStyleFormat::wrap_right, printTextFormat::wrap_right, unicodeStyleFormat::wrap_right_border, and printTextFormat::wrap_right_border.
Definition at line 3048 of file print.c.
References always_ignore_sigpipe, PG_SIG_DFL, PG_SIG_IGN, pqsignal, and SIGPIPE.
Referenced by CloseGOutput(), ClosePager(), do_copy(), do_watch(), exec_command_write(), PageOutputInternal(), and setQFout().
Definition at line 3061 of file print.c.
References always_ignore_sigpipe.
Referenced by setQFout().
Definition at line 3840 of file print.c.
References decimal_point, fb(), groupdigits, pg_strdup(), and thousands_sep.
Referenced by main().
Definition at line 3945 of file print.c.
References encoding, fb(), PQdsplen(), PQmblen(), start, and str.
Referenced by print_aligned_text(), and print_aligned_vertical().
Definition at line 2796 of file print.c.
Referenced by print_troff_ms_text(), and print_troff_ms_vertical().
Definition at line 50 of file print.c.
Referenced by restore_sigpipe_trap(), and set_sigpipe_trap_state().
| volatile sig_atomic_t cancel_pressed = false |
Definition at line 48 of file print.c.
Referenced by ClosePager(), describeTableDetails(), do_watch(), ExecQueryAndProcessResults(), ExecQueryTuples(), listExtensionContents(), listTSConfigsVerbose(), listTSParsersVerbose(), MainLoop(), print_aligned_text(), print_aligned_vertical(), print_asciidoc_text(), print_asciidoc_vertical(), print_csv_text(), print_csv_vertical(), print_html_text(), print_html_vertical(), print_latex_longtable_text(), print_latex_text(), print_latex_vertical(), print_troff_ms_text(), print_troff_ms_vertical(), print_unaligned_text(), print_unaligned_vertical(), printQuery(), printTable(), PrintVariables(), psql_cancel_callback(), SendQuery(), and wait_until_connected().
|
static |
Definition at line 53 of file print.c.
Referenced by additional_numeric_locale_len(), format_numeric_locale(), and setDecimalLocale().
|
static |
Definition at line 57 of file print.c.
Referenced by footers_with_default().
|
static |
|
static |
Definition at line 54 of file print.c.
Referenced by additional_numeric_locale_len(), format_numeric_locale(), and setDecimalLocale().
| const printTextFormat pg_asciiformat |
Definition at line 61 of file print.c.
Referenced by do_pset(), and get_line_style().
| const printTextFormat pg_asciiformat_old |
Definition at line 82 of file print.c.
Referenced by do_pset(), and print_aligned_vertical().
| printTextFormat pg_utf8format |
Definition at line 104 of file print.c.
Referenced by do_pset(), and refresh_utf8format().
|
static |
Definition at line 55 of file print.c.
Referenced by additional_numeric_locale_len(), format_numeric_locale(), and setDecimalLocale().
|
static |
Definition at line 145 of file print.c.
Referenced by refresh_utf8format().