axhash-ffi 1.0.0

C-stable FFI wrapper and distribution crate for the AxHash engine.
Documentation
/* This file is generated by cbindgen. Do not edit it manually. */

#pragma once

/* Generated with cbindgen:0.29.2 */

#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>

typedef enum AxHashRuntimeBackend {
  AX_HASH_RUNTIME_BACKEND_SCALAR = 0,
  AX_HASH_RUNTIME_BACKEND_AARCH64_NEON = 1,
  AX_HASH_RUNTIME_BACKEND_X86_64AVX2 = 2,
} AxHashRuntimeBackend;

typedef struct AxHashState AxHashState;

typedef struct AxHashIovec {
  const uint8_t *ptr;
  size_t len;
} AxHashIovec;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

const char *axhash_ffi_version(void);

uint64_t axhash_bytes(const uint8_t *bytes, size_t len);

uint64_t axhash_bytes_seeded(const uint8_t *bytes, size_t len, uint64_t seed);

void axhash_batch_seeded(const struct AxHashIovec *iovecs,
                         size_t count,
                         uint64_t seed,
                         uint64_t *out_hashes);

struct AxHashState *axhash_hasher_new(void);

struct AxHashState *axhash_hasher_new_seeded(uint64_t seed);

bool axhash_hasher_reset(struct AxHashState *state, uint64_t seed);

bool axhash_hasher_write(struct AxHashState *state, const uint8_t *bytes, size_t len);

uint64_t axhash_hasher_finish(struct AxHashState *state);

void axhash_hasher_free(struct AxHashState *state);

enum AxHashRuntimeBackend axhash_runtime_backend(void);

bool axhash_runtime_has_simd(void);

#ifdef __cplusplus
}  // extern "C"
#endif  // __cplusplus