All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Function parameters support
Date: Sun, 09 May 2010 15:40:13 +0200	[thread overview]
Message-ID: <4BE6BB3D.4040501@gmail.com> (raw)
In-Reply-To: <p2gd019d53c1005050158qe8e19b40xf96805ab877b4d12@mail.gmail.com>

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

BVK Chaitanya wrote:
> Hi,
>
>
> Attached patch adds function parameters ($1, $2, etc. and $#) support
> to GRUB script..  Shell expansion for "$@" and $@ specials is not yet
> available.
>
> PS:  It needs to be applied over my earlier, remove grub_script_cmdblock patch.
>
>   

+	  grub_error (GRUB_ERR_BAD_ARGUMENT, "bad variabe name substitution");
typo
The only place where new scope is added or removed is:
+  grub_list_push (GRUB_AS_LIST_P (&scope), GRUB_AS_LIST (&new_scope));
+
+  ret = grub_script_execute (func->func);
+
+  grub_list_pop (GRUB_AS_LIST_P (&scope));
+
So you can actually do sth like:
int current_script_argc;
char *current_script_args;

And have an update function with:
saved_args = current_script_args;
saved_argc = current_script_argc;
current_script_args = ..
current_script_argsc = ...;
ret = ....;
current_script_args = saved_args;
current_script_argc = saved_argc;

-  grub_env_set ("?", errnobuf);
+  grub_script_env_set ("?", errnobuf);
Any use of this change?

 

>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

  parent reply	other threads:[~2010-05-09 13:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  8:58 [PATCH] Function parameters support BVK Chaitanya
2010-05-05 17:36 ` Seth Goldberg
2010-05-07  6:14   ` BVK Chaitanya
2010-05-12  5:26   ` BVK Chaitanya
2010-05-12  5:35     ` Seth Goldberg
2010-05-18 17:20     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-05-19 12:40       ` BVK Chaitanya
2010-05-09 13:40 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-05-12  4:59   ` BVK Chaitanya

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=4BE6BB3D.4040501@gmail.com \
    --to=phcoder@gmail.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 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.