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

void clear_cache(void);

/**
 * Returns null on success, or an owned error C-string on failure.
 * The caller must free a non-null return value with free_string().
 */
const char *add_to_cache(const char *function_name, const char *path1, const char *path2);

/**
 * Returns a JSON result string on success or {"error":"..."} on failure.
 * The caller must free the returned pointer with free_string().
 */
const char *groth16_prove_v2(const char *graph_path, const char *zkey_path, const char *inputs);

/**
 * Accepts base64-encoded binary data for graph and zkey (no filesystem access).
 * Returns a JSON result string on success or {"error":"..."} on failure.
 * The caller must free the returned pointer with free_string().
 */
const char *groth16_prove_v2_base64(const char *graph_b64,
                                    const char *zkey_b64,
                                    const char *inputs);

void free_string(char *s);
