calog/libs/calogJson.h
2026-07-03 02:13:23 -05:00

21 lines
927 B
C

// calogJson.h -- calog JSON library.
//
// Bridges JSON text and calog's canonical value/aggregate model, so any engine can parse
// and produce JSON without an engine-specific library:
// jsonParse(text) -> value (object -> map, array -> list, number ->
// int or real, string, true/false, null -> nil)
// jsonStringify(value) -> compact JSON text
// Marshalling is binary-safe; \uXXXX (with surrogate pairs) decodes to UTF-8. Nesting is
// bounded by CALOG_MAX_DEPTH both ways. The natives are INLINE (pure computation, no shared
// state), so there is nothing to shut down.
#ifndef CALOG_JSON_H
#define CALOG_JSON_H
#include "calog.h"
// Register the JSON natives (jsonParse, jsonStringify) on a runtime. Stateless: safe to call
// on any number of runtimes, and there is no matching shutdown.
int32_t calogJsonRegister(CalogT *calog);
#endif