(lookup): Rename lookup() to symbol_by_value(), make it public
and move it to nstr.c.
This commit is contained in:
parent
edaa05b8cb
commit
d4f52f6ca2
3 changed files with 18 additions and 16 deletions
|
@ -680,3 +680,15 @@ nstr_exec_val(struct valstr *val, natid cnum, void *ptr, nsc_type want)
|
|||
|
||||
val->val_type = valtype;
|
||||
}
|
||||
|
||||
char *
|
||||
symbol_by_value(int key, struct symbol *table)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; table[i].name; i++)
|
||||
if (key == table[i].value)
|
||||
return table[i].name;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue