NCDInterpProg_hash.h 729 B

123456789101112
  1. #define CHASH_PARAM_NAME NCDInterpProg__Hash
  2. #define CHASH_PARAM_ENTRY NCDInterpProg__hashentry
  3. #define CHASH_PARAM_LINK int
  4. #define CHASH_PARAM_KEY NCDInterpProg__hashkey
  5. #define CHASH_PARAM_ARG NCDInterpProg__hasharg
  6. #define CHASH_PARAM_NULL ((int)-1)
  7. #define CHASH_PARAM_DEREF(arg, link) (&(arg)[(link)])
  8. #define CHASH_PARAM_ENTRYHASH(arg, entry) (badvpn_djb2_hash((const uint8_t *)(entry).ptr->name))
  9. #define CHASH_PARAM_KEYHASH(arg, key) (badvpn_djb2_hash((const uint8_t *)(key)))
  10. #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) (!strcmp((entry1).ptr->name, (entry2).ptr->name))
  11. #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) (!strcmp((key1), (entry2).ptr->name))
  12. #define CHASH_PARAM_ENTRY_NEXT hash_next