From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [tarantool-patches] Re: [PATCH v5 05/12] lib: implement JSON tree class for json library References: <20181120164316.vtekyag77waocgco@esperanza> From: Kirill Shcherbatov Message-ID: <1f43ac24-3fc5-bb30-acd4-64889b6c63fb@tarantool.org> Date: Wed, 21 Nov 2018 13:37:39 +0300 MIME-Version: 1.0 In-Reply-To: <20181120164316.vtekyag77waocgco@esperanza> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit To: tarantool-patches@freelists.org, Vladimir Davydov Cc: Kostya Osipov List-ID: > First, I agree with Kostja that naming looks confusing. Please try to > come up with better names and send them to us for review before > reworking the patch so that we could agree first. I like the following names: /*********************************************/ /*****/ JSON Parser class: /*****/ /*********************************************/ json_path_token, json_path_parser, json_path_parser_create().. /*********************************************/ /*****/ MHash for JSON Tree class: /*****/ /*********************************************/ mh_json_tree_t mh_json_tree_cmp(), mh_json_tree_find(), mh_json_tree_node()..... /*********************************************/ /*****/ JSON Tree class: /*****/ /*********************************************/ json_path_node_hash json_tree, json_tree_node, json_tree_create(...), json_tree_node_create(...), struct json_tree_node * json_tree_lookup(struct json_tree *tree, struct json_tree_node *parent, const char *path, uint32_t path_len) --- we need parent entry as our paths are relative, i.e. tuple[fieldno][{jsonpath}] struct json_tree_entry * json_tree_token_lookup(struct json_tree *tree, struct json_tree_node *parent, json_path_token *token) type * json_tree_lookup_entry(tree, parent, path, path_len, type, member) type * json_tree_token_lookup_entry(tree, parent, token, type, member) json_tree_foreach_entry_preorder(node, &tree.root, struct test_struct, tree_node) { }