MCPcopy Index your code
hub / github.com/git/git / layout

Function layout

column.c:36–52  ·  view source on GitHub ↗

* Calculate cell width, rows and cols for a table of equal cells, given * table width and how many spaces between cells. */

Source from the content-addressed store, hash-verified

34 * table width and how many spaces between cells.
35 */
36static void layout(struct column_data *data, int *width)
37{
38 int i;
39
40 *width = 0;
41 for (i = 0; i < data->list->nr; i++)
42 if (*width < data->len[i])
43 *width = data->len[i];
44
45 *width += data->opts.padding;
46
47 data->cols = (data->opts.width - strlen(data->opts.indent)) / *width;
48 if (data->cols == 0)
49 data->cols = 1;
50
51 data->rows = DIV_ROUND_UP(data->list->nr, data->cols);
52}
53
54static void compute_column_width(struct column_data *data)
55{

Callers 1

display_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected