From patchwork Mon Oct 11 11:21:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1539229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=rNd05CGO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43f; helo=mail-wr1-x43f.google.com; envelope-from=swupdate+bncbcxploxj6ikrbzv4scfqmgqecwwajti@googlegroups.com; receiver=) Received: from mail-wr1-x43f.google.com (mail-wr1-x43f.google.com [IPv6:2a00:1450:4864:20::43f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HSbx70FXzz9sXM for ; Mon, 11 Oct 2021 22:22:18 +1100 (AEDT) Received: by mail-wr1-x43f.google.com with SMTP id p12-20020adfc38c000000b00160d6a7e293sf10532381wrf.18 for ; Mon, 11 Oct 2021 04:22:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633951335; cv=pass; d=google.com; s=arc-20160816; b=GvYSL9bwBUyN147GfuExL2wp63D1lkfC7VkVzLuwEpMrPw4nK1tE0FTP0PpjypZs44 lNiggLQiwI9PZUvGV4a9ToqK2+9h0YmeSE/C+a13dg6FfvwA8AEDZ4l7dTrnsB1vY7rb bm/1qv8G5TVqhxPUPYHAf5epEKkxCJY3Z7WY2vMV6k23XcUJva0CzTtGPkHK+mYDC+bf KyMhnwAIt3cg2esjf+WtIRkbkEpYZbNaJUbncp2YuW506arf3gjNnVmL40l08I4W7hgB TE3P0v6SnhIB/6YrxqWlQiUf3JuT7YVAG6UOB5yInGkX7P/5kAF3t6TqBlpN/2DzHEQR WbWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=haTQfExVygKwz+1G5fRnqVkvJTjthXsctmoiLNbAjp4=; b=acux899ECpI3VHeE3Rw0yX/24E1tT1Wys/mH359t9VkfifmxTsQLtx9ASacpbjYZyL S6S+m3+oFkWTPR+v0ZSY5oEZ2irmXvn3LaBIyNswcE09EIA2Y1i1m8XTWcmIyCVAm28G wYBDcZpSK4c15LnMEdMCHoO4ByeCAO+hFvqcxElT/TUmXyDQXnpIRcofL4ftJw+aP9gX mW8DstIADBwaF7GGlQH0CtBgXyWo7WxZUZkB9PFv2IQq2dAMvtsATZilrYmOSyUTh0Gi sxhRlTS3DrObeE0aoNQh6/ggCSSjF3TzqSzRIDpz8rGhofgClfAFo64wog1vXUV0Ezvm u15A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=haTQfExVygKwz+1G5fRnqVkvJTjthXsctmoiLNbAjp4=; b=rNd05CGOizVvSoAd2MA11COFGwA24VAbXVGc70t5qtqGO95s4xbqNjH1XFAW+Tara5 /epMfL99/IsU0Cus4yweTDGlfPVns7lUfx+K4ybNhXqknkuenJ68bJlgfBge33xKHmYU MezotW5nMjFP8auQn2KyeP7Ox6JZ0fFnbT2iK/f92hwytlFq8ut67hgl96oG6jYTwqLy 865lfStjahhwlNQk4+xyLWmsFa1o25I1Tx9ssadTwskJFwnei+A7HD3mfV7Jyx2OcBzH x2fzo3Kq+69bEOSwb1WtpFqm2iXwCQkL6FpSlpN6sWNcICQxVd1vqzcK3itSUlp6ZjMf fw+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=haTQfExVygKwz+1G5fRnqVkvJTjthXsctmoiLNbAjp4=; b=HNyzLmdFnkYGG/anGO8zDVzn/rk3p3o8O3zpghLnh8TNQTDI5kt8SrB06gxZwbHgHd 5ZDLl5GHYn+B73ApQ1zki8xzyMYcuAdXdJ8vAXP1cV6m6/3dsQM2Kjc0e0RtCRCtAAVi UAluYwxl2hieOWzw96rTMF/oAKdqqG/nGsgrALgyBnZqBBhEqQT79rkCMJULu21EquPs +suRsZVe/aBUCRgOJyjdzuGPBy+5cfTFzSctHGGTr0vXRc/DAFMSNA6zl5BfdWVXPvZF EuVxXv0wm0U1ZXtnLuivT1nxAjc5k6LWIqNh0Ki77YbEXvb5lwfzwh+pqv5jcDyUwRkZ IwnA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM531jx2ravRrP35DbIPMzP926/HcT8otoG0swjVrw2KXihUigKwuE devvoIvuXU3S5b5SZ0SXusE= X-Google-Smtp-Source: ABdhPJxJRAS/pgzUKpW2TRF9nhk8KNx1tawvrcadwGE0zq3/b3kBRzjxyHU5Do4RIadNopKQWeoqpA== X-Received: by 2002:a7b:ce08:: with SMTP id m8mr7459079wmc.93.1633951335047; Mon, 11 Oct 2021 04:22:15 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:c782:: with SMTP id l2ls578883wrg.2.gmail; Mon, 11 Oct 2021 04:22:14 -0700 (PDT) X-Received: by 2002:a5d:47c6:: with SMTP id o6mr24185223wrc.416.1633951334172; Mon, 11 Oct 2021 04:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633951334; cv=none; d=google.com; s=arc-20160816; b=IczKciydCHZK8abZi0NJGPH9HBOFLWLgipFGsdh7qe/10KVYpD/gF5xr6+OT3Finx+ qdR+aXoHLjghFh5I0RZP7sgCm0ypmt8sqnGqnlH9pAJRb4GCRznEQxYozAdHZnwpC/Qy 1J7OwGb9dleLW9UK2XjNoDT0T27HDUSBW7h/VyYM0DpgjBorTVzMA3sdNXuLTnDm5bbg wlBxxQwuMa1Nc37lfFwzyEznk/P3gNeSrmVjcVpG7YFIPqK8z2EXvUl9PwsroUvLQ8tQ WtDI/LXmq3aZbOX+jkKH0I8Xp8Rh7LJKYz62W673VPs9fUfE67wEOfPKAE2WDtJDKk0b NIUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=7awqaT9suMpQM0GS3FKqZY0EdYjohEQBrWVteQQFaF8=; b=J2Uq+zfErhw2byneJOPcL/XvwwJDIUl/AADHdSzgATcpQUptBhE8xN8R3YRbDuL88L WsWyNdiSrGN+LDLYii0XGXIirMZUBCtrT7wH0HTiPzH+RwX9C/zf2KBlzZP+rBpgO+Hj 8JnX2AHrX/FqUWJ9QrlGbG7q+n2hMlTXjnx83RJ/MObJkHOt0dqSQ9+7RyYB/H0zXcPS aacY/zC6aHz2HbSo4y2Fiul4Qhh8yVPg/0EPm1WSEz9AzeoEgwAqj6IZl2WcihmgGiZR 1I+Wn/Yb02BMfJkhzQY9rPRnPJJLSFtYyJkeoOzjO+VreQne9MJPEMtp8COWJAkjqXB/ ac0A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id g2si1545288wmc.4.2021.10.11.04.22.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 04:22:14 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4HSbx172PSz1sByw; Mon, 11 Oct 2021 13:22:13 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4HSbx16q43z1qqkC; Mon, 11 Oct 2021 13:22:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 7egBpai5bMU7; Mon, 11 Oct 2021 13:22:13 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 11 Oct 2021 13:22:13 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id D69EF4540BF1; Mon, 11 Oct 2021 13:22:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q45EIDCX0i3H; Mon, 11 Oct 2021 13:22:10 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 26400454148F; Mon, 11 Oct 2021 13:22:04 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 04/29] util: add function to convert string to lowercase Date: Mon, 11 Oct 2021 13:21:31 +0200 Message-Id: <20211011112156.44192-5-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211011112156.44192-1-sbabic@denx.de> References: <20211011112156.44192-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , No function available in libc, just add to utilities. Signed-off-by: Stefano Babic --- core/util.c | 12 ++++++++++++ include/util.h | 1 + 2 files changed, 13 insertions(+) diff --git a/core/util.c b/core/util.c index 7e96652..2844e1d 100644 --- a/core/util.c +++ b/core/util.c @@ -269,6 +269,18 @@ char *substring(const char *src, int first, int len) { return s; } +/* + * Convert all chars of a string to lower, + * there is no ready to use function + */ + +char *string_tolower(char *s) +{ + char *p = s; + for ( ; *p; ++p) *p = tolower(*p); + return s; +} + int openfileoutput(const char *filename) { int fdout; diff --git a/include/util.h b/include/util.h index 31f67b1..3d328ee 100644 --- a/include/util.h +++ b/include/util.h @@ -190,6 +190,7 @@ char **splitargs(char *args, int *argc); char *mstrcat(const char **nodes, const char *delim); char** string_split(const char* a_str, const char a_delim); char *substring(const char *src, int first, int len); +char *string_tolower(char *s); size_t snescape(char *dst, size_t n, const char *src); void freeargs (char **argv); int get_hw_revision(struct hw_type *hw);