<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libubox/sh, branch master</title>
<subtitle>C utility functions for OpenWrt</subtitle>
<id>https://git.openwrt.org/project/libubox/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/libubox/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/'/>
<updated>2026-02-12T15:57:28Z</updated>
<entry>
<title>libubox: add anonymous strings, ints, et al in arrays</title>
<updated>2026-02-12T15:57:28Z</updated>
<author>
<name>Philip Prindeville</name>
</author>
<published>2023-09-15T18:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=8c7b489daa029b3841584f6ac76e2a0b68d74ef3'/>
<id>urn:sha1:8c7b489daa029b3841584f6ac76e2a0b68d74ef3</id>
<content type='text'>
You can have a "name" in an array member without an associated value.

Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
Link: https://github.com/openwrt/libubox/pull/12
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>libubox: document positional arguments</title>
<updated>2026-02-12T15:57:28Z</updated>
<author>
<name>Philip Prindeville</name>
</author>
<published>2023-09-15T19:53:02Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=5a65cb5a79b757d24beeab4144333b012a4935ec'/>
<id>urn:sha1:5a65cb5a79b757d24beeab4144333b012a4935ec</id>
<content type='text'>
Use local variables for positional arguments where they're captured,
and provide comments for position arguments.

Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
Link: https://github.com/openwrt/libubox/pull/12
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>libubox: send warnings to stderr</title>
<updated>2026-02-12T15:57:28Z</updated>
<author>
<name>Philip Prindeville</name>
</author>
<published>2023-09-16T21:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=d324c0503040914dd125298093c83fd07bf9f012'/>
<id>urn:sha1:d324c0503040914dd125298093c83fd07bf9f012</id>
<content type='text'>
Errors are sent to stderr in all but once place.

Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
Link: https://github.com/openwrt/libubox/pull/12
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>libubox: Add ability to find ordinal position inside a table</title>
<updated>2025-12-08T13:59:11Z</updated>
<author>
<name>Philip Prindeville</name>
</author>
<published>2025-11-14T19:04:01Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=7928f1711703767b0ac5ce916c7231d0e1af1ca2'/>
<id>urn:sha1:7928f1711703767b0ac5ce916c7231d0e1af1ca2</id>
<content type='text'>
When adding anonymous objects to an array, the only way to select
those objects (as in "json_select", i.e. moving the cursor) is to
select them via their ordinality.

This function returns a selectable index to those objects.

Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
Link: https://github.com/openwrt/libubox/pull/33
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>libubox: Drop extraneous space when appending values to variable</title>
<updated>2025-11-13T10:45:59Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2023-09-15T22:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=82cb5fd66af910c71deef67d49a5c9e3d319bde9'/>
<id>urn:sha1:82cb5fd66af910c71deef67d49a5c9e3d319bde9</id>
<content type='text'>
Don't have a leading space when building out a variable via appends.

Fixes: #15
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt; [fix fixes trailer]
</content>
</entry>
<entry>
<title>jshn.sh: Add pretty-printing to json_dump</title>
<updated>2023-04-15T13:04:19Z</updated>
<author>
<name>Philip Prindeville</name>
</author>
<published>2023-04-14T18:37:05Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=6fc29d1c429240a9afb71c22aa161b066502f3ed'/>
<id>urn:sha1:6fc29d1c429240a9afb71c22aa161b066502f3ed</id>
<content type='text'>
If a JSON file might be read by a human, say for debugging, it
could be useful to pretty-print it.  We do this in places by
calling "json_dump -i" but it shouldn't be necessary to know the
arguments to "jshn" (and indeed, that's not portable if we retool
the underlying implementation). Conversely output that's ephemeral
doesn't need to be pretty (say being piped as input to another
command).

Signed-off-by: Philip Prindeville &lt;philipp@redfish-solutions.com&gt;
</content>
</entry>
<entry>
<title>jshn.sh: add json_add_fields function for adding multiple fields at once</title>
<updated>2022-09-27T12:17:52Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2022-09-27T12:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=ea56013409d5823001b47a9bba6f74055a6d76a5'/>
<id>urn:sha1:ea56013409d5823001b47a9bba6f74055a6d76a5</id>
<content type='text'>
This simplifies passing extra object data as a function parameter

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>sh/jshn.sh: add json_for_each_item()</title>
<updated>2018-02-08T11:15:20Z</updated>
<author>
<name>Hans Dedecker</name>
</author>
<published>2018-02-01T15:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=bb0c830b2a259b7c5ffa7c309ce9d3004f3c41a1'/>
<id>urn:sha1:bb0c830b2a259b7c5ffa7c309ce9d3004f3c41a1</id>
<content type='text'>
Function usefull to iterate through the different elements of an
array or object; the provided callback function is called for each
element which is passed the value, key and user provided arguments.
For field types different from array or object the callback is called
with the retrieved value.

Signed-off-by: Hans Dedecker &lt;dedeckeh@gmail.com&gt;
Acked-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
<entry>
<title>jshn: add functionality to read big JSON</title>
<updated>2018-01-22T08:21:03Z</updated>
<author>
<name>Christian Beier</name>
</author>
<published>2018-01-18T20:21:09Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=9c4aeda96220b3f0d097d153bedd328f71f382bf'/>
<id>urn:sha1:9c4aeda96220b3f0d097d153bedd328f71f382bf</id>
<content type='text'>
The existing read functionality feeds the complete JSON to jshn as a
cmdline argument, leading to `-ash: jshn: Argument list too long`
errors for JSONs bigger than ca. 100KB.

This commit adds the ability to read the JSON directly from a file if
wanted, removing this shell-imposed size limit.

Tested on x86-64 and ar71xx. An mmap()-based solution was also evaluated,
but found to make no performance difference on either platform.

Signed-off-by: Christian Beier &lt;dontmind@freeshell.org&gt;
</content>
</entry>
<entry>
<title>jshn: properly support JSON "null" type</title>
<updated>2018-01-07T14:52:24Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2018-01-07T14:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/libubox/commit/?id=1c08e80313fd487112c48346889cc57badeef751'/>
<id>urn:sha1:1c08e80313fd487112c48346889cc57badeef751</id>
<content type='text'>
Instead of abort parsing, properly deal with "null" values by implementing
support for reading and formatting such values.

Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
</feed>
