From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B3AC044643A for ; Thu, 24 Sep 2020 20:01:00 +0300 (MSK) From: Timur Safin Date: Thu, 24 Sep 2020 20:00:15 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2.X 2/7] module api: export box_key_def_dup List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Exporting `box_key_def_dup` as accessor to the internal `key_def_dup` Part of #5273 --- src/box/key_def_api.c | 6 ++++++ src/box/key_def_api.h | 10 ++++++++++ src/exports.h | 1 + 3 files changed, 17 insertions(+) diff --git a/src/box/key_def_api.c b/src/box/key_def_api.c index 2555b9fdd..98602ff24 100644 --- a/src/box/key_def_api.c +++ b/src/box/key_def_api.c @@ -199,6 +199,12 @@ box_key_def_new_ex(box_key_part_def_t *parts, uint32_t part_count) return key_def; } +box_key_def_t * +box_key_def_dup(const box_key_def_t *key_def) +{ + return key_def_dup(key_def); +} + void box_key_def_delete(box_key_def_t *key_def) { diff --git a/src/box/key_def_api.h b/src/box/key_def_api.h index 8dd6eb10b..a419b712c 100644 --- a/src/box/key_def_api.h +++ b/src/box/key_def_api.h @@ -173,6 +173,16 @@ box_key_part_def_create(box_key_part_def_t *part); API_EXPORT box_key_def_t * box_key_def_new_ex(box_key_part_def_t *parts, uint32_t part_count); +/** + * Duplicate key_def. + * \param key_def Original key_def. + * + * \retval not NULL Duplicate of src. + * \retval NULL Memory error. + */ +box_key_def_t * +box_key_def_dup(const box_key_def_t *key_def); + /** * Delete key definition * diff --git a/src/exports.h b/src/exports.h index 592b388bb..202f5bf19 100644 --- a/src/exports.h +++ b/src/exports.h @@ -31,6 +31,7 @@ EXPORT(box_iterator_free) EXPORT(box_iterator_next) EXPORT(box_key_def_delete) EXPORT(box_key_def_dump_parts) +EXPORT(box_key_def_dup) EXPORT(box_key_def_merge) EXPORT(box_key_def_new) EXPORT(box_key_def_new_ex) -- 2.20.1