From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iRa6e-0001Na-Sh for mharc-grub-devel@gnu.org; Mon, 04 Nov 2019 06:01:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRa6b-0001L6-Jf for grub-devel@gnu.org; Mon, 04 Nov 2019 06:01:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRa6W-00064F-Hj for grub-devel@gnu.org; Mon, 04 Nov 2019 06:01:05 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:38709) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRa6V-00063Z-ST for grub-devel@gnu.org; Mon, 04 Nov 2019 06:01:00 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5DB945B8; Mon, 4 Nov 2019 06:00:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 04 Nov 2019 06:00:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=fT/HI3GBKYweZXLk+OPBae+7bDB 6sVkY17IZD2sH+XI=; b=YuREMKGBk/DluTKN5bT1eGcak1MR0VZG5UZa82GQvjT J+++qL5UVJpbSlmBuutY/BWo8EHVpyJKzVoDgBm1/Wkviz/am96jeXi6F12babmd dGlJ3cMiWqAmj99EBaFuyhSkUpXJ8Df7tcx/EvF8M+je4E1ZPUrVZ1gE7d+fZOsE X/t/qNFzFfaWAVBCmFmOq+neVQgfZLg5YbO3xU5Pmn7l5dNq9swvjxNxDcDkt+8v TWU7eVfIyoJlTG1IBI06u0iBT8EjZbiOTGAx+KHHqbikG9ba9At8n1SuBMJN3S3n VdPgV6aCbl0uIwEtMxQMWbFMU3hR2dKXrkiyzd+tg4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fT/HI3 GBKYweZXLk+OPBae+7bDB6sVkY17IZD2sH+XI=; b=NgVSlzITox+1+nlfEtOLeR kEikp7zMnwN5raLbzjJve71LfKO9Zmd33wh0wkcSUGeLDSxSCD+L4TcgVxKX5hYX wRkbvKl62qJvktmr1xte6xhVRN8eD6y6L1gmFcB17WDEaO7K0aYkJTf077mQQA1J 5uQmJ0O27B9r9OAqsZ7xqETU4mgG/SgMg8Whti+a9fdjbpu/U4ycQKViGMJjtPef fqCo7VbN4+ORb8xuBoU3POQsY1SBT5MXtrAETRLwzXv1bQN4aO/AEnRQwloTcg2L jPOZMtXXibdNhuE3OJhf42VO25M6lkBaJUmgiqYnrFFI7hqTYn+BP+VP7rfMbUgA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddufedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucfkphepkeelrdduvd drheelrdegheenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from NSJAIL (x590c3b2d.dyn.telefonica.de [89.12.59.45]) by mail.messagingengine.com (Postfix) with ESMTPA id 2630E80064; Mon, 4 Nov 2019 06:00:55 -0500 (EST) Received: from localhost (10.192.0.11 [10.192.0.11]) by NSJAIL (OpenSMTPD) with ESMTPSA id 3e663348 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 4 Nov 2019 11:00:53 +0000 (UTC) Date: Mon, 4 Nov 2019 12:00:53 +0100 From: Patrick Steinhardt To: Max Tottenham Cc: The development of GNU GRUB Subject: Re: [PATCH 2/6] jsmn: Add convenience functions Message-ID: <20191104110053.GA2673@ncase> References: <20191104102620.GA923@akamai.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20191104102620.GA923@akamai.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.19 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 11:01:07 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 04, 2019 at 10:26:21AM +0000, Max Tottenham wrote: > On 11/02, Patrick Steinhardt wrote: > > The newly added jsmn library is a really bare-bones library that > > focusses on simplicity. Because of that, it is lacking some functions > > for convenience to abstract away some of its inner workings and to make > > code easier to read. As such, we're now adding some functions that are > > going to be used by the LUKS2 implementation later on. > >=20 > > Signed-off-by: Patrick Steinhardt > > --- > > include/grub/jsmn.h | 108 ++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 108 insertions(+) > >=20 >=20 > Would it not make sense to keep the additions in a separate header from > the vendored upstream library? That way it'll likely be easier to pull > in any updates. Yeah, I thought about that, too. I wasn't sure about where "jsmn.h" and our own extension should live, though, which is why I just bailed for now and waited on some feedback. I could imagine two things: - We create "include/grub/json.h" with an API that uses GRUB's coding style. It would thus work as a wrapper around the jsmn API and contain functions like "grub_json_parse", "grub_json_get_object" and also a struct "grub_json_t" that contains all things required to work with the parsed JSON object. The implementation would be contained in "gurb-core/lib/json.c" and use "grub-core/lib/jsmn.h", which would be the unmodified upstream library. This would allow us to swap out the JSON parser in the future more easily without breaking any users and also make the API feel less foreign. - Or there is both a "include/grub/jsmn.h" and "include/grub/json.h", where the former one is the unmodified JSMN dependency and the latter one provides our own extended functions. I feel like the first one would be much cleaner, but I'd love to hear what you think about this first. Patrick --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEtmscHsieVjl9VyNUEXxntp6r8SwFAl3ABOMACgkQEXxntp6r 8Szi2hAAj1jiTLeEM+1+3jgx/72CO1gmr2Y4qFGAuN9/3kk+hxYN8fbsUb+R70Zp UPjgCArahXhuulec8tSbN8EXUAkCyAKHdD59QPKPuiDicZze+w59Uh0n6sA0Ssin UBT9/pPZshzOmmH+YaoeEiIavs9OrpoXEvC+AqvIm+F8mlGudy2CIryxCkZu77SJ b6jRnx2VUIKYwuB7d9Io/1HzAWwtu3FQ4DEegcYXeNEojsOOBQ2HM20wipYEfr+U z3up2xDRYqJlC2YE4doWNzLrrraK5Mj6pIi53UqfdQIH1BOfrJnWrbsK1cNzakpM C2kheybzCW2yzUVsCGR08jZemyhi7hlCqm0Pi6DQS0z5nq2ZWQlIonQxu6cvj3sg Mc7298jM7vtpIZRLutayaulQU9I/FfMVg/9ItfV48XQyY7Fq4V1AYLypaFgGIYVe IzHynKWq9UwRPE0xneeUPOfLK79e+lvULH0Iv88RkXliYwJ51axC102Lk3WvbwL3 MAiVRKqmLRGT7pm3cwsAz/QzzflBa9UHJsMIsnqGKeZox5X2bXZNacPVSaWFsjn4 KO2qGUq+OFh/ztGC8XII8I38Qqamify0DIn2xyuFibwe8t7IyTUSSI7H0klNQWFc WBqA+bMO9UlJh0ELC72zskYYiq6MlnMM5ab2430/O/uiW0lGm0c= =T1DU -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--