From nobody Mon Feb 9 16:13:07 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1699257529774191.5505100252068; Sun, 5 Nov 2023 23:58:49 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id A25B9192F; Mon, 6 Nov 2023 02:58:48 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 65E951983; Mon, 6 Nov 2023 02:40:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3DB4218B5; Mon, 6 Nov 2023 02:39:12 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B399B18B1 for ; Mon, 6 Nov 2023 02:39:08 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-fh7_8pebMSG1FPSmxbncfw-1; Mon, 06 Nov 2023 02:39:06 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC379185A795; Mon, 6 Nov 2023 07:39:05 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.32.79]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6567D492BE0; Mon, 6 Nov 2023 07:39:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: fh7_8pebMSG1FPSmxbncfw-1 From: Laine Stump To: devel@lists.libvirt.org, libvir-list@redhat.com Subject: [libvirt PATCH v2 13/15] util: new function virStringSkipToSpace() Date: Mon, 6 Nov 2023 02:38:58 -0500 Message-ID: <20231106073901.735582-14-laine@redhat.com> In-Reply-To: <20231106073901.735582-1-laine@redhat.com> References: <20231106073901.735582-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: JEHF46F7KZ6IK3ZPJJTHNZEL6TT7VE6O X-Message-ID-Hash: JEHF46F7KZ6IK3ZPJJTHNZEL6TT7VE6O X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Joao Martins , Jason Gunthorpe , Cedric Le Goater X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1699257531309100001 Add a surprisingly missing simple function to the arsenal. Signed-off-by: Laine Stump Reviewed-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virstring.c | 17 +++++++++++++++++ src/util/virstring.h | 1 + 3 files changed, 19 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a943a79e01..3e8eded81e 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3409,6 +3409,7 @@ virSkipSpaces; virSkipSpacesAndBackslash; virSkipSpacesBackwards; virSkipToDigit; +virSkipToSpace; virStrcpy; virStringBufferIsPrintable; virStringFilterChars; diff --git a/src/util/virstring.c b/src/util/virstring.c index 6b728ff047..4a732de5dc 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -441,6 +441,23 @@ virSkipToDigit(const char **str) } =20 =20 +/** + * virSkipToSApace: + * @str: pointer to the char pointer used + * + * Skip over any character that is not whitespace + */ +void +virSkipToSpace(const char **str) +{ + const char *cur =3D *str; + + while (*cur && !g_ascii_isspace(*cur)) + cur++; + *str =3D cur; +} + + /** * virTrimSpaces: * @str: string to modify to remove all trailing spaces diff --git a/src/util/virstring.h b/src/util/virstring.h index 16dcce98f4..9fd8be44cf 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -74,6 +74,7 @@ int virDoubleToStr(char **strp, double number) void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1); void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1); void virSkipToDigit(const char **str) ATTRIBUTE_NONNULL(1); +void virSkipToSpace(const char **str) ATTRIBUTE_NONNULL(1); void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1); void virSkipSpacesBackwards(const char *str, char **endp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); --=20 2.41.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org