MCPcopy Create free account
hub / github.com/coreutils/coreutils / init_page

Function init_page

src/pr.c:1704–1743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1702 Keep track of this total so we know when to stop printing */
1703
1704static void
1705init_page (void)
1706{
1707 int j;
1708 COLUMN *p;
1709
1710 if (storing_columns)
1711 {
1712 store_columns ();
1713 for (j = columns - 1, p = column_vector; j; --j, ++p)
1714 {
1715 p->lines_to_print = p->lines_stored;
1716 }
1717
1718 /* Last column. */
1719 if (balance_columns)
1720 {
1721 p->lines_to_print = p->lines_stored;
1722 }
1723 /* Since we're not balancing columns, we don't need to store
1724 the rightmost column. Read it straight from the file. */
1725 else
1726 {
1727 if (p->status == OPEN)
1728 {
1729 p->lines_to_print = lines_per_body;
1730 }
1731 else
1732 p->lines_to_print = 0;
1733 }
1734 }
1735 else
1736 for (j = columns, p = column_vector; j; --j, ++p)
1737 if (p->status == OPEN)
1738 {
1739 p->lines_to_print = lines_per_body;
1740 }
1741 else
1742 p->lines_to_print = 0;
1743}
1744
1745/* Align empty columns and print separators.
1746 Empty columns will be formed by files with status ON_HOLD or CLOSED

Callers 1

print_pageFunction · 0.85

Calls 1

store_columnsFunction · 0.85

Tested by

no test coverage detected