mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-28 18:19:23 +00:00
for loop support to grub script
This commit is contained in:
1 parent
f7867a01d3
commit
4e6a305be4
8 files changed
+135
-1
No files matched your search
@@ -221,6 +221,30 @@ grub_script_create_cmdif (struct grub_parser_param *state,
|
||||
return (struct grub_script_cmd *) cmd;
|
||||
}
|
||||
|
||||
/* Create a command that functions as a for statement. */
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdfor (struct grub_parser_param *state,
|
||||
struct grub_script_arg *name,
|
||||
struct grub_script_arglist *words,
|
||||
struct grub_script_cmd *list)
|
||||
{
|
||||
struct grub_script_cmdfor *cmd;
|
||||
|
||||
grub_dprintf ("scripting", "cmdfor\n");
|
||||
|
||||
cmd = grub_script_malloc (state, sizeof (*cmd));
|
||||
if (! cmd)
|
||||
return 0;
|
||||
|
||||
cmd->cmd.exec = grub_script_execute_cmdfor;
|
||||
cmd->cmd.next = 0;
|
||||
cmd->name = name;
|
||||
cmd->words = words;
|
||||
cmd->list = list;
|
||||
|
||||
return (struct grub_script_cmd *) cmd;
|
||||
}
|
||||
|
||||
/* Create a command that adds a menu entry to the menu. Title is an
|
||||
argument that is parsed to generate a string that can be used as
|
||||
the title. The sourcecode for this entry is passed in SOURCECODE.
|
||||
|
||||
Reference in new issue
Block a user