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

Function balance

src/pr.c:2002–2020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2000}
2001
2002static void
2003balance (int total_stored)
2004{
2005 COLUMN *p;
2006 int i, lines;
2007 int first_line = 0;
2008
2009 for (i = 1, p = column_vector; i <= columns; ++i, ++p)
2010 {
2011 lines = total_stored / columns;
2012 if (i <= total_stored % columns)
2013 ++lines;
2014
2015 p->lines_stored = lines;
2016 p->current_line = first_line;
2017
2018 first_line += lines;
2019 }
2020}
2021
2022/* Store a character in the buffer. */
2023

Callers 1

store_columnsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected