AKADATA LIMITED
AKAMAN source: json.h
AKAMAN json.h — JSON parsing and protocol data handling.

AKAMAN
A small Linux C utility that retrieves the compact documentation fragment an AI agent needs from the host where it is running.
json.h
JSON parsing and protocol data handling. This is the released v0.1.0 source, shown in full so you can read it before downloading the archive.
#ifndef AKAMAN_JSON_H#define AKAMAN_JSON_H#include "core.h"typedef struct jv jv;struct jv { int t; /* 0 null, 1 bool, 2 num, 3 str, 4 arr, 5 obj */ int b; double num; char *str; jv **items; int ni, cap; struct { char *k; jv *v; } *kv; int nk, kcap; const char *raw; size_t rawlen;};jv *json_parse(const char *s, size_t len);jv *jv_get(jv *obj, const char *key);const char *jv_str(jv *v);void jv_free(jv *v);void json_escape(gbuf *b, const char *s, size_t len);#endif#ifndef AKAMAN_JSON_H
#define AKAMAN_JSON_H
#include "core.h"
typedef struct jv jv;
struct jv {
int t; /* 0 null, 1 bool, 2 num, 3 str, 4 arr, 5 obj */
int b;
double num;
char *str;
jv **items;
int ni, cap;
struct {
char *k;
jv *v;
} *kv;
int nk, kcap;
const char *raw;
size_t rawlen;
};
jv *json_parse(const char *s, size_t len);
jv *jv_get(jv *obj, const char *key);
const char *jv_str(jv *v);
void jv_free(jv *v);
void json_escape(gbuf *b, const char *s, size_t len);
#endif