Lines Matching refs:YlongJson
29 /// Empty pointer of YlongJson*
30 const NULL_MUT_YLONG_JSON: *mut YlongJson = null_mut::<YlongJson>();
35 pub type YlongJson = c_void;
43 ) -> *mut YlongJson {
58 Box::into_raw(Box::from(value)) as *mut YlongJson
74 pub unsafe extern "C" fn ylong_json_print_unformatted(item: *const YlongJson) -> *mut c_char {
95 pub unsafe extern "C" fn ylong_json_delete(item: *mut YlongJson) {
107 item: *const YlongJson,
109 ) -> *mut YlongJson {
121 return Box::into_raw(Box::from(value_clone)) as *mut YlongJson;
125 Box::into_raw(Box::from(value.clone())) as *mut YlongJson
130 pub unsafe extern "C" fn ylong_json_create_null() -> *mut YlongJson {
131 Box::into_raw(Box::from(JsonValue::Null)) as *mut YlongJson
137 pub unsafe extern "C" fn ylong_json_is_null(item: *mut YlongJson) -> c_int {
149 pub unsafe extern "C" fn ylong_json_create_bool(boolean: c_int) -> *mut YlongJson {
151 Box::into_raw(Box::from(JsonValue::Boolean(boolean != FALSE))) as *mut YlongJson
156 pub unsafe extern "C" fn ylong_json_is_bool(item: *const YlongJson) -> c_int {
170 boolean: *const YlongJson,
191 boolean: *mut YlongJson,
211 pub unsafe extern "C" fn ylong_json_create_double_number(number: c_double) -> *mut YlongJson {
212 Box::into_raw(Box::from(JsonValue::Number(Number::Float(number)))) as *mut YlongJson
218 pub unsafe extern "C" fn ylong_json_create_int_number(number: c_longlong) -> *mut YlongJson {
219 Box::into_raw(Box::from(JsonValue::Number(Number::Signed(number)))) as *mut YlongJson
225 pub unsafe extern "C" fn ylong_json_is_number(item: *const YlongJson) -> c_int {
237 pub unsafe extern "C" fn ylong_json_is_double_number(item: *const YlongJson) -> c_int {
252 pub unsafe extern "C" fn ylong_json_is_int_number(item: *const YlongJson) -> c_int {
268 number: *const YlongJson,
293 number: *const YlongJson,
318 number: *mut YlongJson,
338 number: *mut YlongJson,
354 /// Creates a `YlongJson` string from a given C-style string.
355 /// If the input string is null, it returns a null `YlongJson`.
357 pub unsafe extern "C" fn ylong_json_create_string(string: *const c_char) -> *mut YlongJson {
365 Box::into_raw(Box::from(JsonValue::String(string))) as *mut YlongJson
368 /// Checks if the `YlongJson` item is a string.
371 pub unsafe extern "C" fn ylong_json_is_string(item: *const YlongJson) -> c_int {
384 string: *const YlongJson,
402 /// Sets a `YlongJson` string to a given C-style string.
403 /// If the `YlongJson` string or the input string is null, it returns `FAILURE`.
406 string: *mut YlongJson,
424 /// Creates a `YlongJson` array.
426 pub unsafe extern "C" fn ylong_json_create_array() -> *mut YlongJson {
427 Box::into_raw(Box::from(JsonValue::Array(Array::new()))) as *mut YlongJson
430 /// Checks if the `YlongJson` item is an array.
433 pub unsafe extern "C" fn ylong_json_is_array(item: *const YlongJson) -> c_int {
442 /// Gets the size of a `YlongJson` array.
443 /// If the `YlongJson` array or the size is null, it returns `FAILURE`.
446 array: *const YlongJson,
463 /// Gets a `YlongJson` item from an array by index.
464 /// Returns null `YlongJson` if the array is null, the item doesn't exist, or any error occurs.
467 array: *const YlongJson,
469 ) -> *mut YlongJson {
484 array_ref.get_mut(index as usize).unwrap() as *mut JsonValue as *mut YlongJson
487 /// Adds a `YlongJson` item to an array.
491 array: *mut YlongJson,
492 item: *mut YlongJson,
510 /// Replaces a `YlongJson` item in an array by index with a new item.
514 array: *mut YlongJson,
516 new_item: *mut YlongJson,
538 /// Removes a `YlongJson` item from an array by index.
539 /// Returns null `YlongJson` if the array is null, the item doesn't exist, or any error occurs.
542 array: *mut YlongJson,
544 ) -> *mut YlongJson {
557 return Box::into_raw(Box::new(v)) as *mut YlongJson;
562 /// Deletes a `YlongJson` item from an array by index.
565 array: *mut YlongJson,
584 array: *mut YlongJson,
586 ) -> *mut YlongJson {
602 node as *mut Node<JsonValue> as *mut YlongJson
605 /// Retrieves a `YlongJson` item from an array node.
609 array_node: *mut YlongJson,
610 ) -> *mut YlongJson {
615 node.get_element_mut() as *mut JsonValue as *mut YlongJson
618 /// Adds a `YlongJson` item to an array, then returns the node.
619 /// Returns null `YlongJson` if the array or the item is null.
623 array: *mut YlongJson,
624 item: *mut YlongJson,
625 ) -> *mut YlongJson {
639 array_ref.last_node_mut().unwrap() as *mut Node<JsonValue> as *mut YlongJson
647 array_node: *mut YlongJson,
648 new_item: *mut YlongJson,
666 array_node: *mut YlongJson,
667 ) -> *mut YlongJson {
673 Box::into_raw(Box::new(node.remove_self().unwrap())) as *mut YlongJson
679 pub unsafe extern "C" fn ylong_json_delete_array_node(array_node: *mut YlongJson) {
688 /// Creates a `YlongJson` object.
690 pub unsafe extern "C" fn ylong_json_create_object() -> *mut YlongJson {
691 Box::into_raw(Box::from(JsonValue::Object(Object::new()))) as *mut YlongJson
694 /// Checks if the `YlongJson` item is an object.
697 pub unsafe extern "C" fn ylong_json_is_object(item: *const YlongJson) -> c_int {
706 /// Gets the size of a `YlongJson` object.
707 /// If the `YlongJson` object or the size is null, it returns `FAILURE`.
710 object: *mut YlongJson,
731 object: *mut YlongJson,
758 object: *const YlongJson,
760 ) -> *mut YlongJson {
785 target as *mut JsonValue as *mut YlongJson
792 object: *mut YlongJson,
794 item: *mut YlongJson,
825 object: *mut YlongJson,
827 new_item: *mut YlongJson,
861 object: *mut YlongJson,
863 ) -> *mut YlongJson {
878 return Box::into_raw(Box::new(v)) as *mut YlongJson;
887 object: *mut YlongJson,
910 object: *mut YlongJson,
912 value: *mut *mut YlongJson,
928 let v = v as *mut JsonValue as *mut YlongJson;
940 object: *mut YlongJson,
941 func: unsafe extern "C" fn(*mut YlongJson),
954 let value = v as *mut JsonValue as *mut YlongJson;
965 object: *const YlongJson,
967 ) -> *mut YlongJson {
993 target as *mut Node<(String, JsonValue)> as *mut YlongJson
1001 object_node: *mut YlongJson,
1002 ) -> *mut YlongJson {
1008 (&mut node.get_element_mut().1) as *mut JsonValue as *mut YlongJson
1016 object: *mut YlongJson,
1018 item: *mut YlongJson,
1019 ) -> *mut YlongJson {
1042 target as *mut Node<(String, JsonValue)> as *mut YlongJson
1050 object_node: *mut YlongJson,
1051 new_item: *mut YlongJson,
1070 object_node: *mut YlongJson,
1071 ) -> *mut YlongJson {
1077 Box::into_raw(Box::new(node.remove_self().unwrap().1)) as *mut YlongJson
1083 pub unsafe extern "C" fn ylong_json_delete_object_node(object_node: *mut YlongJson) {
1126 /// 1. Calls `ylong_json_parse` to generate a JsonValue as YlongJson*.
1168 /// 1. Calls `ylong_json_free_string` to free a YlongJson*(`C` string).
1241 // The YlongJson* generated by `ylong_json_parse` needs
1251 // If the YlongJson* generated by the function starting with
1252 // `ylong_json_create` is not inserted into another YlongJson*,
1253 // YlongJson* needs to be destructed by calling `ylong_json_delete`.
3012 malloc(size_of::<*mut YlongJson>() * (len as usize)) as *mut *mut YlongJson;
3025 malloc(size_of::<*mut YlongJson>() * (len as usize)) as *mut *mut YlongJson;
3050 malloc(size_of::<*mut YlongJson>() * (len as usize)) as *mut *mut YlongJson;
3073 malloc(size_of::<*mut YlongJson>() * (len as usize)) as *mut *mut YlongJson;
3102 malloc(size_of::<*mut YlongJson>() * (len as usize)) as *mut *mut YlongJson;
3124 unsafe extern "C" fn func(target: *mut YlongJson) {