fetch_ml/native/rust/dataset_hash/include/dataset_hash.h
Jeremie Fraeys 7efefa1933
feat(native): implement Rust native layer as a test
- queue_index: mmap-based priority queue with safe storage wrapper
- dataset_hash: BLAKE3 parallel hashing with rayon
- common: FFI utilities with panic recovery
- Minimal deps: ~20 total (rayon, blake3, memmap2, walkdir, chrono)
- Drop crossbeam, prometheus - use stdlib + manual metrics
- Makefile: cargo build targets, help text updated
- Forgejo CI: clippy, tests, miri, cargo-deny
- C FFI compatible with existing Go bindings
2026-03-14 17:45:58 -04:00

28 lines
691 B
C

#ifndef DATASET_HASH_H
#define DATASET_HASH_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// Hash a directory and return combined digest
// dir: path to directory
// out_hash: output parameter, receives allocated hex string (caller must free with fh_free_string)
// Returns: 0 on success, -1 on error
int fh_hash_directory_combined(const char* dir, char** out_hash);
// Free a string previously returned by FFI functions
void fh_free_string(char* s);
// Get metrics in Prometheus format
// Returns: allocated string with metrics (caller must free with fh_free_string)
char* fh_get_metrics(void);
#ifdef __cplusplus
}
#endif
#endif // DATASET_HASH_H