xref: /csrg-svn/usr.bin/pascal/libpc/MAX.c (revision 62092)
140865Sbostic /*-
2*62092Sbostic  * Copyright (c) 1979, 1993
3*62092Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71664Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)MAX.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111664Smckusick 
121664Smckusick #include "h00vars.h"
131664Smckusick 
143011Smckusic long
MAX(width,reduce,min)151664Smckusick MAX(width, reduce, min)
161664Smckusick 
173011Smckusic 	register long	width;		/* requested width */
183011Smckusic 	long		reduce;		/* amount of extra space required */
193011Smckusic 	long		min;		/* minimum amount of space needed */
201664Smckusick {
213177Smckusic 	if (width <= 0) {
223867Smckusic 		ERROR("Non-positive format width: %D\n", width);
231664Smckusick 	}
241664Smckusick 	if ((width -= reduce) >= min)
251664Smckusick 		return width;
261664Smckusick 	return min;
271664Smckusick }
28