symtab.h 994 B

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