All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add a new "ini" command
Date: Fri, 17 Aug 2012 19:43:33 -0400	[thread overview]
Message-ID: <201208171943.33979.vapier@gentoo.org> (raw)
In-Reply-To: <1345237017-20210-1-git-send-email-joe.hershberger@ni.com>

On Friday 17 August 2012 16:56:57 Joe Hershberger wrote:
> This allows you to read ini-formatted data from anywhere and then
> import one of the sections into the environment
> 
> This is based on rev 16 at http://code.google.com/p/inih/

document it in top level README ?

> --- /dev/null
> +++ b/common/cmd_ini.c
>
> +int do_ini(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

static

> +{
> +	const char *section;
> +	char *file_address;
> +	size_t file_size;
> +
> +	if (argc == 1)
> +		return CMD_RET_USAGE;
> +
> +	section = argv[1];
> +	if (argc < 3)
> +		file_address = (char *)simple_strtoul(getenv("loadaddr"),
> +			NULL, 16);
> +	else
> +		file_address = (char *)simple_strtoul(argv[2], NULL, 16);

file_address = (char *)simple_strtoul(argc < 3 ? getenv("loadaddr") : argv[2],
	NULL, 16);

> +	if (argc < 4)
> +		file_size = (size_t)simple_strtoul(getenv("filesize"),
> +			NULL, 16);
> +	else
> +		file_size = (size_t)simple_strtoul(argv[3], NULL, 16);

same here

> +	ini_parse(file_address, file_size, ini_handler, (void *)section);
> +
> +	/* success */
> +	return 0;
> +}

return ini_parse() ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120817/7b44cbb0/attachment.pgp>

  reply	other threads:[~2012-08-17 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 20:56 [U-Boot] [PATCH] Add a new "ini" command Joe Hershberger
2012-08-17 23:43 ` Mike Frysinger [this message]
2012-10-03 21:15 ` [U-Boot] [PATCH v2] " Joe Hershberger
2012-10-04  1:20   ` [U-Boot] [U-Boot,v2] " Tom Rini
2012-10-04  8:49   ` [U-Boot] [PATCH v2] " Igor Grinberg
2012-10-04 19:54     ` [U-Boot] [PATCH] Improve license declaration for cmd_ini.h Joe Hershberger
2012-10-05 17:26       ` Albert ARIBAUD
2012-10-05 17:51         ` Wolfgang Denk
2012-10-05 17:53       ` Wolfgang Denk
2012-10-05 22:27       ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201208171943.33979.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.