xref: /original-bsd/usr.bin/pascal/libpc/MAX.c (revision 6b005e0a)
1 /*-
2  * Copyright (c) 1979, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)MAX.c	8.1 (Berkeley) 06/06/93";
10 #endif /* not lint */
11 
12 #include "h00vars.h"
13 
14 long
15 MAX(width, reduce, min)
16 
17 	register long	width;		/* requested width */
18 	long		reduce;		/* amount of extra space required */
19 	long		min;		/* minimum amount of space needed */
20 {
21 	if (width <= 0) {
22 		ERROR("Non-positive format width: %D\n", width);
23 	}
24 	if ((width -= reduce) >= min)
25 		return width;
26 	return min;
27 }
28