1*40865Sbostic /*- 2*40865Sbostic * Copyright (c) 1979 The Regents of the University of California. 3*40865Sbostic * All rights reserved. 4*40865Sbostic * 5*40865Sbostic * %sccs.include.redist.c% 6*40865Sbostic */ 71707Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)SUCC.c 1.6 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 111707Smckusick 123034Smckusic long 131707Smckusick SUCC(value, lower, upper) 141707Smckusick 153034Smckusic long value; 163034Smckusic long lower; 173034Smckusic long upper; 181707Smckusick { 193859Smckusic if (value == upper) { 203859Smckusic ERROR("Cannot take succ of last element of a range\n"); 213859Smckusic } 221707Smckusick value++; 231707Smckusick if (value < lower || value > upper) { 243859Smckusic ERROR("Value of %D is out of range\n", value); 251707Smckusick } 261707Smckusick return value; 271707Smckusick } 28