Annotation of 43BSDTahoe/usr.lib/libpc/NAM.c, revision 1.1

1.1     ! root        1: /* Copyright (c) 1979 Regents of the University of California */
        !             2: 
        !             3: static char sccsid[] = "@(#)NAM.c 1.3 6/10/81";
        !             4: 
        !             5: #include "h00vars.h"
        !             6: 
        !             7: char *
        !             8: NAM(val, name)
        !             9: 
        !            10:        long            val;    /* internal enumerated type value */
        !            11:        char            *name;  /* ptr to enumerated type name descriptor */
        !            12: {
        !            13:        register int    value = val;
        !            14:        register short  *sptr;
        !            15: 
        !            16:        sptr = (short *)name;
        !            17:        if (value < 0 || value >= *sptr) {
        !            18:                ERROR("Enumerated type value of %D is out of range on output\n",
        !            19:                        val);
        !            20:                return;
        !            21:        }
        !            22:        sptr++;
        !            23:        return  name + 2 + sptr[value];
        !            24: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.