This package contains an API in ATS for the jansson library.
castfn JSONptr2ptr {l:addr} (x: !JSONptr(l)):<> ptr (l)
praxi
JSONptr_is_gtez {l:addr} (x: !JSONptr(l)): [l >= null] void
praxi
JSONptr_free_null
{l:addr | l <= null} (x: JSONptr(l)): void
fun JSONptr_is_null
{l:addr} (x: !JSONptr l):<> bool (l==null) = "mac#atspre_ptr_is_null"
fun JSONptr_isnot_null
{l:addr} (x: !JSONptr (l)):<> bool (l > null) = "mac#atspre_ptr_isnot_null"
castfn JSONiter2ptr {l1,l2:addr} (x: !JSONiter (l1, l2)):<> ptr (l2)
praxi
JSONiter_is_gtez
{l1,l2:addr}
(x: !JSONiter (l1, l2)): [l2 >= null] void
praxi
JSONiter_free_null
{l1,l2:addr | l2 <= null} (x: JSONiter (l1, l2)): void
praxi
JSONiter_return
{l1,l2:addr}
(json: !JSONptr l1, iter: JSONiter (l1, l2)): void
fun JSONiter_is_null
{l1,l2:addr}
(x: !JSONiter (l1, l2)):<> bool (l2==null) = "mac#atspre_ptr_is_null"
fun JSONiter_isnot_null
{l1,l2:addr}
(x: !JSONiter (l1, l2)):<> bool (l2 > null) = "mac#atspre_ptr_isnot_null"
fun json_typeof (json: !JSONptr1): int = "mac#%"
fun json_is_null
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_true
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_false
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_boolean
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_integer
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_real
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_number
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_string
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_array
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun json_is_object
{l:addr} (json: !JSONptr (l)) : bool = "mac#%"
fun
json_incref{l:agz}
(json: !JSONptr(l)) : JSONptr(l) = "mac#%"
fun
json_decref (json: JSONptr0): void = "mac#%"
fun json_null () : JSONptr1 = "mac#%"
fun json_true () : JSONptr1 = "mac#%"
fun json_false () : JSONptr1 = "mac#%"
castfn int2json_int (x: int): json_int
castfn lint2json_int (x: lint): json_int
castfn llint2json_int (x: llint): json_int
fun json_integer
(value: json_int) : JSONptr0 = "mac#%"
fun json_integer_value
(json: !JSONptr1): json_int = "mac#%"
fun json_integer_set
(json: !JSONptr1, value: json_int): int(*err*) = "mac#%"
fun json_string
(value: NSH(string)) : JSONptr0 = "mac#%"
fun json_string_nocheck
(value: NSH(string)) : JSONptr0 = "mac#%"
fun json_string_value
{l1:agz} (
json: !JSONptr (l1)
) : [l2:agz]
(minus (JSONptr l1, strptr l2) | strptr l2) = "mac#%"
fun json_string_set
(json: !JSONptr1, value: NSH(string)): int = "mac#"
fun json_string_set_nocheck
(json: !JSONptr1, value: NSH(string)): int = "mac#%"
fun json_array ((*void*)) : JSONptr0 = "mac#%"
fun json_array_size (json: !JSONptr1) : size_t = "mac#%"
fun json_array_get
{l1:agz} (
json: !JSONptr (l1), index: size_t
) : [l2:addr]
(minus (JSONptr l1, JSONptr l2) | JSONptr l2) = "mac#%"
fun json_array_get_exnmsg
{l1:agz} (
json: !JSONptr (l1), index: size_t, msg: NSH(string)
) : [l2:agz]
(minus (JSONptr l1, JSONptr l2) | JSONptr l2) = "mac#%"
macdef
json_array_get_exnloc (x, i) =
json_array_get_exnmsg (,(x), ,(i), $mylocation)
fun json_array_get1
(json: !JSONptr1, index: size_t): JSONptr0 = "mac#%"
fun json_array_get1_exnmsg
(json: !JSONptr1, index: size_t, msg: NSH(string)): JSONptr1 = "mac#%"
macdef
json_array_get1_exnloc (x, i) =
json_array_get1_exnmsg (,(x), ,(i), $mylocation)
fun json_array_set
(
json: !JSONptr1, index: size_t, value: !JSONptr0(*preserved*)
) : int(*err*) = "mac#%"
fun json_array_set_new
(
json: !JSONptr1, index: size_t, value: (JSONptr0)/*consumed*/
) : int(*err*) = "mac#%"
fun json_array_append
(
json: !JSONptr1, value: !JSONptr0(*preserved*)
) : int(*err*) = "mac#%"
fun json_array_append_new
(
json: !JSONptr1, value: (JSONptr0)/*consumed*/
) : int(*err*) = "mac#%"
fun json_array_insert
(
json: !JSONptr1, index: size_t, value: !JSONptr0(*preserved*)
) : int(*err*) = "mac#%"
fun json_array_insert_new
(
json: !JSONptr1, index: size_t, value: (JSONptr0)/*consumed*/
) : int(*err*) = "mac#%"
fun json_array_remove
(json: !JSONptr1, index: size_t): int(*err*) = "mac#%"
fun json_array_clear (json: !JSONptr1): int(*0*) = "mac#%"
fun json_array_extend
(json1: !JSONptr1, json2: !JSONptr0): int(*err*) = "mac#%"
fun json_object ((*void*)) : JSONptr0 = "mac#%"
fun json_object_size (json: !JSONptr1): size_t = "mac#%"
fun json_object_get
{l1:agz} (
json: !JSONptr l1, key: NSH(string)
) : [l2:addr]
(minus (JSONptr l1, JSONptr l2) | JSONptr l2) = "mac#%"
fun json_object_get_exnmsg {l1:agz} ( json: !JSONptr l1, key: NSH(string), msg: NSH(string) ) : [l2:agz] ( minus (JSONptr l1, JSONptr l2) | JSONptr l2 ) = "mac#%" // end of [json_object_get_exnmsg]
macdef
json_object_get_exnloc (x, k) =
json_object_get_exnmsg (,(x), ,(k), $mylocation)
fun json_object_get1
(json: !JSONptr1, key: NSH(string)): JSONptr0 = "mac#%"
fun json_object_get1_exnmsg
(json: !JSONptr1, key: NSH(string), msg: NSH(string)): JSONptr1 = "mac#%"
macdef
json_object_get1_exnloc (x, k) =
json_object_get1_exnmsg (,(x), ,(k), $mylocation)
fun json_object_set ( json: !JSONptr1, key: NSH(string), value: !JSONptr0 (*preserved*) ) : int(*err*) = "mac#%" // endfun
fun json_object_set_nocheck
(
json: !JSONptr1, key: NSH(string), value: !JSONptr0 (*preserved*)
) : int(*err*) = "mac#%"
fun json_object_set_new
(
json: !JSONptr1, key: NSH(string), value: (JSONptr0)/*consumed*/
) : int(*err*) = "mac#%"
fun json_object_set_new_nocheck
(
json: !JSONptr1, key: NSH(string), value: (JSONptr0)/*consumed*/
) : int(*err*) = "mac#%"
fun json_object_del
(
json: !JSONptr1, key: NSH(string)
) : int(*err*) = "mac#%"
fun json_object_clear (json: !JSONptr1): int(*err*) = "mac#%"
fun json_object_update
(json1: !JSONptr1, json2: !JSONptr0) : int(*err*) = "mac#%"
fun json_object_update_existing
(json1: !JSONptr1, json2: !JSONptr0) : int(*err*) = "mac#%"
fun json_object_update_missing
(json1: !JSONptr1, json2: !JSONptr0) : int(*err*) = "mac#%"
fun
json_object_iter
{l:agz} (json: !JSONptr (l)) : JSONiter0 (l) = "mac#%"
fun
json_object_iter_at{l:agz}
(json: !JSONptr (l), key: NSH(string)): JSONiter0 (l) = "mac#%"
fun
json_object_iter_next{l1,l2:agz}
(json: !JSONptr l1, iter: !JSONiter (l1, l2)): JSONiter0 (l1) = "mac#%"
fun
json_object_iter_nextret{l1,l2:agz}
(json: !JSONptr l1, iter: (JSONiter (l1, l2))): JSONiter0 (l1) = "mac#%"
fun json_object_iter_key
{l1,l2:agz} (iter: !JSONiter (l1, l2)): objkey l1 = "mac#%"
fun json_object_iter_value
{l1,l2:agz} (iter: !JSONiter (l1, l2)): JSONptr1 = "mac#%"
fun json_object_iter_set {l1,l2,l3:agz} ( json: !JSONptr l1 , iter: !JSONiter (l1, l2) , value: !JSONptr l3(*preserved*) ) : int(*err*) = "mac#%" // endfun
fun json_object_iter_set_new {l1,l2,l3:agz} ( json: !JSONptr l1 , iter: !JSONiter (l1, l2) , value: JSONptr l3 /*consumed*/ ) : int(*err*) = "mac#%" // endfun
fun json_object_key_to_iter
{l:addr} (key: objkey (l)): JSONiter1 (l) = "mac#%"
fun json_loads ( inp: NSH(string) , flags: int , error: &json_err? >> _ ) : JSONptr0 = "mac#%" // endfun
// staload "jansson/SATS/jansson.sats" // implement main () = let // var err: json_err? // val root = json_loads ("{\"int\":0}", 0(*flag*), err) val () = assertloc (JSONptr_isnot_null (root)) // val _(*err*) = json_dumpf (rt, stdout_ref, 0) // end of [val] val () = fprint_newline (stdout_ref) // val () = json_decref (root) in // nothing end // end of [main]
fun json_loadb {lb:addr} {n1,n2:int | n1 >= n2} ( pf: !bytes(n1) @ lb | bufp: ptr lb, n2: size_t n2 , flags: int , error: &json_err? >> _ ) : JSONptr0 = "mac#%" // endfun
fun json_loadf ( inp: FILEref , flags: int , error: &json_err? >> _ ) : JSONptr0 = "mac#%" // endfun
fun json_load_file ( path: NSH(string) , flags: int , error: &json_err? >> _ ) : JSONptr0 = "mac#%" // endfun
fun json_dumps
(root: !JSONptr1, flags: int): Strptr0 = "mac#%"
fun json_dumpf
(root: !JSONptr1, out: FILEref, flags: int): int(*err*) = "mac#%"
fun json_dump_file
(root: !JSONptr1, path: NSH(string), flags: int): int(*err*) = "mac#%"
overload iseqz with JSONptr_is_null
overload isneqz with JSONptr_isnot_null
This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. |
|