xref: /original-bsd/usr.bin/pascal/libpc/MAX.c (revision 5fb3de76)
1 /* Copyright (c) 1979 Regents of the University of California */
2 
3 static char sccsid[] = "@(#)MAX.c 1.2 03/07/81";
4 
5 #include "h00vars.h"
6 #include "h01errs.h"
7 
8 long
9 MAX(width, reduce, min)
10 
11 	register long	width;		/* requested width */
12 	long		reduce;		/* amount of extra space required */
13 	long		min;		/* minimum amount of space needed */
14 {
15 	if (width < 0) {
16 		ERROR(EFMTSIZE, width);
17 		return;
18 	}
19 	if ((width -= reduce) >= min)
20 		return width;
21 	return min;
22 }
23