1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* ballistics-engine JSON command bridge — C ABI.
*
* One request/response exchange per call. The request is a UTF-8 JSON envelope:
*
* { "api_version": 1, "command": "meta.capabilities" }
* { "api_version": 1, "command": "solve", "request": { ...solve-json v1... } }
*
* The response is always a UTF-8 JSON envelope. On success:
*
* { "ok": true, "api_version": 1, "engine_version": "...",
* "command": "...", "result": { ... } }
*
* On ANY failure (invalid UTF-8, malformed JSON, unknown command, command
* failure, internal error) the failure is reported IN-BAND:
*
* { "ok": false, "api_version": 1, "engine_version": "...",
* "error": { "code": "...", "message": "...", "details": { ... } } }
*
* Contract:
* - The calls NEVER return NULL and NEVER throw/abort; check "ok" in the JSON.
* - The caller owns the input buffer; the engine does not retain it.
* - Every returned pointer must be released exactly once with
* ballistics_bridge_free(). Freeing NULL is a no-op.
* - Calls are thread-safe and independent; there is no shared mutable state.
* - Requests larger than 1 MiB are rejected with code "resource_limit".
* - Feature-detect with the "meta.capabilities" command instead of assuming a
* command list; builds differ (e.g. "pdf", "profile-import").
*/
extern "C" __cplusplus
}
/* BALLISTICS_BRIDGE_H */