print_columns(shf, n, func, arg, max_width)
print_columns(shf, n, func, arg, max_width, prefcol)
print_columns(shf, n, func, arg, max_width)	struct shf *shf;	int n;	char *(*func) ARGS((void *, int, char *, int));	void *arg;	int max_width;{	char *str = (char *) alloc(max_width + 1, ATEMP);	int i;	int r, c;	int rows, cols;	int nspace;	/* max_width + 1 for the space.  Note that no space	 * is printed after the last column to avoid problems	 * with terminals that have auto-wrap.	 */	cols = x_cols / (max_width + 1);	if (!cols)		cols = 1;	rows = (n + cols - 1) / cols;	if (n && cols > rows) {		int tmp = rows;		rows = cols;		cols = tmp;		if (rows > n)			rows = n;	}	nspace = (x_cols - max_width * cols) / cols;	if (nspace <= 0)		nspace = 1;	for (r = 0; r < rows; r++) {		for (c = 0; c < cols; c++) {			i = c * rows + r;			if (i < n) {				shf_fprintf(shf, "%-*s",					max_width,					(*func)(arg, i, str, max_width + 1));				if (c + 1 < cols)					shf_fprintf(shf, "%*s", nspace, null);			}		}		shf_putchar('\n', shf);	}	afree(str, ATEMP);}