No matching definitions.

json/parse

src/json/parse.tur
defn

json-parse

(json-parse [json :cstr] :ptr<void>)

parse a JSON string into an opaque document handle.

jsonNUL-terminated JSON string

result<:int> -- ok(doc-handle) on success, err(:cstr message) on failure. The doc handle must be freed with json-free when no longer needed.

(let [r (json-parse "{\"x\":1}")]
    (if (ok? r) (json-emit (ok-val r)) "parse error"))

Since: P4

defn

json-free

(json-free [doc :int] :void)

free a document handle returned by json-parse.

doc:int doc handle (unwrapped ok-val from json-parse result)
(json-free (ok-val r))

Since: P4

Internal definitions
__ok
__err