-/* $Id: enums.c,v 1.16 2001/03/26 19:42:40 brianp Exp $ */
+/* $Id: enums.c,v 1.17 2001/04/16 21:07:33 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
+static char token_tmp[20];
+
const char *_mesa_lookup_enum_by_nr( int nr )
{
enum_elt tmp, *e, **f;
f = (enum_elt **)bsearch( &e, index1, Elements(all_enums),
sizeof(*index1), (cfunc) compar_nr );
- return f ? (*f)->c : "(unknown)";
+ if (f) {
+ return (*f)->c;
+ }
+ else {
+ /* this isn't re-entrant safe, no big deal here */
+ sprintf(token_tmp, "0x%x\n", nr);
+ return token_tmp;
+ }
}