18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * A symbol table (symtab) maintains associations between symbol 48c2ecf20Sopenharmony_ci * strings and datum values. The type of the datum values 58c2ecf20Sopenharmony_ci * is arbitrary. The symbol table type is implemented 68c2ecf20Sopenharmony_ci * using the hash table type (hashtab). 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Author : Stephen Smalley, <sds@tycho.nsa.gov> 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci#ifndef _SS_SYMTAB_H_ 118c2ecf20Sopenharmony_ci#define _SS_SYMTAB_H_ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#include "hashtab.h" 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistruct symtab { 168c2ecf20Sopenharmony_ci struct hashtab table; /* hash table (keyed on a string) */ 178c2ecf20Sopenharmony_ci u32 nprim; /* number of primary names in table */ 188c2ecf20Sopenharmony_ci}; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciint symtab_init(struct symtab *s, unsigned int size); 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciint symtab_insert(struct symtab *s, char *name, void *datum); 238c2ecf20Sopenharmony_civoid *symtab_search(struct symtab *s, const char *name); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#endif /* _SS_SYMTAB_H_ */ 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci 28