NCDStringIndex_hash.h 793 B

12345678910111213
  1. #define CHASH_PARAM_NAME NCDStringIndex__Hash
  2. #define CHASH_PARAM_ENTRY struct NCDStringIndex__entry
  3. #define CHASH_PARAM_LINK NCD_string_id_t
  4. #define CHASH_PARAM_KEY NCDStringIndex_hash_key
  5. #define CHASH_PARAM_ARG NCDStringIndex_hash_arg
  6. #define CHASH_PARAM_NULL ((NCD_string_id_t)-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->str)
  9. #define CHASH_PARAM_KEYHASH(arg, key) badvpn_djb2_hash((const uint8_t *)(key))
  10. #define CHASH_PARAM_ENTRYHASH_IS_CHEAP 0
  11. #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) (!strcmp((entry1).ptr->str, (entry2).ptr->str))
  12. #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) (!strcmp((key1), (entry2).ptr->str))
  13. #define CHASH_PARAM_ENTRY_NEXT hash_next