xxhash32-php.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #define FFI_LIB "libxxhash.so"
  2. typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
  3. typedef uint32_t XXH32_hash_t;
  4. struct XXH32_state_s {
  5. XXH32_hash_t total_len;
  6. XXH32_hash_t large_len;
  7. XXH32_hash_t v1;
  8. XXH32_hash_t v2;
  9. XXH32_hash_t v3;
  10. XXH32_hash_t v4;
  11. XXH32_hash_t mem32[4];
  12. XXH32_hash_t memsize;
  13. XXH32_hash_t reserved; /* never read nor write, might be removed in a future version */
  14. }; /* typedef'd to XXH32_state_t */
  15. typedef struct XXH32_state_s XXH32_state_t; /* incomplete type (pointer only) */
  16. extern XXH32_hash_t XXH32 (const void* input, size_t length, XXH32_hash_t seed);
  17. extern XXH32_state_t* XXH32_createState(void);
  18. extern XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr);
  19. extern void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state);
  20. extern XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, XXH32_hash_t seed);
  21. extern XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length);
  22. extern XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr);
  23. typedef struct { unsigned char digest[4]; } XXH32_canonical_t;
  24. extern void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash);
  25. extern XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src);