1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 21da177e4SLinus Torvalds /* 31da177e4SLinus Torvalds * A symbol table (symtab) maintains associations between symbol 41da177e4SLinus Torvalds * strings and datum values. The type of the datum values 51da177e4SLinus Torvalds * is arbitrary. The symbol table type is implemented 61da177e4SLinus Torvalds * using the hash table type (hashtab). 71da177e4SLinus Torvalds * 8*0fe53224SStephen Smalley * Author : Stephen Smalley, <stephen.smalley.work@gmail.com> 91da177e4SLinus Torvalds */ 101da177e4SLinus Torvalds #ifndef _SS_SYMTAB_H_ 111da177e4SLinus Torvalds #define _SS_SYMTAB_H_ 121da177e4SLinus Torvalds 131da177e4SLinus Torvalds #include "hashtab.h" 141da177e4SLinus Torvalds 151da177e4SLinus Torvalds struct symtab { 1603414a49SOndrej Mosnacek struct hashtab table; /* hash table (keyed on a string) */ 171da177e4SLinus Torvalds u32 nprim; /* number of primary names in table */ 181da177e4SLinus Torvalds }; 191da177e4SLinus Torvalds 200e83c9c6SChristian Göttsche int symtab_init(struct symtab *s, u32 size); 211da177e4SLinus Torvalds 22237389e3SOndrej Mosnacek int symtab_insert(struct symtab *s, char *name, void *datum); 23237389e3SOndrej Mosnacek void *symtab_search(struct symtab *s, const char *name); 24237389e3SOndrej Mosnacek 251da177e4SLinus Torvalds #endif /* _SS_SYMTAB_H_ */ 261da177e4SLinus Torvalds 271da177e4SLinus Torvalds 28