Message ID | 20210811114847.430004-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBJXSZ2EAMGQEBHER3IQ@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::339; helo=mail-wm1-x339.google.com; envelope-from=swupdate+bncbcxploxj6ikrbjxsz2eamgqebher3iq@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=k7Xu4Xuh; dkim-atps=neutral Received: from mail-wm1-x339.google.com (mail-wm1-x339.google.com [IPv6:2a00:1450:4864:20::339]) (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 ozlabs.org (Postfix) with ESMTPS id 4Gl7Q36YHsz9sXN for <incoming@patchwork.ozlabs.org>; Wed, 11 Aug 2021 21:48:59 +1000 (AEST) Received: by mail-wm1-x339.google.com with SMTP id w25-20020a1cf6190000b0290252505ddd56sf786865wmc.3 for <incoming@patchwork.ozlabs.org>; Wed, 11 Aug 2021 04:48:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628682535; cv=pass; d=google.com; s=arc-20160816; b=qqW0rTx6phGuQzx2U64zizo5OyZgIe3OhSORYinxgVX5GkKjznO5KG9ZohGm0/oC9L evNHC0ee/Rj5UOPhJOKxEsc9CTAEYKdl2szbp4BRfNWbekM+sUKKjoxnHNEr2jgQu5Fc um649cq1sreyROJBk1/sQlGayfjfh02pUWk+ZDR0RFKNPZ0p0iq96V0suTV0UcTKLw+G Qn+auQXCe1GnUksku3gExVuiTDuF5Y18lOC3DalPTMFbsdmqIf7X0Yu/Wj5iWpaCIYSc SlYTdIz9ZVsGbqbNjbzJP8UwVC9sHw/ymY4IoRvEarCY33/4tSYeNq03GTQkK1GhjFXJ IpbQ== 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:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=EE2JaMhBeeQmWrFzjnc8+Uepyxy+sED+bkeo9lF3lAs=; b=aJQDtFFqJBjpw39eH2WAHL3cLWk7CEIDYn/m3xonDKlL/1hb5m5eTaleXzx3xvujcv gwOxb0LGx1nQUHQc8OYZkg7ONADq3g7kM9UprpvJMlJhE6RbWKSlaym4/Livtjyt5uqu aaf/yTDyMOxtZTSkXPu03EWyxqYcLIfxoWCfKYYZGhkdX2AtDG56hS6YdgFwq3s7Z1Qb SQ/162aQ4HbvQG01qY6dd/0u0qS+t8q2tDibjJEykb5ZNT4YJpgRjtOcqts4SXYG+rgA kmXZVel/FW27qVLmzBFiGdQYTJVJMx9na82PDgDVxCL/nZ89KZCisJ9gO7oc/atj6pic QDkg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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=20161025; h=sender:from:to:cc:subject:date:message-id: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=EE2JaMhBeeQmWrFzjnc8+Uepyxy+sED+bkeo9lF3lAs=; b=k7Xu4XuhNRnltJ485RCMabI32Srt1YI42TswIGrY05aT92N+yhx0Ens5Pn8Gm5ul+8 65tobdo77ufpiWyuYlWrmFPE/H0l+vVa/Ti+DaYDJAuO8luLDPF9Q+0TuEtlysr2VsOi j9LnhRko5+01gqV6UDAghWo4VAHDbfFt/rdwTGsBkvS7l/qyhvmv0t7vguV7pFUxu5TT aEmCWJNwUHXTxq2G1l2iAfiNCS+leyrCIyuHlSo3NyQAI2rm9xFKF9V0zKG1lClx+rKC ZlCuc7q8fYxjddBTS1JCnLOXYY9QWbFnDbiuSq84cvpR4AomxVxvVrVX71a55WgQyOd6 /ABw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :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=EE2JaMhBeeQmWrFzjnc8+Uepyxy+sED+bkeo9lF3lAs=; b=jfQ8qzGiZ1tTL651qzOjlAJwruZe91N2CNM7WtXlT7o/GoOncKpsoDgvt6NZcB1Emo eW1vhmAg9kVzzcbe18xZj7r7FOUk6p37vTvWuuaKyIhnU5MutFRlrKyV08sgHIfakIwE 0sjH2OQuYnx/aTckPnWWZppatqjddYUkcV76jjjvWJ+AdFBSBnljI3KMvTgQ3g6Ye64+ ZhxAS1w/v+WRvvkbCZBaJOKHJw6xf9+ZxvN310cXt+KI+iNWbN4vUh2G7X2Le3jfosJk Xxz7pPMl3+bjRHKh7gEUMqNA6RVkfkpNf+SFblzrtNAFWEKo/6KljGg6SsCDQhFDeXW4 bPvg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533I/3V0qXS6mwpLqG0h/moV5HC4GXJ2tgPusYlZeMWXOzvh2YO+ G/PjDsk1jp5rqSlk+T9PP8o= X-Google-Smtp-Source: ABdhPJwWAmb3/nniDeH5XIy89B6ATyDQJPuVWs7vewOMvzbwKOR774a+OASeQyDEb40823U3BkDOBQ== X-Received: by 2002:a5d:56c7:: with SMTP id m7mr37599338wrw.310.1628682534988; Wed, 11 Aug 2021 04:48:54 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a5d:6251:: with SMTP id m17ls391044wrv.1.gmail; Wed, 11 Aug 2021 04:48:54 -0700 (PDT) X-Received: by 2002:adf:f0c2:: with SMTP id x2mr14409189wro.107.1628682534179; Wed, 11 Aug 2021 04:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628682534; cv=none; d=google.com; s=arc-20160816; b=rKboUIGEypV71P4jtJZcu/iJeHFyuBA3eoirvCLd4J/qtY06qt1+Sh6N6hSTv8Zm+y Q5DZ8lgN5lstFKiDfSRgutORQqIxFUgh+WWItnfHHy33DGGVSXlJqDS1iO8qrXuH6Ltt PFGxFBR0NhTZUO6qXSJQdRyCSSGpU7gdvnXbplqbT2GOeQ6WeR+tP+ZstFaR5/80X48a +501/EoKfyYlhcRFnK2AaS6oaXgwAZ86Gx6jvw7d0v3LDyH/WTRrWwnKbXoZb/atYtUQ DS/Q2pMQBzLdpVxvmC1LvEYz8JitNYhrXhXfnIpvXjMW2+s0VDS4PXFL1rGE7rQHTNVt t7TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=ZKoRnHBgwLL8sVO7hjS4BtoJi0mhuvAhKKmi50HBM8U=; b=pyMJoLYOJDKJVP/m12AnefXfsBlx5Cm0+VANf0majMzqnYSmEYE+C/MHC7d5/BogKY Zl2VU0PEeTKD4HK3tfFaprVpL5NtRSXlpIoPI1TiGIRI4XYSkE2WR4+tcfL/IykXSn1H m9tu/zXkB/5zF6HNqRfhx3gjnhNyTdNpLzCvzRIKAnxGJUla6ifJkAFH6Uc2gpc9bmUc r4oGod5+RtICebAEwKsMEFm0xDUq/I/WNY8+Al+nn30iV68y2N2JGQ7Hh7/8UbUZRjI6 LbGUzPq3PzXOB/iYqLmsO0VqKKoIV/6RkUEillWAVxmDN57o3NnbPFmcIUZqMB4+9DjU XT2w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 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. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id u2si1391492wro.0.2021.08.11.04.48.54 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Aug 2021 04:48:54 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.10; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Gl7Px750Bz1rk5y; Wed, 11 Aug 2021 13:48:53 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Gl7Px6lXNz1qqyY; Wed, 11 Aug 2021 13:48:53 +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 GFG7nNnpJs55; Wed, 11 Aug 2021 13:48:52 +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; Wed, 11 Aug 2021 13:48:52 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id E812E45425B9; Wed, 11 Aug 2021 13:48:51 +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 vleOLRgEA5Qb; Wed, 11 Aug 2021 13:48:49 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 1AFB0454086D; Wed, 11 Aug 2021 13:48:49 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH V3 1/3] util: add strtobool() function Date: Wed, 11 Aug 2021 13:48:45 +0200 Message-Id: <20210811114847.430004-1-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[V3,1/3] util: add strtobool() function
|
expand
|
diff --git a/core/util.c b/core/util.c index 8651391..f640c7a 100644 --- a/core/util.c +++ b/core/util.c @@ -715,6 +715,13 @@ unsigned long long ustrtoull(const char *cp, unsigned int base) return result; } +bool strtobool(const char *s) +{ + if (s && (strcmp(s, "true") || strcmp(s, "TRUE"))) + return true; + return false; +} + int swupdate_mount(const char *device, const char *dir, const char *fstype) { #if defined(__linux__) diff --git a/include/util.h b/include/util.h index ad07b18..9f29f5f 100644 --- a/include/util.h +++ b/include/util.h @@ -171,6 +171,7 @@ int IsValidHash(const unsigned char *hash); _a < _b ? _a : _b; }) char *sdup(const char *str); +bool strtobool(const char *s); /* * Function to extract / copy images
Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/util.c | 7 +++++++ include/util.h | 1 + 2 files changed, 8 insertions(+)