Grub Development Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Colin D Bennett <colin@gibibit.com>
To: grub-devel@gnu.org
Subject: Re: atoi
Date: Sat, 26 Jul 2008 07:36:35 -0700	[thread overview]
Message-ID: <20080726073635.1cb8bbbe@gibibit.com> (raw)
In-Reply-To: <998366.10826.qm@web31604.mail.mud.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

On Sat, 26 Jul 2008 06:52:31 -0700 (PDT)
Viswesh S <viswesh_vichu@yahoo.com> wrote:

> Hi,
> Just a confirmation, 
> Is there an implementation for atoi or similar conversion implemented
> in grub2 already. I suppose, I need to implement it myself.
> I am planning to implement a setpci command in grub2.Hence the
> question Viswesh

Try grub_strtoul(n, 0, 0) from 'kern/misc.c'.  It is better than atoi
since it provides error checking (if you choose to specify a char **end
as the 2nd arg instead of 0) and supports multiple bases (the 3rd arg;
0 means auto detect).

Regards,
Colin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      reply	other threads:[~2008-07-26 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26 13:52 atoi Viswesh S
2008-07-26 14:36 ` Colin D Bennett [this message]

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=20080726073635.1cb8bbbe@gibibit.com \
    --to=colin@gibibit.com \
    --cc=grub-devel@gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox