1 2/* Author : Stephen Smalley, <sds@epoch.ncsc.mil> */ 3 4/* FLASK */ 5 6/* 7 * A symbol table (symtab) maintains associations between symbol 8 * strings and datum values. The type of the datum values 9 * is arbitrary. The symbol table type is implemented 10 * using the hash table type (hashtab). 11 */ 12 13#ifndef _SEPOL_POLICYDB_SYMTAB_H_ 14#define _SEPOL_POLICYDB_SYMTAB_H_ 15 16#include <sepol/policydb/hashtab.h> 17#include <sys/cdefs.h> 18 19__BEGIN_DECLS 20 21/* The symtab_datum struct stores the common information for 22 * all symtab datums. It should the first element in every 23 * struct that will be used in a symtab to allow the specific 24 * datum types to be freely cast to this type. 25 * 26 * The values start at 1 - 0 is never a valid value. 27 */ 28typedef struct symtab_datum { 29 uint32_t value; 30} symtab_datum_t; 31 32typedef struct { 33 hashtab_t table; /* hash table (keyed on a string) */ 34 uint32_t nprim; /* number of primary names in table */ 35} symtab_t; 36 37extern int symtab_init(symtab_t *, unsigned int size); 38extern void symtab_destroy(symtab_t *); 39 40__END_DECLS 41#endif /* _SYMTAB_H_ */ 42 43/* FLASK */ 44