blob: f2614138d0cd8afdf1fb0d53e8c39dd3ed6d483a [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * A symbol table (symtab) maintains associations between symbol
4 * strings and datum values. The type of the datum values
5 * is arbitrary. The symbol table type is implemented
6 * using the hash table type (hashtab).
7 *
8 * Author : Stephen Smalley, <sds@tycho.nsa.gov>
9 */
10#ifndef _SS_SYMTAB_H_
11#define _SS_SYMTAB_H_
12
13#include "hashtab.h"
14
15struct symtab {
Olivier Deprez157378f2022-04-04 15:47:50 +020016 struct hashtab table; /* hash table (keyed on a string) */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000017 u32 nprim; /* number of primary names in table */
18};
19
20int symtab_init(struct symtab *s, unsigned int size);
21
Olivier Deprez157378f2022-04-04 15:47:50 +020022int symtab_insert(struct symtab *s, char *name, void *datum);
23void *symtab_search(struct symtab *s, const char *name);
24
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000025#endif /* _SS_SYMTAB_H_ */
26
27