From patchwork Tue Aug 6 06:16:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 95348 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FCB7385B505 for ; Tue, 6 Aug 2024 06:18:47 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A9162385DDDF for ; Tue, 6 Aug 2024 06:16:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A9162385DDDF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A9162385DDDF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722924992; cv=none; b=rSWp7rskVqzQSoFRsTkVvKku/uMHEf5/krRHTzjkfwog7gZ4f/jfwRYr6Ul6Lwf956S2vqs5aVGswDLBzJ5Nj7b/FL4dGfmulan9iSVnzYeaZ6k7sfINIBxIglipZT13LdO9RhXU/PF6+NE9RKXO6YXWg7WL4F0BgHBhRyq92Do= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722924992; c=relaxed/simple; bh=bAWqMZE1zaSz8VinSsFnP4l3GCAP4f5FNyk+07JO7Es=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=svmW5wyP8XDHn0GmKtCrTWrIVaAdPcglfLGJ3XBUvbZhFpqw7YNsoVfDaipUQ8h/bXynzjrQfWt6Z1QcWcSJBOKpAlnzyvhM5NJ9Ux8PaLyvEgLsyPvm5gf47l34Y396+mw8Iz49G/UQvp3gAYpOUTwKYIBtqJkukfQrJ/nPq20= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722924987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3ewcAO7IQJhHgdMSqy2nSu1HMrEkJ3jsKyYzzrCtvY4=; b=Y/Srh3s1Ctoo372A+GON+H5oUOTo6cicq0wYkQfqG9ef44NX+XWMm+DCVoDhEuKlpAxzDJ anZLykL6w5sHMvOYfc5OMC3uGMlZkq9PC/Dt/IzxzuXO9T/Esm3FOVzJp+tMUbcTPwLjmL 6235b7EdYyjCWjCjAzP98oumbVFNYpU= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-110-Y5HxT2j2PfWz7eG0t2jNQw-1; Tue, 06 Aug 2024 02:16:25 -0400 X-MC-Unique: Y5HxT2j2PfWz7eG0t2jNQw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 160891955D48 for ; Tue, 6 Aug 2024 06:16:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.40]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1FAC11955F40 for ; Tue, 6 Aug 2024 06:16:23 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v2 3/7] manual: __is_last is no longer part of iconv internals In-Reply-To: Message-ID: <0e6f0284e9a58bb2497d8dc73080960029cc5e8a.1722924862.git.fweimer@redhat.com> References: X-From-Line: 0e6f0284e9a58bb2497d8dc73080960029cc5e8a Mon Sep 17 00:00:00 2001 Date: Tue, 06 Aug 2024 08:16:20 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The __is_last field was replaced with a bitmask in commit 85830c4c4688b30d3d76111aa9a26745c7b141d6 in 2000, and multiple bits are in use today. Reviewed-by: DJ Delorie --- manual/charset.texi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manual/charset.texi b/manual/charset.texi index 427db3bc80..3aaa62d088 100644 --- a/manual/charset.texi +++ b/manual/charset.texi @@ -2422,11 +2422,11 @@ written into the buffer to signal how much output is available. If this conversion step is not the last one, the element must not be modified. The @code{__outbufend} element must not be modified. -@item int __is_last -This element is nonzero if this conversion step is the last one. This -information is necessary for the recursion. See the description of the -conversion function internals below. This element must never be -modified. +@item int __flags +This field is a set of flags. The @code{__GCONV_IS_LAST} bit is set if +this conversion step is the last one. This information is necessary for +the recursion. See the description of the conversion function internals +below. This element must never be modified. @item int __invocation_counter The conversion function can use this element to see how many calls of @@ -2731,8 +2731,8 @@ Otherwise the function has to emit a byte sequence to bring the state object into the initial state. Once this all happened the other conversion modules in the chain of conversions have to get the same chance. Whether another step follows can be determined from the -@code{__is_last} element of the step data structure to which the first -parameter points. +@code{__GCONV_IS_LAST} flag in the @code{__flags} field of the step +data structure to which the first parameter points. The more interesting mode is when actual text has to be converted. The first step in this case is to convert as much text as possible from the @@ -2866,7 +2866,7 @@ gconv (struct __gconv_step *step, struct __gconv_step_data *data, /* @r{Call the steps down the chain if there are any but only} @r{if we successfully emitted the escape sequence.} */ - if (status == __GCONV_OK && ! data->__is_last) + if (status == __GCONV_OK && ! (data->__flags & __GCONV_IS_LAST)) status = fct (next_step, next_data, NULL, NULL, written, 1); @} @@ -2892,7 +2892,7 @@ gconv (struct __gconv_step *step, struct __gconv_step_data *data, /* @r{If this is the last step, leave the loop. There is} @r{nothing we can do.} */ - if (data->__is_last) + if (data->__flags & __GCONV_IS_LAST) @{ /* @r{Store information about how many bytes are} @r{available.} */