/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright 1997 by Massachusetts Institute of Technology3*4* Copyright 1987 by MIT Student Information Processing Board5*6* Permission to use, copy, modify, and distribute this software7* and its documentation for any purpose and without fee is8* hereby granted, provided that the above copyright notice9* appear in all copies and that both that copyright notice and10* this permission notice appear in supporting documentation,11* and that the names of M.I.T. and the M.I.T. S.I.P.B. not be12* used in advertising or publicity pertaining to distribution13* of the software without specific, written prior permission.14* Furthermore if you modify this software you must label15* your software as modified software and not distribute it in such a16* fashion that it might be confused with the original M.I.T. software.17* M.I.T. and the M.I.T. S.I.P.B. make no representations about18* the suitability of this software for any purpose. It is19* provided "as is" without express or implied warranty.20*/2122#include "com_err.h"23#include "error_table.h"2425static const char char_set[] =26"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";2728const char *29error_table_name_r (unsigned long num,30/*@out@*/ /*@returned@*/ char *outbuf)31/*@modifies outbuf@*/32{33long ch;34int i;35/*@out@*/ char *p;3637p = outbuf;38num >>= ERRCODE_RANGE;3940for (i = 3; i >= 0; i--) {41ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);42if (ch != 0)43*p++ = char_set[ch-1];44}45*p = '\0';46return(outbuf);47}4849/*@observer@*/50const char * error_table_name(unsigned long num)51/*@modifies internalState@*/52{53static char buf[6];5455return error_table_name_r(num, buf);56}575859