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 */ 71666Smckusick 8*40865Sbostic #ifndef lint 9*40865Sbostic static char sccsid[] = "@(#)NAM.c 1.5 (Berkeley) 04/09/90"; 10*40865Sbostic #endif /* not lint */ 111666Smckusick 121666Smckusick #include "h00vars.h" 131666Smckusick 141666Smckusick char * 153013Smckusic NAM(val, name) 161666Smckusick 173013Smckusic long val; /* internal enumerated type value */ 181666Smckusick char *name; /* ptr to enumerated type name descriptor */ 191666Smckusick { 203013Smckusic register int value = val; 211666Smckusick register short *sptr; 221666Smckusick 231666Smckusick sptr = (short *)name; 241666Smckusick if (value < 0 || value >= *sptr) { 253867Smckusic ERROR("Enumerated type value of %D is out of range on output\n", 263867Smckusic val); 271666Smckusick } 281666Smckusick sptr++; 291666Smckusick return name + 2 + sptr[value]; 301666Smckusick } 31