From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1OB6zl-0002Ku-PL for mharc-grub-devel@gnu.org; Sun, 09 May 2010 09:56:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OB6zg-0002I7-Qo for grub-devel@gnu.org; Sun, 09 May 2010 09:56:33 -0400 Received: from [140.186.70.92] (port=48611 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OB6ze-0001VS-Tr for grub-devel@gnu.org; Sun, 09 May 2010 09:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OB6k2-0006fg-OK for grub-devel@gnu.org; Sun, 09 May 2010 09:40:23 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:5770) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OB6k2-0006fb-Ig for grub-devel@gnu.org; Sun, 09 May 2010 09:40:22 -0400 Received: by fg-out-1718.google.com with SMTP id 22so480632fge.12 for ; Sun, 09 May 2010 06:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=fP8GndcUS+rTN4AA3bXaY/BxZZ8jjT7bmIoyjUMwJxs=; b=bJ8mHlAce/J0GvTcUgNlBlHlqK8/zDpCSrOAYQk+JIywG0boBTN7HViMnvLwI/Dl8U vP7BrMkiOARN72IExdTw9OdGFUYnAZLYCwroJ0FLbfFtdBr1iMiNIb8gI5KtufJwjAGG bmnpvXU0StCj/q8i/qTZMqXMaeLAiyYYUUJac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=ON2xf3KCCh1s2VR9kTcyRN6OBKQsBSf2hjMqQARvVEI9ezLkoiD9cUv0vX8ohdkg8L GZ/CV485tORRKcL6MGvvZuX6kDRkJaxROXXFP0jIBEvrYwPHjHvjPlzUJkoeyhfiuooX K8eTrHP4c/T3NZuJV3JJR4FyL1MhWDreLbiHk= Received: by 10.87.71.7 with SMTP id y7mr7463278fgk.63.1273412421801; Sun, 09 May 2010 06:40:21 -0700 (PDT) Received: from debian.bg45.phnet (4-97.203-62.cust.bluewin.ch [62.203.97.4]) by mx.google.com with ESMTPS id d6sm6669564fga.13.2010.05.09.06.40.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 09 May 2010 06:40:20 -0700 (PDT) Message-ID: <4BE6BB3D.4040501@gmail.com> Date: Sun, 09 May 2010 15:40:13 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig984F772D5C27C0AB85858E27" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Function parameters support X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2010 13:56:33 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig984F772D5C27C0AB85858E27 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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_cmdbloc= k patch. > > =20 + 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 =3D 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 =3D current_script_args; saved_argc =3D current_script_argc; current_script_args =3D .. current_script_argsc =3D ...; ret =3D ....; current_script_args =3D saved_args; current_script_argc =3D saved_argc; - grub_env_set ("?", errnobuf); + grub_script_env_set ("?", errnobuf); Any use of this change? =20 > =20 > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig984F772D5C27C0AB85858E27 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAkvmu0IACgkQNak7dOguQglhigD+KFrwRFfV9d28UYKdefHprLue K+xvAj6Vlw4r6z+izOoBAIjXVENAX8WM6Gptw8UXDFp47l2+0O/SCli/HNGAPf99 =qwK7 -----END PGP SIGNATURE----- --------------enig984F772D5C27C0AB85858E27--