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

Function line_cost

src/fmt.c:969–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967 depends on LEN, the length of the line beginning there. */
968
969static COST
970line_cost (WORD *next, int len)
971{
972 int n;
973 COST cost;
974
975 if (next == word_limit)
976 return 0;
977 n = goal_width - len;
978 cost = SHORT_COST (n);
979 if (next->next_break != word_limit)
980 {
981 n = len - next->line_length;
982 cost += RAGGED_COST (n);
983 }
984 return cost;
985}
986
987/* Output to stdout a paragraph from word up to (but not including)
988 FINISH, which must be in the next_break chain from word. */

Callers 1

fmt_paragraphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected