[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Function parameters support
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: [PATCH] Function parameters support |
Date: |
Sun, 09 May 2010 15:40:13 +0200 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20091109) |
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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature