+ env = talloc(script, struct env_entry);
+ env->name = talloc_strdup(env, "prefix");
+ env->value = talloc_strdup(env, "/");
+
+ list_add(&script->environment, &env->list);
+}
+
+struct grub2_command *script_lookup_command(struct grub2_script *script,
+ const char *name)
+{
+ struct grub2_command *command;
+
+ list_for_each_entry(&script->commands, command, list) {
+ if (!strcmp(command->name, name))
+ return command;
+ }
+
+ return NULL;
+}
+
+void script_register_command(struct grub2_script *script,
+ struct grub2_command *command)
+{
+ list_add(&script->commands, &command->list);
+}
+
+
+void script_execute(struct grub2_script *script)
+{
+ statements_execute(script, script->statements);
+}
+
+struct grub2_script *create_script(void *ctx)
+{
+ struct grub2_script *script;
+
+ script = talloc(ctx, struct grub2_script);
+
+ init_env(script);
+ list_init(&script->commands);
+ register_builtins(script);
+