| 1949 | current line. */ |
| 1950 | |
| 1951 | static void |
| 1952 | store_columns (void) |
| 1953 | { |
| 1954 | int i, j; |
| 1955 | unsigned int line = 0; |
| 1956 | unsigned int buff_start; |
| 1957 | int last_col; /* The rightmost column which will be saved in buff */ |
| 1958 | COLUMN *p; |
| 1959 | |
| 1960 | buff_current = 0; |
| 1961 | buff_start = 0; |
| 1962 | |
| 1963 | if (balance_columns) |
| 1964 | last_col = columns; |
| 1965 | else |
| 1966 | last_col = columns - 1; |
| 1967 | |
| 1968 | for (i = 1, p = column_vector; i <= last_col; ++i, ++p) |
| 1969 | p->lines_stored = 0; |
| 1970 | |
| 1971 | for (i = 1, p = column_vector; i <= last_col && files_ready_to_read; |
| 1972 | ++i, ++p) |
| 1973 | { |
| 1974 | p->current_line = line; |
| 1975 | for (j = lines_per_body; j && files_ready_to_read; --j) |
| 1976 | |
| 1977 | if (p->status == OPEN) /* Redundant. Clean up. */ |
| 1978 | { |
| 1979 | input_position = 0; |
| 1980 | |
| 1981 | if (!read_line (p)) |
| 1982 | read_rest_of_line (p); |
| 1983 | |
| 1984 | if (p->status == OPEN |
| 1985 | || buff_start != buff_current) |
| 1986 | { |
| 1987 | ++p->lines_stored; |
| 1988 | line_vector[line] = buff_start; |
| 1989 | end_vector[line++] = input_position; |
| 1990 | buff_start = buff_current; |
| 1991 | } |
| 1992 | } |
| 1993 | } |
| 1994 | |
| 1995 | /* Keep track of the location of the last char in buff. */ |
| 1996 | line_vector[line] = buff_start; |
| 1997 | |
| 1998 | if (balance_columns) |
| 1999 | balance (line); |
| 2000 | } |
| 2001 | |
| 2002 | static void |
| 2003 | balance (int total_stored) |
no test coverage detected