![]() |
Fun API Documentation 0.42.1
The programming language that makes you have fun!
|
json-c helpers for Fun VM JSON-related opcodes (conditional build). More...
#include <json-c/json.h>Go to the source code of this file.
Functions | |
| static Value | json_to_fun (json_object *j) |
| Convert a json-c object tree into a Fun Value. | |
| static json_object * | fun_to_json (const Value *v) |
| Convert a Fun Value into a newly allocated json-c object tree. | |
json-c helpers for Fun VM JSON-related opcodes (conditional build).
This module centralizes small utilities that convert between json-c objects and the Fun VM's Value type. Keeping the concrete conversion logic in src/extensions/ allows VM opcode implementations to remain minimal — they focus on VM stack marshalling and delegate the heavy lifting here, mirroring other extensions (PCRE2, SQLite, XML2, INI).
Build-time feature flag:
Type mapping between json-c and Fun:
Ownership and memory:
Encoding and limits:
Thread-safety:
Definition in file json.c.
|
static |
Convert a Fun Value into a newly allocated json-c object tree.
Mapping rules:
Unsupported or opaque Fun types are stringified using the placeholder "<unsupported>" to keep the conversion total.
Ownership:
Notes and limitations:
| v | Pointer to the source Value (must not be NULL). |
|
static |
Convert a json-c object tree into a Fun Value.
Mapping rules:
Error handling and ownership:
Notes:
| j | Pointer to a json_object (may be NULL). |