#if !defined(__KVMGR_H__) #define __KVMGR_H__ 1 #include "htab.h" #include "mylock.h" #include "xce/types.h" #include "xlist.h" #include "zarray.h" #include "persist.h" typedef enum { KVMGR_KEY_INT = 0, KVMGR_KEY_STRING } kvmgr_key_type_t; typedef struct { kvmgr_key_type_t key_type; uint32_t nslots; uint32_t delta; destroy_fn_t datakiller; } kvmgr_params_t; extern typeinfo_t xkvmgr_type; /* * kvmgr_capture_keys — capture key→index mappings for checkpoint * serialization (Part 3.8). * * Caller MUST hold the kvmgr write lock for the full duration of * this call. The function allocates *keys_out and populates it with * *n_keys_out entries. Each entry's key[] field is an owned deep * copy that remains valid after the write lock is released. * * Caller must free(*keys_out) when done. * * Returns 0 on success. * Returns -ENOMEM if allocation fails. */ int kvmgr_capture_keys(var kvmgr, slot_key_t** keys_out, size_t* n_keys_out); #endif