From 50137406e0815bb936577df4f827e6538eeca7ba Mon Sep 17 00:00:00 2001 From: rexy712 Date: Thu, 26 Mar 2020 09:14:42 -0700 Subject: [PATCH] Fix incorrect comments in rjp.h --- include/rjp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/rjp.h b/include/rjp.h index e5e4e88..1c1b8c8 100644 --- a/include/rjp.h +++ b/include/rjp.h @@ -135,6 +135,7 @@ RJP_string rjp_escape(const char* src); RJP_value* rjp_parse(const char* str, int flags); //Read json data in using a user supplied callback and convert it to RJP's format RJP_value* rjp_parse_cback(int flags, RJP_parse_callback* cbacks); +//Convert RJP's representation to rjp_alloc'd JSON string char* rjp_to_json(const RJP_value* root, int pretty); //Initialize a root RJP_value to copy of value @@ -154,6 +155,7 @@ void rjp_free_value(RJP_value* root); //Deep copy RJP_value //When dest is not null, cleanup and then fill the object pointed to by dest. Otherwise allocate a new value. RJP_value* rjp_copy_value(RJP_value* dest, const RJP_value* src); +//Steal resources from src and use them to populate dest RJP_value* rjp_move_value(RJP_value* dest, RJP_value* src); //set existing value @@ -181,10 +183,10 @@ RJP_value* rjp_value_parent(const RJP_value* element); RJP_data_type rjp_value_type(const RJP_value* value); /***************** OBJECT OPERATIONS *******************/ -//add a member to a json object, allocating a copy of the key +//create a member in an object RJP_value* rjp_new_member(RJP_value* dest, const char* key, RJP_index keylen); -//add a member to a json object without allocation. key must be allocated using rjp_alloc/rjp_calloc RJP_value* rjp_new_member_steal_key(RJP_value* dest, char* key, RJP_index keylen); +//copy a value into a new member in an object RJP_value* rjp_add_member(RJP_value* dest, const char* key, RJP_index keylen, RJP_value* src); RJP_value* rjp_add_member_steal_key(RJP_value* dest, char* key, RJP_index keylen, RJP_value* src); @@ -211,7 +213,6 @@ RJP_value* rjp_object_to_ordered(RJP_value* object); RJP_value* rjp_object_to_unordered(RJP_value* object); /***************** OBJECT ITERATOR OPERATIONS *******************/ -//Access first member of a json object void rjp_init_object_iterator(RJP_object_iterator* iter, const RJP_value* object); void rjp_delete_object_iterator(RJP_object_iterator* it); RJP_value* rjp_object_iterator_current(const RJP_object_iterator* it); @@ -219,7 +220,6 @@ RJP_value* rjp_object_iterator_next(RJP_object_iterator* it); RJP_value* rjp_object_iterator_peek(const RJP_object_iterator* it); /***************** ARRAY OPERATIONS *******************/ -//add an element to a json array RJP_value* rjp_new_element(RJP_value* dest); RJP_value* rjp_add_element(RJP_value* dest, RJP_value* src); RJP_value* rjp_remove_element(RJP_value* arr, RJP_value* elem);