From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 CA584469719 for ; Fri, 16 Oct 2020 01:03:10 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <2af960e6-6b81-f0b0-1edf-39ecc6013121@tarantool.org> Date: Fri, 16 Oct 2020 00:03:09 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2.X v4 1/4] module api: export box_tuple_validate List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Timur Safin , alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the patch! > diff --git a/src/box/tuple.h b/src/box/tuple.h > index 53ae690cc..755aee506 100644 > --- a/src/box/tuple.h > +++ b/src/box/tuple.h > @@ -283,6 +283,17 @@ box_tuple_update(box_tuple_t *tuple, const char *expr, const char *expr_end); > box_tuple_t * > box_tuple_upsert(box_tuple_t *tuple, const char *expr, const char *expr_end); > > +/** > + * Check tuple data correspondence to the space format. > + * @param tuple Tuple to validate. > + * @param format Format to which the tuple must match. > + * > + * @retval 0 The tuple is valid. > + * @retval -1 The tuple is invalid. The public functions should say in their comments if they set a diag in case of an error. Here and in the other patches. I didn't say it earlier, because didn't think of it. Realized it today. > + */ > +int > +box_tuple_validate(box_tuple_t *tuple, box_tuple_format_t *format);